Pertemuan 3 Edit, Delete,Simpan.

Slides:



Advertisements
Similar presentations
1 Crystal Report adalah sebuah paket software Report Generator (Pembangkit Laporan). Crystal report dapat dipanggil dari visual basic untuk diminta bantuannya.
Advertisements

Extension Specification
Advance CSS (Menu and Layout). CSS Navigation MENU.
PEMOGRAMAN APLIKASI BERGERAK (Java ME) Nyimas Artina Getting Started.
Algoritma Genetika ( 2 ).
The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
By Asep Taufik Muharram. Data Definition Language (DDL) Digunakan untuk melakukan pembuatan struktur database, mulai dari mendefinisikan database, tabel-tabel.
PENGANTAR KOMPUTER Cara Membuat Long Talk Human dengan Microsoft Office Microsoft Word.
Arfansyah, M.Kom. MEMBUAT LAPORAN : 1. Tambahkan File Crystal Report: Klik Menu Project  Add Windows Form Pilih Tab Reporting Pilih Crystal report Beri.
Pertemuan : 6 Basis Data Terapan
Dasar MySQL.
Pembuatan Installer melalui aplikasi setup Tinaliah, S. Kom.
Multiple Tiers in Action
Learning HTML Week 6. Every Web Page Has the Same Basic Structure The title of your page The guts of the web page, text, graphics, links and so on.
Introduction to HTML II Shih-Heng Chin. Preface Structure of a HTML File Elements used frequently Tables.
PPA – course 5 Materi: Cascading Style Sheet. What is CSS? sebuah standar yang digunakan untuk mendefinisikan tampilan secara seragam dan akurat. Contoh:
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit F Working with Tables.
Using FrontPage Express. Slide 1 Standard toolbars and menus Time indicator: gives an approximation of download time of the page.
Web pages in Linux David Douglas Sam M. Walton College of Business, University of Arkansas.
Polling System Part 1 Creating PHP & MySQL Files CIS 254.
CAKEPHP Blog tutorial. what you’ll need examples/blog/blog.html 2  A running web server  A database server.
1. Pengenalan HTML M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307)
 2003 Prentice Hall, Inc. All rights reserved. Introduction to HTML: Tables Outline 1 Introduction 2 Basic HTML Tables 3 Intermediate HTML Tables and.
26 HTML Tables … surround table … surround each row … surround each cell … like, but bold and centered by default (for table headings) … table title No.
MySQL. Is a SQL (Structured Query Language) database server. Can be accessed using PHP with embedded SQL Queries Supports Large DB’s, 60,000 tables with.
Database to HTML and Back again A programmers tale.
Make an HTML table using Visual Studio. Approach 1: drag table from Toolbox.
HTML Help book. HTML HTML is the programming language used to make web pages for the Internet. HTML stands for Hyper Text Markup Language. HTML is made.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
Lotus Notes Signature
Tugas Pertemuan 9 1. Pelajari teknik memahami gambar susun dan beberapa istilah yang ditunjukkan dalam gambar, pelajari tabel rincian komponen dan cara.
Oracle Developer/2000.
HTML TABLE Khafiizh Hastuti.
Pertemuan 1&2 - Dasar Pemrograman PHP
MEMBUAT LAPORAN : 1. Tambahkan File Crystal Report:
pernyataan kontrol pengulangan - lanjutan -
BAB INHERITANCE (Pewarisan)
Pertemuan 5 Login Dan session.
CodeIgniter Form & Login
Table Pertemuan 10 Matakuliah : L0182 / Web & Animation Design
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
LOOPING DAN FUNCTION Pertemuan 5.
Week 6 Creating Tables using HTML.
>> HTML: Tables.
Pertemuan ke 13 Input dan cari.
Getting Started – Table 2
HTML Tables CS 1150 Spring 2017.
HTML Layout and Sub Meun
MEMBUAT LAPORAN : 1. Tambahkan File Crystal Report:
PHP: Output Formatting
MySQL tutorial.
HTML Tables CS 1150 Fall 2016.
Creating Tables Steps for creating a Table Important Facts about Table
Табеле Табеле се представљају елементом TABLE.
MODUL SEMAK RALAT APDM.
Mr. Rouda’s CSCI 101 sections
PENGUMPULAN PROJEK DALAM SATU SISTEM APLIKATI
Matakuliah : Web Design
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
Creating Tables Steps for creating a Table Important Facts about Table
Web Design and Development
Creating Tables in a Web Site
Pemrograman mesin bubut CNC OLEH: DR. B. SENTOT WIJANARKA, M.T.
MYOB PREMIER V.13 Intermediate
HTML Tables.
Hyperlinks 1 2.
Using FrontPage Express
Creating Tables Steps for creating a Table Important Facts about Table
Advanced Tables.
A Title Link 1 Some text A picture Link 2 Link 3 Link 4   Link 1 | Link 2 | Link 3 | Link 4.
Presentation transcript:

Pertemuan 3 Edit, Delete,Simpan

Membuat menu edit,delete,hapus,simpan Tambahkan kode berikut pada file news.php setelah <td> <?php echo $row->news_data; ?> </td> : <td> <?php echo anchor('coba/edit/'.$row>id_news,'Edit'); ?> |<?php echo anchor('coba/delete/'.$row>id_news,'Delete'); ?> </td>

Tambahkan file baru di view dengan nama ubah.php <html> <head> <title> </title> </head> <?php echo form_open('coba/ubah/'.$news_id->id_news); ?> <table width=500> <tr> <td> Title</td> <td> :</td> <td> <?php echo form_input('title',$news_id->news_title); ?> </td> </tr>

LANJUTAN DARI UBAH.PHP <tr> <td>content </td> <td> : </td> <td> <?php echo form_textarea('content',$news_id->news_content); ?> </td> </tr> <td colspan="3"> <td><?php echo form_submit('update', 'update data'); ?> </td> <td><?php echo form_reset('reset', ' reset data'); ?> </td> </td> </table> <?php echo form_close(); ?> </body></html>

Tambahkan kode pada file controller yang bernama coba.php public function ubah() { $this->load->helper('form'); if(!empty($_POST['update'])) $this->m->update_data($_POST,$id); redirect('coba/index'); } else $data['news_id'] = $this->m->get_news_id($id); $this->load->view('ubah',$data);

function get_news_id($id) { $this ->db->from('news') Tambahkan kode pada file mdl_coba.php function get_news_id($id) { $this ->db->from('news') ->where('id_news',$id) ->limit(1); $q=$this->db->get(); return $q->row(); }

lanjutan function update_data($p,$id) { $data=array( 'news_title'=>$p['title'], 'news_content'=>$p['content'], ); $this->db->where('id_news',$id); $this->db->update('news',$data); }

Fungsi untuk delete public function delete($id) { Tambahkan kode pada file coba.php di controller public function delete($id) { $this->m->delete_data($id); redirect('coba/index'); }

function delete_data($id) { $this->db->where('id_news',$id); Tambahkan file pada model dengan file mdl_coba.php function delete_data($id) { $this->db->where('id_news',$id); $this->db->delete('news'); $this>db>last_query(); }