getPageN($page, $db); } if ($type == "hot") { getHot($db); } if ($type == "detail") { $id = $_GET['id']; getActivity($id, $db); } if ($type == "join") { $id = $_GET['id']; joinActivity($id, $db); } if ($type == "getjoin") { $id = $_GET['id']; getJoin($id, $db); } function getJoin($acid, $db) { $searchsql = "Select * from user where userid in (Select userid from ActivityParticipation where activityid='{$acid}' order by createTime desc)"; $result = $db->query($searchsql); $joinlist = '['; $count = 0; while ($row = $result->fetchArray(SQLITE3_ASSOC)) { $nickname = $row['nickname']; $userid = $row['userid']; $joinnode = array("userid" => $userid, "nickname" => $nickname); foreach ($joinnode as $key => $value) { $joinnode[$key] = urlencode($value); } if ($count > 0) {
public function print_slip($id, $period_id) { $this->data['employee_id'] = $id; //render employee detail $this->data['employee_detail'] = $this->payroll->get_employee_detail($id); //lastq(); $this->data['monthly_income'] = $this->payroll->get_by_id($id, $period_id); $monthly_income_id = getValue('id', 'payroll_monthly_income', array('employee_id' => 'where/' . $id, 'payroll_period_id' => 'where/' . $period_id)); $this->data['period'] = getValue('title', 'payroll_period', array('id' => 'where/' . $period_id)); $table = 'payroll_monthly_income_component'; $table_join = 'payroll_component'; $condition = 'payroll_monthly_income_component.payroll_component_id = payroll_component.id'; $select = "{$table}.value as value,{$table_join}.title as component,{$table_join}.component_type_id as type"; $this->data['income'] = getJoin($table, $table_join, $condition, 'left', $select, array('payroll_monthly_income_id' => 'where/' . $monthly_income_id, 'component_type_id' => 'where/1'))->result(); $this->data['deduction'] = getJoin($table, $table_join, $condition, 'left', $select, array('payroll_monthly_income_id' => 'where/' . $monthly_income_id, 'component_type_id' => 'where/2'))->result(); //print_mz($this->data['component']); //UcapanSelamat $this->data['dob'] = getValue('birth_dttm', 'hris_persons', array('person_id' => 'where/' . $id)); $this->data['family_dob'] = getAll('hris_employee_family', array('employee_id' => 'where/' . $id)); $this->load->library('mpdf60/mpdf'); $html = $this->load->view('payroll/monthly_income/payroll_slip', $this->data, true); $stylesheet = file_get_contents('assets/modules/css/payroll/mpdfstyletables.css'); $mpdf = new mPDF(); $mpdf = new mPDF('A4'); $mpdf->WriteHTML($stylesheet, 1); // The parameter 1 tells that this is css/style only and no body/html/text $mpdf->WriteHTML($html, 2); $mpdf->Output('payroll_slip_' . $id . '.pdf', 'I'); }
function detail_email_submit($id) { 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'); $sess_nik = get_nik($sess_id); $data_result = $this->data['task_detail'] = $this->form_spd_luar_model->where('users_spd_luar.id', $id)->form_spd_luar($id)->result(); $this->data['td_num_rows'] = $this->form_spd_luar_model->where('users_spd_luar.id', $id)->form_spd_luar($id)->num_rows(); $this->data['tc_id'] = $task_receiver_id = getValue('task_receiver', 'users_spd_luar', array('id' => 'where/' . $id)); $this->data['biaya_pjd'] = getJoin('users_spd_luar_biaya', 'pjd_biaya', 'users_spd_luar_biaya.pjd_biaya_id = pjd_biaya.id', 'left', 'users_spd_luar_biaya.*, pjd_biaya.title as jenis_biaya', array('user_spd_luar_id' => 'where/' . $id)); return $this->load->view('form_spd_luar/spd_luar_email', $this->data, TRUE); } }
function getUserGroup($id) { //$group = getAll('users_groups', array('user_id'=>'where/'.$id))->result(); $group = getJoin('users_groups', 'groups', 'users_groups.group_id = groups.id', 'left', 'groups.name as group_name, users_groups.*', array('users_groups.user_id' => 'where/' . $id), array('!=groups.id' => '2')); $groups = ''; if (!empty($group)) { foreach ($group->result() as $key) { $groups = ucwords($key->group_name); } return $groups; } }
function do_approve($id) { if (!$this->ion_auth->logged_in()) { redirect('auth/login', 'refresh'); } else { $user = getJoin('users', 'users_edit_approval', 'users.id = users_edit_approval.user_id', 'left', 'users.*,users_edit_approval.*', array('users_edit_approval.id' => 'where/' . $id))->row(); $user_id = get_nik($this->session->userdata('user_id')); $date_now = date('Y-m-d'); $data = array('is_app' => 1, 'app_status_id' => $this->input->post('app_status'), 'user_app' => $user_id, 'date_app' => $date_now, 'note' => $this->input->post('note')); $this->db->where('id', $id); $this->db->update('users_edit_approval', $data); $data_n = array('first_name_new' => !empty($user->first_name_new) ? $user->first_name_new : '', 'last_name_new' => !empty($user->last_name_new) ? $user->last_name_new : '', 'bod_new' => !empty($user->bod_new) ? $user->bod_new : '', 'marital_id_new' => $user->marital_id_new, 'phone_new' => !empty($user->phone_new) ? $user->phone_new : '', 'previous_email_new' => !empty($user->previous_email_new) ? $user->previous_email_new : '', 'bb_pin_new' => !empty($user->bb_pin_new) ? $user->bb_pin_new : ''); $approval_status = $this->input->post('app_status'); $this->approval->approve('edit_user', $id, $approval_status, ''); if ($approval_status == 1) { print_mz($this->update_employeetable($user->user_id, $data_n)); } } }
<?php include_once '../../config/config.php'; include_once $serverPath . 'utils/db/db_get.php'; $table = "villain"; if (!empty($_GET["id"])) { $joinOn = ["npc_id" => "id"]; $t1_constraints = ["id" => $_GET["id"]]; $t2_constraints = []; $query = getJoin("villain", "npc", $joinOn, $t1_constraints, $t2_constraints); print json_encode(runQuery($query)[0]); } else { if (!empty($_GET['column'])) { $column = $_GET['column']; if ($column == "stats") { $query = " SELECT villain.id, villain.method_type, villain.scheme_type, villain.weakness_type, npc.first_name,\n\t\t\t\t\t\tnpc.last_name FROM `villain` INNER JOIN `npc` ON villain.npc_id = npc.id;"; print json_encode(runQuery($query)); } else { if ($column == "ids") { $query = "SELECT npc_id AS id FROM `villain`;"; $results = runQuery($query); $ids = []; foreach ($results as $result) { array_push($ids, $result['id']); } print json_encode($ids); } } } }