<?php
$cate_id = "CNT_PROD_WORKER";

/*
* @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 'getProdList':


      $squl = "USP_P_CNT_PROD_WORKER_S10";

      $params = array(
        "P_ST_DATE" => $_REQUEST["date_st"],
        "P_ED_DATE" => $_REQUEST["date_ed"],
      );
      $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);
}