56 lines
1.6 KiB
PHP
Executable File

<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Formbuilder_model extends CI_model {
function __construct() {
parent::__construct();
$this->load->database();
}
function delete($id)
{
$this->db->where('id', $id);
$this->db->delete('forms');
}
function getFormData($id){
$this->db->order_by('id', 'DESC')->where('id',$id);
$query = $this->db->get('forms')->row();
return $query->form_data;
}
function total_list(){
$query = $this->db->get('forms');
$output=$query->result();
return count($output);
}
function get_list(){
$query = $this->db->get('forms');
$output=$query->result();
return $output;
}
function getNameByLimitBySearch($limit, $start, $search) {
// $this->db->like('id', $search);
// $this->db->order_by('id', 'desc');
// $this->db->or_like('name', $search);
// $this->db->or_like('status', $search);
$this->db->limit($limit, $start);
$query = $this->db->get('forms');
return $query->result();
}
function getNameByLimit($limit, $start, $orderColumn, $orderType) {
// if($orderColumn==0)
// $this->db->order_by('id', $orderType);
// else if($orderColumn==1)
// $this->db->order_by('name', $orderType);
// else if($orderColumn==2)
// $this->db->order_by('status', $orderType);
$this->db->limit($limit, $start);
$query = $this->db->get('forms');
return $query->result();
}
}