if(isset($_GET["id"])) { $profile = Staff::Load($_GET["id"]); } */ if (!$profile->IsValid()) { ShowError("Invalid profile."); } else { ?> <h2><?php echo $profile->GetName() . " (" . $profile->GetUsername() . ")"; ?> </h2> <p>Account Type: <?php echo Staff::GetTypeReal($profile->GetType()); ?> </p> <p>Community: <?php echo Building::GetCommunity($profile->GetBuilding()); ?> </p> <p>Building: <?php echo $profile->GetBuilding(); ?> </p> <?php }
break; } } } if ($correct === null) { exit; } $lastTicket = Ticket::GetByStaffIDOrderSingle($staff->GetID(), "last_modified_date", "DESC"); if (!$lastTicket->IsValid()) { exit; } $client = Client::Load($lastTicket->GetClientID()); if (!$client->IsValid()) { exit; } $body = "Client Information\nID: " . $client->GetUsername() . "\nName: " . $client->GetName() . "\nCommunity: " . Building::GetCommunity($client->GetBuilding()) . "\nBuilding: " . $client->GetBuilding() . "\nRoom: " . $client->GetLocation(); $remaining = 255 - strlen($body); if ($remaining > 50) { $body .= "\nDescription: "; $remaining = 255 - strlen($body); $body .= DisplayLimited($lastTicket->GetDescription()); } header("content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <Response> <Sms><?php echo $body; ?> </Sms> </Response>
switch ($q) { case -1: // dashboard open tickets panel // dashboard open tickets panel case QUERY_MY_OPEN_TICKETS: $sWhere .= "sid=" . $me->GetID() . " AND status=" . STATUS_OPENED . ""; break; case QUERY_ALL_MY_TICKETS: $sWhere .= "sid=" . $me->GetID(); break; case QUERY_OPEN_TICKETS_IN_MY_BUILDING: $sWhere .= "building=" . $database->quote($me->GetBuilding()) . " AND status=" . STATUS_OPENED . ""; break; case QUERY_OPEN_TICKETS_IN_MY_COMMUNITY: $inCommunity = true; $sWhere .= "community=" . $database->quote(Building::GetCommunity($me->GetBuilding())) . " AND status=" . STATUS_OPENED . ""; break; case QUERY_ALL_TICKETS: default: $sWhere = substr_replace($sWhere, "", -4); break; } /* Query */ $statement = $database->prepare("SELECT COUNT(*) FROM tickets"); $statement->execute(); $totalNumRows = $statement->fetch(PDO::FETCH_NUM); $statement = $database->prepare("SELECT SQL_CALC_FOUND_ROWS " . implode(",", $aColumns) . " FROM tickets " . $sWhere . " " . $sOrder . " " . $sLimit); $statement->execute(); $statement2 = $database->prepare("SELECT FOUND_ROWS()");
<?php // Called when TypeAhead autocomplete are updated $data = array(); if (isset($_GET["un"])) { $un = CleanString($_GET["un"]); $client = Client::GetByUsername($un); if ($client->IsValid() && $client->IsActive()) { $data["name"] = $client->GetName(); $data["building"] = $client->GetBuilding(); $data["location"] = $client->GetLocation(); $data["phone_number"] = $client->GetPhoneNumber(); $data["community"] = Building::GetCommunity($client->GetBuilding()); } } else { if (isset($_GET["sq"])) { $query = CleanString($_GET["sq"]); $staffs = Staff::GetAll(); foreach ($staffs as $staff) { if ($staff->IsActive() && strpos($staff->GetUsername(), $query) === 0) { array_push($data, $staff->GetUsername()); } } } else { $query = CleanString($_GET["q"]); $data = Client::GetUsernameBeginsWith($query); } } echo json_encode($data);
<?php if (isset($_POST["ticket"])) { $clientid = CleanString($_POST["clientid"]); $description = $_POST["description"]; if (!isset($_POST["tags"])) { ShowError("You must specify at least one tag!"); } else { $tags = $_POST["tags"]; $client = Client::GetByUsername($clientid); if (empty($clientid) || empty($description) || empty($tags)) { ShowError("One or more fields were empty!"); } elseif (!$client->IsValid()) { ShowError("Invalid Client ID."); } else { $ticket = Ticket::Add($client->GetID(), $me->GetID(), $description, STATUS_OPENED, $tags, $client->GetBuilding(), Building::GetCommunity($client->GetBuilding())); $me->IncrementPoints(5); ShowInfo("Created Ticket Successfully"); RedirectTimer("ticket&id=" . $ticket->GetID(), 0); } } } else { ?> <form class="form-horizontal" role="form" method="post"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Client Information </div>
<?php $ticket = null; if (isset($_GET["id"])) { $ticket = Ticket::Load($_GET["id"]); } if (is_null($ticket) || !$ticket->IsValid()) { ShowError("Invalid ticket."); } else { $creator = Staff::Load($ticket->GetCreatorID())->GetUsername(); $client = Client::Load($ticket->GetClientID()); $clientid = $client->GetUsername(); $name = $client->GetName(); $community = Building::GetCommunity($client->GetBuilding()); $building = $client->GetBuilding(); $room = $client->GetLocation(); ?> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"><?php echo Pages::GetCurrentPage() . " #" . $ticket->GetID(); ?> </h1> </div> </div> <?php if (isset($_POST["update"])) { $update_description = $_POST["update_description"]; if (empty($update_description)) {