Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class User extends CI_Controller {
- function __construct() {
- parent::__construct();
- $this->load->model('User_model');
- }
- function index() {
- $this->load->view('user_view');
- }
- function get_data_user() {
- $post = $this->input->post();
- $list = $this->User_model->get_datatables($post);
- $data = array();
- $no = $post['start'];
- foreach ($list['data'] as $field) {
- $no++;
- $row = array();
- $row[] = $no;
- $row[] = $field->no_rangka;
- $row[] = $field->no_polisi;
- $row[] = $field->model;
- $row[] = $field->type;
- $row[] = $field->transmission;
- $row[] = $field->warna;
- $row[] = $field->tahun;
- $row[] = $field->km;
- $row[] = $field->customer;
- $row[] = $field->telephone;
- $row[] = $field->handphone;
- $row[] = $field->contact_person;
- $row[] = $field->telephone_cp;
- $row[] = $field->cabang_penjual;
- $row[] = $field->cabang_service;
- $row[] = $field->salesman;
- $row[] = $field->last_service;
- $row[] = $field->job;
- $row[] = $field->pekerjaan_utama;
- $row[] = $field->program_promo;
- $row[] = $field->status_aktif;
- $row[] = $field->hasil_fu1;
- $row[] = $field->hasil_fu2;
- $row[] = $field->hasil_fu3;
- $data[] = $row;
- }
- $output = array(
- "raw" => array(
- "sql" => $list['sql'],
- "input" => $post
- ),
- "draw" => $post['draw'],
- "recordsTotal" => $this->User_model->count_all(),
- "recordsFiltered" => $this->User_model->count_filtered($post),
- "data" => $data,
- "recordsShow" => count($data)
- );
- //output dalam format JSON
- echo json_encode($output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment