} } $smarty->assign("data", $cableLine_arr); $smarty->assign("pages", $pages); $smarty->assign("mode", NULL); $smarty->assign("sort", $sort ? '0' : '1'); } elseif ($_GET['mode'] == 'change' and isset($_GET['fsotid'])) { 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['fsotid']; $res = FSOT_SELECT('', $wr); if ($res['count'] < 1) { $message = 'Типа кассеты с таким ID не существует!<br /> <a href="FSOT.php">Назад</a>'; showMessage($message, 0); } $rows = $res['rows']; $smarty->assign("id", $rows[0]['id']); $smarty->assign("marking", $rows[0]['marking']); $smarty->assign("manufacturer", $rows[0]['manufacturer']); $smarty->assign("note", $rows[0]['note']); } elseif ($_GET['mode'] == 'add') { if ($_SESSION['class'] > 1) { $message = '!!!'; showMessage($message, 0); }
$smarty->assign("FSOT_values", $FSOT_Values); $smarty->assign("FSOT_text", $FSOT_Text); $smarty->assign("FSOT_selected", $rows[0]['FiberSpliceOrganizationType']); } elseif ($_GET['mode'] == 'add') { if ($_SESSION['class'] > 1) { $message = '!!!'; showMessage($message, 0); } $smarty->assign("mode", "add_change"); $smarty->assign("mod", "2"); $back = getenv("HTTP_REFERER"); if (isset($_GET['parent_back'])) { $back .= (parse_url($back, PHP_URL_QUERY) ? '&' : '?') . 'back=' . urlencode($_GET['parent_back']); } $smarty->assign("back", $back); $res = FSOT_SELECT('', ''); $rows2 = $res['rows']; $i = -1; while (++$i < $res['count']) { $FSOT_Values[] = $rows2[$i]['id']; $FSOT_Text[] = $rows2[$i]['marking']; } $smarty->assign("FSOT_values", $FSOT_Values); $smarty->assign("FSOT_text", $FSOT_Text); $smarty->assign("FSOT_selected", ''); $smarty->assign("id", ''); } elseif ($_GET['mode'] == 'delete' and isset($_GET['fsoid'])) { if ($_SESSION['class'] > 1) { $message = '!!!'; showMessage($message, 0); }
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; }