Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
farm
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/farm/farm-list.php
<?php use CTS\CTS; use Farm\Farm; // warning 제거 //페이징관련 SQL $page = $_GET['page'] ? $_GET['page'] : 1; $onePage = 10; //몇 번째의 글부터 가져오는지(일단 한페이지당 12개의 목록 출력으로 설정) $currentLimit = ($onePage * $page) - $onePage; $sqlLimit = ' limit ' . $currentLimit . ', ' . $onePage; //limit sql 구문 $arrAddConditionSql = ""; $res = Farm::getFarmList($arrAddConditionSql, $sqlLimit); //페이징 관련 $totalCount = Farm::getFarmListCnt($arrAddConditionSql); list($paging, $pageRecord) = Farm::createPaging($totalCount, $page); ?> <div class="card-box"> <form method="get" id="form1" name="form1" action="#"> <input type="hidden" id="mode" name="mode" value="<?php echo $mode?>"/> <input type="hidden" id="paramFarmCode" name="paramFarmCode"/> <table class="table table-borderless"> <tr> <td class="float-right"> <div class="form-row"> <div class="col-auto"> <a href="javascript:goInsert()" class="btn btn-primary btn-md w-lg"><i class="ion-edit"></i><?php echo (" 농장등록")?></a> </div> </div> </td> </tr> </table> <table class="table table-hover table-bordered" style="width:100%"> <thead class="thead-light text-center"> <tr> <th><?php echo ("순번") ?></th> <th><?php echo ("농장명") ?></th> <th><?php echo ("농장주") ?></th> <th><?php echo ("농장유형") ?></th> <th><?php echo ("주소") ?></th> <th><?php echo ("연락처") ?></th> </tr> </thead> <tbody> <?php $i=0;foreach($res as $row):?> <tr onclick="javascript:goFarmDetail('<?php echo $row['farm_code'] ?>')"> <td class="text-center"> <?php echo $totalCount - (($page - 1) * $onePage + $i); ?> </td> <td class="text-left"><?php echo $row['farm_name'] ?></td> <td class="text-center"><?php echo $row['farm_admin'] ?></td> <td class="text-center"><?php echo $row['farm_type'] ?></td> <td class="text-left"><?php echo $row['farm_add1'] ?><?php echo $row['farm_add2'] ?></td> <td class="text-center"><?php echo $row['farm_phone'] ?></td> </tr> <?php $i++;endforeach;?> </tbody> </table> </form> <div> <nav class="text-center"> <?php Farm::printPageNavigator($pageRecord)?> </nav> </div> </div> <script> function goFarmDetail(farm_code){ $("#paramFarmCode").val(farm_code); document.form1.action="/farm/farm-edit.php"; document.form1.submit(); } function goInsert(){ document.form1.action="/farm/farm-insert.php"; document.form1.submit(); } </script>