public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('users'); $xcrud->table_name('Profile'); $xcrud->default_tab('Profile'); $xcrud->columns('email,first_name,last_name,phone,company,default_group,foto'); $xcrud->fields('email,first_name,last_name,phone,company,default_group,foto'); $xcrud->where('nik=', nik); //echo nik; $xcrud->unset_add(); $xcrud->unset_pagination(); $xcrud->unset_print(); $xcrud->unset_limitlist(); $xcrud->unset_csv(); $xcrud->unset_remove(); $xcrud->unset_search(); $xcrud->benchmark(); //$xcrud->unset_limit(); $xcrud->set_attr('first_name', array('ReadOnly' => 'True')); $xcrud->set_attr('last_name', array('disabled' => 'True')); $xcrud->set_attr('default_group', array('ReadOnly' => 'True')); $xcrud->change_type('foto', 'image', array('width' => 2, 'height' => 2)); $xcrud->unset_title(); //$xcrud->relation('jabatan','jabatan','kode_jabatan','nama_jabatan'); $data['content'] = $xcrud->render('edit', id); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('profile', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('trans_mstr_unit'); $xcrud->table_name('Master Unit'); $xcrud->default_tab('Info Kendaraan'); // $xcrud->columns('no_surat_jalan,nomor_unit,route'); // $xcrud->relation('kode_kustomer','xx_mstr_kustomer','kode_kustomer','nama_kustomer'); $xcrud->relation('pemilik', 'trans_mstr_owner', 'kode_owner', 'nama_owner'); $xcrud->relation('tipe_unit', 'trans_mstr_tipe_unit', 'kode_tipe_unit', 'nama_tipe'); // $xcrud->relation('kode_bongkar2','trans_mstr_lokasi','kode_lokasi','nama_lokasi'); // $xcrud->relation('kode_bongkar3','trans_mstr_lokasi','kode_lokasi','nama_lokasi'); // // $xcrud->label('kode_kustomer,Nama Kustomer'); // $trans_transaksi_dn_detail = $xcrud->nested_table('Detail DN','no_surat_jalan','trans_transaksi_dn_detail','no_surat_jalan'); // 2nd level // $trans_transaksi_dn_detail->default_tab('Detail Information'); // $trans_transaksi_dn_detail->table_name('Detail Delivery Notes'); // $trans_transaksi_dn_detail->columns('nama_material,spesifikasi_material,berat,jumlah,tarif,total'); // $trans_transaksi_dn_detail->fields('nama_material,spesifikasi_material,berat,jumlah,tarif,total'); // // $trans_transaksi_dn_detail->subselect('Totals','SELECT SUM(berat) FROM trans_transaksi_dn_detail'); // current table // // $trans_transaksi_dn_detail->sum('creditLimit,Paid,Profit'); // sum row(), receives data from full table (ignores pagination) // // $trans_transaksi_dn_detail->change_type('Profit','price','0',array('prefix'=>'$')); // number format $data['content'] = $xcrud->render(); $this->load->view('commons/header'); $this->load->view('unit', $data); $this->load->view('commons/footer'); }
/** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('orders'); $data['content'] = $xcrud->render(); $this->load->view('welcome_message', $data); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('trash'); $xcrud->table_name('trash'); $xcrud->default_tab('message'); $xcrud->columns('date,from,to,subject,message'); $xcrud->fields('from,to,subject,message', false, 'Text Message'); $xcrud->fields('description,image,document,remark', false, 'Attachment'); $xcrud->fields('to,subject,message'); $xcrud->order_by('date', 'desc'); $xcrud->column_width('message', '70%'); $xcrud->where('from_id', array(id)); $status = "deleted"; $xcrud->where('status_pesan', $status); $xcrud->column_pattern('date', '<a href="#" class="xcrud-action" data-task="view" data-primary="{id}">{value}</a>'); $xcrud->buttons_position('left'); //$xcrud->change_type('hasil_scan', 'image'); // // if ( access == "admin") { //$xcrud->where('nik=',nik); // } //$section ="<section class="content-header"><h1>Profile<small>Profile</small></h1><ol class="breadcrumb"></section>"; //$data['section']; // $xcrud->unset_add(); // $xcrud->unset_pagination(); // $xcrud->unset_print(); // $xcrud->unset_limitlist(); //if ( access != "admin") { //$xcrud->where('divisi=',access_group); $xcrud->unset_add(); //$xcrud->unset_remove(); $xcrud->unset_edit(); // //} $xcrud->unset_csv(); // $xcrud->label('hasil_scan','Foto'); //$xcrud->unset_remove(); //$xcrud->unset_search(); $xcrud->benchmark(); // $xcrud->pass_var('from',USER_NAME,'create'); // echo USER_NAME ; //$xcrud->unset_limit(); // $xcrud->p('first_name',array('ReadOnly'=>'True')); $xcrud->set_attr('from', array('ReadOnly' => 'True', 'value' => USER_NAME)); // $xcrud->set_attr('last_name',array('disabled'=>'True')); // $xcrud->set_attr('default_group',array('ReadOnly'=>'True')); // $xcrud->change_type('foto','image',array('width' => 2, 'height' => 2)); $xcrud->unset_title(); $xcrud->relation('to', 'view_users', 'id', 'nama_lengkap'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('trash', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('dokumen_file'); $xcrud->table_name('Dokumen'); $xcrud->default_tab('Dokumen'); $xcrud->columns('nomor,divisi, nama,deskripsi,dokumen'); $xcrud->fields('nomor,divisi, nama,deskripsi,dokumen'); $xcrud->change_type('dokumen', 'file', '', array('not_rename' => true)); //$xcrud->change_type('dokumen','file',array('width' => 2, 'height' => 2)); // if (access == "user") { $xcrud->where('divisi=', access_group); //$xcrud->where('divisi=',$all); $xcrud->unset_add(); $xcrud->unset_remove(); $xcrud->unset_edit(); } if (access == "viewer") { //$xcrud->where('divisi=',access_group); //$xcrud->where('divisi=',$all); $xcrud->unset_add(); $xcrud->unset_remove(); $xcrud->unset_edit(); } //$section ="<section class="content-header"><h1>Profile<small>Profile</small></h1><ol class="breadcrumb"></section>"; //$data['section']; // $xcrud->unset_add(); //$xcrud->unset_pagination(); //$xcrud->unset_print(); //$xcrud->unset_limitlist(); $xcrud->unset_csv(); $xcrud->label('nama', 'Nama Dokumen'); $xcrud->label('dokumen', 'Dokumen'); //$xcrud->unset_remove(); //$xcrud->unset_search(); $xcrud->benchmark(); //$xcrud->unset_limit(); // $xcrud->set_attr('first_name',array('ReadOnly'=>'True')); // $xcrud->set_attr('last_name',array('disabled'=>'True')); // $xcrud->set_attr('default_group',array('ReadOnly'=>'True')); // $xcrud->change_type('foto','image',array('width' => 2, 'height' => 2)); $xcrud->unset_title(); $xcrud->relation('divisi', 'divisi', 'kode_divisi', 'nama_divisi'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('dokumen_file', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('message'); $xcrud->table_name('message'); //$xcrud->default_tab('Text Message'); $xcrud->columns('to,subject,message'); $xcrud->fields('to,from,subject,message,from_id', false, 'Text Message'); $xcrud->fields('description,image,document,remark', false, 'Attachment'); $xcrud->change_type('image', 'image'); $xcrud->column_width('message', '70%'); $xcrud->hide_button('save_return'); $xcrud->change_type('document', 'file'); $xcrud->where('from_id', array(id)); $xcrud->order_by('date', 'desc'); $xcrud->unset_edit(); $xcrud->unset_csv(); $xcrud->unset_search(); $xcrud->benchmark(); // $xcrud->pass_var('from',USER_NAME,'create'); // echo USER_NAME ; //$xcrud->unset_limit(); $xcrud->label('from_id', ''); // $xcrud->p('first_name',array('ReadOnly'=>'True')); $xcrud->set_attr('subject', array('id' => 'subject')); $xcrud->set_attr('from', array('ReadOnly' => 'True', 'value' => USER_NAME)); // $xcrud->buttons_position('left'); $idid = id; $xcrud->set_attr('from_id', array('ReadOnly' => 'True', 'type' => 'hiddden', 'value' => $idid)); // $xcrud->pass_var('from_id',id,'create'); 'type'=>'hidden' // $xcrud->set_attr('last_name',array('disabled'=>'True')); // $xcrud->set_attr('default_group',array('ReadOnly'=>'True')); // $xcrud->change_type('foto','image',array('width' => 2, 'height' => 2)); $xcrud->unset_title(); $xcrud->relation('to', 'view_users', 'id', 'nama_lengkap'); $xcrud->hide_button('return'); $xcrud->validation_required('to'); $xcrud->validation_required('subject'); //echo id; $data['content'] = $xcrud->render('create'); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('message', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('divisi'); $xcrud->table_name('divisi'); $xcrud->default_tab('divisi'); $xcrud->columns('id,kode_divisi,nama_divisi,keterangan'); $xcrud->fields('id,kode_divisi,nama_divisi,keterangan'); //$xcrud->change_type('hasil_scan', 'image'); // // if ( access == "admin") { //$xcrud->where('nik=',nik); // } //$section ="<section class="content-header"><h1>Profile<small>Profile</small></h1><ol class="breadcrumb"></section>"; //$data['section']; // $xcrud->unset_add(); // $xcrud->unset_pagination(); // $xcrud->unset_print(); // $xcrud->unset_limitlist(); if (access != "admin") { //$xcrud->where('divisi=',access_group); $xcrud->unset_add(); $xcrud->unset_remove(); $xcrud->unset_edit(); } $xcrud->unset_csv(); // $xcrud->label('hasil_scan','Foto'); //$xcrud->unset_remove(); $xcrud->unset_search(); $xcrud->benchmark(); //$xcrud->unset_limit(); // $xcrud->set_attr('first_name',array('ReadOnly'=>'True')); // $xcrud->set_attr('last_name',array('disabled'=>'True')); // $xcrud->set_attr('default_group',array('ReadOnly'=>'True')); // $xcrud->change_type('foto','image',array('width' => 2, 'height' => 2)); $xcrud->unset_title(); //$xcrud->relation('jabatan','jabatan','kode_jabatan','nama_jabatan'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('division', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('users'); $xcrud->table_name('Profile'); $xcrud->default_tab('Profile'); $xcrud->columns('id,email,first_name,last_name,phone,company,default_group,foto,active'); $xcrud->fields('id,email,first_name,last_name,phone,company,default_group,foto,active'); $xcrud->set_attr('user_id', array('readonly' => 'true', 'type' => 'EMAIL')); $ipaddress = $_SERVER['REMOTE_ADDR']; $browser = @$_SERVER[HTTP_USER_AGENT]; $xcrud->pass_var('browser', $browser, 'create'); $xcrud->pass_var('ip_address', $ipaddress, 'create'); $xcrud->pass_var('create_user', USER_NAME, 'create'); $xcrud->pass_var('create_date', date('Y-m-d H:i:s'), 'create'); $xcrud->pass_var('modify_user', USER_NAME, 'edit'); $xcrud->pass_var('modify_date', date('Y-m-d H:i:s'), 'edit'); $xcrud->unset_csv(); $xcrud->benchmark(); $xcrud->change_type('foto', 'image'); $xcrud->unset_title(); $xcrud->relation('default_group', 'groups', 'id', 'description'); $group = $xcrud->nested_table('Division', 'id', 'users_groups', 'user_id'); $group->columns('user_id,group_id,access,access_group'); $group->fields('user_id,group_id,access,access_group'); $group->unset_title(); $group->fields('user_id,group_id,access'); $group->set_attr('user_id', array('readonly' => 'true')); $group->label('active', 'Status'); $group->label('access', 'Hak Akses'); $group->relation('access_group', 'divisi', 'kode_divisi', 'nama_divisi'); $group->relation('group_id', 'groups', 'id', 'description'); $group->label('access_group', 'Division'); $group->label('group_id', 'Group'); $group->fields('user_id,group_id,access'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('users', $data); $this->load->view('commons/footer'); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('message'); $xcrud->table_name('message'); $xcrud->default_tab('message'); $xcrud->columns('date,from,subject,message,document'); $xcrud->fields('from,subject,message', false, 'Text Message'); $xcrud->fields('description,image,document,remark', false, 'Attachment'); $xcrud->where('to', array(id)); $xcrud->order_by('date', 'desc'); $xcrud->column_width('message', '50%'); //$xcrud->column_cut(100,'message'); $xcrud->create_action('publish', 'publish_action'); // action callback, function publish_action() in functions.php $xcrud->create_action('unpublish', 'unpublish_action'); $xcrud->button('#', 'Tandai Sudah dibaca', 'glyphicon glyphicon-eye-close', 'xcrud-action', array('data-task' => 'action', 'data-action' => 'publish', 'data-primary' => '{id}'), array('bool', '!=', '1')); $xcrud->button('#', 'tandai Belum dibaca', 'glyphicon glyphicon-eye-open', 'xcrud-action', array('data-task' => 'action', 'data-action' => 'unpublish', 'data-primary' => '{id}'), array('bool', '=', '1')); $xcrud->column_class('from', 'align-center font-bold'); $xcrud->column_pattern('date', '<a href="#" class="xcrud-action" data-task="view" data-primary="{id}">{value}</a>'); $xcrud->column_pattern('from', '<a href="#" class="xcrud-action" data-task="view" data-primary="{id}">{value}</a>'); $xcrud->buttons_position('left'); //$xcrud->fields('description,image,document,remark', false, 'Add Document'); $xcrud->label('document', 'Attachment'); $xcrud->change_type('image', 'image'); $xcrud->change_type('document', 'file'); //$xcrud->change_type('hasil_scan', 'image'); // // if ( access == "admin") { //$xcrud->where('nik=',nik); // } //$section ="<section class="content-header"><h1>Profile<small>Profile</small></h1><ol class="breadcrumb"></section>"; //$data['section']; // $xcrud->unset_add(); // $xcrud->unset_pagination(); // $xcrud->unset_print(); // $xcrud->unset_limitlist(); //if ( access != "admin") { //$xcrud->where('divisi=',access_group); $xcrud->unset_add(); $xcrud->unset_remove(); $xcrud->unset_edit(); // //} $xcrud->unset_csv(); // $xcrud->label('hasil_scan','Foto'); //$xcrud->unset_remove(); //$xcrud->unset_search(); $xcrud->benchmark(); // $xcrud->pass_var('from',USER_NAME,'create'); // echo USER_NAME ; //$xcrud->unset_limit(); // $xcrud->p('first_name',array('ReadOnly'=>'True')); $xcrud->set_attr('from', array('ReadOnly' => 'True', 'value' => USER_NAME)); // $xcrud->set_attr('last_name',array('disabled'=>'True')); // $xcrud->set_attr('default_group',array('ReadOnly'=>'True')); // $xcrud->change_type('foto','image',array('width' => 2, 'height' => 2)); $xcrud->unset_title(); $xcrud->relation('to', 'view_users', 'id', 'nama'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('inbox', $data); $this->load->view('commons/footer'); }
function edit_post($edit_post) { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('news'); $xcrud->table_name(' Add News & Event'); //$xcrud->default_tab('Text Message'); $xcrud->columns('id,judul,artikel,gambar,tanggal,entry_by'); $xcrud->fields('judul,artikel,gambar,status,youtube_url,icon,frame,entry_by'); $xcrud->button('http://localhost/qms/timeline/baca_artikel?news_id={id}', 'Preview', 'glyphicon glyphicon-zoom-in'); //$xcrud->fields('description,image,document,remark', false, 'Attachment'); $xcrud->unset_view(); //$xcrud->change_type('gambar','image'); $xcrud->change_type('gambar', 'image', false, array('width' => 450, 'path' => '../uploads', 'thumbs' => array(array('height' => 55, 'width' => 120, 'crop' => true, 'marker' => '_th')))); $xcrud->order_by('id', 'desc'); $xcrud->benchmark(); $xcrud->pass_var('entry_by', USER_NAME, 'create'); $xcrud->pass_var('entry_id', id, 'create'); $hari = date('w'); $tgl = date('d'); $bln = date('m'); $thn = date('y'); switch ($hari) { case 0: $hari = 'Minggu'; break; case 1: $hari = 'Senin'; break; case 2: $hari = 'Selasa'; break; case 3: $hari = 'Rabu'; break; case 4: $hari = 'Kamis'; break; case 5: $hari = 'Jumat'; break; case 6: $hari = 'Sabtu'; break; default: $hari = 'Unknown'; break; } switch ($bln) { case 1: $bln = 'Januari'; break; case 2: $bln = 'Februari'; break; case 3: $bln = 'Maret'; break; case 4: $bln = 'April'; break; case 5: $bln = 'Mei'; break; case 6: $bln = 'Juni'; break; case 7: $bln = 'Juli'; break; case 8: $bln = 'Agustus'; break; case 9: $bln = 'September'; break; case 10: $bln = 'Oktober'; break; case 11: $bln = 'November'; break; case 12: $bln = 'Desember'; break; default: $bln = 'Unknown'; break; } $tgl_bahasaindo = $hari . ", " . $tgl . " " . $bln . " " . "20" . $thn; $xcrud->pass_var('tanggal', $tgl_bahasaindo, 'create'); // echo USER_NAME ; //$xcrud->unset_limit(); $xcrud->set_attr('entry_by', array('ReadOnly' => 'True')); $xcrud->set_attr('icon', array('ReadOnly' => 'True', 'id' => 'icon')); $xcrud->set_attr('frame', array('ReadOnly' => 'True', 'id' => 'frame')); $xcrud->set_attr('youtube_url', array('id' => 'youtube_url')); //echo id; $data['content'] = $xcrud->render('edit', $edit_post); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('news', $data); $this->load->view('commons/footer'); $DB1 = $this->load->database('default', TRUE); }
public function index() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('trans_transaksi_dn_header'); $xcrud->default_tab('Info DN'); $xcrud->table_name('Surat Jalan'); $xcrud->columns('no_kontrak,no_surat_jalan,tgl_surat_jalan,nomor_unit,kode_route,total'); $xcrud->order_by('tgl_surat_jalan', 'desc'); $xcrud->subselect('total', 'SELECT (SELECT IFNULL(SUM(a.total),0) FROM trans_transaksi_dn_detail a where a.no_surat_jalan = {no_surat_jalan})+ (SELECT b.tarif + (b.tarif_lift_of * b.jum_lift_of) + (b.tarif_multidrop * b.jum_multidrop) FROM trans_transaksi_dn_header b where b.no_surat_jalan = {no_surat_jalan})'); // current table $xcrud->sum('total', 'Total is {total}'); $xcrud->change_type('total', 'price', '0', array('prefix' => 'Rp. ', 'separator' => '.', 'point' => ',')); $xcrud->column_class('total', 'align-right'); $xcrud->readonly('tarif,tarif_lift_of,tarif_multidrop'); $xcrud->set_attr('no_surat_jalan', array('id' => 'no_surat_jalan')); $xcrud->set_attr('no_kontrak', array('id' => 'no_kontrak')); $xcrud->set_attr('kode_route', array('id' => 'kode_route')); $xcrud->set_attr('jum_multidrop', array('id' => 'jum_multidrop')); $xcrud->set_attr('tarif', array('id' => 'tarif_header')); $xcrud->set_attr('tarif_multidrop', array('id' => 'tarif_multidrop')); $xcrud->set_attr('tarif_lift_of', array('id' => 'tarif_lift_of')); $xcrud->set_attr('opt_tarif', array('id' => 'opt_tarif', 'onclick' => 'fn_opt_tarif();')); $xcrud->set_attr('opt_kustomer', array('id' => 'opt_kustomer', 'onclick' => 'fn_opt_kustomer();')); $xcrud->set_attr('kode_kustomer', array('id' => 'kode_kustomer')); $xcrud->set_attr('no_dokumen', array('id' => 'no_dokumen')); $xcrud->set_attr('kode_produk', array('id' => 'kode_produk')); $xcrud->set_attr('nomor_unit', array('id' => 'nomor_unit')); $xcrud->set_attr('kode_supir', array('id' => 'kode_supir')); // $xcrud->create_action('my_action','my_function'); $xcrud->fields('no_surat_jalan,tgl_surat_jalan,opt_kustomer,kode_kustomer,no_kontrak', false, 'Penomoran'); $xcrud->fields('opt_dokumen,no_dokumen,kode_route', false, 'Dokumen'); $xcrud->fields('kode_bongkar1,kode_bongkar2,kode_bongkar3,opt_tarif, shift', false, 'Pembongkaran'); $xcrud->fields('tgl_berangkat,tgl_est_tiba_di_kust,tgl_akt_tiba_di_kust,tgl_est_POD,tgl_aktual_POD,tgl_info_ke_KS', false, 'Waktu'); $xcrud->fields('kode_produk,nomor_unit,kode_supir,nomor_kontainer,kode_kapal', false, 'Barang'); $xcrud->fields('jum_multidrop,tarif_multidrop,jum_lift_of, tarif_lift_of,tarif,total,status_surat_jalan', false, 'Tarif'); $xcrud->relation('no_kontrak', 'trans_mstr_kontrak_header', 'id', 'no_kontrak', 'status = "Open"', '', '', '', '', 'kode_kustomer', 'kode_kustomer'); //$xcrud->relation('no_kontrak','trans_mstr_kontrak_header','no_kontrak','no_kontrak'); $xcrud->relation('no_dokumen', 'trans_mstr_proyek', 'no_proyek', 'nama_proyek', '', 'id desc'); $xcrud->relation('kode_kustomer', 'xx_mstr_kustomer', 'kode_kustomer', 'nama_kustomer'); //$xcrud->relation('kode_route','trans_mstr_route','kode_route','keterangan'); $xcrud->relation('kode_route', 'trans_mstr_route', 'kode_route', 'keterangan', '', '', '', '', '', 'kode_kustomer', 'kode_kustomer'); $xcrud->relation('kode_bongkar1', 'xx_mstr_kust_ship_to', 'nid', 'plant_bongkar', '', '', '', ' ', '', 'kode_kustomer', 'kode_kustomer'); $xcrud->relation('kode_bongkar2', 'xx_mstr_kust_ship_to', 'nid', 'plant_bongkar', '', '', '', ' ', '', 'kode_kustomer', 'kode_kustomer'); $xcrud->relation('kode_bongkar3', 'xx_mstr_kust_ship_to', 'nid', 'plant_bongkar', '', '', '', ' ', '', 'kode_kustomer', 'kode_kustomer'); $xcrud->relation('nomor_unit', 'trans_mstr_unit', 'nomor_unit', 'nomor_unit', '', '', '', ' -- '); $xcrud->relation('kode_supir', 'v_mstr_supir', 'kode_supir', 'nama_supir'); $xcrud->relation('kode_kapal', 'trans_mstr_kapal', 'kode_kapal', 'nama_kapal'); $xcrud->relation('kode_produk', 'trans_mstr_produk', 'kode_produk', 'nama_produk'); $xcrud->label(array('no_kontrak' => 'No. Kontrak / No. PO')); $xcrud->label(array('kode_bongkar1' => 'Plant Bongkar 1')); $xcrud->label(array('kode_bongkar2' => 'Plant Bongkar 2')); $xcrud->label(array('kode_bongkar3' => 'Plant Bongkar 3')); $xcrud->label(array('opt_kustomer' => 'Tipe Kustomer')); $xcrud->label(array('opt_dokumen' => 'Tipe Dokumen')); $xcrud->label(array('kode_kustomer' => 'Nama Kustomer')); $xcrud->label(array('kode_route' => 'Route')); $xcrud->label(array('total' => 'Total')); $xcrud->change_type('opt_tarif', 'radio', '', 'Tujuan,Balikan'); $xcrud->change_type('shift', 'radio', '', '1,2,3'); $xcrud->change_type('opt_dokumen', 'radio', '', 'PO,SCF,SPK,Lainnya'); $xcrud->change_type('opt_kustomer', 'radio', '', 'KS - Import,KS - Posco,KS - Delta,KS - Domestik,Lain-lain'); $xcrud->change_type('status_surat_jalan', 'radio', 'Open', 'Open,Close1,Close2'); $trans_transaksi_dn_detail = $xcrud->nested_table('Detail Material', 'no_surat_jalan', 'trans_transaksi_dn_detail', 'no_surat_jalan'); // 2nd level $trans_transaksi_dn_detail->unset_title(); $trans_transaksi_dn_detail->columns('nama_material,spesifikasi_material,jumlah,kode_satuan_jum,berat,kode_satuan_berat,tarif,total,keterangan'); $trans_transaksi_dn_detail->fields('nama_material,spesifikasi_material,jumlah,kode_satuan_jum,berat,kode_satuan_berat,tarif,total,keterangan'); $trans_transaksi_dn_detail->set_attr('jumlah', array('id' => 'jumlah')); $trans_transaksi_dn_detail->set_attr('berat', array('id' => 'berat')); $trans_transaksi_dn_detail->set_attr('tarif', array('id' => 'tarif_detail')); $trans_transaksi_dn_detail->set_attr('total', array('id' => 'total')); $trans_transaksi_dn_detail->set_attr('kode_satuan_jum', array('id' => 'kode_satuan_jum')); $trans_transaksi_dn_detail->set_attr('kode_satuan_berat', array('id' => 'kode_satuan_berat')); $trans_transaksi_dn_detail->set_attr('kode_satuan_tarif', array('id' => 'kode_satuan_tarif')); $trans_transaksi_dn_detail->relation('kode_satuan_jum', 'xx_mstr_satuan', 'satuan', 'satuan'); $trans_transaksi_dn_detail->relation('kode_satuan_berat', 'xx_mstr_satuan', 'satuan', 'satuan'); $trans_transaksi_dn_detail->relation('kode_satuan_tarif', 'xx_mstr_satuan', 'satuan', 'satuan'); $trans_transaksi_dn_detail->label(array('kode_satuan_jum' => 'Satuan')); $trans_transaksi_dn_detail->label(array('kode_satuan_berat' => 'Satuan')); $trans_transaksi_dn_detail->label(array('kode_satuan_tarif' => 'Satuan')); $trans_transaksi_dn_detail->subselect('Total Detail', 'SELECT SUM(tarif) FROM trans_transaksi_dn_detail where no_surat_jalan = {no_surat_jalan}'); // current table $trans_transaksi_dn_detail->sum('total', 'Total price is {value}'); $trans_transaksi_dn_detail->sum('berat', 'Total berat is {value}'); $trans_transaksi_dn_detail->change_type('Total Detail', 'price', '0', array('prefix' => '$')); $trans_transaksi_dn_detail->change_type('total', 'price', '0', array('prefix' => 'Rp. ', 'separator' => '.', 'point' => ',', 'id' => 'total')); $trans_transaksi_dn_detail->change_type('tarif', 'price', '0', array('prefix' => 'Rp. ', 'separator' => '.', 'point' => ',', 'id' => 'tarif_detail')); $trans_transaksi_dn_detail->column_class('total,tarif,berat', 'align-right'); $data['content'] = $xcrud->render(); $meta = $this->meta; $this->load->view('commons/header', $meta); $this->load->view('dn', $data); $this->load->view('commons/footer'); }
public function home() { $this->load->helper('xcrud'); $xcrud = xcrud_get_instance(); $xcrud->table('pendaftaran'); $xcrud->hide_button(array('save_return', 'save_edit', 'return', 'add')); $data['content'] = $xcrud->render('view'); $this->load->view('home', $data); }