Example #1
0
<?php

include "./findconfig.php";
include $_SERVER['DOCUMENT_ROOT'] . "/" . $ROOTPATH . "/Includes/Top.php";
?>


<?php 
$DB = new conn();
$DB->connect();
$active_user = getLoggedUser($DB);
?>

<SCRIPT TYPE="text/javascript">	
	var locations = <?php 
echo json_encode($locations);
?>
;
	<?php 
if ($AgencyParams["EnableDTOffices"]) {
    ?>
 var DTOffices = <?php 
    echo json_encode($AgencyParams["DTOffices"]);
    ?>
; <?php 
}
?>

</SCRIPT>

Example #2
0
 case 'delUser':
     global $userName;
     if (strlen($userName)) {
         $newSession = new SessionSwitcher("AjaXplorer");
         AuthService::deleteUser($userName);
         $result = TRUE;
     }
     break;
 case 'updateUser':
     global $user;
     if (is_array($user)) {
         $newSession = new SessionSwitcher("AjaXplorer");
         if (AuthService::updatePassword($user["name"], $user["password"])) {
             //@TODO Change this to match your CMS code
             if ($user["right"] == "admin") {
                 $userObj = getLoggedUser();
                 if ($user["name"] == $userObj->getId()) {
                     AuthService::updateAdminRights($userObj);
                 }
             }
             $result = TRUE;
         } else {
             $result = FALSE;
         }
     }
     break;
 case 'installDB':
     global $user, $reset;
     $result = TRUE;
     break;
 default:
Example #3
0
            if ($user["dtoffice"] == "" || $user["dtoffice"] == "_" || in_array($user["dtoffice"], $dts)) {
                $retArray[] = $row;
            }
        }
    }
    $output = $retArray;
    //$output = $sql;
    $DB->close();
}
if ($id == "getNewInventoryTable") {
    if (!UserMay("ViewInventory")) {
        AccessDenied();
    }
    $DB = new conn();
    $DB->connect();
    $user = getLoggedUser($DB);
    $sql = <<<SQLEND
\t\t\tselect inventory.inventory_id, inventory.product_id, inventory.invoice, inventory.dtoffice, products.product_model, products.product_name, inventory.serial, inventory.status, inventory.status_date, inventory.status_data, inventory.storagelocation_id, sl.storagelocation_name as slname, inventory_status.status_name, inventory_status.preposition, inventory.status_data_text, inventory.DateAdded, inventory.DateReceived, users.username AS AddedByName
\t\t\tfrom inventory
\t\t\tjoin products on inventory.product_id = products.product_id
\t\t\tjoin storagelocations sl on inventory.storagelocation_id = sl.storagelocation_id
\t\t\tjoin inventory_status on inventory.status = inventory_status.status_id
\t\t\tjoin users on inventory.AddedBy = users.User_ID
SQLEND;
    $and = false;
    if (isset($_POST["productID"])) {
        $product_id = $DB->sanitize($_POST["productID"]);
        if ($and) {
            $sql = $sql . " AND ";
        } else {
            $sql = $sql . " WHERE ";