<?php require_once('../Connections/regentSelect.php'); ?>
<?php require_once('../Connections/regentAdmin.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
//redirect user if thier comp privilages are not yes
if (isset($_SESSION['comp_priv']) && $_SESSION['comp_priv']=='n'){
$insertGoTo = "indv_submissions.php";
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
header(sprintf("Location: %s", $insertGoTo));
}
// reset the error tracking array
$error = array();
// recordset retrieves customer information and assigns it to variables
$var1_getCustInfo = "0";
if (isset($_POST['realtor_id'])) {
$var1_getCustInfo = (get_magic_quotes_gpc()) ? $_POST['realtor_id'] : addslashes($_POST['realtor_id']);
}
mysql_select_db($database_regentAdmin, $regentAdmin);
$query_getCustInfo = sprintf("SELECT customer.idsCustomerID, customer.lngzCompanyID, customer.txtFirstName, customer.txtLastName, customer.lngzAccountStatus, customer.lngzPostID, customer.numHangers, customer.lngzPayment, customer.curSpecial, post.PostId, post.curAddCost FROM customer LEFT JOIN post ON customer.lngzPostID = post.PostID WHERE customer.idsCustomerID = '%s'", $var1_getCustInfo);
$getCustInfo = mysql_query($query_getCustInfo, $regentAdmin) or die(mysql_error());
$row_getCustInfo = mysql_fetch_assoc($getCustInfo);
$totalRows_getCustInfo = mysql_num_rows($getCustInfo);
$rltr_hangers = $row_getCustInfo['numHangers'];
$rltr_payment = $row_getCustInfo['lngzPayment'];
$rltr_special = $row_getCustInfo['curSpecial'];
$rltr_post = $row_getCustInfo['curAddCost'];
$rltr_status = $row_getCustInfo['lngzAccountStatus'];
// Recordset populates the customer drop down menu
$var1_getRealtors = "0";
if (isset($_SESSION['comp_id'])) {
$var1_getRealtors = (get_magic_quotes_gpc()) ? $_SESSION['comp_id'] : addslashes($_SESSION['comp_id']);
}
mysql_select_db($database_regentSelect, $regentSelect);
$query_getRealtors = sprintf("SELECT customer.idsCustomerID,CONCAT( customer.txtLastName, ', ', customer.txtFirstName) AS Realtor FROM customer WHERE customer.lngzAccountStatus = 1 AND customer.blnErequest = 0 AND customer.lngzCompanyID = %s ORDER BY customer.txtLastName, customer.txtFirstName", $var1_getRealtors);
$getRealtors = mysql_query($query_getRealtors, $regentSelect) or die(mysql_error());
$row_getRealtors = mysql_fetch_assoc($getRealtors);
$totalRows_getRealtors = mysql_num_rows($getRealtors);
// validate form input
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
// assign user id value from session variable
$_POST['user_id'] = intval($_SESSION['user_id']);
// check to ensure realtor is selected
if (empty($_POST['realtor_id'])) {
$error['realtor'] = 'Please select a Realtor for the Record';
}
// check to ensure service is selected
if (empty($_POST['service_id'])) {
$error['service_blank'] = 'Please select a service for the Record';
}
// check to ensure zone is selected
if (empty($_POST['zone'])) {
$error['zone_blank'] = 'Please select a zone for the Record';
}
//check for valid date format
$pattern = '((0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/](19|20)\d\d)';
if (!preg_match($pattern, trim($_POST['dt_service']))) {
$error['date'] = 'Please enter a valid date. Format: dd/mm/yyyy';
} else {
$dt_exp = explode("/", $_POST['dt_service']);
$d = $dt_exp[0];
$m = $dt_exp[1];
$y = $dt_exp[2];
$_POST['dt_service'] = $y.'-'.$m.'-'.$d;
}
// check to make sure there are no post dated ups or fixes
$entry_date = trim($_POST['dt_service']);
$tmrw_date = trim(date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")+1, date("y"))));
if (isset($_POST['service_id']) && $_POST['service_id']==1){
if ($entry_date != $tmrw_date){
$error['post_up'] = "Regent Signs does not accept post dated UP requests. Please change the service date to tommorow.";
}
}elseif (isset($_POST['service_id']) && $_POST['service_id']==3){
if ($entry_date != $tmrw_date){
$error['post_up'] = "Regent Signs does not accept post dated FIX requests. Please change the service date to tommorow.";
}
}elseif (isset($_POST['service_id']) && $_POST['service_id']==4){
if ($entry_date != $tmrw_date){
$error['post_up'] = "Regent Signs does not accept post dated CONDO UP requests. Please change the service date to tommorow.";
}
}
// check for valid address format
$pattern = '((^([1-9]([0-9]*)[,][\s])(([1-9]([0-9]*))(([-]([1-9]([0-9]*))|([\s][a-z-A-Z\s]*)))))|((^([1-9]([0-9]*))(([-]([1-9]([0-9]*))|([\s][a-z-A-Z\s]*)))))([\s]([a-z-A-Z\s]*)$))';
if (!preg_match($pattern, trim($_POST['address']))) {
$error['address'] = 'Please enter a valid Address';
}
//quadrant value evaluation
if ($_POST['quadrant'] == 2){
$_POST['address'] = $_POST['address']." SW";
}
// assigne the entry date value
$_POST['dt_enter'] = date('Y-m-d');
// use the service field to assign the status value
if ($_POST['service_id']==1){
$_POST['status'] = true;
}else{
$_POST['status'] = false;
}
// use the service value and city value to calculate the Regent Service value equivilant
$service_flg = false;
if ($_POST['service_id']==1 && $service_flg == false){
if ($_POST['city']<4){
$_POST['service_id'] = 1;
$service_flg = true;
}elseif ($_POST['city']==7){
$_POST['service_id'] = 3;
$service_flg = true;
}elseif ($_POST['city']>3 && $service_flg == false){
$_POST['service_id'] = 2;
$service_flg = true;
}
}elseif ($_POST['service_id']==2 && $service_flg == false){
if ($_POST['city']<4){
$_POST['service_id'] = 8;
$service_flg = true;
}elseif ($_POST['city']==7){
$_POST['service_id'] = 10;
$service_flg = true;
}elseif ($_POST['city']>3 && $service_flg == false){
$_POST['service_id'] = 9;
$service_flg = true;
}
}elseif ($_POST['service_id']==3 && $service_flg == false){
if ($_POST['city']<4){
$_POST['service_id'] = 15;
$service_flg = true;
}elseif ($_POST['city']==7){
$_POST['service_id'] = 17;
$service_flg = true;
}elseif ($_POST['city']>3 && $service_flg == false){
$_POST['service_id'] = 16;
$service_flg = true;
}
}elseif ($_POST['service_id']==4 && $service_flg == false){
$_POST['service_id'] = 43;
$service_flg = true;
}elseif ($_POST['service_id']==5 && $service_flg == false){
$_POST['service_id'] = 44;
$service_flg = true;
}else{
$error['service'] = 'Invalid Service Codes';
}
// recordset for obtaining the service amount
if (isset($_POST['service_id'])) {
$var1_getService = (get_magic_quotes_gpc()) ? $_POST['service_id'] : addslashes($_POST['service_id']);
}
mysql_select_db($database_regentAdmin, $regentAdmin);
$query_getService = sprintf("SELECT service.ServiceId, service.Amount FROM service WHERE service.ServiceId = %s", $var1_getService);
$getService = mysql_query($query_getService, $regentAdmin) or die(mysql_error());
$row_getService = mysql_fetch_assoc($getService);
$totalRows_getService = mysql_num_rows($getService);
// use the listers value to calculate the co-listing and co_value values
if ($_POST['listers']>1){
$_POST['co_listing'] = '1';
$_POST['co_value'] = "0.5";
}else{
$_POST['co_listing'] = '0';
$_POST['co_value'] = "";
}
// use the customer info table, service, listers, and signs fields to calculate the amount and price values
// This calculation must occure after the service id has been changed to the Regent Service ID
if($rltr_status==1){
if ($rltr_payment==1){
if ($_POST['service_id'] == (1||2||3)){
$_POST['amount'] = (($row_getService['Amount']+$rltr_post)/$_POST['listers'])+($rltr_hangers*0.5)+($rltr_special);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (8||9||10)){
$_POST['amount'] = ($row_getService['Amount']/$_POST['listers']);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (15||16||17)){
$_POST['amount'] = ($row_getService['Amount']/$_POST['listers']);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (43||44)){
$_POST['amount'] = ($row_getService['Amount']/$_POST['listers']);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}else{
$error['service_amount'] = "There is an error with the service conditions, please contact Regent Signs";
}
}elseif($rltr_payment==2){
if ($_POST['service_id'] == (1||2||3)){
$_POST['amount'] = ((($row_getService['Amount']+$rltr_post)*2)/$_POST['listers'])+($rltr_hangers*0.5)+($rltr_special);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (8||9||10)){
$_POST['amount'] = 0;
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (15||16||17)){
$_POST['amount'] = ($row_getService['Amount']/$_POST['listers']);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}elseif ($_POST['service_id'] == (43||44)){
$_POST['amount'] = ($row_getService['Amount']/$_POST['listers']);
$_POST['price'] = ($_POST['amount']*$_POST['signs']);
}else{
$error['service_amount'] = "There is an error with the service conditions, please contact Regent Signs";
}
}else{
$error['service_value'] = "There is an error with the service calculation, please contact Regent Signs";
}
}else{
$error['status'] = "The selected customer's account has been flagged, please contact Regent Signs";
}
// determine whether or not there is a pruchase associated with this listing
$_POST['purch_id'] = '1';
// use the city value to place appropriate city code at the beginning of the instructions field
if (!$error) {
if ($_POST['city'] == 2){
$_POST['instructions'] = 'ShPk ' . $_POST['instructions'];
}elseif ($_POST['city'] == 3){
$_POST['instructions'] = 'StAb ' . $_POST['instructions'];
}elseif ($_POST['city'] == 4){
$_POST['instructions'] = 'StPl ' . $_POST['instructions'];
}elseif ($_POST['city'] == 5){
$_POST['instructions'] = 'SpGr ' . $_POST['instructions'];
}elseif ($_POST['city'] == 6){
$_POST['instructions'] = 'Beaumont ' . $_POST['instructions'];
}elseif ($_POST['city'] == 7){
$_POST['instructions'] = 'Leduc ' . $_POST['instructions'];
}elseif ($_POST['city'] == 8){
$_POST['instructions'] = 'FtSk ' . $_POST['instructions'];
}elseif ($_POST['city'] == 9){
$_POST['instructions'] = 'Devon ' . $_POST['instructions'];
}
}
mysql_free_result($getService);
}
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
// wraps entire insert record behavior in a conditional stament based on whether the $error array is empty
if (!$error) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "residential")) {
$insertSQL = sprintf("INSERT INTO residential (user_id, dt_enter, dt_service, cust_id, service_id, address, quadrant, city, vendor, `zone`, listers, signs, co_listing, co_value, status, instructions, hanger1, hanger2, hanger3, topper, amount, price) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['user_id'], "int"),
GetSQLValueString($_POST['dt_enter'], "date"),
GetSQLValueString($_POST['dt_service'], "date"),
GetSQLValueString($_POST['realtor_id'], "int"),
GetSQLValueString($_POST['service_id'], "int"),
GetSQLValueString($_POST['address'], "text"),
GetSQLValueString($_POST['quadrant'], "int"),
GetSQLValueString($_POST['city'], "int"),
GetSQLValueString($_POST['vendor'], "text"),
GetSQLValueString($_POST['zone'], "int"),
GetSQLValueString($_POST['listers'], "int"),
GetSQLValueString($_POST['signs'], "int"),
GetSQLValueString($_POST['co_listing'], "int"),
GetSQLValueString($_POST['co_value'], "text"),
GetSQLValueString($_POST['status'], "int"),
GetSQLValueString($_POST['instructions'], "text"),
GetSQLValueString($_POST['hanger1'], "text"),
GetSQLValueString($_POST['hanger2'], "text"),
GetSQLValueString($_POST['hanger3'], "text"),
GetSQLValueString($_POST['topper'], "text"),
GetSQLValueString($_POST['amount'], "double"),
GetSQLValueString($_POST['price'], "double"));
mysql_select_db($database_regentAdmin, $regentAdmin)
or die("can't connect to database");
$Result1 = mysql_query($insertSQL, $regentAdmin);
// assign a session tracking variable when record is inserted
if ($Result1 === TRUE){
echo "test has been passed";
$_SESSION['success'] = 1;
$_SESSION['rltr_firstName'] = $row_getCustInfo['txtFirstName'];
$_SESSION['rltr_familyName'] = $row_getCustInfo['txtLastName'];
$_SESSION['address'] = $_POST['address'];
echo 'click <a href="comp_submissions.php"> here </a>to go to the next page';
}else{
echo "problem writing to database ". mysql_error() ;
}
$insertGoTo = "comp_submissions.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
// if the record has been inserted, clear the POST array
$_POST = array();
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>E-Request Office Manager Submisions</title>
<link href="../styles/admin_erequest.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="titlebar">
<div id="tpmenu"> <a href="../index.php">HOME</a>
<a href="er_menu.php">MENU</a> </div>
</div>
<div id="content">
<h1>COMPANY E-REQUEST FORM</h1>
<?php if (!empty($_SESSION['username'])){ echo '<p><span class="radioLabel">Welcome, '.$_SESSION['first_name'].' '.$_SESSION['family_name'].'</span> '; } ?></p>
<p><span class="radioLabel">DATE:</span> <?php echo date('d/m/Y g:i A'); ?></p>
<p id="terms"> Only entries <strong>BEFORE</strong> 1:00 PM will be eligable for "Next Day Service."</p>
<?php
// display alerts that were created during user input validation
if ($error) {
echo '<ul>';
foreach ($error as $alert) {
echo "<li class='warning'>$alert</li>\n";
}
echo '</ul>';
}
?><br />
<?php
// uses the return value of the insert query function to display a success or error message.
if(isset($_SESSION['success']) && $_SESSION['success'] == 1){
echo "<p class='success'><strong>The following record was sucessfully submitted:</strong></p><p class='success'>REALTOR: ".$_SESSION['rltr_firstName']." ".$_SESSION['rltr_familyName']."<br />ADDRESS: ".$_SESSION['address']."</p>";
}elseif(isset($_SESSION['success']) && $_SESSION['success'] != 1){
echo "<p class='success'>Record submission failed. Please try again.<br />If problem persits, contact the Regent Signs office.</p>";
}
?>
<form action="<?php echo $editFormAction; ?>" id="residential" name="residential" method="POST">
<p id="terms"> Click on the column heading to recieve help on how to submit your listing. </p>
<table width="100%" align="center" id="striped">
<label><tr>
<th scope="col"><a href="../help/help.php#help_service_date" target="_blank">Service Date<br />
(dd/mm/yyyy)</a></th>
<th id="form" scope="col"><a href="../help/help.php#help_realtor" target="_blank">Realtor</a></th>
<th scope="col"><a href="../help/help.php#help_service" target="_blank">Service</a></th>
<th scope="col"><a href="../help/help.php#help_address" target="_blank">Address</a></th>
<th scope="col"><a href="../help/help.php#help_quadrant" target="_blank">Qdnt</a></th>
<th scope="col"><a href="../help/help.php#help_city" target="_blank">City</a></th>
<th scope="col"><a href="../help/help.php#help_vendor" target="_blank">Vendor</a></th>
<th scope="col"><a href="../help/help.php#help_mls" target="_blank">MLS Zone</a></th>
<th scope="col"><a href="../help/help.php#help_listers" target="_blank">Listers</a></th>
<th scope="col"><a href="../help/help.php#help_signs" target="_blank">Signs</a></th>
</tr></label>
<tr>
<td><div align="center">
<input name="dt_service" type="text" id="dt_service" value="<?php $tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("y")); echo date('d/m/Y', $tomorrow); ?>" size="15" maxlength="10" />
</div></td>
<td><div align="center">
<select name="realtor_id" class="mediumbox" id="realtor_id">
<option value=""></option>
<?php
do {
?><option value="<?php echo $row_getRealtors['idsCustomerID']?>"<?php if (isset($_POST['realtor_id']) && $_POST['realtor_id']==($row_getRealtors['idsCustomerID'])){echo ' selected="selected"' ;} ?>><?php echo $row_getRealtors['Realtor']?></option>
<?php
} while ($row_getRealtors = mysql_fetch_assoc($getRealtors));
$rows = mysql_num_rows($getRealtors);
if($rows > 0) {
mysql_data_seek($getRealtors, 0);
$row_getRealtors = mysql_fetch_assoc($getRealtors);
}
?>
</select>
</div></td>
<td>
<div align="center">
<select name="service_id" id="service_id">
<option value=""></option>
<option value="1"<?php if (empty($_POST)){ echo ' selected="selected"' ;}elseif (isset($_POST['service_id']) && $_POST['service_id'] == 1 || $_POST['service_id'] == 2 || $_POST['service_id'] == 3){echo ' selected="selected"' ;} ?>>Up</option>
<option value="2"<?php if (empty($_POST)){}elseif (isset($_POST['service_id']) && $_POST['service_id'] == 8 || $_POST['service_id'] == 9 || $_POST['service_id'] == 10){echo ' selected="selected"' ;} ?>>Down</option>
<option value="3"<?php if (empty($_POST)){}elseif (isset($_POST['service_id']) && $_POST['service_id'] == 15 || $_POST['service_id'] == 16 || $_POST['service_id'] == 17){echo ' selected="selected"' ;} ?>>Fix</option>
<option value="4"<?php if (empty($_POST)){}elseif (isset($_POST['service_id']) && $_POST['service_id']==43){echo ' selected="selected"' ;} ?>>Cnd Up</option>
<option value="5"<?php if (empty($_POST)){}elseif (isset($_POST['service_id']) && $_POST['service_id']==44){echo ' selected="selected"' ;} ?>>Cnd Down</option>
</select>
</div></td>
<td>
<div align="center">
<input value="<?php
if (isset($_POST['address'])){
if (isset($_POST['quadrant']) && $_POST['quadrant']==1){
echo $_POST['address'];
}elseif (isset($_POST['quadrant']) && $_POST['quadrant']==2){
$str_address = str_replace(" SW", "", $_POST['address']);
echo $str_address;
}else{
echo $_POST['address'];
}
}
?>" name="address" type="text" id="address" maxlength="30" />
</div></td>
<td><select name="quadrant" id="quadrant">
<option value="1" <?php if (isset($_POST['quadrant']) && $_POST['quadrant']==1){echo ' selected="selected"' ;}else{echo ' selected="selected"' ;} ?>>NW</option>
<option value="2" <?php if (isset($_POST['quadrant']) && $_POST['quadrant']==2){echo ' selected="selected"' ;} ?>>SW</option>
</select>
</td>
<td>
<div align="center">
<select name="city" id="city">
<option value=""></option>
<option value="6"<?php if (isset($_POST['city']) && $_POST['city']==6){echo ' selected="selected"' ;} ?>>Beaumont</option>
<option value="9"<?php if (isset($_POST['city']) && $_POST['city']==9){echo ' selected="selected"' ;} ?>>Devon</option>
<option value="1"<?php if (empty($_POST)){ echo ' selected="selected"' ;}elseif (isset($_POST['city']) && $_POST['city']==1){echo ' selected="selected"' ;} ?>>Edmonton</option>
<option value="8"<?php if (isset($_POST['city']) && $_POST['city']==8){echo ' selected="selected"' ;} ?>>Ft. Saskatchewan</option>
<option value="7"<?php if (isset($_POST['city']) && $_POST['city']==7){echo ' selected="selected"' ;} ?>>Leduc</option>
<option value="2"<?php if (isset($_POST['city']) && $_POST['city']==2){echo ' selected="selected"' ;} ?>>Sherwood Park</option>
<option value="5"<?php if (isset($_POST['city']) && $_POST['city']==5){echo ' selected="selected"' ;} ?>>Spruce Grove</option>
<option value="3"<?php if (isset($_POST['city']) && $_POST['city']==3){echo ' selected="selected"' ;} ?>>St. Albert</option>
<option value="4"<?php if (isset($_POST['city']) && $_POST['city']==4){echo ' selected="selected"' ;} ?>>Stony Plain</option>
</select>
</div></td>
<td> <div align="center">
<input value="<?php if (isset($_POST['vendor'])){
echo $_POST['vendor'];} ?>" name="vendor" type="text" id="vendor" maxlength="30" />
</div></td>
<td>
<div align="center">
<select name="zone" id="zone">
<option value=""></option>
<option value="1"<?php if (isset($_POST['zone']) && $_POST['zone']==1){echo ' selected="selected"' ;} ?>>1 Edm</option>
<option value="2"<?php if (isset($_POST['zone']) && $_POST['zone']==2){echo ' selected="selected"' ;} ?>>2 Edm</option>
<option value="3"<?php if (isset($_POST['zone']) && $_POST['zone']==3){echo ' selected="selected"' ;} ?>>3 Edm</option>
<option value="4"<?php if (isset($_POST['zone']) && $_POST['zone']==4){echo ' selected="selected"' ;} ?>>4 Edm</option>
<option value="5"<?php if (isset($_POST['zone']) && $_POST['zone']==5){echo ' selected="selected"' ;} ?>>5 Edm</option>
<option value="6"<?php if (isset($_POST['zone']) && $_POST['zone']==6){echo ' selected="selected"' ;} ?>>6 Edm</option>
<option value="7"<?php if (isset($_POST['zone']) && $_POST['zone']==7){echo ' selected="selected"' ;} ?>>7 Edm</option>
<option value="8"<?php if (isset($_POST['zone']) && $_POST['zone']==8){echo ' selected="selected"' ;} ?>>8 Edm</option>
<option value="9"<?php if (isset($_POST['zone']) && $_POST['zone']==9){echo ' selected="selected"' ;} ?>>9 Edm</option>
<option value="10"<?php if (isset($_POST['zone']) && $_POST['zone']==10){echo ' selected="selected"' ;} ?>>10 Edm</option>
<option value="11"<?php if (isset($_POST['zone']) && $_POST['zone']==11){echo ' selected="selected"' ;} ?>>11 Edm</option>
<option value="12"<?php if (isset($_POST['zone']) && $_POST['zone']==12){echo ' selected="selected"' ;} ?>>12 Edm</option>
<option value="13"<?php if (isset($_POST['zone']) && $_POST['zone']==13){echo ' selected="selected"' ;} ?>>13 Edm</option>
<option value="14"<?php if (isset($_POST['zone']) && $_POST['zone']==14){echo ' selected="selected"' ;} ?>>14 Edm</option>
<option value="15"<?php if (isset($_POST['zone']) && $_POST['zone']==15){echo ' selected="selected"' ;} ?>>15 Edm</option>
<option value="16"<?php if (isset($_POST['zone']) && $_POST['zone']==16){echo ' selected="selected"' ;} ?>>16 Edm</option>
<option value="17"<?php if (isset($_POST['zone']) && $_POST['zone']==17){echo ' selected="selected"' ;} ?>>17 Edm</option>
<option value="18"<?php if (isset($_POST['zone']) && $_POST['zone']==18){echo ' selected="selected"' ;} ?>>18 Edm</option>
<option value="19"<?php if (isset($_POST['zone']) && $_POST['zone']==19){echo ' selected="selected"' ;} ?>>19 Edm</option>
<option value="20"<?php if (isset($_POST['zone']) && $_POST['zone']==20){echo ' selected="selected"' ;} ?>>20 Edm</option>
<option value="21"<?php if (isset($_POST['zone']) && $_POST['zone']==21){echo ' selected="selected"' ;} ?>>21 Edm</option>
<option value="22"<?php if (isset($_POST['zone']) && $_POST['zone']==22){echo ' selected="selected"' ;} ?>>22 Edm</option>
<option value="23"<?php if (isset($_POST['zone']) && $_POST['zone']==23){echo ' selected="selected"' ;} ?>>23 Edm</option>
<option value="24"<?php if (isset($_POST['zone']) && $_POST['zone']==24){echo ' selected="selected"' ;} ?>>24 St. Albert</option>
<option value="25"<?php if (isset($_POST['zone']) && $_POST['zone']==25){echo ' selected="selected"' ;} ?>>25 Sher Park</option>
<option value="26"<?php if (isset($_POST['zone']) && $_POST['zone']==26){echo ' selected="selected"' ;} ?>>26 Edm</option>
<option value="27"<?php if (isset($_POST['zone']) && $_POST['zone']==27){echo ' selected="selected"' ;} ?>>27 Edm</option>
<option value="28"<?php if (isset($_POST['zone']) && $_POST['zone']==28){echo ' selected="selected"' ;} ?>>28 Edm</option>
<option value="29"<?php if (isset($_POST['zone']) && $_POST['zone']==29){echo ' selected="selected"' ;} ?>>29 Edm</option>
<option value="30"<?php if (isset($_POST['zone']) && $_POST['zone']==30){echo ' selected="selected"' ;} ?>>30 Edm</option>
<option value="35"<?php if (isset($_POST['zone']) && $_POST['zone']==35){echo ' selected="selected"' ;} ?>>35 Edm</option>
<option value="40"<?php if (isset($_POST['zone']) && $_POST['zone']==40){echo ' selected="selected"' ;} ?>>40 Edm</option>
<option value="41"<?php if (isset($_POST['zone']) && $_POST['zone']==41){echo ' selected="selected"' ;} ?>>41 Edm</option>
<option value="42"<?php if (isset($_POST['zone']) && $_POST['zone']==42){echo ' selected="selected"' ;} ?>>42 Edm</option>
<option value="50"<?php if (isset($_POST['zone']) && $_POST['zone']==50){echo ' selected="selected"' ;} ?>>50 Edm</option>
<option value="51"<?php if (isset($_POST['zone']) && $_POST['zone']==51){echo ' selected="selected"' ;} ?>>51 Edm</option>
<option value="52"<?php if (isset($_POST['zone']) && $_POST['zone']==52){echo ' selected="selected"' ;} ?>>52 Edm</option>
<option value="53"<?php if (isset($_POST['zone']) && $_POST['zone']==53){echo ' selected="selected"' ;} ?>>53 Edm</option>
<option value="54"<?php if (isset($_POST['zone']) && $_POST['zone']==54){echo ' selected="selected"' ;} ?>>54 Edm</option>
<option value="55"<?php if (isset($_POST['zone']) && $_POST['zone']==55){echo ' selected="selected"' ;} ?>>55 Edm</option>
<option value="56"<?php if (isset($_POST['zone']) && $_POST['zone']==56){echo ' selected="selected"' ;} ?>>56 Edm</option>
<option value="57"<?php if (isset($_POST['zone']) && $_POST['zone']==57){echo ' selected="selected"' ;} ?>>57 Edm</option>
<option value="58"<?php if (isset($_POST['zone']) && $_POST['zone']==58){echo ' selected="selected"' ;} ?>>58 Edm</option>
<option value="59"<?php if (isset($_POST['zone']) && $_POST['zone']==59){echo ' selected="selected"' ;} ?>>59 Edm</option>
<option value="62"<?php if (isset($_POST['zone']) && $_POST['zone']==62){echo ' selected="selected"' ;} ?>>62 Ft. Sask</option>
<option value="81"<?php if (isset($_POST['zone']) && $_POST['zone']==81){echo ' selected="selected"' ;} ?>>81 Leduc</option>
<option value="82"<?php if (isset($_POST['zone']) && $_POST['zone']==82){echo ' selected="selected"' ;} ?>>82 Beaumont</option>
<option value="91"<?php if (isset($_POST['zone']) && $_POST['zone']==91){echo ' selected="selected"' ;} ?>>91 Sp. Grove</option>
<option value="91"<?php if (isset($_POST['zone']) && $_POST['zone']==91){echo ' selected="selected"' ;} ?>>91 St. Plain</option>
<option value="92"<?php if (isset($_POST['zone']) && $_POST['zone']==92){echo ' selected="selected"' ;} ?>>92 Devon</option>
</select>
</div></td>
<td> <div align="center">
<input name="listers" type="text" id="listers" value="<?php if (isset($_POST['listers'])){
echo $_POST['listers'];}else{ echo '1'; } ?>" size="4" maxlength="1" />
</div></td>
<td> <div align="center">
<input name="signs" type="text" id="signs" value="<?php if (isset($_POST['signs'])){
echo $_POST['signs'];}else{ echo '1'; } ?>" size="4" />
</div></td>
</tr>
</table>
<p><label id="blueLable"><a href="../help/help.php#help_instructions" target="_blank">Instructions:</a></label>
<input value="<?php if (isset($_POST['instructions'])){
echo $_POST['instructions'];} ?>" name="instructions" type="text" class="widebox" id="instructions" maxlength="60" />
</p>
<p>
<label id="blueLable"><a href="../help/help.php#help_hangers" target="_blank">Hanger 1:</a></label>
<input value="<?php if (isset($_POST['hanger1'])){
echo $_POST['hanger1'];} ?>" name="hanger1" type="text" class="mediumbox" id="hanger1" />
<label id="blueLable"><a href="../help/help.php#help_hangers" target="_blank">Hanger 2:</a></label>
<input value="<?php if (isset($_POST['hanger2'])){
echo $_POST['hanger2'];} ?>" name="hanger2" type="text" class="mediumbox" id="hanger2" />
<label id="blueLable"><a href="../help/help.php#help_hangers" target="_blank">Hanger 3:</a></label>
<input value="<?php if (isset($_POST['hanger3'])){
echo $_POST['hanger3'];} ?>" name="hanger3" type="text" class="mediumbox" id="hanger3" />
</p>
<p>
<label id="blueLable"><a href="../help/help.php#help_toppers" target="_blank">Topper:</a></label>
<input value="<?php if (isset($_POST['topper'])){
echo $_POST['topper'];} ?>" name="topper" type="text" class="mediumbox" id="topper" />
</p>
<p id="terms"><strong>NOTE:</strong> All hangers and toppers are in addition to the default hangers in your "Customer Preferences" and will be custome made at $9.00 per hanger / topper. <br />
Follow the column heading links for more information </p>
<p>
<input name="insert" type="submit" id="insert" value="Insert Record" />
<input name="co_value" type="hidden" id="co_value" />
<input name="co_listing" type="hidden" id="co_listing" />
<input name="status" type="hidden" id="status" />
<input name="amount" type="hidden" id="amount" />
<input name="price" type="hidden" id="price" />
<input name="user_id" type="hidden" id="user_id" value="<?php echo $_SESSION['user_id']; ?>" />
<input name="dt_enter" type="hidden" id="dt_enter" />
</p>
<input type="hidden" name="MM_insert" value="residential">
</form>
<p>Click <?php if ($_SESSION['comp_priv']=='y'){
echo "<a href='comp_daily_log.php'>HERE</a>";
}else{
echo "<a href='indv_daily_log.php'>HERE</a>";
}
?> to see a list of all confirmed entries for today </p>
<p> </p>
<p><span class="radioLabel"><a href="../help/help.php#help_terms">REVIEW</a> THE REGENT SIGNS E-REQUEST TERMS AND CONDITIONS: </span></p>
</div>
</div>
<?php
echo "<pre>";
echo "Sessions <br/>";
print_r($_SESSION);
echo "Cookies<br/>";
print_r($_COOKIE);
echo "</pre>";
?>
</body>
</html>
<?php
mysql_free_result($getRealtors);
mysql_free_result($getCustInfo);
?>