<?php
$cate_id = "sts_order_send";


/*
* @Overview 생산오더별 진행현황
* @History 2024-04-22 / 이원기 / 최초작성
*/

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 'getMainList':


      $squl = "USP_P_STS_ORDER_SEND_S10";

      $_REQUEST['RS_CODE'] = "";
      $_REQUEST['RS_MSG']  = "";

      $params = array(
        "ST_DT DATE" => $_REQUEST['order_date_st'],
        "ED_DT DATE" => $_REQUEST['order_date_ed'],
        "RS_CODE"      => array(&$_REQUEST['RS_CODE'], SQLSRV_PARAM_OUT),
        "RS_MSG"       => array(&$_REQUEST['RS_MSG'], SQLSRV_PARAM_OUT)
      );


      $rst = $baseObj->DB->exec($squl, $params);

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

      break;
  }
}

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