示例#1
0
 public function item_clicked()
 {
     permissionUser();
     $id = $this->input->post('id');
     $this->db->where('id', $id)->update($this->table_name, array('is_read' => 1));
     return true;
 }
示例#2
0
文件: lists.php 项目: abdulghanni/gsm
 public function ajax_list()
 {
     permissionUser();
     $list = $this->main->get_datatables();
     $data = array();
     $no = $_POST['start'];
     foreach ($list as $r) {
         $no++;
         $row = array();
         $row[] = $no;
         $row[] = $r->kode;
         $row[] = $r->barang;
         $row[] = $r->dalam_stok;
         $row[] = $r->minimum_stok;
         $row[] = $r->satuan;
         $row[] = $r->gudang;
         //add html for action
         /*$row[] = '<a class="btn btn-sm btn-primary" href="javascript:void(0);" title="Edit" onclick="edit_user('."'".$r->id."'".')"><i class="glyphicon glyphicon-pencil"></i></a>
                 <a class="btn btn-sm btn-danger" href="javascript:void(0)" title="Hapus" onclick="delete_user('."'".$r->id."'".')"><i class="glyphicon glyphicon-trash"></i></a>';
           */
         $data[] = $row;
     }
     $output = array("draw" => $_POST['draw'], "recordsTotal" => $this->main->count_all(), "recordsFiltered" => $this->main->count_filtered(), "data" => $data);
     //output to json format
     echo json_encode($output);
 }
示例#3
0
 public function message_clicked()
 {
     permissionUser();
     $id = $this->input->post('id');
     $f_name = getValue('sender_id', 'chat', array('id' => 'where/' . $id));
     $this->db->where('sender_id', $f_name)->update($this->table_name, array('is_read' => 1));
     echo base_url('message');
 }
示例#4
0
文件: chat.php 项目: abdulghanni/gsm
 function index()
 {
     permissionUser();
     $num_rows = getAll($this->table_name, array('receiver_id' => 'where/' . sessId()))->num_rows();
     $this->data['last_id'] = $last_id = $num_rows > 0 ? $this->db->select('id')->where('receiver_id', sessId())->order_by('id', 'asc')->get($this->table_name)->last_row()->id : 0;
     $this->data['last_notif'] = getAll($this->table_name, array('receiver_id' => 'where/' . sessId(), 'id' => 'where/' . $last_id))->row();
     $this->data['all_notification'] = GetAll('notifikasi', array('receiver_id' => 'where/' . sessId(), 'id' => 'order/desc'));
     $this->_render_page('notification/index', $this->data);
 }
示例#5
0
 function print_pdf($id)
 {
     permissionUser();
     $this->data['id'] = $id;
     $this->data['r'] = GetAll('stok_pemindahan', array('id' => 'where/' . $id))->row();
     $this->data['list'] = $this->main->get_list($id)->result_array();
     $this->load->library('pdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true);
     $this->pdf->load_html($html);
     $this->pdf->render();
     $this->pdf->stream($id . '-' . $this->title . '.pdf');
 }
示例#6
0
文件: order.php 项目: jhanojan/gsm
 function input()
 {
     permissionUser();
     $num_rows = getAll('order')->num_rows();
     $last_id = $num_rows > 0 ? $this->db->select('id')->order_by('id', 'asc')->get('order')->last_row()->id : 0;
     $this->data['last_id'] = $num_rows > 0 ? $last_id + 1 : 1;
     $this->data['barang'] = getAll('barang')->result_array();
     $this->data['satuan'] = getAll('satuan')->result_array();
     $this->data['kurensi'] = getAll('kurensi')->result();
     $this->data['metode'] = getAll('metode_pembayaran')->result();
     $this->data['gudang'] = getAll('gudang')->result();
     $this->data['options_supplier'] = options_row($this->model_name, 'get_supplier', 'id', 'title', '-- Pilih Supplier --');
     $this->_render_page('transaksi/order/input', $this->data);
 }
示例#7
0
 function add()
 {
     permissionUser();
     $list = array('barang_id' => $this->input->post('barang_id'), 'catatan_barang' => $this->input->post('catatan_barang'), 'buku' => $this->input->post('buku'), 'satuan_buku' => $this->input->post('satuan_buku'), 'fisik' => $this->input->post('fisik'), 'satuan_id' => $this->input->post('satuan_id'));
     $data = array('no' => $this->input->post('no'), 'tgl' => date('Y-m-d', strtotime($this->input->post('tgl'))), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow());
     $this->db->insert($this->module . '_' . $this->file_name, $data);
     $insert_id = $this->db->insert_id();
     for ($i = 0; $i < sizeof($list['barang_id']); $i++) {
         $data2 = array($this->file_name . '_id' => $insert_id, 'barang_id' => $list['barang_id'][$i], 'catatan' => $list['catatan_barang'][$i], 'buku' => str_replace(',', '', $list['buku'][$i]), 'satuan_buku' => str_replace(',', '', $list['satuan_buku'][$i]), 'fisik' => str_replace(',', '', $list['fisik'][$i]), 'satuan_id' => $list['satuan_id'][$i]);
         $this->db->insert($this->module . '_' . $this->file_name . '_list', $data2);
         $this->db->where(array('barang_id' => $list['barang_id'][$i]));
         $this->db->update('stok', array('dalam_stok' => $list['fisik'][$i]));
     }
     redirect($this->module . '/' . $this->file_name, 'refresh');
 }
示例#8
0
文件: wo.php 项目: abdulghanni/gsm
 function send_notification($id)
 {
     permissionUser();
     $url = base_url() . $this->file_name . '/detail/' . $id;
     $subject = 'Pengajuan Work Order';
     $isi = getName(sessId()) . " membuat Work Order, Untuk melihat detail silakan <a href={$url}> KLIK DISINI </a>.";
     $no = getValue('no', $this->table_name, array('id' => 'where/' . $id));
     //SEND NOTIFICATION TO PRODUCTION
     $group_id = array('8');
     $user_id = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result();
     foreach ($user_id as $u) {
         $data = array('sender_id' => sessId(), 'receiver_id' => $u->user_id, 'sent_on' => dateNow(), 'judul' => $subject, 'isi' => $isi, 'no' => $no, 'url' => $url);
         $this->db->insert('notifikasi', $data);
         $this->send_email(getEmail($u->user_id), $subject, $isi);
     }
     return TRUE;
 }
示例#9
0
文件: Index.php 项目: abdulghanni/gsm
 function index($id = null)
 {
     permissionUser();
     $this->data['title'] = $this->title;
     $this->data['main_title'] = $this->module . '';
     $q = $this->stok->get_judul();
     $this->data['tipedokumen'] = $q->result();
     $filter['statusisasi'] = 'where/1';
     if ($this->session->userdata('webmaster_grup') == 10) {
         $filter['id'] = 'where/2';
     }
     $this->data['opt_dok'] = $this->GetOptDoc($id);
     $this->data['options_barang'] = options_row($this->model_name, 'get_barang', 'kode', 'title', '-- Pilih Barang --');
     $this->data['options_satuan'] = options_row($this->model_name, 'get_satuan', 'id', 'title', '-- Pilih Satuan --');
     $this->data['options_gudang'] = options_row($this->model_name, 'get_gudang', 'id', 'title', '-- Pilih Gudang --');
     $this->data['options_kurensi'] = options_row($this->model_name, 'get_kurensi', 'id', 'title', '-- Pilih Kurensi --');
     $this->_render_page('report/menu/menu', $this->data);
 }
示例#10
0
 function index()
 {
     permissionUser();
     $this->data['num_data_po'] = getAll('purchase_order', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_data_pembelian'] = getAll('pembelian', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_data_so'] = getAll('sales_order', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_data_penjualan'] = getAll('penjualan', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_data_penerimaan'] = getAll('stok_penerimaan', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_data_pengeluaran'] = getAll('stok_pengeluaran', array('created_on' => 'where/' . date('Y-m-d')))->num_rows();
     $this->data['num_stok'] = getAll('barang')->num_rows();
     $this->data['num_barang'] = getAll('barang')->num_rows();
     $this->data['num_stok_tersedia'] = getAll('stok', array(), array('!=dalam_stok' => '0'))->num_rows();
     $this->data['num_stok_minimum'] = $this->db->where('dalam_stok < minimum_stok')->get('stok')->num_rows();
     $this->data['num_stok_minimum'] = $this->db->where('dalam_stok < minimum_stok')->get('stok')->num_rows();
     $this->data['num_barang_jadi'] = getAll('barang', array('jenis_barang_id' => 'where/1'))->num_rows();
     $this->data['num_barang_mentah'] = getAll('barang', array('jenis_barang_id' => 'where/2'))->num_rows();
     $this->data['persen_barang_jadi'] = $this->data['num_barang_jadi'] / $this->data['num_barang'] * 100;
     $this->data['persen_barang_mentah'] = $this->data['num_barang_mentah'] / $this->data['num_barang'] * 100;
     $this->_render_page('dashboard/index', $this->data);
 }
示例#11
0
 function add()
 {
     permissionUser();
     $id = $this->input->post('id');
     $list = array('kode_barang' => $this->input->post('kode_barang'), 'jumlah' => $this->input->post('jumlah'), 'satuan' => $this->input->post('satuan'));
     $data = array('barang_id' => $this->input->post('output'), 'created_on' => date("Y-m-d"), 'created_by' => sessId());
     if ($id > 0) {
         $this->db->where('id', $id);
         $this->db->update($this->file_name, $data);
         $insert_id = $id;
         $this->db->query("DELETE FROM assembly_list WHERE assembly_id='{$id}'");
     } else {
         $this->db->insert($this->file_name, $data);
         $insert_id = $this->db->insert_id();
     }
     for ($i = 0; $i < sizeof($list['kode_barang']); $i++) {
         $data2 = array('assembly_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'jumlah' => str_replace(',', '.', $list['jumlah'][$i]), 'satuan_id' => $list['satuan'][$i]);
         $this->db->insert($this->file_name . '_list', $data2);
     }
     redirect($this->module . '/' . $this->file_name, 'refresh');
 }
示例#12
0
 function bast($id = NULL)
 {
     permissionUser();
     $this->data['id'] = $id;
     /* 
             $this->data[$this->file_name] = $this->main->get_detail($id);
             $this->data[$this->file_name.'_list'] = $this->main->get_list_detail($id); */
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/bast', $this->data, true);
     $mpdf = new mPDF();
     $mpdf = new mPDF('A4');
     $mpdf->WriteHTML($html);
     $mpdf->Output($id . '_BAST-' . $title . '.pdf', 'I');
 }
示例#13
0
 function index()
 {
     permissionUser();
     redirect('transaksi/order', 'refresh');
 }
示例#14
0
 public function list_inv()
 {
     permissionUser();
     $list = $this->inv->get_datatables();
     $data = array();
     $no = $_POST['start'];
     foreach ($list as $r) {
         $photo_link = base_url() . 'uploads/barang/' . $r->id . '/' . $r->photo;
         $file_headers = @get_headers($photo_link);
         $photo = $this->data['photo'] = $file_headers[0] != 'HTTP/1.1 404 Not Found' && !empty($r->photo) ? $photo_link : assets_url('assets/images/no-image-mid.png');
         $no++;
         $row = array();
         $row[] = $no;
         $row[] = "<img height='75px' width='100px' src='{$photo}' />";
         $row[] = $r->kode;
         $row[] = $r->title;
         $row[] = $r->jenis_inventaris;
         $row[] = $r->harga_beli;
         $row[] = $r->umur_ekonomis;
         $row[] = $r->akumulasi;
         $row[] = $r->beban_perbulan;
         $row[] = $r->nilai_buku;
         //add html for action
         $row[] = '<a class="btn btn-sm btn-primary" href="javascript:void(0);" title="Edit" onclick="edit_inv(' . "'" . $r->id . "'" . ')"><i class="glyphicon glyphicon-pencil"></i></a>
               <a class="btn btn-sm btn-danger" href="javascript:void(0)" title="Hapus" onclick="delete_inv(' . "'" . $r->id . "'" . ')"><i class="glyphicon glyphicon-trash"></i></a>';
         $data[] = $row;
     }
     $output = array("draw" => $_POST['draw'], "recordsTotal" => $this->inv->count_all(), "recordsFiltered" => $this->inv->count_filtered(), "data" => $data);
     //output to json format
     echo json_encode($output);
 }
示例#15
0
文件: order.php 项目: abdulghanni/gsm
 function get_up($id)
 {
     permissionUser();
     $up = getValue('up', 'kontak', array('id' => 'where/' . $id));
     $this->data['up'] = explode(',', $up);
     $this->_render_page('purchase/order/up', $this->data);
 }
示例#16
0
 function print_pdf($id)
 {
     permissionUser();
     $this->data['id'] = $id;
     $this->data[$this->file_name] = $this->main->get_detail($id);
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true);
     $mpdf = new mPDF();
     $mpdf = new mPDF('A4');
     $mpdf->WriteHTML($html);
     $mpdf->Output($id . '-' . $title . '.pdf', 'I');
 }
示例#17
0
 function index()
 {
     permissionUser();
     $this->_render_page('dashboard/index', $this->data);
 }
示例#18
0
 function print_pdf($id)
 {
     $this->data['main_title'] = $this->main_title;
     $this->data['file_name'] = $this->file_name;
     $this->data['module'] = $this->module;
     $this->data['title'] = $this->title . ' - Detail';
     permissionUser();
     $this->data['id'] = $id;
     $this->data['is_deleted'] = getValue('is_deleted', 'purchase_request', array('id' => 'where/' . $id));
     $this->data['catatan'] = getValue('catatan', 'purchase_request', array('id' => 'where/' . $id));
     $this->data[$this->file_name] = $this->main->get_detail($id);
     $this->data[$this->file_name . '_list'] = $this->main->get_list_detail($id);
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true);
     $this->mpdf = new mPDF();
     $this->mpdf->AddPage('p', '', '', '', '', 5, 5, 5, 0, 0, 5);
     // margin footer
     $this->mpdf->WriteHTML($html);
     $this->mpdf->Output($id . '-' . '.pdf', 'I');
 }
示例#19
0
 function add_so()
 {
     permissionUser();
     //$this->data['so'] = GetAllSelect('sales_order', array('id','so'), array('id'=>'order/desc'))->result();
     $this->data['so'] = GetAllSelect('stok_pengeluaran', array('id', 'created_on'), array('id' => 'order/desc'))->result();
     $this->load->view($this->module . '/' . $this->file_name . '/no_so', $this->data);
 }
示例#20
0
 public function add_json()
 {
     permissionUser();
     $data = array('kode' => $this->input->post('kode'), 'title' => $this->input->post('title'), 'jenis_id' => $this->input->post('jenis_id'), 'tipe_id' => $this->input->post('tipe_id'), 'up' => implode(',', $this->input->post('up')), 'telepon' => implode(',', $this->input->post('telepon')), 'alamat' => implode(',', $this->input->post('alamat')), 'email' => $this->input->post('email'), 'fax' => $this->input->post('fax'), 'catatan' => $this->input->post('catatan'), 'npwp' => $this->input->post('npwp'), 'no_rekening' => $this->input->post('no_rekening'), 'bank' => $this->input->post('bank'), 'a_n' => $this->input->post('a_n'), 'alamat_pajak' => $this->input->post('alamat_pajak'), 'acc' => $this->input->post('acc'), 'created_by' => sessId(), 'created_on' => dateNow());
     $insert = $this->main->save($data);
     echo json_encode(array('status' => true));
     //echo json_encode(array("status" => TRUE));
 }
示例#21
0
 function bast($id = NULL)
 {
     permissionUser();
     $this->data['id'] = $id;
     $this->data[$this->file_name] = GetAll($this->module . '_' . $this->file_name, array('id' => 'where/' . $id))->row_array();
     $this->data[$this->file_name . '_list'] = GetAll($this->module . '_' . $this->file_name . '_list', array('id' => 'where/' . $id));
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/bast', $this->data, true);
     to_doc($html, 'BAST');
     //        $mpdf = new mPDF();
     //        $mpdf = new mPDF('A4');
     //        $mpdf->WriteHTML($html);
     //        $mpdf->Output($id.'_BAST-'.$title.'.pdf', 'I');
 }
示例#22
0
 function index()
 {
     permissionUser();
     $this->data['options_jenis_satuan'] = options_row('satuan', 'get_jenis_satuan', 'id', 'title', '-- Pilih Satuan Dasar --');
     $this->_render_page($this->module . '/' . $this->file_name, $this->data);
 }
示例#23
0
文件: satuan.php 项目: jhanojan/gsm
 function index()
 {
     permissionUser();
     $this->_render_page('pengaturan/satuan/index', $this->data);
 }
示例#24
0
文件: order.php 项目: abdulghanni/gsm
 function print_pdf($id)
 {
     permissionUser();
     $this->data['id'] = $id;
     $this->data['o'] = $this->order->get_detail($id)->row();
     $this->data['order_list'] = $this->order->get_list_detail($id);
     //Variabel for total-field
     $total_harga = getSum('harga', 'sales_order_list', 'order_id', $id);
     $total_barang = getSum('jumlah', 'sales_order_list', 'order_id', $id);
     $total = $total_harga * $total_barang;
     $is_exc = GetAllSelect('sales_order_list', "inc_ppn, pajak", array('order_id' => 'where/' . $id))->result();
     $exc = 0;
     foreach ($is_exc as $i) {
         echo $i->inc_ppn;
         if ($i->inc_ppn == 0) {
             $exc += $i->pajak;
         }
     }
     $total_ppn = getSum('total_ppn', 'sales_order', 'id', $id);
     $total_pph22 = getSum('total_pph22', 'sales_order', 'id', $id);
     $total_pph23 = getSum('total_pph23', 'sales_order', 'id', $id);
     $biaya_pengiriman = getSum('biaya_pengiriman', 'sales_order', 'id', $id);
     $dibayar = getSum('dibayar', 'sales_order', 'id', $id);
     $dibayar_nominal = getSum('dibayar_nominal', 'sales_order', 'id', $id);
     //Total Field
     $this->data['total_diskon'] = getSum('disc', 'sales_order_list', 'order_id', $id);
     $this->data['total_pajak'] = $total_pajak = $total_ppn + $total_pph22 + $total_pph23;
     $this->data['total'] = $sub_total = $total + $biaya_pengiriman - $total_pajak + $exc;
     $this->data['totalpluspajak'] = $totalpluspajak = $sub_total + $total_pajak;
     $this->data['dp'] = $dp = $totalpluspajak * ($dibayar / 100);
     $this->data['saldo'] = $totalpluspajak - $dp - $dibayar_nominal;
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true);
     $this->mpdf = new mPDF();
     $this->mpdf->setAutoTopMargin = 'stretch';
     $this->mpdf->setAutoBottomMargin = 'stretch';
     $footer = $this->load->view('sales' . '/' . 'order' . '/pdf_footer', $this->data, true);
     $this->mpdf->AddPage('p', '', '', '', '', 5, 5, 5, 0, 0, 25);
     // margin footer
     $this->mpdf->WriteHTML($html);
     $this->mpdf->SetFooter($footer);
     $this->mpdf->Output($id . '-' . '.pdf', 'I');
 }
示例#25
0
 function send_notif($id)
 {
     permissionUser();
     $group_id = array('5', '9', '10');
     $user_id = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result();
     $r = [];
     $receiver = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result_array();
     foreach ($receiver as $key => $value) {
         $r[] = getEmail($value['user_id']);
         //$r[] = '*****@*****.**';
     }
     $r = implode(',', $r);
     $subject = 'Produksi Barang';
     $no = getValue('no', 'produksi', array('id' => 'where/' . $id));
     $url = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $id;
     $isi = $isi = getName(sessId()) . " telah melakukan produksi barang yang direquest, untuk melihat detail <a href={$url}> KLIK DISINI </a>.";
     foreach ($user_id as $u) {
         $data = array('sender_id' => sessId(), 'receiver_id' => $u->user_id, 'sent_on' => dateNow(), 'judul' => $subject, 'no' => $no, 'isi' => $isi, 'url' => $url);
         $this->db->insert('notifikasi', $data);
     }
     $this->send_email($r, $subject, $isi);
 }
示例#26
0
文件: Auth.php 项目: abdulghanni/gsm
 function index()
 {
     permissionUser();
     redirect('dashboard', 'refresh');
 }
示例#27
0
 function index()
 {
     permissionUser();
     redirect($this->module . '/order', 'refresh');
 }
示例#28
0
文件: retur.php 项目: abdulghanni/gsm
 function print_pdf($id)
 {
     permissionUser();
     $this->data['title'] = $this->title;
     $this->data['id'] = $id;
     $this->data[$this->file_name] = $this->main->get_detail($id);
     $this->data[$this->file_name . '_list'] = $this->main->get_list_detail($id);
     $this->load->library('mpdf60/mpdf');
     $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true);
     $this->mpdf = new mPDF();
     $this->mpdf->AddPage('p', '', '', '', '', 5, 5, 5, 0, 0, 5);
     // margin footer
     $this->mpdf->WriteHTML($html);
     $this->mpdf->Output($id . '-' . '.pdf', 'I');
 }
示例#29
0
 function index()
 {
     permissionUser();
     redirect('master/stok', 'refresh');
 }