public function load_notif_header() { $data['notification'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId(), 'limit' => 'limit/3', 'id' => 'order/desc')); $data['notifications'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId(), 'id' => 'order/desc')); $data['notification_num'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId()))->num_rows(); $this->load->view('notification/head_notif_badge', $data); }
function update_component() { $comp = GetAllSelect('payroll_component', 'id')->result(); foreach ($comp as $c) { $data = array('session_id' => $this->new_session, 'payroll_component_id' => $c->id); $filter = array('session_id' => 'where/' . $this->new_session, 'payroll_component_id' => 'where/' . $c->id); $num_rows = GetAllSelect('payroll_component_session', 'id', $filter)->num_rows(); if ($num_rows > 0) { $this->db->where('session_id', $this->new_session)->where('payroll_component_id', $c->id)->update('payroll_component_session', $data); } else { $this->db->insert('payroll_component_session', $data); } $filter2 = array('session_id' => 'where/' . $this->old_session, 'payroll_component_id' => 'where/' . $c->id); $comp_sess_before = getValue('id', 'payroll_component_session', $filter2); print_ag($comp_sess_before); $comp_value = getAll('payroll_component_value', array('payroll_component_session_id' => 'where/' . $comp_sess_before))->row(); print_ag($comp_value); $comp_sess_new = getValue('id', 'payroll_component_session', $filter); $num_rows_new = GetAllSelect('payroll_component_value', 'id', array('payroll_component_session_id' => 'where/' . $comp_sess_new))->num_rows(); if (!empty($comp_value)) { $data2 = array('payroll_component_session_id' => $comp_sess_new, 'from' => $comp_value->from, 'to' => $comp_value->to, 'formula' => $comp_value->formula, 'is_condition' => $comp_value->is_condition, 'min' => $comp_value->min, 'max' => $comp_value->max, 'created_by' => sessId(), 'created_on' => dateNow()); if ($num_rows_new > 0) { $this->db->where('payroll_component_session_id', $comp_sess_new)->update('payroll_component_value', $data2); } else { $this->db->insert('payroll_component_value', $data2); } } print_ag($this->db->last_query()); } }
public function ajax_update() { //$this->_validate(); $data = array('kode' => $this->input->post('kode'), 'title' => $this->input->post('title'), 'catatan' => $this->input->post('catatan'), 'lokasi_gudang_id' => $this->input->post('lokasi_gudang_id'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->gudang->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
public function ajax_add() { //$this->_validate(); $data = array('barang_id' => $this->input->post('barang_id'), 'gudang_id' => $this->input->post('gudang_id'), 'dalam_stok' => $this->input->post('dalam_stok'), 'minimum_stok' => $this->input->post('minimum_stok'), 'harga_beli' => $this->input->post('harga_beli'), 'harga_jual' => $this->input->post('harga_jual'), 'lokasi_detail' => $this->input->post('lokasi_detail'), 'created_by' => sessId(), 'created_on' => dateNow()); $insert = $this->main->save($data); echo json_encode(array("status" => TRUE)); }
public function ajax_update() { //$this->_validate(); $data = array('code' => $this->input->post('kode'), 'name' => $this->input->post('title'), 'type' => $this->input->post('type'), 'ref_id' => $this->input->post('ref'), 'modify_user_id' => sessId(), 'modify_date' => dateNow()); $this->coa_setup->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
public function ajax_update() { //$this->_validate(); $data = array('mata_uang_asing' => $this->input->post('mata_uang_asing'), 'nilai_dalam_rupiah' => $this->input->post('nilai_dalam_rupiah'), 'catatan' => $this->input->post('catatan'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->main->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'diretur' => $this->input->post('diretur'), 'diterima' => $this->input->post('diterima'), 'satuan' => $this->input->post('satuan')); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'pengeluaran_id' => $this->input->post('pengeluaran_id'), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'diretur' => str_replace(',', '', $list['diretur'][$i]), 'diterima' => str_replace(',', '', $list['diterima'][$i]), 'satuan_id' => $list['satuan'][$i]); $this->db->insert($this->table_name . '_list', $data2); } redirect($this->module . '/' . $this->file_name, 'refresh'); }
function load_content($id) { $data['id'] = $id; $sess_id = sessId(); $data['sess_name'] = getName(sessId()); $data['buddy_name'] = getName($id); $q = "SELECT *\n FROM chat\n WHERE (sender_id = '{$sess_id}' AND receiver_id = '{$id}')\n OR (sender_id = '{$id}' AND receiver_id = '{$sess_id}')\n order by sent_on desc\n limit 10\n "; $data['message'] = $this->db->query($q); //lastq(); $data['photo'] = ''; $data['photo_chat'] = ''; $this->db->where('sender_id', $id)->update('chat', array('is_read' => 1)); $this->load->view('chat/content', $data); }
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'); }
public function ajax_add() { //$this->_validate(); $dibayar = str_replace(',', '', $this->input->post('dibayar')); $kurensi = $this->input->post('kurensi'); $list_id = $this->input->post('inv'); $saldo = str_replace(',', '', $this->input->post('saldo')); $data = array('list_id' => $list_id, 'no' => $this->input->post('no'), 'coa_id' => $this->input->post('coa_id'), 'tgl_dibayar' => date('Y-m-d', strtotime($this->input->post('tgl_dibayar'))), 'dibayar' => $dibayar, 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $insert = $this->main->save($data); $terbayar = getValue('terbayar', 'purchase_hutang_list', array('id' => 'where/' . $list_id)); $terbayar = $terbayar + $dibayar; $status = $saldo > 0 ? 2 : 3; $data_list = array('terbayar' => $terbayar, 'saldo' => $saldo, 'status_hutang_id' => $status, 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->db->where('id', $list_id)->update('purchase_hutang_list', $data_list); rekening('purchase_hutang', $insert, $data['coa_id'], 'out', $data['dibayar'], 0, $kurensi); echo json_encode(array("status" => TRUE)); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'diretur' => $this->input->post('diretur'), 'diterima' => $this->input->post('diterima'), 'satuan' => $this->input->post('satuan')); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'ref_id' => $this->input->post('penerimaan_id'), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'diretur' => str_replace(',', '', $list['diretur'][$i]), 'diterima' => str_replace(',', '', $list['diterima'][$i]), 'satuan_id' => $list['satuan'][$i]); if ($this->db->insert($this->table_name . '_list', $data2)) { $sisa = getValue('dalam_stok', 'stok', array('barang_id' => 'where/' . $list['kode_barang'][$i])) - $list['diretur'][$i]; $this->db->where('barang_id', $list['kode_barang'][$i])->update('stok', array('dalam_stok' => $sisa)); $status = $list['diretur'][$i] >= $list['diterima'][$i] ? 4 : 5; } } $this->insert_po_status($this->input->post('penerimaan_id')); redirect($this->module . '/' . $this->file_name, 'refresh'); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'jumlah' => $this->input->post('jumlah'), 'satuan' => $this->input->post('satuan'), 'harga' => $this->input->post('harga'), 'disc' => $this->input->post('disc'), 'catatan_barang' => $this->input->post('catatan_barang')); //print_mz($list); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'tanggal_pengiriman' => date('Y-m-d', strtotime($this->input->post('tanggal_pengiriman'))), 'po' => $this->input->post('po'), 'jatuh_tempo_pembayaran' => date('Y-m-d', strtotime($this->input->post('jatuh_tempo'))), 'no_faktur' => $this->input->post("no_faktur"), 'tanggal_faktur' => date('Y-m-d', strtotime($this->input->post('tanggal_faktur'))), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->where('po', $this->input->post('po'))->update('purchase_order', array('is_invoiced' => 1)); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); if ($this->input->post('metode_pembayaran_id') == 2) { $data_hutang = array('pembelian_id' => $insert_id, 'total' => str_replace(',', '', $this->input->post('saldo')), 'terbayar' => 0, 'saldo' => str_replace(',', '', $this->input->post('saldo')), 'status_hutang_id' => 1); $this->db->insert('purchase_hutang_list', $data_hutang); } for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'jumlah' => str_replace(',', '', $list['jumlah'][$i]), 'satuan_id' => $list['satuan'][$i], 'harga' => str_replace(',', '', $list['harga'][$i]), 'disc' => str_replace(',', '', $list['disc'][$i])); $this->db->insert($this->table_name . '_list', $data2); } redirect($this->module . '/' . $this->file_name, 'refresh'); }
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'); }
function upload_excel() { $config['upload_path'] = './upload/files/excel'; $config['allowed_types'] = 'xlsx|xls|csv'; $config['overwrite'] = TRUE; $config['max_size'] = '10000'; $val = 0; $this->load->library('upload', $config); if (!$this->upload->do_upload('excelfile')) { $error = array('error' => $this->upload->display_errors()); die(print_r($error)); } else { $data = array('upload_data' => $this->upload->data()); // echo "success"; $data_upload = $this->upload->data(); //die(print_r($data_upload)); $result = $this->run_import($data_upload); //die(print_r($result)); foreach ($result as $row) { $employee_ext_id = $row['A']; $val = $row['C']; $employee_id = GetValue('employee_id', 'hris_employee', array('employee_ext_id' => 'where/' . $employee_ext_id)); //count $count = GetAll('payroll_monthly_deduction_medical', array('payroll_period_id' => 'where/' . $this->input->post('periode'), 'employee_id' => 'where/' . $employee_id))->num_rows(); if ($count > 0) { $val_old = GetValue('value', 'payroll_monthly_deduction_medical', array('employee_id' => 'where/' . $employee_id, 'payroll_period_id' => 'where/' . $this->input->post('periode'))); $val_new = $val_old + $val; $data_update = array('value' => $val_new); $this->all_model->update('payroll_monthly_deduction_medical', $data_update, array('employee_id' => $employee_id, 'payroll_period_id' => $this->input->post('periode'))); //lastq(); } else { $data_insert = array('payroll_period_id' => $this->input->post('periode'), 'employee_id' => $employee_id, 'value' => $val, 'created_by' => sessId(), 'created_on' => date('Y-m-d H:i:s')); $this->all_model->insert('payroll_monthly_deduction_medical', $data_insert); } } } redirect('payroll/medical'); }
function send_notif($id) { $group_id = array('3', '4', '8', '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 = 'Pembuatan Sales Order'; $no = getValue('no', $this->table_name, array('id' => 'where/' . $id)); $url = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $id; $isi = $isi = getName(sessId()) . " membuat sales Order, Untuk melihat detail silakan <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); }
?> </div> </div> <div class="col-md-<?php echo $col; ?> "> <div class="approve text-center" style="align:center"> <p class="text-center">Menyetujui,</p> <?php if ($o->is_app_lv4 == 0 && $user_app_lv4 == sessId()) { ?> <div class="btn btn-blue" id="" type="" data-toggle="modal" data-target="#approval-modal4"><i class="icon-ok"></i>Submit</div><br/><br/> <?php } elseif ($o->is_app_lv4 == 0 && $user_app_lv4 != sessId()) { ?> <span class="small"></span> <span class="semi-bold"></span> <span class="small"></span><br/><br/> <span class="semi-bold"></span><br/> <?php } else { $status = $o->app_status_id_lv4 == 1 ? assets_url('images/approved_stamp.png') : ($o->app_status_id_lv4 == 2 ? assets_url('images/rejected_stamp.png') : ($o->app_status_id_lv4 == 3 ? assets_url('images/pending_stamp.png') : "")); ?> <img height="50px" width="75px" src="<?php echo $status; ?> "><br/> <span class="small"><?php echo dateIndo($o->date_app_lv4);
echo assets_url('images/your-logo-here.png'); ?> "> </div> <div class="col-sm-6"> <p class="text-dark"> #<?php echo $o->so; ?> <small class="text-light"></small> </p> </div> </div> <hr/> <?php if ($o->created_by == sessId()) { ?> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="col-sm-4 control-label" for="inputEmail3"> Kepada </label> <div class="col-sm-8"> <select id="kontak_id" class="select2" name="kontak_id" style="width:100%"> <option value="0">-- Pilih Supplier --</option> <?php foreach ($kontak->result() as $u) { $selected = $o->kontak_id == $u->id ? 'selected="selected"' : ''; ?> <option value="<?php
//$photo_chat = (!empty($u->photo)) ? base_url('uploads/'.$u->id.'/80x80/'.$u->photo): assets_url('assets/images/no-image.png'); ?> <img alt="<?php echo $u->username; ?> " height="25px" width="25px" src="<?php echo $photo_chat; ?> " class="media-object"> <div class="media-body"> <h4 class="media-heading"><?php echo $u->username; ?> </h4> <?php $unread_single = GetAllSelect('chat', 'is_read', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId(), 'sender_id' => 'where/' . $u->id))->num_rows(); ?> <?php echo $unread_single != 0 ? '<span class="badge" id="msgs-badge">' . $unread_single . '</span>' : ''; ?> </div> </a> </li> <?php } ?> </ul> </div> </div> <div class="user-chat">
function send_notification($id) { permissionUser(); $url = base_url() . 'stok/penerimaan/detail/' . $id; $isi = getName(sessId()) . " Melakukan Transaksi Penerimaan Barang <a href={$url}> KLIK DISINI </a> "; $no = getValue('no', 'stok_penerimaan', array('id' => 'where/' . $id)); $approver = getAll('approver'); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'no' => $no, 'judul' => 'Penerimaan Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
function notif_manager($id) { permissionUser(); $url = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $id; $isi = getName(sessId()) . " Mengajuan Purchase Order, Untuk melakukan approval silakan <a href={$url}> KLIK DISINI </a>."; $approver = getAll('approver', array('level' => 'where/2')); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'judul' => 'Pengajuan Purchase Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
function send_notification($id) { permissionUser(); $url = base_url() . 'purchase/order/INV/' . $id; $isi = getName(sessId()) . " Melakukan Transaksi cash_ledger Barang <a href={$url}> KLIK DISINI </a> "; $approver = getAll('approver'); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'judul' => 'cash_ledger Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
public function delete_by_id($id) { $data = array('is_deleted' => 1, 'deleted_by' => sessId(), 'deleted_on' => dateNow()); $this->db->where('id', $id); $this->db->update($this->table, $data); //$this->db->delete($this->table); }
public function ajax_list() { $list = $this->main->get_datatables(); $data = array(); $no = $_POST['start']; foreach ($list as $r) { $no_sj = explode(',', $r->no_sj); $ref = ''; foreach ($no_sj as $row => $v) { $ref .= "<a class='btn btn-sm btn-light-azure' href='" . base_url() . "sales/penjualan/detail/" . $r->id . "' target='_blank' title='detail'>" . getValue('no', 'stok_pengeluaran', array('id' => 'where/' . $v)) . "</i></a><br/>"; } $detail = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $r->id; $print = base_url() . $this->module . '/' . $this->file_name . '/print_pdf/' . $r->id; $delete = $r->created_by == sessId() || $this->ion_auth->is_admin() == true ? '<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>' : ''; $edit = $r->created_by == sessId() || $this->ion_auth->is_admin() == true ? '<a class="btn btn-sm btn-info" href="' . base_url() . 'sales/penjualan/input/' . $r->id . '" title="Edit"><i class="glyphicon glyphicon-pencil"></i></a>' : ''; //$print = base_url()."print/file/index.php?stimulsoft_client_key=ViewerFx&stimulsoft_report_key=invoice.mrt¶m1=".$r->id; $sj_date = getValue("created_on", "stok_pengeluaran", array('id' => 'where' . $r->id)); $no++; $row = array(); $row[] = $no; $row[] = "<a href={$detail}>#" . $r->no . '</a>'; //$row[] = date('Ymd', strtotime($sj_date)).sprintf('%04d',$r->no_sj); $row[] = $ref; $row[] = $r->kontak; $row[] = $r->tanggal_transaksi; $row[] = $r->tanggal_pengantaran; $row[] = $r->gudang; $row[] = getName($r->created_by); $row[] = "<a class='btn btn-sm btn-primary' href={$detail} title='detail'><i class='fa fa-info'></i></a>\n <a class='btn btn-sm btn-light-azure' href={$print} target='_blank' title='detail'><i class='fa fa-print'></i></a>\n {$edit}\n {$delete}\n "; $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); }
public function ajax_list() { $list = $this->main->get_datatables(); $data = array(); $no = $_POST['start']; foreach ($list as $r) { if ($r->is_deleted == 0) { $detail = base_url() . $this->file_name . '/detail/' . $r->id; //$print = base_url().$this->file_name.'/print_pdf/'.$r->id; $delete = $r->created_by == sessId() || $this->ion_auth->is_admin() == true ? '<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>' : ''; $no++; $row = array(); $row[] = $no; $row[] = "<a href={$detail}>#" . $r->no . '</a>'; $row[] = $r->project; $row[] = $r->kontak; $row[] = dateIndo($r->tgl); $row[] = $r->creator; $row[] = $r->status; $row[] = "<a class='btn btn-sm btn-primary' href={$detail} title='detail'><i class='fa fa-info'></i></a>\n {$delete}"; $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); }
<div class="chat-content"> <div class="sidebar-content perfect-scrollbar"> <a class="sidebar-back pull-left" id="chat-list" href="javascript:void(0)" title="Back" onclick='showChatList()'><i class="ti-angle-left"></i> <span>Back</span></a> <ol class="discussion"> <?php if ($message->num_rows() > 0) { foreach ($message->result() as $m) { ?> <li class="messages-date"> <?php echo timeago($m->sent_on); ?> </li> <li class="<?php echo $m->sender_id == sessId() ? 'self' : 'other'; ?> "> <div class="message"> <div class="message-name"> <?php echo getName($m->sender_id); ?> </div> <div class="message-text"> <?php echo $m->message; ?> </div> <div class="message-avatar"> <img src="<?php echo $photo_chat;
public function load_badge() { $data['notification_num'] = GetAll('chat', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId()))->num_rows(); $this->load->view('message/badges', $data); }
<a href class="dropdown-toggle" data-toggle="dropdown"> <img src="<?php echo $photo_profile; ?> " alt="<?php echo $sess_name; ?> "> <span class="username"><?php echo $sess_name; ?> <i class="ti-angle-down"></i></span> </a> <ul class="dropdown-menu dropdown-dark"> <li> <a href="<?php echo base_url('users/edit_user/' . sessId()); ?> "> My Profile </a> </li> <!-- <li> <a href="login_lockscreen.html"> Lock Screen </a> </li> --> <li> <a href="<?php echo base_url('auth/logout');
function cek_stok($id) { $num_rows = GetAllSelect('stok', 'barang_id', array('barang_id' => 'where/' . $id))->num_rows(); $data = array('barang_id' => $id, 'created_by' => sessId(), 'created_on' => dateNow()); if ($num_rows < 1) { $this->db->insert('stok', $data); } return true; }
public function ajax_update() { $data = array('kode' => $this->input->post('kode'), 'nama' => $this->input->post('nama'), 'telp_1' => $this->input->post('telp_1'), 'telp_2' => $this->input->post('telp_2'), 'email' => $this->input->post('email'), 'alamat' => $this->input->post('alamat'), 'komisi' => $this->input->post('komisi'), 'catatan' => $this->input->post('catatan'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->main->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
function approve() { $level = $this->input->post('level'); //die($level); $id = $this->input->post('id'); //if($level == 1)$this->notif_manager($id); $data = array('is_app_lv' . $level => 1, 'app_status_id_lv' . $level => $this->input->post('app_status_id_lv' . $level), 'date_app_lv' . $level => dateNow(), 'user_app_lv' . $level => sessId(), 'note_app_lv' . $level => $this->input->post('note_lv' . $level)); $this->db->where('id', $id)->update($this->table_name, $data); echo json_encode(array("status" => $id)); }