Sunteți pe pagina 1din 62

CRUD Generator For PHP Developers

TO CODEIGNITER

STEP 1. Run the sql query in your database.


CREATE TABLE `Tabla_1`( `id` INT(11) NOT NULL AUTO_INCREMENT,`Name` VARCHAR(255),`Age`
numeric(60) DEFAULT NULL,`Mail` VARCHAR(255),`Password` VARCHAR(255),`Comments` TEXT, `status`
ENUM('0','1'), PRIMARY KEY (`id`) );

STEP 2. Add below code in your application/config/routes.php.


// routes for Tabla_1.
$route['manage-Tabla_1']="Tabla_1Controller/ManageTabla_1";
$route['change-status-Tabla_1/(:num)']="Tabla_1Controller/changeStatusTabla_1/$1";
$route['edit-Tabla_1/(:num)']="Tabla_1Controller/editTabla_1/$1";
$route['edit-Tabla_1-post']="Tabla_1Controller/editTabla_1Post";
$route['delete-Tabla_1/(:num)']="Tabla_1Controller/deleteTabla_1/$1";
$route['add-Tabla_1']="Tabla_1Controller/addTabla_1";
$route['add-Tabla_1-post']="Tabla_1Controller/addTabla_1Post";
$route['view-Tabla_1/(:num)']="Tabla_1Controller/viewTabla_1/$1";
// end of Tabla_1 routes

STEP 3. Create "Tabla_1Controller.php" in your application/controllers folder and put


below code in that.
<?php
class Tabla_1Controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('Tabla_1');
$this->load->library('session');
}
/*
function for manage Tabla_1.
return all Tabla_1s.
created by your name
created at 18-01-17.
*/
public function manageTabla_1() {
$data["Tabla_1s"] = $this->Tabla_1->getAll();
$this->load->view('Tabla_1/manage-Tabla_1', $data);
}
/*
function for add Tabla_1 get
created by your name
created at 18-01-17.
*/

public function addTabla_1() {


}

$this->load->view('Tabla_1/add-Tabla_1');

/*
function for add Tabla_1 post
created by your name
created at 18-01-17.
*/
public function addTabla_1Post() {
$data['Name'] = $this->input->post('Name');
$data['Age'] = $this->input->post('Age');
$data['Mail'] = $this->input->post('Mail');
$data['Password'] = md5($this->input->post('Password'));
$data['IsCopy'] = $this->input->post('IsCopy');
$data['Sex'] = $this->input->post('Sex');
$data['Acept'] = json_encode($this->input->post('Acept'));
$data['Comments'] = $this->input->post('Comments');
if ($_FILES['FileName']['name']) {
$data['FileName'] = $this->doUpload('FileName');
}
$this->Tabla_1->insert($data);
$this->session->set_flashdata('success', 'Tabla_1 added Successfully');
redirect('manage-Tabla_1');
}
/*
function for edit Tabla_1 get
returns Tabla_1 by id.
created by your name
created at 18-01-17.
*/
public function editTabla_1($Tabla_1_id) {
$data['Tabla_1_id'] = $Tabla_1_id;
$data['Tabla_1'] = $this->Tabla_1->getDataById($Tabla_1_id);
$this->load->view('Tabla_1/edit-Tabla_1', $data);
}
/*
function for edit Tabla_1 post
created by your name
created at 18-01-17.
*/
public function editTabla_1Post() {
$Tabla_1_id = $this->input->post('Tabla_1_id');
$Tabla_1 = $this->Tabla_1->getDataById($Tabla_1_id);
$data['Name'] = $this->input->post('Name');
$data['Age'] = $this->input->post('Age');
$data['Mail'] = $this->input->post('Mail');
$data['IsCopy'] = $this->input->post('IsCopy');
$data['Sex'] = $this->input->post('Sex');
$data['Acept'] = json_encode($this->input->post('Acept'));
$data['Comments'] = $this->input->post('Comments');
if ($_FILES['FileName']['name']) {
$data['FileName'] = $this->doUpload('FileName');
unlink('./uploads/Tabla_1/'.$Tabla_1[0]->FileName);
}
$edit = $this->Tabla_1->update($Tabla_1_id,$data);
if ($edit) {

$this->session->set_flashdata('success', 'Tabla_1 Updated');


redirect('manage-Tabla_1');
}
}
/*
function for view Tabla_1 get
created by your name
created at 18-01-17.
*/
public function viewTabla_1($Tabla_1_id) {
$data['Tabla_1_id'] = $Tabla_1_id;
$data['Tabla_1'] = $this->Tabla_1->getDataById($Tabla_1_id);
$this->load->view('Tabla_1/view-Tabla_1', $data);
}
/*
function for delete Tabla_1 created by your name
created at 18-01-17.
*/
public function deleteTabla_1($Tabla_1_id) {
$delete = $this->Tabla_1->delete($Tabla_1_id);
$this->session->set_flashdata('success', 'Tabla_1 deleted');
redirect('manage-Tabla_1');
}
/*
function for activation and deactivation of Tabla_1.
created by your name
created at 18-01-17.
*/
public function changeStatusTabla_1($Tabla_1_id) {
$edit = $this->Tabla_1->changeStatus($Tabla_1_id);
$this->session->set_flashdata('success', 'Tabla_1 '.$edit.' Successfully');
redirect('manage-Tabla_1');
}
/*
function for upload files
return uploaded file name.
created by your name
created at 18-01-17.
*/
function doUpload($file) {
$config['upload_path'] = './uploads/Tabla_1';
$config['allowed_types'] = '*';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload($file))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
return $data['upload_data']['file_name'];
}
}
}

STEP 4. Create "Tabla_1.php" in your application/models folder and put below code in
that.
<?php
class Tabla_1 extends CI_Model {
/*
return all Tabla_1s.
created by your name
created at 18-01-17.
*/
public function getAll() {
return $this->db->get('Tabla_1')->result();
}
/*
function for create Tabla_1.
return Tabla_1 inserted id.
created by your name
created at 18-01-17.
*/
public function insert($data) {
$this->db->insert('Tabla_1', $data);
return $this->db->insert_id();
}
/*
return Tabla_1 by id.
created by your name
created at 18-01-17.
*/
public function getDataById($id) {
$this->db->where('id', $id);
return $this->db->get('Tabla_1')->result();
}
/*
function for update Tabla_1.
return true.
created by your name
created at 18-01-17.
*/
public function update($id,$data) {
$this->db->where('id', $id);
$this->db->update('Tabla_1', $data);
return true;
}
/*
function for delete Tabla_1.
return true.
created by your name
created at 18-01-17.
*/
public function delete($id) {
$this->db->where('id', $id);
$this->db->delete('Tabla_1');
return true;
}
/*
function for change status of Tabla_1.

return activated of deactivated.


created by your name
created at 18-01-17.
*/
public function changeStatus($id) {
$table=$this->getDataById($id);
if($table[0]->status==0)
{
$this->update($id,array('status' => '1'));
return "Activated";
}else{
$this->update($id,array('status' => '0'));
return "Deactivated";
}
}
}

STEP 5. Create "Tabla_1" folder in your application/views folder and put addTabla_1.php,edit-Tabla_1.php,manage-Tabla_1.php and view-Tabla_1.php files in that.
add-Tabla_1.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Codeigniter Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Codeigniter Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url(); ?>manage-Tabla_1">Manage Tabla_1</a></li>
<li class="active" ><a href="<?php echo site_url(); ?>add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Add Tabla_1</h2>
<form role="form" method="post" action="<?php echo site_url()?>/add-Tabla_1-post"
enctype="multipart/form-data" >
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" class="form-control" id="Name" name="Name">
</div>
<div class="form-group">
<label for="Age">Age:</label>

<input type="number" class="form-control" id="Age" name="Age">


</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" class="form-control" id="Mail" name="Mail">
</div>
<div class="form-group">
<label for="Password">Password:</label>
<input type="password" class="form-control" id="Password" name="Password">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S"> S
<input type="radio" name="IsCopy" value="N"> N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M">M</option>
<option value="F">F</option>
</select>
</div>
<div class="form-group">
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S"> S
<input type="checkbox" name="Acept[]" value="N"> N
</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments"></textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

edit-Tabla_1.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Codeigniter Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Codeigniter Crud By Crud Generator</a>

</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url(); ?>manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="<?php echo site_url(); ?>add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Update Tabla_1</h2>
<form role="form" method="post" action="<?php echo site_url()?>edit-Tabla_1-post"
enctype="multipart/form-data">
<input type="hidden" value="<?php echo $Tabla_1[0]->id ?>" name="Tabla_1_id">
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" value="<?php echo $Tabla_1[0]->Name ?>" class="form-control" id="Name"
name="Name">
</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" value="<?php echo $Tabla_1[0]->Age ?>" class="form-control" id="Age"
name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" value="<?php echo $Tabla_1[0]->Mail ?>" class="form-control" id="Mail"
name="Mail">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S" <?php if($Tabla_1[0]->IsCopy == "S"){ echo "checked"; }
?> > S
<input type="radio" name="IsCopy" value="N" <?php if($Tabla_1[0]->IsCopy == "N"){ echo
"checked"; } ?> > N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M" <?php if($Tabla_1[0]->Sex == "M"){ echo "selected"; } ?> >M</option>
<option value="F" <?php if($Tabla_1[0]->Sex == "F"){ echo "selected"; } ?> >F</option>
</select>
</div>
<div class="form-group">
<?php $Acepts=json_decode($Tabla_1[0]->Acept); ?>
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S" <?php if(in_array("S",$Acepts)){ echo "checked"; } ?
>> S
<input type="checkbox" name="Acept[]" value="N" <?php if(in_array("N",$Acepts)){ echo
"checked"; } ?> > N</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments">
<?php echo $Tabla_1[0]>Comments ?>
</textarea>
</div>
<div class="form-group">

<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

manage-Tabla_1.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Codeigniter Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Codeigniter Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li class="active" ><a href="<?php echo site_url(); ?>manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="<?php echo site_url(); ?>add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Manage Tabla_1</h2>
<?php if($this->session->flashdata('success')){ ?>
<div class="alert alert-success">
<strong><span class="glyphicon glyphicon-ok"></span> <?php echo $this->session>flashdata('success'); ?></strong>
</div>
<?php } ?>

<?php if(!empty($Tabla_1s)) {?>


<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>

<?php $i=1; foreach($Tabla_1s as $Tabla_1) { ?>


<tr>
<td> <?php echo $i; ?> </td>
<td> <a href="<?php echo site_url()?>view-Tabla_1/<?php echo $Tabla_1->id?>" > <?php echo
$Tabla_1->Name ?> </a> </td>
<td>
<a href="<?php echo site_url()?>change-status-Tabla_1/<?php echo $Tabla_1->id ?>" > <?php
if($Tabla_1->status==0){ echo "Activate"; } else { echo "Deactivate"; } ?></a>
<a href="<?php echo site_url()?>edit-Tabla_1/<?php echo $Tabla_1->id?>" >Edit</a>
<a href="<?php echo site_url()?>delete-Tabla_1/<?php echo $Tabla_1->id?>" onclick="return
confirm('are you sure to delete')">Delete</a>
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
<?php } else {?>
<div class="alert alert-info" role="alert">
<strong>No Tabla_1s Found!</strong>
</div>
<?php } ?>
</div>
</body>
</html>

view-Tabla_1.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Codeigniter Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Codeigniter Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url(); ?>manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="<?php echo site_url(); ?>add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 well">
Name : <?php echo $Tabla_1[0]->Name ?>
</div>

</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Age : <?php echo $Tabla_1[0]->Age ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Mail : <?php echo $Tabla_1[0]->Mail ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
IsCopy : <?php echo $Tabla_1[0]->IsCopy ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Sex : <?php echo $Tabla_1[0]->Sex ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Comments : <?php echo $Tabla_1[0]->Comments ?>
</div>
</div>
</div>
</body>
</html>

STEP 6. Create "uploads/Tabla_1" folder in your root folder.


Done!. You can get the crud functionality in "your site url/manage-Tabla_1"

TO LARAVEL 5.x

STEP 1. Run the sql query in your database.

or
run phpartisanmake:migrationcreate_Tabla_1_tablein your terminal and put below code to new
created migration file and run phpartisanmigrate in your terminal.
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTabla_1Table extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('Tabla_1', function(Blueprint $table)
{
$table->increments('id');
$table->string('Name');
$table->string('Age');
$table->string('Mail');
$table->string('Password');
$table->string('IsCopy');
$table->string('Sex');
$table->string('Acept');
$table->text('Comments');
$table->string('FileName');
$table->enum('status', ['0', '1']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('Tabla_1');
}
}

STEP 2. Add below code in your app/Http/routes.php.

// routes for Tabla_1.


Route::group(array('prefix' => 'Tabla_1'), function()
{
Route::get('/', 'Tabla_1Controller@index');
Route::get('/add-Tabla_1', 'Tabla_1Controller@add');
Route::post('/add-Tabla_1-post', 'Tabla_1Controller@addPost');
Route::get('/delete-Tabla_1/{id}', 'Tabla_1Controller@delete');
Route::get('/edit-Tabla_1/{id}', 'Tabla_1Controller@edit');
Route::post('/edit-Tabla_1-post', 'Tabla_1Controller@editPost');
Route::get('/change-status-Tabla_1/{id}', 'Tabla_1Controller@changeStatus');
Route::get('/view-Tabla_1/{id}', 'Tabla_1Controller@view');
});
// end of Tabla_1 routes

STEP 3. Create "Tabla_1Controller.php" in your app/Http/Controllers folder and put below


code in that.
<?php namespace App\Http\Controllers;
use App\Models\Tabla_1 as Tabla_1;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use Hash;
class Tabla_1Controller extends Controller {
public function index()
{
$data['Tabla_1s'] = Tabla_1::all();
return view('Tabla_1/index',$data);
}
public function add()
{
return view('Tabla_1/add');
}
public function addPost()
{
$Tabla_1_data = array(
'Name' => Input::get('Name'),
'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'Password' => Hash::make(Input::get('Password')),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => '',
);
if (Input::hasFile('FileName')) {
$destinationPath = 'uploads';
$FileName = Input::file('FileName');
$FileName_name = $FileName->getClientOriginalName();

$FileName->move($destinationPath,$FileName_name);
$Tabla_1_data['FileName'] = $FileName_name;
}
$Tabla_1_id = Tabla_1::insert($Tabla_1_data);
return redirect('Tabla_1')->with('message', 'Tabla_1 successfully added');

}
public function delete($id)
{
$Tabla_1=Tabla_1::find($id);
$Tabla_1->delete();
return redirect('Tabla_1')->with('message', 'Tabla_1 deleted successfully.');
}
public function edit($id)
{
$data['Tabla_1']=Tabla_1::find($id);
return view('Tabla_1/edit',$data);
}
public function editPost()
{
$id =Input::get('Tabla_1_id');
$Tabla_1=Tabla_1::find($id);
if (Input::hasFile('FileName')) {
$destinationPath = 'uploads';
$FileName = Input::file('FileName');
$FileName_name = $FileName->getClientOriginalName();
$FileName->move($destinationPath,$FileName_name);
@unlink($destinationPath.'/'.$Tabla_1->FileName);
}
else
{
$FileName_name=$Tabla_1->FileName;
}
$Tabla_1_data = array(

'Name' => Input::get('Name'),


'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => $FileName_name,
);
$Tabla_1_id = Tabla_1::where('id', '=', $id)->update($Tabla_1_data);
return redirect('Tabla_1')->with('message', 'Tabla_1 Updated successfully');

public function changeStatus($id)


{
$Tabla_1=Tabla_1::find($id);
$Tabla_1->status=!$Tabla_1->status;
$Tabla_1->save();
return redirect('Tabla_1')->with('message', 'Change Tabla_1 status successfully');
}
public function view($id)
{
$data['Tabla_1']=Tabla_1::find($id);

return view('Tabla_1/view',$data);
}

STEP 4. Create "Tabla_1.php" in your app/Models folder and put below code in that.
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
use Eloquent;
class Tabla_1 extends Eloquent {
protected $table = 'Tabla_1';
}

STEP 5. Create "Tabla_1" folder in your resources/views folder and put


add.blade.php,edit.blade.php,manage.blade.php and view.blade.php files in that.
add.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li class="active" ><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Add Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/add-Tabla_1-post"
enctype="multipart/form-data" >
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="Name">Name:</label>

<input type="text" class="form-control" id="Name" name="Name">


</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" class="form-control" id="Age" name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" class="form-control" id="Mail" name="Mail">
</div>
<div class="form-group">
<label for="Password">Password:</label>
<input type="password" class="form-control" id="Password" name="Password">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S"> S
<input type="radio" name="IsCopy" value="N"> N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M">M</option>
<option value="F">F</option>
</select>
</div>
<div class="form-group">
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S"> S
<input type="checkbox" name="Acept[]" value="N"> N
</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments"></textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

edit.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>

<nav class="navbar navbar-inverse">


<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Update Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/edit-Tabla_1-post"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" value="<?php echo $Tabla_1->id ?>" name="Tabla_1_id">
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" value="<?php echo $Tabla_1->Name ?>" class="form-control" id="Name"
name="Name">
</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" value="<?php echo $Tabla_1->Age ?>" class="form-control" id="Age"
name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" value="<?php echo $Tabla_1->Mail ?>" class="form-control" id="Mail"
name="Mail">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S" <?php if($Tabla_1->IsCopy == "S"){ echo "checked"; } ?
>>S
<input type="radio" name="IsCopy" value="N" <?php if($Tabla_1->IsCopy == "N"){ echo "checked"; } ?
> > N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M" <?php if($Tabla_1->Sex == "M"){ echo "selected"; } ?> >M</option>
<option value="F" <?php if($Tabla_1->Sex == "F"){ echo "selected"; } ?> >F</option>
</select>
</div>
<div class="form-group">
<?php $Acepts=json_decode($Tabla_1->Acept); ?>
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S" <?php if(in_array("S",$Acepts)){ echo "checked"; } ?
>> S
<input type="checkbox" name="Acept[]" value="N" <?php if(in_array("N",$Acepts)){ echo
"checked"; } ?> > N</div>
<div class="form-group">

<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments">
<?php echo $Tabla_1>Comments ?>
</textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

index.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li class="active" ><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Manage Tabla_1</h2>
@if(Session::has('message'))
<div class="alert alert-success">
<strong><span class="glyphicon glyphiconok"></span>{{ Session::get('message') }}</strong>
</div>
@endif
@if(count($Tabla_1s)>0)
<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>

<tbody>
<?php $i=1 ?>
@foreach($Tabla_1s as $Tabla_1)
<tr>
<td>{{$i}} </td>
<td> <a href="{{Request::root()}}/Tabla_1/view-Tabla_1/{{$Tabla_1->id}}" > {{$Tabla_1>Name }}</a> </td>
<td>
<a href="{{Request::root()}}/Tabla_1/change-status-Tabla_1/{{$Tabla_1->id }}" > @if($Tabla_1>status==0) {{"Activate"}} @else {{"Dectivate"}} @endif </a>
<a href="{{Request::root()}}/Tabla_1/edit-Tabla_1/{{$Tabla_1->id}}" >Edit</a>
<a href="{{Request::root()}}/Tabla_1/delete-Tabla_1/{{$Tabla_1->id}}" onclick="return confirm('are
you sure to delete')">Delete</a>
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-info" role="alert">
<strong>No Tabla_1s Found!</strong>
</div>
@endif
</div>
</body>
</html>

view.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1/manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 well">

Name : <?php echo $Tabla_1->Name ?>


</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Age : <?php echo $Tabla_1->Age ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Mail : <?php echo $Tabla_1->Mail ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
IsCopy : <?php echo $Tabla_1->IsCopy ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Sex : <?php echo $Tabla_1->Sex ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Comments : <?php echo $Tabla_1->Comments ?>
</div>
</div>
</div>
</body>
</html>

Done!. You can get the crud functionality in "your site url/Tabla_1"

LARAVEL 5

STEP 1. Run the sql query in your database.

or
run phpartisanmake:migrationcreate_Tabla_1_tablein your terminal and put below code to new
created migration file and run phpartisanmigrate in your terminal.
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTabla_1Table extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('Tabla_1', function(Blueprint $table)
{
$table->increments('id');
$table->string('Name');
$table->string('Age');
$table->string('Mail');
$table->string('Password');
$table->string('IsCopy');
$table->string('Sex');
$table->string('Acept');
$table->text('Comments');
$table->string('FileName');
$table->enum('status', ['0', '1']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('Tabla_1');
}
}

STEP 2. Add below code in your app/Http/routes.php.

// routes for Tabla_1.


Route::group(array('prefix' => 'Tabla_1'), function()
{
Route::get('/', 'Tabla_1Controller@index');
Route::get('/add-Tabla_1', 'Tabla_1Controller@add');
Route::post('/add-Tabla_1-post', 'Tabla_1Controller@addPost');
Route::get('/delete-Tabla_1/{id}', 'Tabla_1Controller@delete');
Route::get('/edit-Tabla_1/{id}', 'Tabla_1Controller@edit');
Route::post('/edit-Tabla_1-post', 'Tabla_1Controller@editPost');
Route::get('/change-status-Tabla_1/{id}', 'Tabla_1Controller@changeStatus');
Route::get('/view-Tabla_1/{id}', 'Tabla_1Controller@view');
});
// end of Tabla_1 routes

STEP 3. Create "Tabla_1Controller.php" in your app/Http/Controllers folder and put below


code in that.
<?php namespace App\Http\Controllers;
use App\Models\Tabla_1 as Tabla_1;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use Hash;
class Tabla_1Controller extends Controller {
public function index()
{
$data['Tabla_1s'] = Tabla_1::all();
return view('Tabla_1/index',$data);
}
public function add()
{
return view('Tabla_1/add');
}
public function addPost()
{
$Tabla_1_data = array(
'Name' => Input::get('Name'),
'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'Password' => Hash::make(Input::get('Password')),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => '',
);
$destinationPath = 'uploads';
$FileName = Input::file('FileName');

if (Input::hasFile('FileName')) {

$FileName_name = $FileName->getClientOriginalName();
$FileName->move($destinationPath,$FileName_name);
$Tabla_1_data['FileName'] = $FileName_name;
}
$Tabla_1_id = Tabla_1::insert($Tabla_1_data);
return redirect('Tabla_1')->with('message', 'Tabla_1 successfully added');
}
public function delete($id)
{
$Tabla_1=Tabla_1::find($id);
$Tabla_1->delete();
return redirect('Tabla_1')->with('message', 'Tabla_1 deleted successfully.');
}
public function edit($id)
{
$data['Tabla_1']=Tabla_1::find($id);
return view('Tabla_1/edit',$data);
}
public function editPost()
{
$id =Input::get('Tabla_1_id');
$Tabla_1=Tabla_1::find($id);
if (Input::hasFile('FileName')) {
$destinationPath = 'uploads';
$FileName = Input::file('FileName');
$FileName_name = $FileName->getClientOriginalName();
$FileName->move($destinationPath,$FileName_name);
@unlink($destinationPath.'/'.$Tabla_1->FileName);
}
else
{
$FileName_name=$Tabla_1->FileName;
}
$Tabla_1_data = array(
'Name' => Input::get('Name'),
'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => $FileName_name,
);
$Tabla_1_id = Tabla_1::where('id', '=', $id)->update($Tabla_1_data);
return redirect('Tabla_1')->with('message', 'Tabla_1 Updated successfully');
}
public function changeStatus($id)
{
$Tabla_1=Tabla_1::find($id);
$Tabla_1->status=!$Tabla_1->status;
$Tabla_1->save();
return redirect('Tabla_1')->with('message', 'Change Tabla_1 status successfully');
}
public function view($id)
{

$data['Tabla_1']=Tabla_1::find($id);
return view('Tabla_1/view',$data);
}
}

STEP 4. Create "Tabla_1.php" in your app/Models folder and put below code in that.
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
use Eloquent;
class Tabla_1 extends Eloquent {
}

protected $table = 'Tabla_1';

STEP 5. Create "Tabla_1" folder in your resources/views folder and put


add.blade.php,edit.blade.php,manage.blade.php and view.blade.php files in that.
add.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li class="active" ><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Add Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/add-Tabla_1-post"
enctype="multipart/form-data" >
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" class="form-control" id="Name" name="Name">

</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" class="form-control" id="Age" name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" class="form-control" id="Mail" name="Mail">
</div>
<div class="form-group">
<label for="Password">Password:</label>
<input type="password" class="form-control" id="Password" name="Password">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S"> S
<input type="radio" name="IsCopy" value="N"> N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M">M</option>
<option value="F">F</option>
</select>
</div>
<div class="form-group">
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S"> S
<input type="checkbox" name="Acept[]" value="N"> N
</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments"></textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

edit.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">

<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>


</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Update Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/edit-Tabla_1-post"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" value="<?php echo $Tabla_1->id ?>" name="Tabla_1_id">
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" value="<?php echo $Tabla_1->Name ?>" class="form-control" id="Name"
name="Name">
</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" value="<?php echo $Tabla_1->Age ?>" class="form-control" id="Age"
name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" value="<?php echo $Tabla_1->Mail ?>" class="form-control" id="Mail"
name="Mail">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S" <?php if($Tabla_1->IsCopy == "S"){ echo "checked"; } ?
>>S
<input type="radio" name="IsCopy" value="N" <?php if($Tabla_1->IsCopy == "N"){ echo "checked"; } ?
> > N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M" <?php if($Tabla_1->Sex == "M"){ echo "selected"; } ?> >M</option>
<option value="F" <?php if($Tabla_1->Sex == "F"){ echo "selected"; } ?> >F</option>
</select>
</div>
<div class="form-group">
<?php $Acepts=json_decode($Tabla_1->Acept); ?>
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S" <?php if(in_array("S",$Acepts)){ echo "checked"; } ?
>> S
<input type="checkbox" name="Acept[]" value="N" <?php if(in_array("N",$Acepts)){ echo
"checked"; } ?> > N</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments">
<?php echo $Tabla_1>Comments ?>
</textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>

<button type="submit" class="btn btn-primary">Submit</button>


</form>
</div>
</body>
</html>

index.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li class="active" ><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Manage Tabla_1</h2>
@if(Session::has('message'))
<div class="alert alert-success">
<strong><span class="glyphicon glyphiconok"></span>{{ Session::get('message') }}</strong>
</div>
@endif
@if(count($Tabla_1s)>0)
<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $i=1 ?>
@foreach($Tabla_1s as $Tabla_1)
<tr>
<td>{{$i}} </td>
<td> <a href="{{Request::root()}}/Tabla_1/view-Tabla_1/{{$Tabla_1->id}}" > {{$Tabla_1>Name }}</a> </td>
<td>
<a href="{{Request::root()}}/Tabla_1/change-status-Tabla_1/{{$Tabla_1->id }}" > @if($Tabla_1>status==0) {{"Activate"}} @else {{"Dectivate"}} @endif </a>
<a href="{{Request::root()}}/Tabla_1/edit-Tabla_1/{{$Tabla_1->id}}" >Edit</a>

<a href="{{Request::root()}}/Tabla_1/delete-Tabla_1/{{$Tabla_1->id}}" onclick="return confirm('are


you sure to delete')">Delete</a>
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-info" role="alert">
<strong>No Tabla_1s Found!</strong>
</div>
@endif
</div>
</body>
</html>

view.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1/manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 well">
Name : <?php echo $Tabla_1->Name ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Age : <?php echo $Tabla_1->Age ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Mail : <?php echo $Tabla_1->Mail ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">

IsCopy : <?php echo $Tabla_1->IsCopy ?>


</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Sex : <?php echo $Tabla_1->Sex ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Comments : <?php echo $Tabla_1->Comments ?>
</div>
</div>
</div>
</body>
</html>

Done! You can get the crud functionality in "your site url/Tabla_1"

LARAVEL 4

STEP 1. Run the sql query in your database.

or
run phpartisanmake:migrationcreate_Tabla_1_tablein your terminal and put below code to new
created migration file and run phpartisanmigrate in your terminal.
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTabla_1Table extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('Tabla_1', function(Blueprint $table)
{
$table->increments('id');
$table->string('Name');
$table->string('Age');
$table->string('Mail');
$table->string('Password');
$table->string('IsCopy');
$table->string('Sex');
$table->string('Acept');
$table->text('Comments');
$table->string('FileName');
$table->enum('status', ['0', '1']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('Tabla_1');
}
}

STEP 2. Add below code in your app/routes.php.

// routes for Tabla_1.


Route::group(array('prefix' => 'Tabla_1'), function()
{
Route::get('/', 'Tabla_1Controller@index');
Route::get('/add-Tabla_1', 'Tabla_1Controller@add');
Route::post('/add-Tabla_1-post', 'Tabla_1Controller@addPost');
Route::get('/delete-Tabla_1/{id}', 'Tabla_1Controller@delete');
Route::get('/edit-Tabla_1/{id}', 'Tabla_1Controller@edit');
Route::post('/edit-Tabla_1-post', 'Tabla_1Controller@editPost');
Route::get('/change-status-Tabla_1/{id}', 'Tabla_1Controller@changeStatus');
Route::get('/view-Tabla_1/{id}', 'Tabla_1Controller@view');
});
// end of Tabla_1 routes

STEP 3. Create "Tabla_1Controller.php" in your app/controllers folder and put below code
in that.
<?php
class Tabla_1Controller extends BaseController {
public function index()
{
$data['Tabla_1s'] = Tabla_1::all();
return View::make('Tabla_1.index',$data);
}
public function add()
{
return View::make('Tabla_1.add');
}
public function addPost()
{
$Tabla_1_data = array(
'Name' => Input::get('Name'),
'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'Password' => Hash::make(Input::get('Password')),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => '',
);
if (Input::hasFile('FileName')) {
$destinationPath = 'uploads';
$FileName = Input::file('FileName');
$FileName_name = $FileName->getClientOriginalName();
$FileName->move($destinationPath,$FileName_name);
$Tabla_1_data['FileName'] = $FileName_name;
}
$Tabla_1_id = Tabla_1::insert($Tabla_1_data);
return Redirect::action('Tabla_1Controller@index')->with('message', 'Tabla_1 successfully added');

}
public function delete($id)
{

$Tabla_1=Tabla_1::find($id);
$Tabla_1->delete();
return Redirect::action('Tabla_1Controller@index')->with('message', 'Tabla_1 deleted successfully.');

public function edit($id)


{
$data['Tabla_1']=Tabla_1::find($id);
return View::make('Tabla_1.edit',$data);
}
public function editPost()
{
$id =Input::get('Tabla_1_id');
$Tabla_1=Tabla_1::find($id);
if (Input::hasFile('FileName')) {
$destinationPath = 'uploads';
$FileName = Input::file('FileName');
$FileName_name = $FileName->getClientOriginalName();
$FileName->move($destinationPath,$FileName_name);
@unlink($destinationPath.'/'.$Tabla_1->FileName);
}
else
{
$FileName_name=$Tabla_1->FileName;
}
$Tabla_1_data = array(
'Name' => Input::get('Name'),
'Age' => Input::get('Age'),
'Mail' => Input::get('Mail'),
'IsCopy' => Input::get('IsCopy'),
'Sex' => Input::get('Sex'),
'Acept' => json_encode(Input::get('Acept')),
'Comments' => Input::get('Comments'),
'FileName' => $FileName_name,
);
$Tabla_1_id = Tabla_1::where('id', '=', $id)->update($Tabla_1_data);
return Redirect::action('Tabla_1Controller@index')->with('message', 'Tabla_1 Updated successfully');
}
public function changeStatus($id)
{
$Tabla_1=Tabla_1::find($id);
$Tabla_1->status=!$Tabla_1->status;
$Tabla_1->save();
return Redirect::action('Tabla_1Controller@index')->with('message', 'Change Tabla_1 status
successfully');
}
public function view($id)
{
$data['Tabla_1']=Tabla_1::find($id);
return View::make('Tabla_1.view',$data);
}
}

STEP 4. Create "Tabla_1.php" in your app/models folder and put below code in that.

<?php
class Tabla_1 extends Eloquent {
}

protected $table = 'Tabla_1';

STEP 5. Create "Tabla_1" folder in your app/views folder and put


add.blade.php,edit.blade.php,manage.blade.php and view.blade.php files in that.
add.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li class="active" ><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Add Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/add-Tabla_1-post"
enctype="multipart/form-data" >
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" class="form-control" id="Name" name="Name">
</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" class="form-control" id="Age" name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" class="form-control" id="Mail" name="Mail">
</div>
<div class="form-group">
<label for="Password">Password:</label>
<input type="password" class="form-control" id="Password" name="Password">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S"> S
<input type="radio" name="IsCopy" value="N"> N</div>

<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M">M</option>
<option value="F">F</option>
</select>
</div>
<div class="form-group">
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S"> S
<input type="checkbox" name="Acept[]" value="N"> N
</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments"></textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

edit.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Update Tabla_1</h2>
<form role="form" method="post" action="{{Request::root()}}/Tabla_1/edit-Tabla_1-post"
enctype="multipart/form-data">
<input type="hidden" value="<?php echo $Tabla_1->id ?>" name="Tabla_1_id">
<div class="form-group">
<label for="Name">Name:</label>
<input type="text" value="<?php echo $Tabla_1->Name ?>" class="form-control" id="Name"
name="Name">

</div>
<div class="form-group">
<label for="Age">Age:</label>
<input type="number" value="<?php echo $Tabla_1->Age ?>" class="form-control" id="Age"
name="Age">
</div>
<div class="form-group">
<label for="Mail">Mail:</label>
<input type="email" value="<?php echo $Tabla_1->Mail ?>" class="form-control" id="Mail"
name="Mail">
</div>
<div class="form-group">
<label for="IsCopy">IsCopy:</label>
<input type="radio" name="IsCopy" value="S" <?php if($Tabla_1->IsCopy == "S"){ echo "checked"; } ?
>>S
<input type="radio" name="IsCopy" value="N" <?php if($Tabla_1->IsCopy == "N"){ echo "checked"; } ?
> > N</div>
<div class="form-group">
<label for="Sex">Sex:</label>
<select class="form-control" id="Sex" name="Sex">
<option value="M" <?php if($Tabla_1->Sex == "M"){ echo "selected"; } ?> >M</option>
<option value="F" <?php if($Tabla_1->Sex == "F"){ echo "selected"; } ?> >F</option>
</select>
</div>
<div class="form-group">
<?php $Acepts=json_decode($Tabla_1->Acept); ?>
<label for="Acept">Acept:</label>
<input type="checkbox" name="Acept[]" value="S" <?php if(in_array("S",$Acepts)){ echo "checked"; } ?
>> S
<input type="checkbox" name="Acept[]" value="N" <?php if(in_array("N",$Acepts)){ echo
"checked"; } ?> > N</div>
<div class="form-group">
<label for="Comments">Comments:</label>
<textarea class="form-control" id="Comments" name="Comments">
<?php echo $Tabla_1>Comments ?>
</textarea>
</div>
<div class="form-group">
<label for="FileName">FileName:</label>
<input type="file" class="btn btn-primary" id="FileName" name="FileName">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</body>
</html>

index.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>

<nav class="navbar navbar-inverse">


<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li class="active" ><a href="{{Request::root()}}/Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Manage Tabla_1</h2>
@if(Session::has('message'))
<div class="alert alert-success">
<strong><span class="glyphicon glyphiconok"></span>{{ Session::get('message') }}</strong>
</div>
@endif
@if(count($Tabla_1s)>0)
<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $i=1 ?>
@foreach($Tabla_1s as $Tabla_1)
<tr>
<td>{{$i}} </td>
<td> <a href="{{Request::root()}}/Tabla_1/view-Tabla_1/{{$Tabla_1->id}}" > {{$Tabla_1>Name }}</a> </td>
<td>
<a href="{{Request::root()}}/Tabla_1/change-status-Tabla_1/{{$Tabla_1->id }}" > @if($Tabla_1>status==0) {{"Activate"}} @else {{"Dectivate"}} @endif </a>
<a href="{{Request::root()}}/Tabla_1/edit-Tabla_1/{{$Tabla_1->id}}" >Edit</a>
<a href="{{Request::root()}}/Tabla_1/delete-Tabla_1/{{$Tabla_1->id}}" onclick="return confirm('are
you sure to delete')">Delete</a>
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-info" role="alert">
<strong>No Tabla_1s Found!</strong>
</div>
@endif
</div>
</body>
</html>

view.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
<title>Laravel Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudegenerator.in">Laravel Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{Request::root()}}/Tabla_1/manage-Tabla_1">Manage Tabla_1</a></li>
<li><a href="{{Request::root()}}/Tabla_1/add-Tabla_1">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 well">
Name : <?php echo $Tabla_1->Name ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Age : <?php echo $Tabla_1->Age ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Mail : <?php echo $Tabla_1->Mail ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
IsCopy : <?php echo $Tabla_1->IsCopy ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Sex : <?php echo $Tabla_1->Sex ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Comments : <?php echo $Tabla_1->Comments ?>
</div>
</div>
</div>
</body>
</html>

Done! You can get the crud functionality in "your site url/Tabla_1"

CAKE PHP 3

STEP 1. Run the sql query in your database.


STEP 2. Create "Tabla1Controller.php" in your src/Controller folder and put below code in
that.
<?php
namespace App\Controller;
class Tabla1Controller extends AppController
{
/*
function for initialisation.
created by your name.
created at 18-01-17.
*/
public function initialize()
{
parent::initialize();
$this->loadComponent('Flash'); // Include the FlashComponent
}
/*
function for manage Tabla1.
return all Tabla1s.
created by your name.
created at 18-01-17.
*/
public function index()
{
$Tabla1s = $this->Tabla1->find('all');
$this->set(compact('Tabla1s'));
}
/*
function for add Tabla1.
created by your name.
created at 18-01-17.
*/
public function add()
{
$Tabla1 = $this->Tabla1->newEntity();
if ($this->request->is('post')) {
$Tabla1 = $this->Tabla1->patchEntity($Tabla1, $this->request->data);
$Tabla1->Password = md5($this->request->data['Password']);
$Tabla1->Acept = json_encode($this->request->data['Acept']);
if(!empty($this->request->data['FileName']['name']))
{
$file = $this->request->data['FileName'];
move_uploaded_file($file['tmp_name'], WWW_ROOT . 'img/uploads' . DS . $file['name']);
$Tabla1->FileName = $file['name'];
}else{
$Tabla1->FileName = '';
}

if ($this->Tabla1->save($Tabla1)) {
$this->Flash->success(__('Tabla1 has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('Unable to add Tabla1.'));

}
$this->set('Tabla1', $Tabla1);

}
/*
function for update Tabla1.
created by your name.
created at 18-01-17.
*/
public function edit($id = null)
{
$Tabla1 = $this->Tabla1->get($id);
if ($this->request->is(['post','put'])) {
$Tabla1 = $this->Tabla1->patchEntity($Tabla1, $this->request->data);
$old_data = $this->Tabla1->get($this->request->data['id']);
$Tabla1->Acept =
json_encode($this->request->data['Acept']);
if(!empty($this->request->data['FileName']['name']))
{
$file = $this->request->data['FileName'];
move_uploaded_file($file['tmp_name'], WWW_ROOT . 'img/uploads' . DS . $file['name']);
unlink('./img/uploads/'.$Tabla1->FileName);
$Tabla1->FileName = $file['name'];
}
if ($this->Tabla1->save($Tabla1)) {
$this->Flash->success(__('Tabla1 has been updated.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('Unable to update Tabla1.'));
}
$this->set('Tabla1', $Tabla1);
}
/*
function for activate and deactivate of Tabla1.
created by your name.
created at 18-01-17.
*/
public function changeStatus($id = null,$status = null)
{
$status=!($status);
$Tabla1 = $this->Tabla1->get($id);
$Tabla1->status=$status;
if ($this->Tabla1->save($Tabla1)) {
$this->Flash->success(__('The Tabla1 with id: {0} status changed.', h($id)));
}
return $this->redirect(['action' => 'index']);
}
/*
function for view Tabla1.
created by your name.
created at 18-01-17.

*/
public function view($id)
{
$Tabla1 = $this->Tabla1->get($id);
$this->set('Tabla1', $Tabla1);
}
/*
function for delete Tabla1.
created by your name.
created at 18-01-17.
*/
public function delete($id)
{
$this->request->allowMethod(['post', 'delete']);
$Tabla1 = $this->Tabla1->get($id);
if ($this->Tabla1->delete($Tabla1)) {
$this->Flash->success(__('The Tabla1 with id: {0} has been deleted.', h($id)));
return $this->redirect(['action' => 'index']);
}
}
}

STEP 3. Create "Tabla1Table.php" in your src/Model/Table folder and put below code in
that.
<?php
namespace App\Model\Table;
use Cake\ORM\Table;
use Cake\Validation\Validator;
class Tabla1Table extends Table
{
public function initialize(array $config)
{
$this->addBehavior('Timestamp');
}
public function validationDefault(Validator $validator)
{
$validator
->notEmpty('Name');
return $validator;
}
}

STEP 4. Create "Tabla1" folder in your src/Template folder and put


add.ctp,edit.ctp,index.ctp and view.ctp files in that.
add.ctp

<style>
.container,.navbar{
width:90%;
margin: auto;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li.active {
background-color: #4CAF50;
color: white;
}
li:hover:not(.active) {
background-color: #555;
color: white;
}
</style>
<nav class="navbar">
<ul>
<li><a href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a> </li>
<li> <?= $this->Html->link('Manage Tabla1', ['action' => 'index']) ?> </li>
<li class="active" > <?= $this->Html->link('Add New Tabla1', ['action' => 'add']) ?> </li>
</ul>
</nav>
<div class="container">
<h1>Add Tabla1</h1>
<?php
echo $this->Form->create($Tabla1, array('type' => 'file'));
echo $this->Form->input('Name', array('type' => 'text'));
echo $this->Form->input('Age', array('type' => 'number'));
echo $this->Form->input('Mail', array('type' => 'email'));
echo $this->Form->input('Password', array('type' => 'password'));
$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('IsCopy', array('type' => 'radio','options' => $options ));
$options = array(
'M' => 'M',
'F' => 'F',
);
echo $this->Form->input('Sex', array('type' => 'select','options' => $options ,'empty' => false ));
$options = array(
'S' => 'S',

'N' => 'N',


);
echo $this->Form->input('Acept', array('multiple' => 'checkbox','options' => $options ));
echo $this->Form->input('Comments', array('type' => 'textarea'));
echo $this->Form->input('FileName', array('type' => 'file'));
echo $this->Form->button(__('Save Post'));
echo $this->Form->end();
?>
</div>

edit.ctp
<style>
.container,.navbar{
width:90%;
margin: auto;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li.active {
background-color: #4CAF50;
color: white;
}
li:hover:not(.active) {
background-color: #555;
color: white;
}
</style>
<nav class="navbar">
<ul>
<li class="active" ><a href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a> </li>
<li> <?= $this->Html->link('Manage Tabla1', ['action' => 'index']) ?> </li>
<li> <?= $this->Html->link('Add New Tabla1', ['action' => 'add']) ?> </li>
</ul>
</nav>
<div class="container">
<h1>Update Tabla1</h1>
<?php
echo $this->Form->create($Tabla1, array('type' => 'file'));
echo $this->Form->input('id', array('type' => 'hidden','value' => $Tabla1->id));
echo $this->Form->input('Name', array('type' => 'text'));
echo $this->Form->input('Age', array('type' => 'number'));
echo $this->Form->input('Mail', array('type' => 'email'));

$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('IsCopy', array('type' => 'radio','options' => $options ));
$options = array(
'M' => 'M',
'F' => 'F',
);
echo $this->Form->input('Sex', array('type' => 'select','options' => $options ,'empty' => false ));
$options = array(
'S' => 'S',
'N' => 'N',
);
$selectedOption = json_decode($Tabla1->Acept);
echo $this->Form->input('Acept', array('multiple' => 'checkbox','options' => $options ,'value' =>
$selectedOption ));
echo $this->Form->input('Comments', array('type' => 'textarea'));
echo $this->Form->input('FileName', array('type' => 'file'));
echo $this->Form->button(__('Save Post'));
echo $this->Form->end();
?>
</div>

index.ctp
<?php
use Cake\Routing\Router;
?>
<style>
.container,.navbar{
width:90%;
margin: auto;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li {
display: block;
color: #000;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li .active {
background-color: #4CAF50;
color: white;
}

li :hover:not(.active) {
background-color: #555;
color: white;
}
</style>
<nav class="navbar">
<ul>
<li><a href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a> </li>
<li class="active" > <?= $this->Html->link('Manage Tabla1', ['action' => 'index']) ?> </li>
<li> <?= $this->Html->link('Add New Tabla1', ['action' => 'add']) ?> </li>
</ul>
</nav>
<div class="container">
<h2>Manage Tabla1</h2>
<?php if(!empty($Tabla1s)) {?>
<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach($Tabla1s as $Tabla1) { ?>
<tr>
<td> <?php echo $i; ?> </td>
<td> <a href="<?php echo Router::url('/') ?>Tabla1/view/<?php echo $Tabla1->id ?>" > <?php echo
$Tabla1->Name ?> </a></td>
<td>
<a href="<?php echo Router::url('/'); ?>Tabla1/changeStatus/<?php echo $Tabla1->id ?>/<?php echo
$Tabla1->status ?>" > <?php if($Tabla1->status==0){ echo "Activate"; } else { echo "Deactivate"; } ?
></a>
<a href="<?php echo Router::url('/'); ?>Tabla1/edit/<?php echo $Tabla1->id ?>">Edit</a>
<?= $this->Form->postLink(
'Delete',
['action' => 'delete', $Tabla1->id],
['confirm' => 'Are you sure?'])
?>
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
<?php } else {?>
<div class="alert alert-info" role="alert">
<strong>No Tabla1 found!</strong>
</div>
<?php } ?>
</div>

view.ctp
<style>
.container,.navbar{
width:90%;

margin: auto;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li .active {
background-color: #4CAF50;
color: white;
}
li :hover:not(.active) {
background-color: #555;
color: white;
}
</style>
<nav class="navbar">
<ul>
<li class="active" ><a href="http://crudegenerator.in">Cake PHP Crud By Crud Generator</a> </li>
<li> <?= $this->Html->link('Manage Tabla1', ['action' => 'index']) ?> </li>
<li> <?= $this->Html->link('Add New Tabla1', ['action' => 'add']) ?> </li>
</ul>
</nav>
<div class="container">
<div style="background-color:black; color:white; padding:20px;">
Name : <?php echo $Tabla1->Name ?>
</div>
<div style="background-color:black; color:white; padding:20px;">
Age : <?php echo $Tabla1->Age ?>
</div><div style="background-color:black; color:white; padding:20px;">
Mail : <?php echo $Tabla1->Mail ?>
</div>
<div style="background-color:black; color:white; padding:20px;">
IsCopy : <?php echo $Tabla1->IsCopy ?>
</div>
<div style="background-color:black; color:white; padding:20px;">
Sex : <?php echo $Tabla1->Sex ?>
</div>
<div style="background-color:black; color:white; padding:20px;">
Comments : <?php echo $Tabla1->Comments ?>
</div>
<div style="background-color:black; color:white; padding:20px;">
FileName : <?php echo $Tabla1->FileName ?>
</div>
</div>

STEP 6. Create "uploads" folder in your app/wbroot/img folder.


Done! You can get the crud functionality in "your site url/Tabla1"

CAKE PHP 2

STEP 1. Run the sql query in your database.


STEP 2. Add below code in your app/config/routes.php.
Router::connect('/Tabla_1', array('controller' => 'Tabla_1', 'action' => 'index', 'home'));

STEP 3. Create "Tabla_1Controller.php" in your app/Controller folder and put below code
in that.
<?php
class Tabla_1Controller extends AppController {
public $components = array('Session');
/*
function for manage Tabla_1.
return all Tabla_1s.
created by your name.
created at 18-01-17.
*/
public function index()
{
$Tabla_1s = $this->Tabla_1->find('all');
$this->set('Tabla_1s', $Tabla_1s);
}
/*
function for add Tabla_1.
created by your name
created at 18-01-17.
*/
public function add()
{
if (!empty($this->data)) {
if(!empty($this->data['Tabla_1']['FileName']['name']))
{
$file = $this->data['Tabla_1']['FileName'];
move_uploaded_file($file['tmp_name'], WWW_ROOT . 'img/uploads' . DS . $file['name']);
$this->request->data['Tabla_1']['FileName'] = $file['name'];
}else{
$this->request->data['Tabla_1']['FileName'] = '';
}
$this->request->data['Tabla_1']['Password'] = md5($this->data['Tabla_1']['Password']);
$this->request->data['Tabla_1']['Acept'] = json_encode($this->data['Tabla_1']['Acept']);
if ($this->Tabla_1->save($this->request->data)) {
$this->Session->setFlash('The Tabla_1 has been saved');

$this->redirect(array('action' => 'index'));


} else {
$this->Session->setFlash
('The Tabla_1 could not be saved. Please, try again.');
}
}
}
/*
function for edit Tabla_1.
created by your name
created at 18-01-17.
*/
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash('Invalid Tabla_1');
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
$old_data=$this->Tabla_1->findById($this->data['Tabla_1']['id']);
if(!empty($this->data['Tabla_1']['FileName']['name']))
{
$file = $this->data['Tabla_1']['FileName'];
move_uploaded_file($file['tmp_name'], WWW_ROOT . 'img/uploads' . DS . $file['name']);
if($old_data['Tabla_1']['FileName']!=''){
unlink('./img/uploads/'.$old_data['Tabla_1']['FileName']);
}
$this->request->data['Tabla_1']['FileName'] = $file['name'];
}else{
$this->request->data['Tabla_1']['FileName'] = $old_data['Tabla_1']['FileName'];
}
$this->request->data['Tabla_1']['Acept'] = json_encode($this->data['Tabla_1']['Acept']);
if ($this->Tabla_1->save($this->request->data)) {
$this->Session->setFlash('The Tabla_1 has been saved');
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('The Tabla_1 could not be saved. Please, try again.');
}
}
if (empty($this->data)) {
//$this->data = $this->Tabla_1->read(null, $id);
$this->set('Tabla_1', $this->Tabla_1->findById($id));
}

/*
function for view Tabla_1.
created by your name
created at 18-01-17.
*/
function view($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid Tabla_1');
$this->redirect(array('action' => 'index'));
}
$this->set('Tabla_1', $this->Tabla_1->findById($id));
}
/*
function for activate and deactivate of Tabla_1.
created by your name
created at 18-01-17.
*/
public function changeStatus($id = null,$status = null)
{
if (!$id) {
$this->Session->setFlash('Invalid id for Tabla_1');
$this->redirect(array('action' => 'index'));
}
$status=!($status);
$this->Tabla_1->id = $id;
if ($this->Tabla_1->saveField('status',$status)) {
$this->Session->setFlash('Tabla_1 Status changed');
} else {
$this->Session->setFlash(__('Tabla_1 Status was not changed',
true));
}
$this->redirect(array('action' => 'index'));
}
/*
function for delete Tabla_1.
created by your name
created at 18-01-17.
*/
public function delete($id = null)
{
if (!$id) {
$this->Session->setFlash('Invalid id for Tabla_1');
$this->redirect(array('action' => 'index'));
}
if ($this->Tabla_1->delete($id)) {
$this->Session->setFlash('Tabla_1 deleted');
} else {
$this->Session->setFlash(__('Tabla_1 was not deleted',
true));
}
$this->redirect(array('action' => 'index'));
}

STEP 4. Create "Tabla_1.php" in your app/Model folder and put below code in that.
<?php
class Tabla_1 extends AppModel {
var $name = 'Tabla_1';
}
?>

STEP 5. Create "Tabla_1"" folder in your app/view and put add.ctp,edit.ctp,index.ctp and
view.ctp files in that.
add.ctp
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cake PHP Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo $this->webroot; ?>Tabla_1/index">Manage Tabla_1</a></li>
<li class="active" ><a href="<?php echo $this->webroot; ?>Tabla_1/add">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Add Tabla_1</h2>
<?php echo $this->Form->create('Tabla_1',array('enctype'=>'multipart/form-data','type' => 'post','url' =>
array('controller' => 'Tabla_1', 'action' => 'add'))); ?>
<?php echo $this->Form->input('Name', array('type' => 'text','class' => 'form-control')); ?>
<?php echo $this->Form->input('Age', array('type' => 'number','class' => 'form-control')); ?>
<?php echo $this->Form->input('Mail', array('type' => 'email','class' => 'form-control')); ?>
<?php echo $this->Form->input('Password', array('type' => 'password','class' => 'form-control')); ?
>
<?php
$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('IsCopy', array('type' => 'radio','options' => $options)); ?>

<?php
$options = array(
'M' => 'M',
'F' => 'F',
);
echo $this->Form->select('Sex', $options, array('empty'=>false,'class' => 'form-control')); ?>
<?php
$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('Acept',array(
'multiple' => 'checkbox',
'options' => $options,
));

?>
<?php echo $this->Form->input('Comments', array('type' => 'textarea','class' => 'form-control')); ?>
<?php echo $this->Form->input('FileName', array('type' => 'file','class' => 'form-control')); ?>
<?php echo $this->Form->end("Add Tabla_1"); ?>
</div>
</body>
</html>

edit.ctp
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cake PHP Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo $this->webroot; ?>Tabla_1/index">Manage Tabla_1</a></li>
<li><a href="<?php echo $this->webroot; ?>Tabla_1/add">Add Tabla_1</a></li>
</ul>
</div>
</nav>
<div class="container">
<h2>Update Tabla_1</h2>
<?php echo $this->Form->create('Tabla_1',array('enctype'=>'multipart/form-data','type' => 'post','url' =>
array('controller' => 'Tabla_1', 'action' => 'edit'))); ?>
<?php echo $this->Form->input('id', array('type' => 'hidden','value' => $Tabla_1['Tabla_1']['id'])); ?>
<?php echo $this->Form->input('Name', array('type' => 'text','class' => 'form-control','value' =>
$Tabla_1['Tabla_1']['Name'])); ?>
<?php echo $this->Form->input('Age', array('type' => 'number','class' => 'form-control','value' =>
$Tabla_1['Tabla_1']['Age'])); ?>
<?php echo $this->Form->input('Mail', array('type' => 'email','class' => 'form-control','value' =>
$Tabla_1['Tabla_1']['Mail'])); ?>
<?php

$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('IsCopy', array('type' => 'radio','options' => $options,'value' =>
$Tabla_1['Tabla_1']['IsCopy'])); ?>
<?php
$options = array(
'M' => 'M',
'F' => 'F',
);
echo $this->Form->select('Sex', $options, array('empty'=>false,'class' => 'form-control','value' =>
$Tabla_1['Tabla_1']['Sex'])); ?>
<?php
$selectedOption = json_decode($Tabla_1['Tabla_1']['Acept']);
$options = array(
'S' => 'S',
'N' => 'N',
);
echo $this->Form->input('Acept',array(
'multiple' => 'checkbox',
'options' => $options,
'selected' => $selectedOption
));
?>
<?php echo $this->Form->input('Comments', array('type' => 'textarea','class' => 'formcontrol','value' => $Tabla_1['Tabla_1']['Comments'])); ?>
<?php echo $this->Form->input('FileName', array('type' => 'file','class' => 'form-control','value' =>
$Tabla_1['Tabla_1']['FileName'])); ?>
<?php echo $this->Form->end("Update Tabla_1"); ?>
</div>
</body>
</html>

index.ctp
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cake PHP Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li class="active" ><a href="<?php echo $this->webroot; ?>Tabla_1/index">Manage
Tabla_1</a></li>
<li><a href="<?php echo $this->webroot; ?>Tabla_1/add">Add Tabla_1</a></li>
</ul>
</div>
</nav>

<div class="container">
<h2>Manage Tabla_1</h2>
<?php if(!empty($Tabla_1s)) {?>
<table class="table table-hover">
<thead>
<tr>
<th>SL No</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach($Tabla_1s as $Tabla_1) { ?>
<tr>
<td> <?php echo $i; ?> </td>
<td> <a href="<?php echo $this->webroot; ?>Tabla_1/view/<?php echo $Tabla_1['Tabla_1']['id'] ?>"
> <?php echo $Tabla_1['Tabla_1']['Name'] ?></a></td>
<td>
<a href="<?php echo $this->webroot; ?>Tabla_1/changeStatus/<?php echo $Tabla_1['Tabla_1']['id'] ?
>/<?php echo $Tabla_1['Tabla_1']['status'] ?>" > <?php if($Tabla_1['Tabla_1']['status']==0){ echo
"Activate"; } else { echo "Deactivate"; } ?></a>
<a href="<?php echo $this->webroot; ?>Tabla_1/edit/<?php echo $Tabla_1['Tabla_1']['id'] ?>"
>Edit</a>
<a href="<?php echo $this->webroot; ?>Tabla_1/delete/<?php echo $Tabla_1['Tabla_1']['id'] ?>"
onclick="return confirm('are you sure to delete')">Delete</a>
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
<?php } else {?>
<div class="alert alert-info" role="alert">
<strong>No Tabla_1s Found!</strong>
</div>
<?php } ?>
</div>
</body>
</html>

view.ctp
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cake PHP Crud By Crud Generator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://crudgenerator.in">Cake PHP Crud By Crud Generator</a>
</div>
<ul class="nav navbar-nav">
<li><a href="<?php echo $this->webroot; ?>Tabla_1/index">Manage Tabla_1</a></li>

<li><a href="<?php echo $this->webroot; ?>Tabla_1/add">Add Tabla_1</a></li>


</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 well">
Name : <?php echo $Tabla_1['Tabla_1']['Name'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Age : <?php echo $Tabla_1['Tabla_1']['Age'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Mail : <?php echo $Tabla_1['Tabla_1']['Mail'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
IsCopy : <?php echo $Tabla_1['Tabla_1']['IsCopy'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Sex : <?php echo $Tabla_1['Tabla_1']['Sex'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
Comments : <?php echo $Tabla_1['Tabla_1']['Comments'] ?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-10 well">
FileName : <?php echo $Tabla_1['Tabla_1']['FileName'] ?>
</div>
</div>
</div>
</body>
</html>

STEP 6. Create "uploads" folder in your app/wbroot/img folder.


Done! You can get the crud functionality in "your site url/Tabla1"

CORE PHP

STEP 1. Run the sql query in your database.


STEP 2. Create "Tabla_1" folder and put dbconfig.php, index.php, add_Tabla_1.php,
edit_Tabla_1.php, view_Tabla_1.php and style.css in that folder
dbconfig.php
<?php
$con=mysqli_connect("localhost","root","","your database name");
?>

index.php
<?php
include_once 'dbconfig.php';
if(isset($_GET['delete_id']))
{
$sql_query="DELETE FROM Tabla_1 WHERE id=".$_GET['delete_id'];
mysqli_query($con,$sql_query);
header("Location: $_SERVER[PHP_SELF]");
}
if(isset($_GET['changestatus_id']))
{
$sql_query="UPDATE Tabla_1 SET `status`='".$_GET['status']."' WHERE id=".$_GET['changestatus_id'];
mysqli_query($con,$sql_query);
header("Location: $_SERVER[PHP_SELF]");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Core PHP Crud functions By Crud Generator</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript">
function edt_id(id)
{
window.location.href='edit_Tabla_1.php?edit_id='+id;
}
function view_id(id)
{
window.location.href='view_Tabla_1.php?view_id='+id;
}
function delete_id(id)
{
if(confirm('Sure to Delete ?'))
{
window.location.href='index.php?delete_id='+id;
}
}

function changestatus_id(id,status)
{
window.location.href='index.php?changestatus_id='+id+'&status='+status;
}
</script>
</head>
<body>
<center>
<div id="header">
<div id="content">
<label>Core PHP Crud functions - <a href="http://crudgenerator.in" target="_blank">By Crud
Generator</a></label>
</div>
</div>
<div id="body">
<div id="content">
<table align="center">
<tr>
<th colspan="5"><a href="add_Tabla_1.php">add Tabla_1.</a></th>
</tr>
<th>SL NO</th>
<th>Name</th>
<th colspan="3">Actions</th>
</tr>
<?php
$sql_query="SELECT * FROM Tabla_1";
$result_set=mysqli_query($con,$sql_query);
$i=1;
while($row=mysqli_fetch_row($result_set))
{
?>
<tr>
<td align="center" ><?php echo $i; ?></td>
<td align="center" > <a href="javascript:view_id('<?php echo $row[0]; ?>')"> <?php echo
$row[1]; ?> </a> </td>
<?php if($row[count($row)-1]==1) { ?>
<td align="center"><a href="javascript:changestatus_id('<?php echo $row[0]; ?
>',0)">Deactivate</a></td>
<?php } else { ?>
<td align="center"><a href="javascript:changestatus_id('<?php echo $row[0]; ?
>',1)">Activate</a></td>
<?php } ?>
<td align="center"><a href="javascript:edt_id('<?php echo $row[0]; ?>')">Edit</a></td>
<td align="center"><a href="javascript:delete_id('<?php echo $row[0]; ?>')">Delete</a></td>
</tr>
<?php
$i++;
}
?>
</table>
</div>
</div>
</center>
</body>
</html>

add_Tabla_1.php

<?php
include_once 'dbconfig.php';
if(isset($_POST['btn-save']))
{
// variables for input data
$Name = $_POST['Name'];
$Age = $_POST['Age'];
$Mail = $_POST['Mail'];
$Password = md5($_POST['Password']);
$IsCopy = $_POST['IsCopy'];
$Sex = $_POST['Sex'];
$Acept = json_encode($_POST['Acept']);
$Comments = $_POST['Comments'];
$FileName = $_FILES["FileName"]["name"];
$file_name = $_FILES["FileName"]["name"];
$file_tmp = $_FILES["FileName"]["tmp_name"];
if($file_name!=''){
move_uploaded_file($file_tmp,"uploads/".$file_name);
}
// variables for input data
// sql query for inserting data into database
$sql_query="INSERT INTO Tabla_1
(`Name`,`Age`,`Mail`,`Password`,`IsCopy`,`Sex`,`Acept`,`Comments`,`FileName`) VALUES('".$Name."','".
$Age."','".$Mail."','".$Password."','".$IsCopy."','".$Sex."','".$Acept."','".$Comments."','".$FileName."')";
// sql query for inserting data into database
// sql query execution function
if(mysqli_query($con,$sql_query))
{
?>
<script type="text/javascript">
alert('Tabla_1 added Successfully ');
window.location.href='index.php';
</script>
<?php
}
else
{
?>
<script type="text/javascript">
alert('error occured while inserting your data');
</script>
<?php
}
// sql query execution function
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Core PHP Crud functions By Crud Generator</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<div id="header">
<div id="content">

<label>Core PHP Crud functions - <a href="http://www.crudgenerator.in" target="_blank">By Crud


Generator</a></label>
</div>
</div>
<div id="body">
<div id="content">
<form method="post" enctype="multipart/form-data" >
<table align="center">
<tr>
<td align="center"><a href="index.php">back to main page</a></td>
</tr>
<tr>
<td>
<input type="text" class="form-control" id="Name" name="Name" required placeholder="Name">
</td>
</tr>
<tr>
<td>
<input type="number" class="form-control" id="Age" name="Age" required placeholder="Age">
</td>
</tr>
<tr>
<td>
<input type="email" class="form-control" id="Mail" name="Mail" required placeholder="Mail">
</td>
</tr>
<tr>
<td>
<input type="password" class="form-control" id="Password" name="Password" required
placeholder="Password">
</td>
</tr>
<tr>
<td>
<input type="radio" class="check" name="IsCopy" value="S"> S<br>
<input type="radio" class="check" name="IsCopy" value="N"> N<br>
</td>
</tr>
<tr>
<td>
<select class="form-control" id="Sex" name="Sex">
<option value="M.F">M.F</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" class="check" name="Acept[]" value="S"> S<br>
<input type="checkbox" class="check" name="Acept[]" value="N"> N<br>
</td>
</tr>
<tr>
<td>
<textarea class="form-control" id="Comments" name="Comments"></textarea>
</td>
</tr>
<tr>
<td>

<input type="file" class="form-control" id="FileName" name="FileName" required


placeholder="FileName">
</td>
</tr>
<tr>
<td><button type="submit" name="btn-save"><strong>SAVE</strong></button></td>
</tr>
</table>
</form>
</div>
</div>
</center>
</body>
</html>

edit_Tabla_1.php
<?php
include_once 'dbconfig.php';
if(isset($_GET['edit_id']))
{
$sql_query="SELECT * FROM Tabla_1 WHERE id=".$_GET['edit_id'];
$result_set=mysqli_query($con,$sql_query);
$fetched_row=mysqli_fetch_array($result_set,MYSQLI_ASSOC);
}
if(isset($_POST['btn-update']))
{
// variables for input data
$Name = $_POST['Name'];
$Age = $_POST['Age'];
$Mail = $_POST['Mail'];
$IsCopy = $_POST['IsCopy'];
$Sex = $_POST['Sex'];
$Acept = json_encode($_POST['Acept']);
$Comments = $_POST['Comments'];
if($_FILES["FileName"]["name"]==''){
$FileName = $fetched_row['FileName'];
}else{
$FileName = $_FILES["FileName"]["name"];
$file_name = $_FILES["FileName"]["name"];
$file_tmp = $_FILES["FileName"]["tmp_name"];
if($file_name!=''){
move_uploaded_file($file_tmp,"uploads/".$file_name);
}

// variables for input data


// sql query for update data into database
$sql_query="UPDATE Tabla_1 SET
`Name`='$Name',`Age`='$Age',`Mail`='$Mail',``='$',`IsCopy`='$IsCopy',`Sex`='$Sex',`Acept`='$Acept',`
Comments`='$Comments' WHERE id=".$_GET['edit_id'];
// sql query for update data into database
// sql query execution function
if(mysqli_query($con,$sql_query))
{

?>
<script type="text/javascript">
alert('Tabla_1 updated successfully');
window.location.href='index.php';
</script>
<?php
}
else
{
?>
<script type="text/javascript">
alert('error occured while updating data');
</script>
<?php
}
// sql query execution function
}
if(isset($_POST['btn-cancel']))
{
header("Location: index.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Core PHP Crud functions By Crud Generator</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<div id="header">
<div id="content">
<label>Core PHP Crud functions - <a href="http://crudgenerator.in" target="_blank">By Crud
Generator</a></label>
</div>
</div>
<div id="body">
<div id="content">
<form method="post" enctype="multipart/form-data">
<table align="center">
<tr>
<td>
<input type="text" value="<?php echo $fetched_row['Name'] ?>" class="form-control" id="Name"
name="Name">
</td>
</tr>
<tr>
<td>
<input type="number" value="<?php echo $fetched_row['Age'] ?>" class="form-control" id="Age"
name="Age">
</td>
</tr>
<tr>
<td>
<input type="email" value="<?php echo $fetched_row['Mail'] ?>" class="form-control" id="Mail"
name="Mail">
</td>

</tr>
<tr>
<td>
<input type="radio" class="check" name="IsCopy" value="S" <?php if($fetched_row['IsCopy'] == "S")
{ echo "checked"; } ?> > S<br>
<input type="radio" class="check" name="IsCopy" value="N" <?php if($fetched_row['IsCopy'] == "N")
{ echo "checked"; } ?> > N<br>
</td>
</tr>
<tr>
<td>
<select class="form-control" id="Sex" name="Sex">
<option value="M.F" <?php if($fetched_row['Sex'] == "M.F"){ echo "selected"; } ?> >M.F</option>
</select>
</td>
</tr>
<tr>
<td>
<?php $Acepts=json_decode($fetched_row['Acept']); ?>
<input class="check" type="checkbox" name="Acept[]" value="S" <?php if(in_array("S",$Acepts)){ echo
"checked"; } ?> > S<br>
<input class="check" type="checkbox" name="Acept[]" value="N" <?php if(in_array("N",$Acepts)){ echo
"checked"; } ?> > N<br>
</td>
</tr>
<tr>
<td>
<textarea class="form-control" id="Comments" name="Comments">
<?php echo
$fetched_row['Comments'] ?>
</textarea>
</td>
</tr>
<tr>
<td>
<input type="file" value="<?php echo $fetched_row['FileName'] ?>" class="form-control"
id="FileName" name="FileName">
</td>
</tr>
<tr>
<td>
<button type="submit" name="btn-update"><strong>UPDATE</strong></button>
<button type="submit" name="btn-cancel"><strong>Cancel</strong></button>
</td>
</tr>
</table>
</form>
</div>
</div>
</center>
</body>
</html>

view_Tabla_1.php
<?php
include_once 'dbconfig.php';
if(isset($_GET['view_id']))
{

$sql_query="SELECT * FROM Tabla_1 WHERE id=".$_GET['view_id'];


$result_set=mysqli_query($con,$sql_query);
$fetched_row=mysqli_fetch_array($result_set,MYSQLI_ASSOC);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Core PHP Crud functions By Crud Generator</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<div id="header">
<div id="content">
<label>Core PHP Crud functions - <a href="http://crudgenerator.in" target="_blank">By Crud
Generator</a></label>
</div>
</div>
<table align="center">
<tr>
<th colspan="5">Name: <?php echo $fetched_row['Name'] ?></th>
</tr>
<tr>
<th colspan="5">Age: <?php echo $fetched_row['Age'] ?></th>
</tr>
<tr>
<th colspan="5">Mail: <?php echo $fetched_row['Mail'] ?></th>
</tr>
<tr>
<th colspan="5">IsCopy: <?php echo $fetched_row['IsCopy'] ?></th>
</tr>
<tr>
<th colspan="5">Sex: <?php echo $fetched_row['Sex'] ?></th>
</tr>
<tr>
<th colspan="5">Comments: <?php echo $fetched_row['Comments'] ?></th>
</tr>
</table>
</center>
</body>
</html>

style.css
@charset "utf-8";
/* CSS Document */
{
margin:0;
padding:0;
}
body
{
background:#f9f9f9;
font-family:"Courier New", Courier, monospace;

}
#header
{
width:100%;
height:50px;
background:#A0D8B1;
color:#f9f9f9;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size:35px;
text-align:center;
}
#header a
{
color:#fff;
text-decoration:blink;
}
#body
{
margin-top:50px;
}
table
{
width:80%;
font-family:Tahoma, Geneva, sans-serif;
font-weight:bolder;
color:#999;
margin-bottom:80px;
}
table a
{
text-decoration:none;
color:#A0D8B1;
}
table,td,th
{
border-collapse:collapse;
border:solid #d0d0d0 1px;
padding:20px;
}
table td input,table td select,table td textarea
{
width:97%;
height:35px;
border:dashed #A0D8B1 1px;
padding-left:15px;
font-family:Verdana, Geneva, sans-serif;
box-shadow:0px 0px 0px rgba(1,0,0,0.2);
outline:none;
}
.check
{
width:15px;
height:15px;
border:dashed #A0D8B1 1px;
padding-left:15px;
font-family:Verdana, Geneva, sans-serif;
box-shadow:0px 0px 0px rgba(1,0,0,0.2);
outline:none;
}

table td input:focus
{
box-shadow:inset 1px 1px 1px rgba(1,0,0,0.2);
outline:none;
}
table td button
{
border:solid #f9f9f9 0px;
box-shadow:1px 1px 1px rgba(1,0,0,0.2);
outline:none;
background:#A0D8B1;
padding:9px 15px 9px 15px;
color:#f9f9f9;
font-family:Arial, Helvetica, sans-serif;
font-weight:bolder;
border-radius:3px;
width:49.5%;
}
table td button:active
{
position:relative;
top:1px;
}

STEP 3.add a 'uploads' folder in your Tabla_1 folder for file upload
Done!. You can get the crud functionality in "/Tabla_1"

S-ar putea să vă placă și