Пример #1
0
            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>
Пример #2
0
/*
	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()");
$statement2->execute();
$filteredNumRows = $statement2->fetch(PDO::FETCH_NUM);
$rows = $statement->fetchAll(PDO::FETCH_ASSOC);
$rowCount = count($rows);
for ($i = 0; $i < $rowCount; $i++) {
    $row = $rows[$i];
    $color = "";
    if ($q == -1) {
        $color = " danger";
        $rows[$i] = array($row["id"], Client::Load($row["cid"])->GetUsername(), DisplayDatetime($row["creation_date"]), DisplayLimited($row["description"]));
    } else {
        $sid = $row["sid"];
        $status = $row["status"];
        if ($sid == $me->GetID()) {
            $color = " " . ($status == STATUS_OPENED ? "danger" : "success");
        }
        $rows[$i] = array($row["id"], $status == STATUS_OPENED ? "Opened" : "Closed", Client::Load($row["cid"])->GetUsername(), DisplayDatetime($row["creation_date"]), DisplayLimited($row["description"]), implode(", ", json_decode($row["tags"], true)), Staff::Load($sid)->GetUsername(), DisplayDatetime($row["closed_date"]));
    }
    $rows[$i]["DT_RowClass"] = "linkrow" . $color;
}
$output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $totalNumRows[0], "iTotalDisplayRecords" => $filteredNumRows[0], "aaData" => $rows);
echo json_encode($output);