'No', 'O' => 'Optional', 'Y' => 'Yes'); $Key=(!array_key_exists('k', $_GET) || empty($_GET['k']) ? 'none-found' : only_digits($_GET['k'], 20)); list($GoodAcct, $AcctName)=chk_acct($Key,'A'); $Stage=(!array_key_exists('s', $_GET) || empty($_GET['s'])) ? 0 : only_digits($_GET['s'], 1); $Stage=in_array($Stage, array('0', '1', '2')) ? $Stage : '0'; $Cat=0; switch ($Stage) { case 0: $TypeSeq=0; $Cat=0; break; case 1: $TC=(!array_key_exists('TC', $_POST) || empty($_POST['TC'])) ? '0:0' : chk_str($_POST['TC'], 6); if (strpos($TC, ':') === FALSE) { $TypeSeq=0; $Cat=0; $Stage=0; } else { list($TypeSeq, $Cat)=explode(':', $TC); } break; case 2: $TypeSeq=(!array_key_exists('t', $_GET) || empty($_GET['t'])) ? 'none-found' : only_digits($_GET['t'], 3); $Cat=(!array_key_exists('c', $_GET) || empty($_GET['c'])) ? 'none-found' : only_digits($_GET['c'], 2); break; default: $Cat=0; $Stage=0; } if ($Stage > 0) { if (!chkCat($TypeSeq, $Cat)) { $TypeSeq=0; $Cat=0; $Stage=0; } } $Page=$GoodAcct ? '900;url=amenu.php?k='.$Key : '0;url=failed.php'; ?> >

Sub-Category List

'."\n"; echo ($Stage != 1 ? 'Select ' : '').'Category:  '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; $query='select * from style where sg="'.$Comp_SG.'" and type_seq="'.$TypeSeq.'" and cat="'.$Cat.'"'; $cat_res=mysqli_query($db, $query); $cat_row = mysqli_fetch_assoc($cat_res); if ($Stage > 0) { $CatType=get_type($TypeSeq); echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo 'Add New Sub-Category'."\n"; echo ''."\n"; echo ' '."\n"; echo ''."\n"; echo 'Edit Category'."\n"; echo '
'."\n"; echo '
'."\n"; $SubCats=(cntSubCat($TypeSeq, $Cat) > 0); echo ''."\n"; echo ''."\n"; if ($SubCats) { echo ''."\n"; echo ''."\n"; } echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($Comp_SG == '2015') { echo ''."\n"; echo ''."\n"; } echo ''."\n"; echo ''."\n"; $query='select * from style_sub where sg="'.$Comp_SG.'" and type_seq="'.$TypeSeq.'" and cat="'.$Cat.'" order by sub_cat'; $subcat_res=mysqli_query($db, $query); while ($subcat_row=mysqli_fetch_assoc($subcat_res)) { echo ''."\n"; if ($SubCats) { echo ''."\n"; echo ''."\n"; } echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($Comp_SG == '2015') { echo ''."\n"; echo ''."\n"; } echo ''."\n"; if ($SubCats) { echo ''."\n"; } echo ''."\n"; } echo '
'."\n"; echo 'Sub
Category'."\n"; echo '
'."\n"; echo 'Description'."\n"; echo ''."\n"; echo 'Note
Number'."\n"; echo '
'."\n"; echo 'Require
Comment'."\n"; echo '
'."\n"; echo 'Require
Base'."\n"; echo '
'."\n"; echo 'Require
Strength'."\n"; echo '
'."\n"; echo 'Require
Sweetness'."\n"; echo '
'."\n"; echo 'Require
Carbonation'."\n"; echo '
'."\n"; echo 'Require
Color'."\n"; echo '
'."\n"; echo 'Require
Description'."\n"; echo '
'."\n"; echo 'Action'."\n"; echo '
'."\n"; echo ''.$subcat_row['sub_cat'].''."\n"; echo ''."\n"; echo $subcat_row['cat_desc']."\n"; echo ''."\n"; echo (!empty($subcat_row['note_num']) ? ''.$subcat_row['note_num'].'' : 'None')."\n"; echo ''."\n"; echo (array_key_exists($subcat_row['req_comment'], $ReqValues) ? $ReqValues[$subcat_row['req_comment']] : 'Unknown'); echo ''."\n"; if ((($Comp_SG != '2015' && $CatType == 'B') || ($Comp_SG == '2015' && $CatType != 'C')) && $cat_row['base'] != 'Y') { echo (array_key_exists($subcat_row['req_base'], $ReqValues) ? $ReqValues[$subcat_row['req_base']] : 'Unknown'); } else { echo '—'; } echo "\n"; echo ''."\n"; if ($CatType != 'C') { echo (array_key_exists($subcat_row['req_strength'], $ReqValues) ? $ReqValues[$subcat_row['req_strength']] : 'Unknown'); } else { echo '—'; } echo "\n"; echo ''."\n"; echo ($subcat_row['req_sweetness'] == 'N' ? 'No' : ExpandSweetness($subcat_row['req_sweetness'], $subcat_row['type_seq'], FALSE))."\n"; echo ''."\n"; echo ($subcat_row['req_carbonation'] == 'N' ? 'No' : ExpandCarbonation($subcat_row['req_carbonation'], $subcat_row['type_seq'], FALSE))."\n"; echo ''."\n"; if ($CatType == 'B') { echo ($subcat_row['req_color'] == 'N' ? 'No' : ExpandColor($subcat_row['req_color'], $subcat_row['type_seq'], $subcat_row['cat'], $subcat_row['sub_cat'], FALSE))."\n"; } else { echo '—'; } echo ''."\n"; echo (array_key_exists($subcat_row['req_desc'], $ReqValues) ? $ReqValues[$subcat_row['req_desc']] : 'Unknown'); echo ''."\n"; echo 'Change'."\n"; echo ''."\n"; $query='select count(*) from entry where type_seq="'.$TypeSeq.'" and cat="'.$Cat.'"'.(!empty($subcat_row['sub_cat']) ? ' and sub_cat="'.$subcat_row['sub_cat'].'"' : ''); $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); if ($cnt_row[0] > 0) { echo 'Remove'."\n"; } else { echo 'Remove'."\n"; } echo '
'."\n"; } ?>