Exemplo n.º 1
0
<?php

/* This file is part of a copyrighted work; it is distributed with NO WARRANTY.
 * See the file COPYRIGHT.html for more details.
 */
require_once "../functions/inputFuncs.php";
require_once "../classes/Staff.php";
require_once "../classes/StaffQuery.php";
$staffQ = new StaffQuery();
$staffQ->connect();
$all_staff = $staffQ->getAllStaff();
$staffnames = $staffQ->getAssoc($all_staff);
$staffQ->close();
$fields = array("locFldsAddr1" => inputField('text', "location", $location->getAddressOne()), "locFldsAddr2" => inputField('text', "address", $location->getAddressTwo()), "locstaffid" => inputField('select', 'staffid', $location->getStaffid(), NULL, $staffnames), "locFldsCity" => inputField('text', "city", $location->getCity()), "locFldsPincode" => inputField('text', "pincode", $location->getPincode()), "locFldsState" => inputField('text', "state", $location->getState()), "locFldsDays" => inputField('text', "days", $location->getDays()), "locFldsTime" => inputField('text', "time", $location->getTime()), "locFldsLatitude" => inputField('text', "latitude", $location->getLatitude()), "locFldsLongitude" => inputField('text', "longitude", $location->getLongitude()));
?>


<table class="primary">
  <tr>
    <th colspan="2" valign="top" nowrap="yes" align="left">
      <?php 
echo H($headerWording);
?>
 <?php 
echo $loc->getText("locFldsHeader");
?>
    </td>
  </tr>
<?php 
foreach ($fields as $title => $html) {
    ?>
$staff->setUserid($_POST["userid"]);
$staff->setPwd($_POST["pwd"]);
$_POST["pwd"] = $staff->getPwd();
$staff->setPwd2($_POST["pwd2"]);
$_POST["pwd2"] = $staff->getPwd2();
if (!$staff->validatePwd()) {
    $pageErrors["pwd"] = $staff->getPwdError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/staff_pwd_reset_form.php");
    exit;
}
#**************************************************************************
#*  Update staff member
#**************************************************************************
$staffQ = new StaffQuery();
$staffQ->connect();
if ($staffQ->errorOccurred()) {
    $staffQ->close();
    displayErrorPage($staffQ);
}
if (!$staffQ->resetPwd($staff)) {
    $staffQ->close();
    displayErrorPage($staffQ);
}
$staffQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
Exemplo n.º 3
0
#*  Retrieving get location id
#****************************************************************************
$locationid = $_GET["locationid"];
if (isset($_GET["msg"])) {
    $msg = "<font class=\"error\">" . H($_GET["msg"]) . "</font><br><br>";
} else {
    $msg = "";
}
#****************************************************************************
#*  Search database for location
#****************************************************************************
$lotQ = new LocationQuery();
$lotQ->connect();
$lot = $lotQ->get($locationid);
$lotQ->close();
$staffQ = new StaffQuery();
$staffQ->connect();
$staff = $staffQ->getFirstNameLastName($lot->getStaffid());
$staffQ->close();
#**************************************************************************
#*  Show location information
#**************************************************************************
require_once "../shared/header.php";
?>

<?php 
echo $msg;
?>

<table class="primary">
  <tr>