Ejemplo n.º 1
0
//END CONFIG AREA ----------------------------------------------------------
# Read the value of 'action' whether it is passed via $_POST or $_GET with $_REQUEST
if (isset($_REQUEST['act'])) {
    $myAction = trim($_REQUEST['act']);
} else {
    $myAction = "";
}
switch ($myAction) {
    //check 'act' for type of process
    case "edit":
        //2) show first name change form
        editDisplay();
        break;
    case "update":
        //3) Change customer's first name
        updateExecute();
        break;
    default:
        //1)Select Customer from list
        selectFirst();
}
function selectFirst()
{
    //Select Customer
    global $config;
    $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.CustomerID,"Please Select a Customer.")){return false;}
				return true;//if all is passed, submit!
Ejemplo n.º 2
0
#session protected page - level is defined in $access var
# Read the value of 'action' whether it is passed via $_POST or $_GET with $_REQUEST
if (isset($_REQUEST['act'])) {
    $myAction = trim($_REQUEST['act']);
} 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>