session_start();
header("Cache-control: private"); //IE 6 Fix
$_SESSION['McMember_SpecialTitle'] = "Create 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'];
$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,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";
$FieldValues = "'$Unit','$HouseNumber','$BlockName','$Address1','$Address2','$City','$State','$Zip','$Country',";
$FieldValues = $FieldValues."'$Display1','$PT1','$AC1','$P1','$S1','$Display2','$PT2','$AC2','$P2','$S2','$Email',";
$FieldValues = $FieldValues."CURDATE(),$theMemId,$theOrgId";
$qVals = "INSERT INTO unit ($FieldNames) VALUES ($FieldValues)";
// echo $qVals;
$result = $connector->query("$qVals");
$theNewGrpId = mysql_insert_id();
$theGrpId = $theNewGrpId;
header("Location: ViewUnits.php");
}
?>