Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
doc
/
view
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/doc/view/sale_view.php
<?php $idx = $_REQUEST['idx']; $title = $_REQUEST['title']; $sheet_name = $_REQUEST['sheet_name']; $sql = "select * from sale where sale_post= $idx group by sheet_name order by sale_idx asc"; $getSale = \DB::query($sql); ?> <div class="ibox-content"> <table class="table table-borderless"> <tr> <td class="float-right"> <div class="col-auto"> <!-- <a href="javascript:excel_update('<?php echo $idx; ?>')" class="btn btn-warning btn-md"><i class="ion-trash-b"></i><?php echo (" 수 정")?></a> --> <a href="javascript:excel_delete('<?php echo $idx; ?>', '<?php echo $title; ?>', '<?php echo $getSale[0]['sale_title']; ?>')" class="btn btn-danger btn-md"><i class="ion-trash-b"></i><?php echo (" 삭 제")?></a> <a href="javascript:goList()" class="btn btn-primary btn-md"><i class="ion-navicon-round"></i><?php echo (" 목 록");?></a> </div> </td> </tr> </table> <ul class="nav nav-pills"> <?php foreach($getSale as $key => $value): $option = ""; if($value['sheet_name'] == "$sheet_name"){ $option = "active show"; } ?> <li class="nav-item border"> <a class="nav-link <?php echo $option;?> " data-toggle="tab" href="#home<?php echo $value['sheet_name'];?>"><?php echo $value['sheet_name'];?></a> </li> <?php endforeach; ?> </ul> <div id="myTabContent" class="tab-content"> <?php foreach($getSale as $key => $value): $option = ""; if($value['sheet_name'] == "$sheet_name"){ $option = "active show"; } ?> <div class='tab-pane <?php echo $option;?> ' id='home<?php echo $value['sheet_name'];?>'> <table class="table table-bordered text-center " > <thead > <?php $sql = "select * from sale where sale_post=$idx and sheet_name like '{$value['sheet_name']}' order by sale_idx"; $getSaleSheet= \DB::query($sql); $bool = true; $tmpfarm = ""; $tmpnum = ""; $tmphatchery = ""; foreach($getSaleSheet as $key => $value): // 한번 실행 start if($bool){ ?> <tr> <th colspan=9;><h3><?PHP echo $value['sale_title']; ?></h3></th> </tr> <tr> <th colspan=2;><?PHP echo substr($value['sale_date'],0,10)." ".$value['sheet_name'].'요일' ; ?></th> <th></th> <th class='text-white bg-danger' colspan=3;>해당 부화장에서 직접 운송</th> <th></th> <th colspan=2;>※모든 농가 병아리 도착시간 사전 연락 바랍니다.</th> </tr> <tr class=""> <th rowspan=2; class="bg-warning ">지역</th> <th rowspan=2; class="bg-warning">농가명</th> <th rowspan=2; class="bg-warning">분양수수</th> <th rowspan=2; class="bg-warning">부화장</th> <th colspan=2; class="bg-warning">계군별 분양수</th> <th colspan=2; class="bg-warning">연락처</th> <th rowspan=2; class="bg-warning">비고</th> </tr> <tr> <th class="bg-warning">계군명</th> <th class="bg-warning">수 수</th> <th class="bg-warning">소장</th> <th class="bg-warning">농장</th> </tr> <?php // $tempLocation = $value['sale_location']; $bool=false; } // 한번 실행 end ?> <tr class='text-center '> <?php if($tmpfarm != $value['sale_farm'] ){ echo "<th class='align-self-center'; >".$value['sale_location']."</th>"; echo "<th>".$value['sale_farm']."</th>"; echo "<th>".$value['sale_num']."</th>"; echo "<th>".$value['sale_hatchery']."</th>"; // $tempLocation = $value['sale_location']; }else if($tmpfarm == $value['sale_farm'] && $tmpnum != $value['sale_num'] ){ echo "<th> </th>"; echo "<th> </th>"; echo "<th>".$value['sale_num']."</th>"; echo "<th> </th>"; }else if($tmpfarm == $value['sale_farm'] && $tmphatchery != $value['sale_hatchery']){ echo "<th> </th>"; echo "<th> </th>"; echo "<th> </th>"; echo "<th>".$value['sale_hatchery']."</th>"; }else { echo "<th> </th>"; echo "<th> </th>"; echo "<th> </th>"; echo "<th> </th>"; } ?> <!-- <th> <?php echo $value['sale_farm']; ?> </th> <th> <?php echo $value['sale_num']; ?> </th> --> <!-- <th> <?php echo $value['sale_hatchery']; ?> </th> --> <th> <?php echo $value['sale_flock']; ?> </th> <th> <?php echo $value['sale_flock_num']; ?> </th> <?php if($tmpfarm != $value['sale_farm']){ $connect = ""; if($value['sale_director_phone'] != ""){ $connect = " : "; } echo "<th>".$value['sale_director'].$connect .$value['sale_director_phone']."</th>"; echo "<th>".$value['sale_farm_phone']."</th>"; $tmpfarm = $value['sale_farm']; $tmpnum = $value['sale_num']; $tmphatchery = $value['sale_hatchery']; } else { echo "<th> </th>"; echo "<th> </th>"; } ?> <!-- <th> <?php echo $value['sale_director']; ?> </th> --> <!-- <th> <?php echo $value['sale_director_phone']; ?> </th> --> <!-- <th> <?php echo $value['sale_farm_phone']; ?> </th> --> <th> <?php $comment = json_decode($value['sale_comment']); if(!empty($comment)) { foreach ($comment as $k => $v){ echo $v; if($v != ""){ echo " : "; } } } ?> </th> </tr> <?php endforeach; ?> </thead> </table> </div> <?php endforeach; ?> </div> </div> <!-- ibox end --> <script> function goList() { history.go(-1); } function excel_delete(idx,flock_code, sale_title) { if(confirm("삭제하시겠습니까? 삭제된 내용은 복구할 수 없습니다.")) { var data = new FormData(); data.append("type","sale"); data.append("division", "delete"); data.append("idx", idx); data.append("flock_code",idx); data.append("sale_title",sale_title); $.ajax({ data: data, type: 'post', url: "/doc/process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "failed delete" : var obj = { "types" : "alert", "title" : "삭제 실패", "content" : "다시 한번 시도해주세요." }; alertModals(obj); break; case 'success delete': location.href = '/doc/saleList/ps_saleList.php?page=1&sale_type=종계'; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }else { } } </script>