Posts

Showing posts from April, 2020

Create Pagination using Codeigniter

Pagination.php        Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Pagination extends CI_Controller { function __construct() { parent:: __construct(); $this->load->model('pagination_model'); $this->load->library('pagination'); } public function index() { $config=[         'base_url' => base_url('Pagination/index'),         'per_page' => 3,         'total_rows' => $this->pagination_model->num_rows(),         'full_tag_open' => "<ul class='pagination'>",         'first_link' => false,         'last_link' => false,         'full_tag_close'=> "</ul>",         'next_tag_open' => "<li>",         'next_tag...

DataTables Server-side Processing in Codeigniter

 Form.php       Controller  <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Form extends CI_Controller { function __construct() { parent:: __construct(); $this->load->model('form_model'); } public function serverside()     {         $this->load->view('include/header');         $this->load->view('form/server-side-datatable');         $this->load->view('include/footer');     } public function get_form_data()     {         $columns = array(             0 => 'id',             1 => 'text',             2 => 'dropdown',             3 => 'radio',             4 => 'status',         ...

CRUD With Client-Side Validation | Codeigniter

Form.php        Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Form extends CI_Controller { function __construct() { parent:: __construct(); $this->load->model('form_model'); } public function index() { $data['formdatas'] = $this->form_model->get_form_data(); $this->load->view('include/header'); $this->load->view('form/list',$data); $this->load->view('include/footer'); } public function create()     {         $this->load->view('include/header');         $this->load->view('form/create');         $this->load->view('include/footer');     }     public function submitform()     {         if (!empty($this->input->post())) {             if (isset($_FILES['singleFile']) && ...

Bootstrap Template

Welcome.php      Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function index() { $this->load->view('include/header'); $this->load->view('include/home'); $this->load->view('include/footer'); } } header.php    view <!DOCTYPE html> <html lang="en"> <head>   <title>Bootstrap Example</title>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1">   <!-- Bootstrap  -->     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1....