function load_nav($changePage = 0) { $objResponse = new xajaxResponse(); if ($changePage != 0) { $_SESSION['curPage'] = $changePage; } $text .= gen_nav(); $objResponse->assign("top_nav", "innerHTML", $text); return $objResponse; }
function gen_main() { $text = ''; $text .= '<div id="top_wrapper">'; $text .= '<nav id="top_nav" class="navbar navbar-inverse navbar-fixed-top animated fadeInDown">'; $text .= gen_nav(); $text .= '</nav>'; $text .= '</div>'; $text .= '<div id="middle_wrapper" class="animated fadeIn">'; switch ($_SESSION['curPage']) { case '1': $text .= gen_residents(); break; case '2': $text .= gen_guests(); break; case '3': if ($_SESSION['user']['admin']) { $text .= gen_users(); } else { $_SESSION['curPage'] = 1; $text .= gen_main(); } break; case '4': $text .= gen_shifts(); break; } $text .= '</div>'; $text .= '<div id="bottom_wrapper">'; $text .= '<nav id="bottom_nav" class="navbar navbar-default navbar-fixed-bottom animated fadeInUp">'; $text .= gen_footer(); $text .= '</nav>'; $text .= '</div>'; return $text; }
<?php require_once "plib/head.php"; $cgi = getCGI(); gsql_esc($cgi); $p_id = $cgi[p_id]; $ids = $cgi[ids]; if ($p_id == "" || $ids == "") { sys_exit("参数错误"); } conProjDB($p_id); $sp = explode(",", $ids); foreach ($sp as $kk => $id) { $name = $cgi["name{$id}"]; $url = $cgi["url{$id}"]; $showorder = $cgi["showorder{$id}"]; if ($showorder == "") { $showorder = "0"; } $sqlstr = sprintf("update navigation set name='%s', url='%s', showorder='%s' where id={$id}", $name, $url, $showorder, $id); print "{$sqlstr}"; $res = mysql_query($sqlstr, $proj_mysql) or sys_exit("系统忙, 请稍候再试。", $sqlstr . ":\n" . mysql_error()); } gen_nav(); sys_jmp("navlist.php?p_id={$p_id}");