Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
qr
/
code
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/qr/code/ps_list.php
<?php use CTS\CTS; //main parameters /* $sale_date = $_REQUEST['sale_date']; $sale_hatchery = $_REQUEST['sale_hatchery']; $sale_flock = $_REQUEST['sale_flock']; $sale_index = $_REQUEST['sale_index']; $sale_title = $_REQUEST['sale_title']; $sale_post = $_REQUEST['sale_post']; $sale_location = $_REQUEST['sale_location']; $sale_num = $_REQUEST['sale_num']; $sale_flock_num = $_REQUEST['sale_flock_num']; $sale_director = $_REQUEST['sale_director']; $sale_director_phone = $_REQUEST['sale_director_phone']; $sale_farm_phone = $_REQUEST['sale_farm_phone']; $sale_comment = $_REQUEST['sale_comment']; $sheet_name = $_REQUEST['sheet_name']; */ $sale_type = $_REQUEST['sale_type']; $page = $_GET['page'] ? $_GET['page'] : 1; $onePage = 10; $currentLimit = ($onePage * $page) - $onePage; $sqlLimit = ' limit ' . $currentLimit . ', ' . $onePage; $inputDate = $_REQUEST['inputDate']; $inputMonth = $_REQUEST['inputMonth']; $inputDay = $_REQUEST['inputDay']; $inputFarm = $_REQUEST['inputFarm']; $sqlAdd = ""; try { if($inputDate != ""){ $sqlAdd .= " and s.sale_date like '{$inputDate}%' "; } if($inputMonth != ""){ $sqlAdd .= " and SUBSTRING(s.sale_date ,6,2) like '{$inputMonth}%' "; } if($inputDay != ""){ $sqlAdd .= " and SUBSTRING(s.sale_date ,9,2) like '{$inputDay}%' "; } if($inputFarm != ""){ $sqlAdd .= " and s.sale_farm like '{$inputFarm}%' "; } $sql = "SELECT *, DATE_FORMAT(sale_date, '%Y-%m-%d') dates FROM qr q left join sale s ON q.qr_sale = s.sale_idx WHERE q.qr_use = 'Y'". $sqlAdd ." AND s.sale_type = '종계' ORDER BY q.qr_update desc "; } catch (exception $e) { } // echo $sql; $rs = \DB::query($sql.$sqlLimit); $rsCnt = \DB::query($sql); $cnt = count($rsCnt); list($paging, $pageRecord) = CTS::createPaging($cnt, $page); ?> <style> .qrcodesize { width:80px; height:80px; } .checkboxs { width : 20px; height : 20px; } </style> <!-- search --> <div class=""> <div class="columns columns-right btn-group float-left"> <button class="btn btn-outline-danger mr-2" type="button" onclick="delete_post()" name="paginationSwitch" aria-label="Pagination Switch" title="delete file"> QR코드삭제 </button> <button class="btn btn-outline-primary " type="button" onclick="create_post()" name="paginationSwitch" aria-label="Pagination Switch" title="upliad file"> QR코드생성 </button> </div> <form id="frm_process" name="frm_process" action="" method="post" > <div class="columns columns-right btn-group float-right"> <div class="search pr-1 "> <input class="form-control" onkeyup="enterkey()" id="inputDate" name="inputDate" type="text" placeholder="분양 년도" autofocus> </div> <div class="search pr-1 "> <input class="form-control" onkeyup="enterkey()" id="inputMonth" name="inputMonth" type="text" placeholder="분양 월" > </div> <div class="search pr-1 "> <input class="form-control" onkeyup="enterkey()" id="inputDay" name="inputDay" type="text" placeholder="분양 일" > </div> <div class="search pr-1 "> <input class="form-control" onkeyup="enterkey()" id="inputFarm" name="inputFarm" type="" placeholder="농가명" > </div> <div class="pr-1 float-right"> <button id="farmSearchList" onclick="searchFarm()" class="btn btn-secondary " type="button" name="pagination" title="Hide/Show pagination"> 검색 </button> </div> </div> </form> <br /> <br /> </div> <form id="form" name="form" method="post" > <input type="hidden" id="qr_sale" name="qr_sale" /> <input type="hidden" id="qr_url" name="qr_url" /> </form> <div class="card clear_float"> <table class="table card-table"> <thead class="thead-light text-center"> <tr class="bg-warning"> <th class=""></th> <th class=""></th> <th class=""></th> <th class=""></th> <th class=""></th> </tr> </thead> <tbody> <?php $i= 0; if(count($rs) == 0 ) { echo " <td colspan=4 class='text-center'> 검색 결과가 없습니다</td>"; } foreach($rs as $key => $value) : $i++; $types = "예산"; if($value["sale_hatchery"] == "오포"){ $types = "오포"; } ?> <tr class="text-center" > <td><input class="checkboxs" type="checkbox" value="<?php echo $value['qr_sale'];?>" /></td> <td><img src="/web/files/qr/<?=$value["qr_url"]?>" alt="qr code" class='qrcodesize' /> </td> <td class="text-left" > <strong>일련번호: <?=$value["qr_sale"]?></strong><br /> 분양일: <?=$value["dates"]?><br /> 지역 : <?=$value["sale_location"]?> / 농가명 : <?=$value["sale_farm"]?> <br /> 부화장 : <?=$value["sale_hatchery"]?> / 계군명 : <?=$value["sale_flock"]?> / 수 수 : 25,600<br /> </td> <!-- 비고사항 --> <td class = "text-left" > <br /> QR코드 생성일 : <?=$value["qr_update"]?> <br /> 농가 연락처 : <?=$value["sale_farm_phone"]?> <br /> 분양계군 수수 : <?=$value["sale_flock_num"]?><br /> </td> <td> <input type="button" name="other" id="other" class="btn btn-primary btn-md" value="<?php echo ('인수증출력');?>" onclick="receipts('<?=$value["qr_sale"]?>', '<?=$value["qr_url"]?>', '<?=$types?>')"/> </td> </tr> <?php endforeach; ?> </tbody> </table> <nav class="text-center"> <?php CTS::printPageNavigator($pageRecord)?> </nav> </div> <script> function delete_post() { chkBoxs = document.getElementsByClassName("checkboxs"); data = new FormData; data.append("division", "delteQR") for( var i = 0; i < chkBoxs.length; i++) { if(chkBoxs[i].checked) data.append("check[]", chkBoxs[i].value); else data.append("check[]", ""); } $.ajax({ data: data, type: 'post', url: "../code/qr_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { alert(data['msg']); switch(data['msg']) { case "delete_success": location.reload() break; } }, error: function(error,request) { alert("QR코드삭제완료"); location.reload() } }); } // } function create_post() { location.href = "/qr/code/insertQR.php?sale_type=<?=$sale_type;?>"; }; function receipts(qr_sale, qr_url, types){ $("#qr_sale").val(qr_sale); $("#qr_url").val(qr_url); if(types == "예산"){ document.form.action = "receipt.php"; document.form.submit(); }else if(types == "오포"){ document.form.action = "receipt2.php"; document.form.submit(); } } var frm_process = document.frm_process.pagination; var frm_input = document.frm_process; var action_process = frm_process.onclick = function() { location.href = "/qr/code/ps_list.php?page=1&inputDate="+frm_input.inputDate.value+"&inputMonth="+frm_input.inputMonth.value+"&inputDay=" +frm_input.inputDay.value+"&inputFarm="+frm_input.inputFarm.value; } function enterkey(){ if (window.event.keyCode == 13) { action_process(); } }; </script>