Академический Документы
Профессиональный Документы
Культура Документы
E-mail : gyankoshprokashoni@gmail.com
gk_tarafder@yahoo.com
ISBN : 978-
infobook7@gmail.com
www.bookbd.info
MVC)
facebook.com/mmr.sinha
infobook7@gmail.com
www.bookbd.info
facebook.com/ebookbd
htaccess)
MVC
Model
View
Controller
Cakephp Cakephp
স্ত
Server
xampp
xampp
xampp
xampp
htaccess)
htaccess)
htaccess)
htaccess)
MVC
MVC
MVC
Model
Model
Model
Model
View
View
View
View
Controller
Controller
Controller
Controller
xampp server
Cakephp
Cakephp
Cakephp
Cakephp
Xampp server
Cakephp
Cakephp
xampp server
4.2 †ewmK KbwdMv‡ikb ‰Zix
Default
Default
Server
Server Guest user
Service
xampp
Xampp
Xampp Xampp Apache, mysql, php, perl
Windows, Mac, Linux
xampp
Server Guest user
Service Xampp
Xampp
Xampp Software
xampp
xampp
Xampp https://www.apachefriends.org/xampp-windows.html
Xampp Software CD Software
Xampp win-32-1.8.1-vc9-install
xampp
Xampp CD Software Xampp win-32-
1.8.1-vc9-install Xampp-win32-1.8.1-vc9
install yes
ok
Xampp Installation
ok
Xampp Installation
next
xampp installation
next
Xampp Installation
Xampp C
C
Xampp Installation
finish
Yes
Xampp Installation
Search Box
Codeigniter
Codeigniter/EllisLab
codeigniter/EllisLab
Codeigniter
Save file
OK Downlodes
OK
Downloads
Codeigniter_2.2.0.zip Extract
Here Extract
Codeigniter Codeigniter_2.2.0.zip
Extract Here Extract
Extract
Codeigniter_2.2.0.zip Extract
Xampp
htdocs
htdocs
Codeigniter_2.2.0
f2 Codeigniter_2.2.0 codeigniter
Codeigniter
Mozilla firefox Browser
Address bar
Welcome Message
Libraries, Helper Files, Config files
Xampp Xampp
htdocs
codeigniter
application config
autoload.php
url url
Autoload[‘helper’]
Autoload[‘helper’]
Autoload[‘config’] Config
Autoload [‘Language’]
Autoload[‘models’]
Mozilla Firefox
localhost/phpmyadmin
localhost/phpmyadmin
$db['default']['hostname'] = 'localhost';
localhost $db['default']['username'] = ' ';
root $db['default']['password'] = ' ';
xampp
$db['default']['database'] = ' ';
url url_suffix charset Encryption_Key
Date formate.
Extention .php
Extention .php Extention
Extention aspx, java, html
session session
Xampp Xampp
Xampp
Xampp
htdocs
htdocs
codeigniter
codeigniter
Application
Application
Config
config
config.php
config.php
English
htaccess)
htaccess)
htaccess)
htaccess)
htaccess)
htaccess)
htaccess)
.htaccess .htaccess
Hypertext Access
.htaccess abc.htaccess
.htaccess
.htaccess
htaccess)
.htaccess
f2
.htaccess
htaccess
htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /codeigniter
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
htaccess
htaccess)
Htaccess
Protect your site with a password.
Deny access to your site based on IP.
Prevent directory listing.
Redirect visitors to another page.
Enable server-side includes.
Customize the Error pages for your site.
Change your default directory page (index.html).
start Adobe
Dreamweaver cs6
site
New Site
New site site setup for unnamed site
Site Name
Local site folder
c drive
xampp folder
xampp folder
htdocs folder
htdocs folder
login_pro folder
Open
librarysystem folder
librarysystem folder
select
Servers
servers
Servers
Basic Advanced Basic Server
Name Localhost connect using
Local/Network Server folder
web url http://Localhost/librarysystem
Advanced
Advanced Testing Server
Server Model PHP MySQL Save
PHP MySQL
Application folder
config folder
$autoload[‘libraries’]
array() ‘'database', 'session
autoload[‘helper’] array array( )
‘url’, ‘file’, ‘form’ autoload[‘config] array
array( ) ‘config’
config.php config.php
$config[‘base_url’] array
array
http://localhost/librarysystem
base url
database.php
database.php
database.php $db[‘default’] [‘hostname’]
$db[‘default’] [‘stricton’] array $db[‘default’]
[‘username]
(root) $db[‘default’] [‘password’]
$db[‘default’]
[‘database’]
librarysys
localhost/phpmyadmin
MySQL Localhost Create new database
phpmyAdmin interface
routes.php
routes.php
routes.php
routes.php
Application folder views folder
new file
add_book.php
views folder add_book.php
add_book.php
add_book.php
<!DOCTYPE html><html><head>
<meta charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style.css" />
<title><?php echo $title ?></title>
</head><body>
<div class="header"><h1>Library Manage System</h1></div>
<div class="menu">
<a href="<?php echo base_url().'manage' ?>">Dashboard</a></div>
<div class="center">
<h2 align="center">Add Book Information</h2>
<div id="infoMessage"><?php echo $message;?></div>
<?php echo form_open("bookname/add");?>
<table width="600" border="0" cellpadding="0" cellspacing="2" align="center">
<tr><td width="150" align="right" bgcolor="#FFFFFF">Book Name: </td>
<td><?php echo form_input('book_name','','size="58"');?></td>
</tr>
<tr><td width="150" align="right" bgcolor="#FFFFFF">Author Name: </td>
<td><?php echo form_input('author_name','','size="58"');?></td>
</tr>
<tr>
<td width="150" align="right" bgcolor="#FFFFFF">Publisher: </td>
<td><?php echo form_input('publisher','','size="58"');?></td> </tr>
<tr>
<td width="150" align="right" bgcolor="#FFFFFF">Price: </td>
<td><?php echo form_input('price','','size="58"');?></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF"></td>
<td><?php echo form_submit('submit', 'Submit');?>
<input type="button" name="btnBack" id="btnBack" value="Back"
onclick="window.location.href='<?php echo base_url() ?>manage'" /></td>
</tr>
</table>
<?php echo form_close(); ?>
</div>
</body></html>
add_book.php
Application folder
Models folder
New file
untitled.php
Library_model.php
Library_model.php
Library_model.php
Library_model.php
Application folder
controllers folder
New file
controllers folder untitled.php
manage_library.php
manage_library.php
manage_library.php
Manage_library.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Manage_library extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Library_model');
$this->load->library('form_validation');
}
public function index()
{
$data['bookname'] = $this->Library_model->get_allbook();
$data['title'] = 'Library Management';
$data['message'] = $this->session->flashdata('message');
$this->load->view('manage_library', $data);
}
function add_bookinfo() {
$data['title'] = 'Add Book Information';
//validate form input
$this->form_validation->set_rules('book_name', 'Book Name', 'required|xss_clean');
$this->form_validation->set_rules('author_name', 'Author Name', 'required|xss_clean');
$this->form_validation->set_rules('publisher', 'Publisher', 'required|xss_clean');
$this->form_validation->set_rules('price', 'Price', 'required|xss_clean');
if ($this->form_validation->run() == true)
{
$data = array(
'Book_name' => $this->input->post('book_name'),
'Author_name' => $this->input->post('author_name'),
'Publisher' => $this->input->post('publisher'),
'Price' => $this->input->post('price'), );
$this->Library_model->insert_bookinfo($data);
$this->session->set_flashdata('message', "<p>Book Information added successfully.</p>");
redirect(base_url().'manage');
}else{
//display the add book form
//set the flash data error message if there is one
$data['message'] = (validation_errors() ? validation_errors() : $this-
>session->flashdata('message'));
$data['Book_name'] = array(
'name' => 'book_name',
'id' => 'book_name',
'type' => 'text',
'style' => 'width:300px;',
'value' => $this->form_validation->set_value('Book_name'),
);
$data['Author_name'] = array(
'name' => 'author_name',
'id' => 'author_name',
'type' => 'text',
'cols' => 10,
'rows' => 5,
'value' => $this->form_validation->set_value('Author_name'),
);
$data['Publisher'] = array(
'name' => 'publisher',
'id' => 'publisher',
'type' => 'text',
'style' => 'width:40px;text-align: right',
'value' => $this->form_validation->set_value('Publisher'),
);
$data['Price'] = array(
'name' => 'price',
'id' => 'price',
'type' => 'text',
'style' => 'width:40px;text-align: right',
'value' => $this->form_validation->set_value('Price'),
);
$this->load->view('add_book', $data);
}
}
manage_library.php
manage_library.php
Manage_library.php
<!DOCTYPE html><html><head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style.css">
<title><?php echo $title ?></title>
</head><body>
<div class="header"><h1>Library Manage System</h1></div>
<div class="menu">
<ul>
<li><a href="<?php echo base_url().'bookname/add' ?>">Add New Book</a></li>
<li><a href="<?php echo base_url().'view_books' ?>">View Books</a></li>
</ul>
</div>
<div class="message"> <div id="infoMessage"><?php echo $message;?></div></div>
<div class="content">
<form name="frmlibrary" method="post">
<input type="hidden" name="rid" />
<input type="hidden" name="command" />
<table width="900" align="center">
<tr>
<th width="150"><strong>Book Name</strong></th>
<th><strong>Author Name</strong></th>
<th><strong>Publisher</strong></th>
<th><strong>Price</strong></th>
<th><strong>Edit</strong></th>
<th><strong>Delete</strong></th>
</tr>
<?php
foreach ($bookname as $bookname){
$book_id = $bookname['book_id'];
?>
<tr align="center">
<td><?php echo $bookname['book_name'] ?></td>
<td><?php echo $bookname['author_name'] ?></td>
<td><?php echo $bookname['publisher'] ?></td>
<td><?php echo $bookname['price'] ?></td>
<td><a href='bookname/edit/<?php echo $book_id ?>'>Edit</a></td>
<td>
<?php
echo anchor('bookname/delete/'.$book_id, 'Delete', array('onClick' => "return
confirm('Are you sure you want to delete?')"));
?>
</td>
</tr>
<?php
}
?>
</table>
</form>
</div>
</body></html>
manage_library.php
routes.php
$route['default_controller'] = "manage_library";
$route['manage'] = "manage_library";
$route['bookname/add'] = 'manage_library/add_bookinfo';
routes.php
librarysys book
book_id, book_name,
author_name, publisher, price Mozilla firefox web Browser
localhost/phpmyadmin
librarysys
Create new table on database librarysys
Name Number of fields. Name
book Number of fields
Go
Go
Go field
book_id type INT
Length/values index
primary A_I
field
book_name type VARCHAR
Length/values field
author_name type
VARCHAR Length/values
field
publisher type VARCHAR
Length/values field
price type
float Length/values
Save
book
book
routes.php
Routes.php
$route['default_controller'] = "manage_library";
$route['manage'] = "manage_library";
$route['bookname/add'] = 'manage_library/add_bookinfo';
$route['bookname/edit/(:any)'] = 'manage_library/edit_bookinfo/$1';
routes.php
manage_library.php
Manage_library.php
function edit_bookinfo($id) {
$bookname = $this->Library_model->get_books($id);
$data['title'] = 'Edit Phone Holder';
//validate form input
$this->form_validation->set_rules('book_name', 'Book Name', 'required|xss_clean');
$this->form_validation->set_rules('author_name', 'Author Name', 'required|xss_clean');
$this->form_validation->set_rules('publisher', 'Publisher', 'required|xss_clean');
$this->form_validation->set_rules('price', 'Price', 'required|xss_clean');
if (isset($_POST) && !empty($_POST)){
$data = array(
'Book_name' => $this->input->post('book_name'),
'Author_name' => $this->input->post('author_name'),
'Publisher' => $this->input->post('publisher'),
'Price' => $this->input->post('price'), );
if ($this->form_validation->run() === true)
{
$this->Library_model->update_bookinfo($id, $data);
$this->session->set_flashdata('message', "<p>Book Information updated successfully.</p>");
redirect(base_url().'bookname/edit/'.$id);
//redirect('manage');
}
}
$data['message'] = (validation_errors() ? validation_errors() : $this->session-
>flashdata('message'));
$data['bookname'] = $bookname;
//display the edit book form
$data['Book_name'] = array(
'name' => 'book_name',
'id' => 'book_name',
'type' => 'text',
'style' => 'width:300px;',
'value' => $this->form_validation->set_value('Book_name', $bookname['book_name']), );
$data['Author_name'] = array(
'name' => 'author_name',
'id' => 'author_name',
'type' => 'text',
'cols' => 28,
'rows' => 5,
'value' => $this->form_validation->set_value('Author_name', $bookname['author_name']), );
$data['Publisher'] = array(
'name' => 'publisher',
'id' => 'publisher',
'type' => 'text',
'style' => 'width:300px;text-align: right',
'value' => $this->form_validation->set_value('Publisher', $bookname['publisher']), );
$data['Price'] = array(
'name' => 'price',
'id' => 'price',
'type' => 'text',
'style' => 'width:300px;text-align: right',
'value' => $this->form_validation->set_value('Price', $bookname['price']), );
$this->load->view('edit_book', $data);
}
manage_library.php
Application folder Model folder library_model.php
library_model.php
Library_model.php
library_model.php
Application folder views folder edit_book.php
views folder
New file
edit_book.php
Application folder Views folder edit_book.php
edit_book.php
Edit_book.php
<!DOCTYPE html><head>
<meta charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style.css">
<title><?php echo $title ?></title>
</head><body>
<div class="header"><h1>Library Manage System</h1></div>
<div class="menu"><a href="<?php echo base_url().'manage' ?>">Dashboard</a></div>
<div class="message"><div id="infoMessage"><?php echo $message;?></div></div>
<div class="center">
<h2 align="center">Edit Book Information</h2>
<?php $id = $bookname['book_id']; ?>
<?php echo form_open("bookname/edit/$id");?>
<table width="700" border="1" cellpadding="0" cellspacing="2" align="center">
<tr> <td width="130" align="right"> Book Name: </td>
<td><?php echo form_input($book_name); ?></td> </tr>
<tr> <td width="130" align="right"> Author Name: </td>
<td><?php echo form_input($author_name); ?></td> </tr>
<tr> <td align="right">Publisher:</td>
<td><?php echo form_input($publisher); ?></td> </tr>
<tr> <td align="right">Price:</td>
<td><?php echo form_input($price); ?></td> </tr>
<tr> <td> </td>
<td><?php echo form_submit('submit', 'Submit');?>
<input type="button" name="btnBack" id="btnBack" value="Back"
onclick="window.location.href='<?php echo base_url() ?>manage'" />
</td></tr> </table>
<?php echo form_close(); ?>
</div>
</body></html>
edit_book.php
Mozilla firefox Web Browser
Localhost/librarysystem
Edit
edit
Dashboard
Dashboard Author Name
Md Mijanur Rahman & Badsha
Author Name
routes.php library_model.php
manage_library.php routes.php
Application folder config folder
routes.php
routes.php
Routes.php
$route['default_controller'] = "manage_library";
$route['manage'] = "manage_library";
$route['bookname/add'] = 'manage_library/add_bookinfo';
$route['bookname/edit/(:any)'] = 'manage_library/edit_bookinfo/$1';
$route['bookname/delete/(:any)'] = 'manage_library/delete_bookinfo/$1';
$route['404_override'] = '';
routes.php
Library_model.php
library_model.php del_bookinfo
Application folder controllers folder manage_library.php
manage_library.php
Manage_library.php
function delete_bookinfo($book_id) {
$this->Library_model->del_bookinfo($book_id);
$this->session->set_flashdata('message', '<p>Book Information were
successfully deleted!</p>');
redirect('manage');
manage_library.php delete_bookinfo
Mozilla firefox web Browser
Localhost/librarysystem delete
Delete
ok
cancel ok
Ok CSS3
view_book.php
view_book.php
view_book.php
View_book.php
view_book.php
view_book.php
view_book.php
View_book.php
<!DOCTYPE html><html><head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style.css">
<title><?php echo $title ?></title>
</head>
<body>
<div class="header"><h1>Library Manage System</h1></div>
<div class="menu">
<ul>
<li><a href="<?php echo base_url().'bookname/add' ?>">Add New Book</a></li>
<li><a href="<?php echo base_url().'manage' ?>">View Books</a></li>
</ul>
</div>
<div class="message"> <div id="infoMessage"><?php //echo $message;?></div></div>
<div class="content">
<form name="frmlibrary" method="post">
<input type="hidden" name="rid" />
<input type="hidden" name="command" />
<table width="900" align="center">
<tr>
<th width="150"><strong>Book Name</strong></th>
<th><strong>Author Name</strong></th>
<th><strong>Publisher</strong></th>
<th><strong>Price</strong></th>
</tr>
<?php
foreach ($bookname as $bookname){
$book_id = $bookname['book_id'];
?>
<tr align="center">
<td><?php echo $bookname['book_name'] ?></td>
<td><?php echo $bookname['author_name'] ?></td>
<td><?php echo $bookname['publisher'] ?></td>
<td><?php echo $bookname['price'] ?></td>
</tr>
<?php
}
?>
</table>
</form></div>
</body></html>
Mozilla firefox web Browser
localhost/librarysystem/view_book
start Adobe
Dreamweaver cs6
site
New Site
New site site setup for unnamed site
Site Name
Local site folder
c drive
xampp folder
xampp folder
htdocs folder
htdocs folder
greencreative folder
Open
greencreative folder
greencreative folder
select
Servers
servers
Servers
Basic Advanced Basic Server
Name Localhost connect using
Local/Network Server folder
web url http://Localhost/greencreative
Advanced
Advanced Testing Server
Server Model PHP MySQL Save
PHP MySQL
config
folder
config folder autoload.php
$autoload[‘helper’]
= array ();
‘URL’
URL
$autoload[‘congfig’] array config
$autoload[‘congfig’] config
base url
sitecontrol.php
config folder routes.php
$route[‘default_controller’]
welcome
welcome sitecontrol
green
greencreative.zip
xampp folder htdocs folder
Extract Here green
green folder
green folder
backgorund.png, bar.png, footer.png, header.png, style.css, tab_back.png
greencreative
greencreative
green index.html
edit with notepad++
header.php
views folder
New File
views folder untitled.html
menu.php
menu.php
green index.html
<div id="bar"> </div>
views folder menu.php
menu.php
menu.php
views folder
New File
content.php
green index.html
<div class="contentTitle"><h1>Template Usage</h1></div>
<div class="contentText">Each title is an H1 tag, so choose them
carefully :) </div> </div>
contact.php
green index.html
content.php
content.php
footer.php
footer.php
footer.php green index.html
index.html footer.php
sitecontrol.php
Application folder controllers
folder sitecontrol.php
sitecontrol.php
localhost/greencreative
www.bookbd.info
ক্ষ
infobook7@gmail.com