function add_row($id) { $data['id'] = $id; $data['barang'] = getAll('barang')->result_array(); $data['satuan'] = getAll('satuan')->result_array(); $this->load->view('penyesuaian/row', $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()); } }
function load_msg_header() { //CHAT $data['users'] = getAll('users', array('username' => 'order/asc'), array('!=id' => sessId())); $data['unread_all'] = GetAllSelect('chat', 'is_read', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId()))->num_rows(); $data['messages'] = getAll('chat', array('receiver_id' => 'where/' . sessId(), 'limit' => 'limit/3', 'id' => 'order/desc'))->result(); $this->load->view('chat/header', $data); }
function index() { $this->data['title'] = ucfirst($this->title); $this->data['page_title'] = $this->page_title; $this->data['period'] = getAll('payroll_period'); permission(); $this->_render_page($this->filename, $this->data); }
function detail($id) { permissionUser(); $notif = $this->data['notif'] = getAll($this->table_name, array('receiver_id' => 'where/' . sessId(), 'id' => 'where/' . $id))->row(); $photo_link = getValue('photo', 'users', array('id' => 'where/' . $notif->sender_id)); $photo_link = base_url() . 'uploads/' . $notif->sender_id . '/' . $photo_link; $file_headers = @get_headers($photo_link); $this->data['sender_photo'] = $file_headers[0] != 'HTTP/1.1 404 Not Found' ? $photo_link : assets_url('assets/images/no-image-mid.png'); $this->load->view('notification/detail', $this->data); }
function artikel() { $sql = "SELECT P.partnumber,P.description,P.unit,P.weight,t.rate,P.sellprice,P.listprice,P.priceupdate,"; $sql .= "PG.partsgroup,P.notes,P.image,P.onhand,P.buchungsgruppen_id as bugru FROM "; $sql .= "chart c left join tax t on c.taxkey_id=t.taxkey, parts P left join partsgroup PG on "; $sql .= "PG.id=P.partsgroup_id left join buchungsgruppen B on P.buchungsgruppen_id = B.id "; $sql .= "WHERE P.shop='t' and c.id=B.income_accno_id_0"; $rs = getAll("erp", $sql, "artikel"); return $rs; }
function get_all_url() { //从数据库中查处所有已经有的数据,进行对比,如果有,则不插入 $mysql_str = "SELECT cn_thinkphp_tuijian.title_url from cn_thinkphp_tuijian ORDER BY id ;"; $res_datas = getAll($mysql_str); $arr_exit = array(); foreach ($res_datas as $res_data) { $arr_exit[] = $res_data[0]; } return $arr_exit; }
function index() { $this->data['title'] = ucfirst($this->title); $this->data['page_title'] = $this->page_title; $filter = array('is_deleted' => 'where/0', 'is_active' => 'where/1', 'component_type_id' => 'order/asc', 'code' => 'order/asc'); $this->data['p_component'] = $list_component = getAll('payroll_component', $filter)->result_array(); $filter = array('status_cd' => 'where/normal'); $this->data['job_class'] = $this->all_model->GetAll('hris_job_class', $filter, 'job_class_level'); //lastq(); permission(); $this->_render_page($this->filename, $this->data); }
function get_dari_so($id) { permissionUser(); $num_rows = getAll($this->table_name)->num_rows(); $last_id = $num_rows > 0 ? $this->db->select('id')->order_by('id', 'asc')->get($this->table_name)->last_row()->id : 0; $this->data['last_id'] = $num_rows > 0 ? $last_id + 1 : 1; $order_id = getValue('ref', 'stok_pengeluaran', array('id' => 'where/' . $id)); $so = $this->db->where('id', $order_id)->get('sales_order')->row()->so; $this->data['tgl_terima'] = getValue('tgl', 'stok_pengeluaran', array('id' => 'where/' . $id)); $this->data['order'] = $this->main->get_detail_po($so); $this->data['order_list'] = getAll('stok_pengeluaran_list', array('pengeluaran_id' => 'where/' . $id)); $this->load->view($this->module . '/' . $this->file_name . '/dari_so', $this->data); }
function getAllCats() { $result = json_decode(getAll('category')); if (!empty($result->category)) { $result->category = array_map(function ($t) { if (!empty($t->icon)) { $t->icon_url = SITEURL . 'category_icons/' . $t->icon; } return $t; }, $result->category); } echo json_encode($result); }
function get_dari_po($id) { permissionUser(); $num_rows = getAll($this->table_name)->num_rows(); $last_id = $num_rows > 0 ? $this->db->select('id')->order_by('id', 'asc')->get($this->table_name)->last_row()->id : 0; $this->data['last_id'] = $num_rows > 0 ? $last_id + 1 : 1; $order_id = getValue('ref_id', 'stok_penerimaan', array('id' => 'where/' . $id)); $this->data['tgl_terima'] = getValue('tgl', 'stok_penerimaan', array('ref_id' => 'where/' . $id)); $this->data['order'] = $this->main->get_detail_po($id); $this->data['order_list'] = getAll('purchase_order_list', array('order_id' => 'where/' . $id)); //print_mz($this->data['order_list']->result()); $this->load->view($this->module . '/' . $this->file_name . '/dari_po', $this->data); }
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); }
function input() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } else { $sess_id = $this->data['sess_id'] = $this->session->userdata('user_id'); $this->get_bu(); $this->data['all_users'] = getAll('users', array('active' => 'where/1', 'username' => 'order/asc'), array('!=id' => '1')); $this->get_user_atasan(); $this->data['subordinate'] = getAll('users', array('superior_id' => 'where/' . get_nik($sess_id))); $this->_render_page('form_promosi/input', $this->data); } }
function edit() { $session_id = $this->input->post('session_id'); permission(); $filter = array('session_id' => 'where/' . $session_id); $num_rows = getAll('payroll_umk', $filter)->num_rows(); //lastq(); $data = array('value' => str_replace(',', '', $this->input->post('value')), 'session_id' => $session_id); if ($num_rows > 0) { $this->db->where('session_id', $session_id)->update('payroll_umk', $data); } else { $this->db->insert('payroll_umk', $data); } return true; }
function get_chart() { $tanggal = array(); $num_data = array(); for ($i = 7; $i > 0; $i--) { $d = new dateTime("{$i} days ago"); $tanggal[] = $d->format('d M'); $num_data_po[] = getAll('purchase_order', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); $num_data_so[] = getAll('sales_order', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); $num_data_penerimaan[] = getAll('stok_penerimaan', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); $num_data_pengeluaran[] = getAll('stok_pengeluaran', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); $num_data_pembelian[] = getAll('pembelian', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); $num_data_penjualan[] = getAll('penjualan', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows(); } echo json_encode(array('tanggal' => $tanggal, 'num_data_po' => $num_data_po, 'num_data_pembelian' => $num_data_pembelian, 'num_data_so' => $num_data_so, 'num_data_penjualan' => $num_data_penjualan, 'num_data_penerimaan' => $num_data_penerimaan, 'num_data_pengeluaran' => $num_data_pengeluaran)); }
function edit($id) { $this->data['title'] = 'Edit ' . $this->title; $this->data['file_name'] = $this->file_name; $this->data['module'] = $this->module; permissionUser(); $filter = array('is_deleted' => 0); $this->data['jenis'] = getAll('kontak_jenis', $filter); $this->data['tipe'] = getAll('kontak_tipe', $filter); $this->data['r'] = $r = $this->main->get_detail($id); $this->data['up'] = explode(',', $r->up); //print_mz($this->data['up']); $this->data['telepon'] = explode(',', $r->telepon); $this->data['alamat'] = explode(',', $r->alamat); $this->_render_page($this->module . '/' . $this->file_name . '/edit', $this->data); }
function index($fname = "fn:", $sort_by = "id", $sort_order = "asc", $offset = 0) { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { $id = $this->session->userdata('user_id'); //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); redirect('person/detail/' . $id); } else { //set the flash data error message if there is one $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message'); //set sort order $this->data['sort_order'] = $sort_order; //set sort by $this->data['sort_by'] = $sort_by; //set filter by title $this->data['fname_param'] = $fname; $exp_fname = explode(":", $fname); $fname_re = str_replace("_", " ", $exp_fname[1]); $fname_post = strlen($fname_re) > 0 ? array('users.username' => $fname_re) : array(); //set default limit in var $config['list_limit'] at application/config/ion_auth.php $this->data['limit'] = $limit = strlen($this->input->post('limit')) > 0 ? $this->input->post('limit') : 25; $this->data['offset'] = 6; //list of filterize all approval $this->data['approval_all'] = $this->approval_model->like($fname_post)->where('is_deleted', 0)->approval()->result(); $this->data['num_rows_all'] = $this->approval_model->like($fname_post)->where('is_deleted', 0)->approval()->num_rows(); $this->data['approval'] = $this->approval_model->like($fname_post)->where('is_deleted', 0)->limit($limit)->offset($offset)->order_by($sort_by, $sort_order)->approval()->result(); //list of filterize limit approval for pagination d(); $this->data['_num_rows'] = $this->approval_model->like($fname_post)->where('is_deleted', 0)->limit($limit)->offset($offset)->order_by($sort_by, $sort_order)->approval()->num_rows(); //config pagination $config['base_url'] = base_url() . 'approval/index/fn:' . $exp_fname[1] . '/' . $sort_by . '/' . $sort_order . '/'; $config['total_rows'] = $this->data['num_rows_all']; $config['per_page'] = $limit; $config['uri_segment'] = 6; //inisialisasi config $this->pagination->initialize($config); //create pagination $this->data['halaman'] = $this->pagination->create_links(); $this->data['fname_search'] = array('name' => 'title', 'id' => 'title', 'type' => 'text', 'value' => $this->form_validation->set_value('title')); $this->data['users'] = getAll('users', array('active' => 'where/1', 'username' => 'order/asc'), array('!=id' => '1')); $this->data['form_type'] = getAll('form_type', array('is_deleted' => 'where/0')); $this->_render_page('approval/index', $this->data); } }
function getMany($class, $search_criteria = array()) { if (empty($search_criteria)) { return getAll($class); } foreach ($search_criteria as $key => $value) { if (empty($value)) { unset($search_criteria[$key]); } } $finder = new $class(); $objects = $finder->find($search_criteria); if (!$objects) { $objects = array(); } return $objects; }
function show($params = array()) { if (!isset($params['id']) || !$params['id']) { $staff_members = getAll('Staff'); if (!isset($params['start_date']) || !isset($params['end_date'])) { $hours_criteria = array('current_week' => true); $this->data->dates = array('start_date' => date('Y-m-d', strtotime('last Sunday')), 'end_date' => date('Y-m-d', strtotime('next Sunday'))); } else { $hours_criteria = array('hour_search' => array('start_date' => $params['start_date'], 'end_date' => $params['end_date'])); $this->data->dates = array('start_date' => $params['start_date'], 'end_date' => $params['end_date']); } foreach ($staff_members as $staff) { if (!$staff->get('active')) { continue; } if (!isset($this->data->billable_hours_this_week)) { $this->data->staff = array(); $this->data->billable_hours_this_week = array(); } if (!isset($this->data->total_hours_this_week)) { $this->data->staff = array(); $this->data->total_hours_this_week = array(); } $this->data->staff[$staff->get('id')] = $staff->getName(); $this->data->billable_hours_this_week[$staff->get('id')] = $staff->getBillableHoursTotal($hours_criteria); $this->data->total_hours_this_week[$staff->get('id')] = $staff->getHoursTotal($hours_criteria); } } else { $this->data->active_projects = getMany('Project', array('active' => true)); $staff = new Staff($params['id']); $this->data->staff = $staff; $this->data->staff_hours = $staff->getHours(); $hours_criteria = array('current_month' => true); $this->data->hours_this_month = $staff->getHoursTotal($hours_criteria); $this->data->billable_hours_this_month = $staff->getBillableHoursTotal($hours_criteria); $hours_criteria = array('current_week' => true); $this->data->hours_this_week = $staff->getHoursTotal($hours_criteria); $this->data->billable_hours_this_week = $staff->getBillableHoursTotal($hours_criteria); $this->data->new_project = new Project(); $this->data->new_project->set(array('staff_id' => Session::getUserId())); $this->data->new_support_hour = new Hour(); $this->data->new_support_hour->set(array('staff_id' => Session::getUserId(), 'date' => date('Y-m-d'))); $this->data->graph = array('staff' => $staff->id, 'call' => 'overview'); } }
function input($id = NULL) { $this->data['val'] = $this->data['list'] = array(); if ($id > 0) { $this->data['val'] = GetAll($this->file_name, array('id' => 'where/' . $id))->row_array(); $this->data['list'] = GetAll($this->file_name . '_list', array($this->file_name . '_id' => 'where/' . $id))->result_array(); } $this->data['title'] = $this->title . ' - Input'; permissionUser(); $this->data['module'] = $this->module; $this->data['file_name'] = $this->file_name; $this->data['r'] = $this->main->get_detail($id); $this->data['opt_barang'] = GetAll('barang')->result(); $this->data['barang'] = getAll('barang')->result_array(); $this->data['satuan'] = getAll('satuan')->result_array(); $this->data['opt_satuan'] = GetOptAll('satuan'); $this->_render_page($this->module . '/' . $this->file_name . '/input', $this->data); }
function input() { $this->data['title'] = $this->title . ' - Input'; $this->data['main_title'] = $this->main_title; $this->data['file_name'] = $this->file_name; $this->data['module'] = $this->module; permissionUser(); $num_rows = getAll($this->table_name)->num_rows(); $last_id = $num_rows > 0 ? $this->db->select('id')->order_by('id', 'asc')->get($this->table_name)->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_kontak'] = options_row('main', 'get_kontak', 'id', 'title', '-- Pilih kontak --'); $this->data['po'] = GetAllSelect('purchase_order', array('id', 'po'), array('is_invoiced' => 'where/0', 'id' => 'order/desc'))->result(); $this->_render_page($this->module . '/' . $this->file_name . '/input', $this->data); }
function input() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } else { $user_id = $this->session->userdata('user_id'); $user_nik = get_nik($user_id); //$this->get_user_pengganti(); $this->data['sisa_cuti'] = !empty($this->get_sisa_cuti($user_nik)[0]['ENTITLEMENT']) ? $this->get_sisa_cuti($user_nik)[0]['ENTITLEMENT'] : '-'; $u = $this->data['all_users'] = getAll('users', array('active' => 'where/1', 'username' => 'order/asc'), array('!=id' => '1')); foreach ($u->result_array() as $row) { $result[$row['id']] = ucwords(strtolower($row['username'])); } $this->data['users'] = $result; // form cuti yang akan diambil $this->data['comp_session'] = $this->form_cuti_model->render_session()->result(); $this->data['alasan_cuti'] = $this->get_type_cuti(); //$this->data['_num_rows'] = $this->form_cuti_model->where('users.id',$user_id)->form_cuti_input()->num_rows(); $this->_render_page('form_cuti/input', $this->data); } }
function getBugru() { $sql = "select B.id,tax.rate from buchungsgruppen B left join chart on income_accno_id_0=chart.id left join taxkeys T on "; $sql .= "T.chart_id=income_accno_id_0 left join tax on tax.id=T.tax_id where T.startdate<=now()"; $rs = getAll("erp", $sql, "getBugru"); if ($rs) { foreach ($rs as $row) { $steuer = sprintf("%0.2f", $row["rate"] * 100); $GLOBALS["buchungsgruppen"][$steuer] = $row["id"]; } } }
<?php //DELETE THIS LINE WHEN GOING LIVE ini_set('display_errors', 1); error_reporting(E_ALL); ///////////////////////////////////////////////// require_once 'includes/init.php'; confirm_logged_in(); check_user_level(); $tbl = 'tbl_user'; $user = getAll($tbl); if (!empty($_SESSION['message'])) { $message = $_SESSION['message']; } ?> <!doctype html> <html> <head> <meta charset="UTF-8"> <title>EDFC | Admin - Delete a User</title> <link rel="stylesheet" href="../css/normalize.css"/> <link rel="stylesheet" href="../css/foundation.css" /> <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"/> </head> <body> <div class="small-12 medium-12 large-12 columns cms_section"> <h2>Delete A User</h2> <?php if (!empty($message)) { echo "<div class=\"admin_message\">" . $message . "</div>";
function get_subordinate() { $id = get_nik($this->input->post('id')); $subordinate = getAll('users', array('superior_id' => 'where/' . $id)); foreach ($subordinate->result_array() as $row) { $result['0'] = '-- Pilih User --'; $result[$row['id']] = ucwords(strtolower($row['username'])); } $data['result'] = $result; $this->load->view('dropdown_atasan', $data); }
switch ($arg) { case '-h': case '--html': $phpunit_coverage = '--coverage-html ' . $argv[++$i]; break; case '-c': case '--clover': $phpunit_coverage = '--coverage-clover ' . $argv[++$i]; break; case '-g': case '--groups': $run_as = 'groups'; break; case 'all': if ($run_as == 'paths') { $components = getAll($phpunit_conf); } break; default: if (strpos($arg, 'Zend') !== false) { $components[] = $arg; } else { $components[] = 'Zend_' . $arg; } } } } $result = 0; if ($run_as == 'groups') { $groups = join(',', $components); echo "{$groups}:\n";
</div> </div> <div class="form-group"> <label for="" class="col-sm-2">Comment</label> <div class="col-sm-10"> <textarea name="comment" class="form-control" id="textComment" rows="5" placeholder="Your comment here"></textarea> </div> </div> <button type="submit" name="submit" class="btn btn-primary">Submit</button> </form> </div> </div> <div class="comments"> <?php if ($result = getAll()) { foreach ($result as $data) { echo '<div class="comment-entry">'; echo "<div class=\"comment-header\"><span class=\"comment-name\">" . $data['name'] . "</span><span class=\"comment-time\">" . $data['time'] . "</span></div>"; echo "<div class=\"comment-content\">" . $data['content'] . "</div></div>"; } } ?> </div> </div> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
function arrayTodo($objEquipo) { return getAll($objEquipo); }
<?php require 'config.php'; header('Content-Type: application/json,charset=utf-8'); $action = $_REQUEST['action']; if ($action == 'getquota') { getquota($_REQUEST['rank']); } else { if ($action == 'getinfo') { getInfo($_REQUEST['fbid']); } else { if ($action == 'getall') { getAll(); } else { if ($action == 'random') { random($_REQUEST['rank'], $_REQUEST['fbid']); } } } } /*$json=json_decode($jsonstr); //print_r($json); foreach ($json as $user) { $result = $conn->query("update member set response='{$user->rsvp_status}' where fbid='{$user->id}'"); //mysqli_stmt_execute($stmt); }*/ function getInfo($fbid) { //echo $conn; global $conn; if (isset($_REQUEST['token'])) {
<table> <div id="department"> <div class="row"> <div class="col-md-4"> COA </div> <div class="col-md-1"> : </div> <div class="col-md-7"> <select class="select2" style="width:100%" name="coa"> <?php $c = getAll('sv_setup_coa')->result(); echo '<option value="">All</option>'; foreach ($c as $k) { echo '<option value="' . $k->name . '">' . $k->name . '</option>'; } ?> </select> </div> </div> </div> </table>