コード例 #1
0
} else {
    $myAction = "";
}
switch ($myAction) {
    //check for type of process
    case "edit":
        # 2) show form to edit data
        editDisplay();
        break;
    case "update":
        # 3) execute SQL, redirect
        updateExecute();
        break;
    default:
        # 1)Select Administrator
        selectAdmin();
}
function selectAdmin()
{
    //Select administrator
    global $config;
    if ($_SESSION["Privilege"] == "admin") {
        #redirect if logged in only as admin
        myRedirect(THIS_PAGE . "?act=edit");
    }
    $config->loadhead = '
	<script type="text/javascript" src="' . VIRTUAL_PATH . 'include/util.js"></script>
	<script type="text/javascript">
			function checkForm(thisForm)
			{//check form data for valid info
				if(empty(thisForm.AdminID,"Please Select an Administrator.")){return false;}
コード例 #2
0
} else {
    $myAction = "";
}
switch ($myAction) {
    //check for type of process
    case "edit":
        # 2) show form to edit data
        editDisplay($nav1);
        break;
    case "update":
        # 3) execute SQL, redirect
        updateExecute($nav1);
        break;
    default:
        # 1)Select Administrator
        selectAdmin($nav1);
}
function selectAdmin($nav1 = '')
{
    //Select administrator
    if ($_SESSION["Privilege"] == "admin") {
        #redirect if logged in only as admin
        header('Location:' . ADMIN_PATH . THIS_PAGE . "?act=edit");
        die;
    }
    $loadhead = '
	<script type="text/javascript" src="' . VIRTUAL_PATH . 'include/util.js"></script>
	<script type="text/javascript">
			function checkForm(thisForm)
			{//check form data for valid info
				if(empty(thisForm.AdminID,"Please Select an Administrator.")){return false;}