<?php
$cate_id = "CNT_FACLT_CT";
include_once "{$_SERVER['DOCUMENT_ROOT']}/common.inc.php";
include_once _SVC_INC_PATH_ . "/auth_check.php";
include_once _HOME_INC_PATH_ . "/ajax_init.php";

if (!_notAuth("R")) {


  switch ($_REQUEST['mode']) {

    // 부서정보
    case 'getFacltCtList':


      $squl = "USP_P_CNT_FACLT_CT_S10";

      $params = array(
        "P_ST_DATE"    => $_REQUEST["date_st"],
        "P_ED_DATE"    => $_REQUEST["date_ed"],
        "P_FACLT_GRP"   => $_REQUEST["FACLT_GRP_P"] ?: "",
        "P_FACLT_CD"   => $_REQUEST["FACLT_CD"] ?: "",
        "P_FACLT_NM"   => $_REQUEST["FACLT_NM"] ?: "",
      );
      $rst = $baseObj->DB->exec($squl, $params);

      $rows = array();
      if ($rst) {
        $retval['code'] = true;
        while ($row = $baseObj->DB->fetch_array($rst)) {
          $rows[] = $row;
        }
        ;
        $retval['data'] = $rows;
        $retval['mesg'] = '정상 동작 되었습니다.';
      } else {
        $retval['code'] = false;
      }

      break;
  }
}

if (!$_REQUEST['no_echo']) {
  echo json_encode($retval);
}