<?php
include($_SERVER['DOCUMENT_ROOT'] .'/script/HeaderInc.php');
if('XMLHttpRequest' == $_SERVER['HTTP_X_REQUESTED_WITH'] && true === isset($_SESSION['SessionAuth']['id']) && 0 < $_SESSION['SessionAuth']['id']) {
  if(true === isset($_GET['purchasestatus_id']) && '' != $_GET['purchasestatus_id']){
    $ObjPurchaseStatusMod = new PurchaseStatusMod($MS_SP);
    $ArrPurchaseStatus = $ObjPurchaseStatusMod->GetFromDb('SqlAll', 'GetRow', "a.purchasestatus_id = '". $_GET['purchasestatus_id'] ."'");
    $smarty->assign('ArrPurchaseStatus', $ArrPurchaseStatus);
  }
  
  function gwsc() {
    $ArrReturn = array();
    $cs = array('00', '33', '66', '99', 'CC', 'FF');

    for($i=0; $i<6; $i++) {
      for($j=0; $j<6; $j++) {
        for($k=0; $k<6; $k++) {
          $c = $cs[$i] .$cs[$j] .$cs[$k];
          $ArrReturn[] = "<option value=\"$c\">#$c</option>\n";
        }
      }
    }
    return $ArrReturn;
  }
  
  $smarty->assign('ArrColorOption', gwsc());
  $VarReturn = $smarty->fetch('PurchaseStatus/Form.tpl');
}
else{
  $VarReturn = $MS_SP->Sp_LangMessage['error']['ErrFuncAccessDenied'];
}
echo $VarReturn;
include($_SERVER['DOCUMENT_ROOT'] .'/script/FooterInc.php');
?>