require("util.php3"); DoTitle("Administration Functions - Add Location"); $sql = new MySQL_class; $sql->Create("churchil_demo"); /* If we've got any data handed in via CGI, then add the * new catagory to the database. Do some error checking * first though */ if ($NewLoc != "") { /* First check to make sure the user has included all * of the required variables. If not, gripe about it * and return them a page with the existing info filled * out already. */ $error = 0; $error += RequiredVar("Name",$Name); $error += RequiredVar("Address",$Addr1); $error += RequiredVar("City",$City); $error += RequiredVar("State",$State); $error += RequiredVar("Zipcde",$ZipCode); if ($error == 0) { $date = strftime("%Y-%m-%d",time()); $insert = "insert into Locations values (0,'" . AddSlashes($Name) . "', '" . AddSlashes($Addr1) . "', '" . AddSlashes($Addr2) . "', '" . AddSlashes($Addr3) . "', '" . AddSlashes($City) . "', '$State', '$ZipCode', '$Phone'," . "'$Fax', '" . AddSlashes($Notes) . "', '" . AddSlashes($Directions) . "', '$date')"; $sql->Insert($insert); echo("
Created new location: $Name\n"); echo("