session_start(); //capture variables if (isset($_GET['curtain'])) { //the current curtain $curtain = $_GET['curtain']; if($curtain == 1) { if(isset($_POST['mapCustom'])) { //if something is clicked, it posts the new data here, which is inserted into the new checkbox $Map1_check = $_POST['Map1']; if($Map1_check == 1) {$Map1_check = "CHECKED";}else{$Map1_check = "";} $_SESSION['arr']['Map1'] = $Map1_check; $Map2_check = $_POST['Map2']; if($Map2_check == 1) {$Map2_check = "CHECKED";}else{$Map2_check = "";} $_SESSION['arr']['Map2'] = $Map2_check; $Map3_check = $_POST['Map3']; if($Map3_check == 1) {$Map3_check = "CHECKED";}else{$Map3_check = "";} $_SESSION['arr']['Map3'] = $Map3_check; $mapCustom_select = $_POST['mapCustom']; $_SESSION['arr']['mapCustom'] = $mapCustom_select; } else { //if there are no posts, retrieve the session values $Map1_check = $_SESSION['arr']['Map1']; $Map2_check = $_SESSION['arr']['Map2']; $Map3_check = $_SESSION['arr']['Map3']; $mapCustom_select = $_SESSION['arr']['mapCustom']; } } } else{ //if none then home screen $curtain = 0; } if (isset($_GET['sys'])) { //if there is a call to a system screen $sys = $_GET['sys']; } else{ //otherwise no system $sys = 0; } if(isset($_SESSION['arr'])) { //if there is an array session variable, take the query string and update values foreach($_GET as $key => $val) { foreach($_SESSION['arr'] as $session_key => $session_val) { if($key == $session_key){$_SESSION['arr'][$session_key] = $val;} } if($key == 'custom') { //if the user is passing in a custom map choice, it adds it to the list of active maps, unselects all checkboxes but the lists, and chooses that item from the list if(!in_array($val, $_SESSION['custom'])) { $_SESSION['custom'][] = $val; } $Map1_check = ""; $_SESSION['arr']['Map1'] = $Map1_check; $Map2_check = ""; $_SESSION['arr']['Map2'] = $Map2_check; $Map3_check = "CHECKED"; $_SESSION['arr']['Map3'] = $Map3_check; $mapCustom_select = $val; $_SESSION['arr']['mapCustom'] = $mapCustom_select; } } $key = 0; $val = 0; }else{ //otherwise create an array session variable $arr = array('map' => 0, 'places' => 0, 'people' => 0, 'system' => 0, 'Map1' => '', 'Map2' => '', 'Map3' => '', 'mapCustom' => '0'); $_SESSION['arr'] = $arr; $curtain = 0; //and load the home screen $sys = 35; } if(!isset($_SESSION['custom'])) { $custom_array = array(); $custom_array[] = '0'; $_SESSION['custom'] = $custom_array; } //set up colors $color_back = "#FFFFFF"; $color_1 = "#BEDFC4"; if($curtain == 1) $color_back = $color_1; $color_2 = "#D4ECFB"; if($curtain == 2) $color_back = $color_2; $color_3 = "#FFFDC3"; if($curtain == 3) $color_back = $color_3; //the contents of the page if nothing has been selected $home_screen = '
Welcome to the
NORTHGATE MALL InThAir® zone
Would you like to see today\'s sales? YES
'; //the custom options $aCustomMaps = array(); $aCustomMaps[0] = '----'; //base maps $aCustomMaps[1] = 'Althetic Shoes/Apparel'; //all 3 stores $aCustomMaps[2] = 'Sam'; //NO $aCustomMaps[3] = 'JCPenney'; //NO $aCustomMaps[4] = 'Bath and Body Works'; //NO $aCustomMaps[5] = 'Kirk'; //NO $aCustomMaps[6] = 'Bill'; //most maps made $aCustomMaps[7] = 'Foot Action'; //make all maps $aCustomMaps[8] = 'Alisha'; //yes (maybe) $aCustomMaps[9] = 'Doug'; //yes (maybe) $aCustomMaps[10] = 'Mary'; //yes //all the possible screens in the prototype are given a space in the curtains's arrays $aMap = array(); //an utter mess... creates the map screen, including javascript to set and check cookies for check boxes $aMap[0] = ''; $aMap[0] .= '| + |
| - |