$FSO[] = ''; } } $smarty->assign("data", $FSO); $smarty->assign("pages", $pages); $smarty->assign("mode", ''); } elseif ($_GET['mode'] == 'change' and isset($_GET['fsoid'])) { if ($_SESSION['class'] > 1) { $message = '!!!'; showMessage($message, 0); } $smarty->assign("mode", "add_change"); $smarty->assign("mod", "1"); $smarty->assign("back", getenv("HTTP_REFERER")); $wr['id'] = $_GET['fsoid']; $res = FSO_SELECT('', $wr); if ($res['count'] < 1) { $message = 'Кассеты с таким ID не существует!<br /> <a href="FSO.php">Назад</a>'; showMessage($message, 0); } $rows = $res['rows']; $res = FSOT_SELECT('', ''); $rows2 = $res['rows']; $i = -1; while (++$i < $res['count']) { $FSOT_Values[] = $rows2[$i]['id']; $FSOT_Text[] = $rows2[$i]['marking']; } $smarty->assign("id", $rows[0]['id']); $smarty->assign("FSOT_values", $FSOT_Values);
function getFSOTsInfo($sort, $linesPerPage = -1, $skip = -1) { $res = FSOT_SELECT($sort, '', $linesPerPage, $skip); $result['FSOTs'] = $res; unset($wr); for ($i = 0; $i < $res['count']; $i++) { $wr['FiberSpliceOrganizationType'] = $res['rows'][$i]['id']; $res2 = FSO_SELECT('', $wr); $result['FSOTs']['rows'][$i]['FSOCount'] = $res2['count']; } return $result; }