public static function getInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }
$passwordIsValid = false; } /** Check whether the boolean values show that the input data was validated successfully. * If the data was validated successfully, add it as a new entry in the "wishers" database. * After adding the new entry, close the connection and redirect the application to editWishList.php. */ if (!$userIsEmpty && $userNameIsUnique && $accountEmailIsValid && $businessNameIsUnique && $BusinessAccountEmailIsUnique && $UserAccountEmailIsUnique && !$passwordIsEmpty && !$password2IsEmpty && $passwordIsValid) { $hash = md5(rand(0, 1000)); if (isset($_POST['isBusiness'])) { BusinessDB::getInstance()->create_business($_POST["user"], $email, $_POST["password"], $hash); $link = "verifyBusiness.php?email="; echo $link; } else { if (!isset($_POST['isBusiness'])) { echo $email; BusinessDB::getInstance()->create_user($_POST["user"], $email, $_POST["password"], $hash); $link = "verifyUser.php?email="; echo $link; } } echo $email; $from = "Earthbird <*****@*****.**>"; $to = $email; $subject = "Earthbird Verification"; $body = ' Thanks for signing up! Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below. ------------------------ Username: '******'user'] . '
echo time(); ?> " /> <title></title> </head> <body> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $phoneFull = BusinessDB::getInstance()->format_phone_for_sql($_POST["phoneFull"]); $area_code = $phoneFull[0]; $exchange_code = $phoneFull[1]; $line_number = $phoneFull[2]; $business = array("id" => $_POST["businessID"], "owner_name" => $_POST["ownerName"], "address" => $_POST["address"], "city" => $_POST["city"], "state" => $_POST["state"], "postal_code" => $_POST["postalCode"], "email" => $_POST["email"], "area_code" => $area_code, "exchange_code" => $exchange_code, "line_number" => $line_number, "extension" => $_POST["extension"], "website" => $_POST["website"], "goal" => $_POST["goal"], "work_type" => $_POST["workType"], "positions_open" => $_POST["positionsOpen"], "compensated_experience" => $_POST["compensatedExperience"], "hours_needed" => $_POST["hoursNeeded"], "begin_month" => $_POST['beginMonth'], "end_month" => $_POST['endMonth'], "other_information" => $_POST["otherInformation"]); } else { if (array_key_exists("businessID", $_GET)) { $business = mysqli_fetch_array(BusinessDB::getInstance()->get_businesses_by_business_id($_GET["businessID"])); } else { $business = array("owner_name" => "", "address" => "", "city" => "", "state" => "", "postal_code" => "", "email" => "", "phoneFull" => "", "extension" => "", "website" => "", "goal" => "", "work_type" => "", "positions_open" => "", "compensated_experience" => "", "hours_needed" => "", "begin_month" => "", "end_month" => "", "other_information" => ""); } } ?> <form name="editBusiness" action="editBusiness.php" method="POST"> <input type="hidden" name="businessID" value="<?php echo $business["id"]; ?> " /> Name of Owner: <input type="text" name="ownerName" value="<?php echo $business['owner_name']; ?> "/><br/>
--> <?php require_once "C:\\xampp\\htdocs\\BusinessDatabase\\Includes\\dp.php"; ?> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php if (isset($_GET['email']) && !empty($_GET['email']) and isset($_GET['hash']) && !empty($_GET['hash'])) { // Verify data $email = mysql_escape_string($_GET['email']); // Set email variable $hash = mysql_escape_string($_GET['hash']); // Set hash variable } $search = BusinessDB::getInstance()->check_user_hash($email, $hash); $match = mysqli_num_rows($search); if ($match > 0) { echo "Success! Your account has been verified! You may now login!"; $updateAccount = BusinessDB::getInstance()->update_user_account($email, $hash); } else { echo "Failed! Invalid URL or account has already been activated!"; } ?> </body> </html>
<th>Address</th> <th>Email Address</th> <th>Phone Number</th> <th>Website</th> <th>Goal</th> <th>Work Type</th> <th>Available Positions</th> <th>Compensated Experience</th> <th>Hours Needed</th> <th>Beginning Month</th> <th>Ending Month</th> <th>Other Information</th> </tr> <?php $result = BusinessDB::getInstance()->get_businesses_by_business_id($businessID); while ($row = mysqli_fetch_array($result)) { echo "<tr><td>" . htmlentities($row["name"]) . "</td>"; echo "<td>" . htmlentities($row["owner_name"]) . "</td>"; echo "<td>" . htmlentities($row[2] . " " . $row[3] . " " . $row[4] . " " . $row[5]) . "</td>"; echo "<td>" . htmlentities($row["email"]) . "</td>"; echo "<td>" . htmlentities("(" . $row[7] . ") " . $row[8] . " - " . $row[9] . " Ext. " . $row[10]) . "</td>"; echo "<td>" . htmlentities($row["website"]) . "</td>"; echo "<td>" . htmlentities($row["goal"]) . "</td>"; echo "<td>" . htmlentities($row["work_type"]) . "</td>"; echo "<td>" . htmlentities($row["positions_open"]) . "</td>"; echo "<td>" . htmlentities($row["compensated_experience"]) . "</td>"; echo "<td>" . htmlentities($row["hours_needed"]) . "</td>"; echo "<td>" . htmlentities($row["begin_month"]) . "</td>"; echo "<td>" . htmlentities($row["end_month"]) . "</td>"; echo "<td>" . htmlentities($row["other_information"]) . "</td></tr>\n";
if (empty($_POST['state'])) { $state = '%'; } if (empty($_POST['postalCode'])) { $postalCode = '%'; } if (empty($_POST['workType'])) { $workType = '%'; } if (empty($_POST['compensatedExperience'])) { $compensatedExperience = '%'; } if (empty($_POST['hoursNeeded'])) { $hoursNeeded = '%'; } $allBusinesses = BusinessDB::getInstance()->get_all_businesses($city, $state, $postalCode, $workType, $compensatedExperience, $hoursNeeded); ?> <html> <head> <meta charset="UTF-8"> <title></title> </head> <table border="black"> <tr> <th>Name</th> <th>Owner</th> <th>Address</th> <th>Email Address</th> <th>Phone Number</th>
$logonUserSuccess = false; $logonBusinessSuccess = false; //verify user's credentials if ($_SERVER['REQUEST_METHOD'] == "POST") { $logonUserSuccess = BusinessDB::getInstance()->verify_user_credentials($_POST['user'], md5($_POST['userpassword'])); echo $logonUserSuccess; $logonBusinessSuccess = BusinessDB::getInstance()->verify_business_credentials($_POST['user'], md5($_POST['userpassword'])); if ($logonUserSuccess == true) { session_start(); $_SESSION['user'] = BusinessDB::getInstance()->get_user_name_from_email($_POST['user']); header('Location: searchBusiness.php'); exit; } else { if ($logonBusinessSuccess == true) { session_start(); $_SESSION['user'] = BusinessDB::getInstance()->get_business_name_from_email($_POST['user']); header('Location: editBusinessInformation.php'); exit; } } } ?> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="style.css?<?php echo time(); ?> " /> <meta charset="utf-8" /> </head>