Top Banner

of 13

Membuat Buku Tamu Dengan Menggunakan CodeIgniter 2

Jul 13, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

APLIKASI BUKU TAMU MENGGUNAKAN CODEIGNITER 2.1.3Ardyanto Hermawan

April 27

2013Modul I

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3I. Hal-hal yang perlu dipersiapkan: 1. PHP: Codeigniter 2.1.3 2. Notepad++ 3. XAMPP 1.8.1 Mengubah file pada /application/config/: a. Config.php$config['base_url'] = 'http://localhost/CodeIgniter/';

II.

b. Autoload.php$autoload['libraries'] = array('database'); $autoload['helper'] = array('url','form');

c. Database.php$db['default']['hostname'] $db['default']['username'] $db['default']['password'] $db['default']['database'] $db['default']['dbdriver'] = = = = = 'localhost'; 'root'; ''; 'codeigniter; 'mysql';

d. Routes.php$route['default_controller'] = "buku_tamu";

III.

Membuat database dengan nama codeigniter a. Membuat table buku_tamuCREATE table buku_tamu ( id tinyint(4) auto_increment, pengirim varchar(50), judul varchar(50), pesan text, waktu timestamp, primary key(id) );

2

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3IV. Membuat Model, View, dan Controller: 1. Membuat buku_tamu_model.php: body{ font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; font-size:12px; } p, h1, form, button{border:0; margin:0; padding:0;} .spacer{clear:both; height:1px;} /* ----------- Wrapper ----------- */ .wrapper{ width: 960px; } /* ----------- My Form ----------- */ .myform{ margin:0 auto; width:400px; padding:14px; } /* ----------- stylized ----------- */ #stylized{ border:solid 2px #b7ddf2; background:#ebf4fb; } #stylized h1 { font-size:14px; font-weight:bold; margin-bottom:8px; } #stylized p{ font-size:11px; color:#666666; margin-bottom:20px; border-bottom:solid 1px #b7ddf2; padding-bottom:10px; } #stylized label{ display:block; font-weight:bold;

4

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3text-align:right; width:140px; float:left; } #stylized .small{ color:#666666; display:block; font-size:11px; font-weight:normal; text-align:right; width:140px; } #stylized input, textarea{ float:left; font-size:12px; padding:4px 2px; border:solid 1px #aacfe4; width:200px; margin:2px 0 20px 10px; } #stylized button{ clear:both; margin-left:150px; width:125px; height:31px; background:#666666; text-align:center; line-height:31px; color:#FFFFFF; font-size:11px; font-weight:bold; } #table table{ margin:10px auto; } Silahkan isi form di bawah ini Buku Tamu Menggunakan CodeIgniter 2.1.3 Pengirim Masukkan nama Judul Masukkan judul pesan Pesan Masukkan pesan

5

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3 Kirim No. Pengirim Judul Pesan Waktu Aksi | Data tidak ditemukan.

6

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3b. update.php body{ font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; font-size:12px; } p, h1, form, button{border:0; margin:0; padding:0;} .spacer{clear:both; height:1px;} /* ----------- My Form ----------- */ .wrapper{ width: 960px; } .myform{ margin:0 auto; width:400px; padding:14px; } /* ----------- stylized ----------- */ #stylized{ border:solid 2px #b7ddf2; background:#ebf4fb; } #stylized h1 { font-size:14px; font-weight:bold; margin-bottom:8px; } #stylized p{ font-size:11px; color:#666666; margin-bottom:20px; border-bottom:solid 1px #b7ddf2; padding-bottom:10px; } #stylized label{ display:block; font-weight:bold; text-align:right; width:140px; float:left;

7

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3} #stylized .small{ color:#666666; display:block; font-size:11px; font-weight:normal; text-align:right; width:140px; } #stylized input, textarea{ float:left; font-size:12px; padding:4px 2px; border:solid 1px #aacfe4; width:200px; margin:2px 0 20px 10px; } #stylized button{ clear:both; margin-left:150px; width:125px; height:31px; background:#666666; text-align:center; line-height:31px; color:#FFFFFF; font-size:11px; font-weight:bold; } Silahkan update form di bawah ini Buku Tamu Menggunakan CodeIgniter 2.1.3 Pengirim Masukkan nama Kirim

8

APLIKASI BUKU TAMU MENGGUNAKAN 2013 CODEIGNITER 2.1.3

3. membuat controller buku_tamu.php