session_start();
header("Cache-control: private"); //IE 6 Fix
$_SESSION['McMember_SpecialTitle'] = "Edit Unit";
// Gets rid of all the error reporting on servers which are not configured appropriately.
error_reporting(E_ALL ^ E_NOTICE);
// Get the PHP file containing the DbConnector class
require_once('../DbConnector.php');
// Create an instance of DbConnector
$connector = new DbConnector();
$theOrgId = $_SESSION['McMember_OrgId'];
$theMemId = $_SESSION['McMember_MemId'];
$thehiddenSubmitter = $_POST['hiddensubmitter'];
$UnitId = $_POST['UnitId'];
$Unit=$_POST['Unit'];
$HouseNumber=$_POST['HouseNumber'];
$BlockName=$_POST['BlockName'];
$Email = $_POST['Email'];
$Address1 = $_POST['Address1'];
$Address2 = $_POST['Address2'];
$City = $_POST['City'];
$State = $_POST['State'];
$Zip = $_POST['Zip'];
$Country = $_POST['Country'];
$AC1 = $_POST['AC'];
$P1 = $_POST['PF'];
$S1 = $_POST['SF'];
$PT1 = $_POST['PT1'];
$Display1 = $AC1."-".$P1."-".$S1;
$AC2 = $_POST['AC2'];
$P2 = $_POST['PF2'];
$S2 = $_POST['SF2'];
$PT2 = $_POST['PT2'];
$Display2 = $AC2."-".$P2."-".$S2;
If ($thehiddenSubmitter == "pookachoo"){
$FieldNames = "Name='$Unit',HouseNumber='$HouseNumber',BlockName='$BlockName'";
$FieldNames = $FieldNames.",Address1='$Address1',Address2='$Address2',City='$City',State='$State',Zip='$Zip',Country='$Country'";
$FieldNames = $FieldNames.",Phone1='$Display1',Phone1Type='$PT1',Phone1AC='$AC1',Phone1P='$P1',Phone1S='$S1'";
$FieldNames = $FieldNames.",Phone2='$Display2',Phone2Type='$PT2',Phone2AC='$AC2',Phone2P='$P2',Phone2S='$S2'";
$FieldNames = $FieldNames.",Email='$Email'";
$qVals = "UPDATE unit SET $FieldNames WHERE UnitId=".$UnitId;
// echo $qVals;
$result = $connector->query("$qVals");
echo '';
}
?>
if(isset($_GET['ID'])){
$theUnitId = $_GET['ID'];
}
$FieldNames = "Name,HouseNumber,BlockName,Address1,Address2,City,State,Zip,Country,";
$FieldNames = $FieldNames."Phone1,Phone1Type,Phone1AC,Phone1P,Phone1S,";
$FieldNames = $FieldNames."Phone2,Phone2Type,Phone2AC,Phone2P,Phone2S,";
$FieldNames = $FieldNames."Email,CreateDate,CreatedBy,OrgId";
$qVals = "SELECT * FROM unit WHERE UnitId=".$theUnitId;
$result = $connector->query("$qVals");
$row = mysql_fetch_array($result);
?>
?>