<?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['sprstatus_id']) && '' != $_GET['sprstatus_id']){
    $ObjSprStatusMod = new SprStatusMod($MS_SP);
    $ArrSprStatus = $ObjSprStatusMod->GetFromDb('SqlAll', 'GetRow', "a.sprstatus_id = '". $_GET['sprstatus_id'] ."'");
    $smarty->assign('ArrSprStatus', $ArrSprStatus);
  }
  
  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('SprStatus/Form.tpl');
}
else{
  $VarReturn = $MS_SP->Sp_LangMessage['error']['ErrFuncAccessDenied'];
}
echo $VarReturn;
include($_SERVER['DOCUMENT_ROOT'] .'/script/FooterInc.php');
?>