本文整理汇总了PHP中DieWithMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP DieWithMsg函数的具体用法?PHP DieWithMsg怎么用?PHP DieWithMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DieWithMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetTeamInfo
function GetTeamInfo($tn)
{
$loc = "teamlib.php->GetTeamInfo";
$tn = intval($tn);
if ($tn < 1 || $tn > 9999) {
DieWithMsg($loc, "illegal tn value.");
}
$loc = "teamlib.php->GetTeamInfo";
$sql = "SELECT * from Teams WHERE TeamNumber=" . intval($tn);
$result = SqlQuery($loc, $sql);
if ($result == false) {
return false;
}
if ($result->num_rows <= 0) {
return false;
}
$row = $result->fetch_assoc();
return $row;
}
示例2: GetUserID
$error_msg = "";
$success_msg = "";
$userid = GetUserID();
$username = GetUserName();
$userIPT = GetUserIPT($userid);
$pagetitle = "Work Order";
$doform = true;
$wid = "";
$ap = array();
$assigned_workers = array();
$primarypic_url = "";
$primarypic_ref = "";
$override = false;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (empty($_GET["wid"])) {
DieWithMsg($loc, "No WID given.");
}
$wid = $_GET["wid"];
if (isset($_GET["override"])) {
$override = $_GET["override"];
}
$wo = GetWO($wid, $override);
if (!$wo) {
$doform = false;
$error_msg = "This Work Order doesn't seem to exist.";
goto GenerateHtml;
}
$pagetabtitle = "Epic " . $wo["WIDStr"];
$pagetitle = "Work Order";
$ap = GetAppendedData($wid);
$assigned_workers = GetAssignedWorkers($wid);
示例3: SaveSheetImg
function SaveSheetImg($folder, $img, $fname)
{
$loc = 'badgelib.php->SaveSheetImg';
global $config;
$pt = $config["UploadDir"] . $folder . '/';
if (!file_exists($pt)) {
$result = @mkdir($pt, 0764);
if ($result === false) {
DieWithMsg($loc, "Unable to Create Folder: " . $pt);
}
}
$pt .= $fname;
$result = imagejpeg($img, $pt, 100);
if ($result === false) {
$msg = 'imagejpeg() failed for ' . $pt;
log_error($loc, $msg);
}
}
示例4: CheckPicDirs
function CheckPicDirs()
{
global $config;
$loc = "piclib.php->CheckPicDirs";
$pt = $config["UploadDir"];
if (!file_exists($pt)) {
$result = @mkdir($pt, 0764);
if ($result === false) {
DieWithMsg($loc, "Unable to Create Folder: " . $pt);
}
}
$pt = $config["UploadDir"] . 'pics/';
if (!file_exists($pt)) {
$result = @mkdir($pt, 0764);
if ($result === false) {
DieWithMsg($loc, "Unable to Create Folder: " . $pt);
}
}
$folders = PicFolderList();
foreach ($folders as $f) {
$p = $config["UploadDir"] . 'pics/' . $f;
if (!file_exists($p)) {
$result = mkdir($p, 0764);
if ($result == false) {
DieWithMsg($loc, "Unable to Create Folder: " . $p);
}
}
}
}
示例5: AddPictureToUser
function AddPictureToUser($username, $source)
{
$loc = "members_bulkpics.php->AddPIctureToUser";
$userid = GetUserIDFromName($username);
$userinfo = GetUserInfo($userid);
if ($userinfo === false) {
DieWithMsg($loc, 'User with ID=' . $userid . ' not found, but should be there.');
}
// Copy the file into our website.
$target = GetTempDir() . "temppic.jpg";
$result = @copy($source, $target);
if ($result == false) {
log_msg($loc, array('Picture not added. Unable to copy file.', 'External File=' . $source, 'Internal Target=' . $target));
return false;
}
$id = StoreUserPic($target, $userid);
return true;
}
示例6: timer
$timer = new timer();
$error_msg = "";
$success_msg = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$action = "";
if (isset($_GET["action"])) {
$action = $_GET["action"];
}
if ($action == 'makeall') {
$success_msg = MakeAllBadges();
}
if ($action == 'makegif') {
$success_msg = MakeGifImages();
}
} else {
DieWithMsg($loc, "Page should not be invoked by POST.");
}
include "forms/header.php";
include "forms/navform.php";
include "forms/badges_menubar.php";
echo '<div class="content_area">' . "\n";
echo '<h2 class="page_title">All Badges</h2>';
if (!empty($success_msg)) {
echo '<div class="inputform_msg" id="inputform_success_msg" >' . $success_msg . "</div>";
}
if (!empty($error_msg)) {
echo '<div class="inputform_msg" id="inputform_error_msg" >' . $error_msg . "</div>";
}
$sql = 'SELECT * FROM UserView ORDER BY BadgeID';
$result = SqlQuery($loc, $sql);
if ($result->num_rows > 0) {
示例7: GenerateSqlInsert
function GenerateSqlInsert($data, $fields)
{
$loc = "database.php->GenerateSqlInsert";
// First make an array that is an intersection of the two inputs.
$final = array();
foreach ($fields as $f) {
$fn = $f[0];
// Field name
$ft = $f[1];
// Field type
if (!isset($data[$fn])) {
continue;
}
if (is_null($data[$fn])) {
continue;
}
$v = $data[$fn];
$final[] = array("FieldName" => $fn, "FieldType" => $ft, "Value" => $v);
}
if (count($final) <= 0) {
return false;
}
// First, list the columns...
$sql = ' (';
$c = 0;
foreach ($final as $f) {
if ($c != 0) {
$sql .= ', ';
}
$sql .= $f["FieldName"];
$c++;
}
$sql .= ') VALUES (';
$c = 0;
foreach ($final as $f) {
if ($c != 0) {
$sql .= ', ';
}
if ($f["FieldType"] == 'int') {
$sql .= intval($f["Value"]);
} else {
if ($f["FieldType"] == 'str') {
$sql .= '"' . SqlClean($f["Value"]) . '"';
} else {
if ($f["FieldType"] == 'bool') {
$sql .= TFstr($f["Value"]);
} else {
DieWithMsg($loc, "Bad Sql type: " . $f["FieldType"] . " for field " . $f["FieldName"] . '.');
}
}
}
$c++;
}
$sql .= ') ';
return $sql;
}
示例8: session_start
//
// Created: 11/14/15 NG
//--------------------------
require_once "libs/all.php";
session_start();
log_page();
CheckLogin();
CheckEditor();
$loc = 'workorders_showworkorder.php';
$timer = new Timer();
$action = "";
$error_msg = "";
$success_msg = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (empty($_GET["IPTGroup"])) {
DieWithMsg($loc, "Bad Page Invoke. No IPTGroup given.");
}
$ReceivingIPTGroup = $_GET["IPTGroup"];
}
include "forms/header.php";
include "forms/navform.php";
include "forms/workorders_menubar.php";
echo '<div class="content_area">';
echo '<h2>List of Known Work Order IDs</h2>';
echo '<br>';
echo '<h2>Completed Work Orders</h2>';
$sql = 'SELECT * FROM WorkOrders WHERE ReceivingIPTGroup= "' . $ReceivingIPTGroup . '" AND Completed = 1 ORDER BY DateNeeded';
//$sql = 'SELECT * FROM WorkOrders';
$result = SqlQuery($loc, $sql);
if ($result->num_rows > 0) {
// output data of each row
示例9: FindUser
goto SetupForm;
}
$workername = $_POST["Workers"];
$workerid = FindUser("FullName", $workername);
$workerinfo = GetUserInfo($workerid);
if (!$workerinfo) {
$error_msg = "Worker not in database! Cannot remove.";
log_error($loc, array($error_msg, "Worker Name: " . $_POST["Workers"]));
goto SetupForm;
}
RemoveAssignment($wid, $workerid);
$msg = 'Deleted Assignment: "' . $workername . '" unassigned by ' . $username;
AttachSystemNote($wid, $msg);
goto SetupForm;
}
DieWithMsg($loc, "Incorrect Post.");
}
SetupForm:
$pagetabtitle = "Epic " . $wo["WIDStr"];
$all_workers = GetAllWorkers();
$cur_workers = GetAssignedWorkers($wid);
$possible_workers = RemoveWorkers($all_workers, $cur_workers);
$possible_workers = SortForIPTTeam($possible_workers, $wo["Receiver"]);
$workers = array();
foreach ($possible_workers as $w) {
$workers[] = $w["FirstName"] . ' ' . $w["LastName"];
}
$currentworkers = array();
foreach ($cur_workers as $w) {
$currentworkers[] = $w["FirstName"] . ' ' . $w["LastName"];
}
示例10: log_msg
log_msg($loc, $success_msg);
$doform = false;
goto GenerateHtml;
}
if (!empty($_POST["UnArchive"])) {
$widunarchivestr = $_POST["WIDUnArchive"];
$wo = fixupwid($widunarchivestr);
if ($wo === false) {
goto GenerateHtml;
}
$success_msg = changeactive($wo["WID"], 1);
log_msg($loc, $success_msg);
$doform = false;
goto GenerateHtml;
}
DieWithMsg($loc, "Unknown post back.");
}
GenerateHtml:
$stylesheet = array("../css/global.css", "../css/nav.css", "../css/utils_archive.css");
include "forms/header.php";
include "forms/nav_form.php";
include "forms/utils_menubar.php";
include "forms/utils_archive_form.php";
include "forms/footer.php";
// --------------------------------------------------------------------
function changeactive($wid, $active)
{
global $username;
$loc = rmabs(__FILE__ . ".changeactive");
$sql = 'UPDATE WorkOrders SET Active=' . intval($active) . ' WHERE WID=' . intval($wid);
$result = SqlQuery($loc, $sql);
示例11: timer
$timer = new timer();
$error_msg = "";
$success_msg = "";
$userid = GetUserID();
$username = GetUserName();
$userIPT = GetUserIPT($userid);
$pagetitle = "Work Order";
$wid = 0;
$picid = 0;
$picurl = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (empty($_GET["wid"])) {
DieWithMsg($loc, "No WID given.");
}
if (empty($_GET["picid"])) {
DieWithMsg($loc, "No picid given.");
}
$wid = intval($_GET["wid"]);
$wo = GetWO($wid);
$picid = intval($_GET["picid"]);
$pagetabtitle = "Epic " . $wo["WIDStr"];
$pagetitle = "Picture for Work Order";
$piccaption = GetPicCaption($wid, $picid);
if ($picid > 0) {
$picfile = PicPathName($picid, "orig");
if (file_exists($picfile)) {
$picurl = PicUrl($picid, "orig");
}
}
if (empty($picurl)) {
$error_msg = "Unable to find Pic... Sorry.";
示例12: PopulateParamList
$IsAuthor = false;
}
// Don't allow authors to changed approved WOs.
if (!IsAdmin() && !IsCaptain() && !IsEditor() && !IsIPTLead() && !$IsAuthor) {
$success_msg = "You do not seem to have privilege to edit this work order.";
$doform = false;
goto GenerateHtml;
}
PopulateParamList($param_list, $wo);
$pagetabtitle = "Epic " . $wo["WIDStr"];
$doform = true;
goto GenerateHtml;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["WID"])) {
DieWithMsg($loc, "No WID in POST.");
}
$wid = intval($_POST["WID"]);
$wo = GetWO($wid);
PopulateParamList($param_list, $_POST);
// Check for required inputs:
$sEmpty = array();
if (empty($_POST["Title"])) {
$sEmpty[] = "Title";
}
if (empty($_POST["Priority"])) {
$sEmpty[] = "Priority";
}
if (empty($_POST["Project"])) {
$sEmpty[] = "Project";
}
示例13: CheckEditor
CheckEditor();
$loc = 'badges_print.php';
$ins_file = "docs/printing_onebadge.txt";
if (file_exists($ins_file)) {
$instructions = file_get_contents($ins_file);
}
if ($_SERVER["REQUEST_METHOD"] != "GET") {
DieWithMsg($loc, 'Bad Page Invoke. Only GET request allowed.');
}
if (empty($_GET["BadgeID"])) {
DieWithMsg($loc, "Bad Page Invoke. No BadgeID given.");
}
$badgeid = $_GET["BadgeID"];
$havebadge = BadgeExists($badgeid);
if (!$havebadge) {
DieWithMsg($loc, "Badge does not exist.");
}
$badge_front_url = GetBadgeUrl($badgeid, 'front');
$badge_back_url = GetBadgeUrl($badgeid, 'back');
$urls = MakePrintImageForOneBadge($badgeid);
include "forms/header.php";
include "forms/navform.php";
include "forms/badges_menubar.php";
echo '<div class="content_area">' . "\n";
echo '<h2 class="page_title">JPG Image for Printing Badge</h2>';
echo '<img class="badges_showbadge_badge" src="' . $badge_front_url . '" style="width: 100px; heigth: auto; margin-left: 10px;">';
echo '<img class="badges_showbadge_badge" src="' . $badge_back_url . '" style="width: 100px; height: auto; margin-left: 10px;">';
echo '<div style="float: left; width: 300px; ">';
echo '<div style="font-size: 16pt; margin-left: 100px; margin-top: 20px;">';
echo '<a href="' . $urls[0] . '" download>Download Front</a>';
echo '</div>';
示例14: GetWorkOrderTasksInfo
$AssignedIPTLeadApproval = $data["AssignedIPTLeadApproval"];
$Project = $data["Project"];
$Priority = $data["Priority"];
$RequestingIPTGroup = $data["RequestingIPTGroup"];
$ReceivingIPTGroup = $data["ReceivingIPTGroup"];
$ProjectOfficeApproval = $data["ProjectOfficeApproval"];
$ReviewedBy = $data["ReviewedBy"];
$AssignedTo = $data["AssignedTo"];
$Completed = $data["Completed"];
$CompletedOn = $data["CompletedOn"];
$data = GetWorkOrderTasksInfo($WorkOrderID);
if ($data === false) {
DieWithMsg($loc, 'Work Order Task with ID=' . $WorkOrderID . ' not found.');
}
$TaskID = $data["TaskID"];
$Quantity = $data["Quantity"];
$Description = $data["Description"];
$UnitPrice = $data["UnitPrice"];
$data = GetWorkOrderPrereqInfo($WorkOrderID);
if ($data === false) {
DieWithMsg($loc, 'Work Order Prerequisite for ID=' . $WorkOrderID . ' not found.');
}
$PrereqID = $data["PrereqID"];
$PrevWorkOrderID = $data["PrevWorkOrderID"];
}
GenerateHtml:
include "forms/header.php";
include "forms/nav_form.php";
include "forms/wo_menubar.php";
include "forms/wo_showworkorder_form.php";
include "forms/footer.php";
示例15: log_page
log_page();
CheckLogin();
CheckEditor();
$loc = 'workorder_showworkorder.php';
$timer = new Timer();
$action = "";
$error_msg = "";
$success_msg = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (empty($_GET["WorkOrderID"])) {
DieWithMsg($loc, "Bad Page Invoke. No WorkOrderID given.");
}
$WorkOrderID = $_GET["WorkOrderID"];
$data = GetWorkOrderInfo($WorkOrderID);
if ($data === false) {
DieWithMsg($loc, 'Work Order with ID=' . $WorkOrderID . ' not found.');
}
$WorkOrderID = $data["WorkOrderID"];
$WorkOrderName = $data["WorkOrderName"];
$Description = $data["Description"];
$DateRequested = $data["DateRequested"];
$DateNeeded = $data["DateNeeded"];
$DayEstimate = $data["DayEstimate"];
$Revision = $data["Revision"];
$Requestor = $data["Requestor"];
$RequestingIPTLeadApproval = $data["RequestingIPTLeadApproval"];
$AssignedIPTLeadApproval = $data["AssignedIPTLeadApproval"];
$Project = $data["Project"];
$Priority = $data["Priority"];
$RequestingIPTGroup = $data["RequestingIPTGroup"];
$ReceivingIPTGroup = $data["ReceivingIPTGroup"];