本文整理汇总了PHP中throw_the_bum_out函数的典型用法代码示例。如果您正苦于以下问题:PHP throw_the_bum_out函数的具体用法?PHP throw_the_bum_out怎么用?PHP throw_the_bum_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了throw_the_bum_out函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: task_select
function task_select(&$state, &$HTML, $rec = -1)
{
if ($rec < 0) {
//checking returned
if (!isset($_GET["row"])) {
return;
}
$rec = $_GET["row"];
//get row number
}
task_list($state);
//restore the record list
if (!array_key_exists($rec, $state->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid task id " . $rec, true);
}
$record = $state->records[$rec];
if ($record[1] != "") {
$inactive = new DateTime($record[1]);
$diff = date_diff($state->from_date, $inactive)->days;
if ($diff < $state->columns[COL_INACTIVE]) {
$state->columns[COL_INACTIVE] = $diff;
$state->columns[COL_AGENT] = "task";
}
$record[0] .= "<br>(inactive as of " . $record[1] . ")";
}
$state->task_id = $rec;
$state->msgStatus = "";
$HTML .= "cell = document.getElementById('TK_" . $state->row . "');\n";
$HTML .= "cell.innerHTML = '" . $record[0] . "';\n";
}
示例2: entry_audit
function entry_audit()
{
global $_DB, $_STATE;
init_setup();
//restore the list
if (!array_key_exists($_POST["selOrgs"], $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid org id " . $_POST["selOrgs"]);
//we're being spoofed
}
init_setup();
//re-display the list
$_SESSION["organization_id"] = intval($_POST["selOrgs"]);
//Set theme for organization:
$sql = "SELECT theme FROM " . $_DB->prefix . "d10_preferences\n\t\t\tWHERE organization_idref=" . $_SESSION["organization_id"] . ";";
$stmt = $_DB->query($sql);
if ($row = $stmt->fetchObject()) {
$_SESSION["_SITE_CONF"]["THEME"] = $row->theme;
}
$stmt->closeCursor();
$_SESSION["org_TZO"] = $_STATE->records[$_POST["selOrgs"]][1];
$_SESSION["UserPermits"] = $GLOBALS["_PERMITS"]->get_permits($_SESSION["person_id"]);
//set the users's permissions
$_STATE->msgStatus = "Your organization has been changed";
return true;
}
示例3: field_input_audit
function field_input_audit()
{
global $_STATE;
$errors = "";
foreach ($_STATE->fields as $name => $field) {
if (($msg = $field->audit()) === true) {
continue;
}
$errors .= "<br>" . $name . ": " . $msg;
}
if ($errors != "") {
$_STATE->msgStatus = "Error:" . $errors;
return false;
}
$diff = date_diff($_STATE->fields["Close Date"]->value, COM_NOW(), true);
if ($diff->m > 2) {
$_STATE->msgStatus = "The Close Date is suspect - proceeding anyway";
}
if (!array_key_exists(strval($_POST["selAccounting"]), $_STATE->accounting)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid accounting id " . $_POST["selAccounting"]);
//we're being spoofed
}
$_STATE->accounting_id = intval($_POST["selAccounting"]);
//Should check to see if inactive is greater than any timelogs?
foreach ($_STATE->fields as $name => $field) {
$field->disabled = true;
}
return TRUE;
}
示例4: errorButler
function errorButler($errno, $errstr, $errfile, $errline)
{
if ($_SESSION["_SITE_CONF"]["RUNLEVEL"] == 1) {
return false;
}
error_log($errstr . " in " . $errfile . " on line " . $errline);
throw_the_bum_out("An error has occurred<br> please notify the system administrator", NULL);
return true;
}
示例5: accounting_select
function accounting_select()
{
global $_STATE;
accounting_list();
//restore the record list
if (!array_key_exists(strval($_POST["selAccounting"]), $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid accounting id " . $_POST["selAccounting"]);
//we're being spoofed
}
$_STATE->record_id = intval($_POST["selAccounting"]);
}
示例6: org_select
function org_select()
{
global $_STATE;
list_setup();
//restore the org list
if (!array_key_exists(strval($_POST["selOrg"]), $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid org id " . $_POST["selOrg"]);
//we're being spoofed
}
$_STATE->record_id = intval($_POST["selOrg"]);
}
示例7: date_select
function date_select(&$state, &$HTML)
{
$rec = strval($_GET["row"]);
if ($rec < $state->columns[COL_OPEN] || $rec >= $state->columns[COL_INACTIVE]) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid date " . $rec, true);
}
$state->logdate = clone $state->from_date;
$state->logdate->add(new DateInterval('P' . $rec . 'D'));
$state->msgStatus = "";
$HTML .= "cell = document.getElementById('DT_" . $state->row . "');\n";
$HTML .= "cell.innerHTML = '" . $state->logdate->format("Y-m-d") . "';\n";
}
示例8: subtask_select
function subtask_select($ID = -1)
{
global $_STATE;
if ($ID < 0) {
//not yet selected
subtask_list();
//restore the record list
if (!array_key_exists(strval($_POST["selSubtask"]), $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $_POST["selSubtask"]);
//we're being spoofed
}
$ID = intval($_POST["selSubtask"]);
}
$_STATE->record_id = $ID;
}
示例9: entry_audit
function entry_audit(&$permits)
{
global $_DB, $_STATE;
permit_list($permits);
//the allowable permits
if (isset($_POST["chkPermit"])) {
foreach ($_POST["chkPermit"] as $ID => $value) {
if (!array_key_exists($ID, $_STATE->fields)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid permit id " . $_POST["chkPermit"]);
}
if ($value == "on") {
$_STATE->fields[strval($ID)]->checked = TRUE;
}
}
}
foreach ($_STATE->fields as $ID => &$permit) {
$permit->disabled = true;
$sqlinsert = "INSERT INTO " . $_DB->prefix . "c20_person_permit (person_idref, permit_idref";
$sqlvalues = "VALUES (" . $_STATE->person_id . ", " . $ID;
if (!$permit->assigned && $permit->checked) {
//add permit
switch ($permit->grade) {
case PERMITS::GR_PRJ:
$sqlinsert .= ", project_idref";
$sqlvalues .= ", " . $_STATE->project_id;
//fall thru to also set org
//fall thru to also set org
case PERMITS::GR_ORG:
$sqlinsert .= ", organization_idref";
$sqlvalues .= ", " . $_SESSION["organization_id"];
//case PERMITS::GR_SYS doesn't set org or project idrefs
}
$sqlinsert .= ") ";
$sqlvalues .= ");";
$_DB->exec($sqlinsert . $sqlvalues);
$permit->assigned = true;
} else {
if ($permit->assigned && !$permit->checked) {
//delete permit
$sql = "DELETE FROM " . $_DB->prefix . "c20_person_permit\n\t\t\t\t\tWHERE person_permit_id=" . $permit->person_permit . ";";
$_DB->exec($sql);
$permit->assigned = false;
}
}
}
return TRUE;
}
示例10: entry_audit
function entry_audit()
{
global $_STATE;
init_setup();
//restore the list
if (!array_key_exists($_POST["selOrgs"], $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid org id " . $_POST["selOrgs"]);
//we're being spoofed
}
init_setup();
//re-display the list
$_SESSION["organization_id"] = intval($_POST["selOrgs"]);
$_SESSION["org_TZO"] = $_STATE->records[$_POST["selOrgs"]][1];
$_SESSION["UserPermits"] = $GLOBALS["_PERMITS"]->get_permits($_SESSION["person_id"]);
//set the users's permissions
$_STATE->msgStatus = "Your organization has been changed";
return true;
}
示例11: entry_audit
function entry_audit()
{
global $_STATE;
if (!isset($_POST["chkTable"])) {
$_STATE->msgStatus = "No tables were saved";
return;
}
foreach ($_POST["chkTable"] as $ID => $value) {
if (!array_key_exists($ID, $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid table name " . $_POST["chkTable"]);
}
if ($value == "on") {
$_STATE->msgStatus .= "<br>" . $ID;
if (!save($_STATE->records[$ID])) {
$_STATE->msgStatus .= ": attempted save failed";
}
}
}
return;
}
示例12: throw_the_bum_out
<?php
//copyright 2010,2014-2015 C.D.Price
$_TEMP_PERMIT = "_LEGAL_";
//a temp permission for the "are you logged in" gate (in prepend)
require_once "prepend.php";
require_once "common.php";
require_once "db_" . $_SESSION['_SITE_CONF']['DBMANAGER'] . ".php";
if (isset($_POST["btnSubmit"])) {
//logging out
throw_the_bum_out("Goodbye!", "Logout: by id=" . $_SESSION["person_id"]);
//let prepend take care of it (not really a bum)
}
$organization = "";
$person = "";
if (isset($_SESSION["person_id"])) {
//logged in
$db = new db_connect($_SESSION['_SITE_CONF']['DBEDITOR']);
$sql = "SELECT name FROM " . $db->prefix . "a00_organization WHERE organization_id=:org";
$stmt = $db->prepare($sql);
$stmt->bindValue(':org', $_SESSION["organization_id"], PDO::PARAM_INT);
$stmt->execute();
if (!($row = $stmt->fetchObject())) {
$organization = "--No Organization--";
} else {
$organization = COM_output_edit($row->name);
}
$stmt->closeCursor();
$sql = "SELECT firstname, lastname FROM " . $db->prefix . "c00_person WHERE person_id=:person";
$stmt = $db->prepare($sql);
$stmt->bindValue(':person', $_SESSION["person_id"], PDO::PARAM_INT);
示例13: DATE_FIELD
break 2;
case STATE::UPDATE:
$_STATE->msgGreet = "";
$new_date = new DATE_FIELD("txtNew", "", TRUE, TRUE, TRUE, 0, FALSE, "now");
$msg = $new_date->audit();
if ($msg === true) {
upgrade($new_date);
} else {
$_STATE->msgStatus = $msg;
$_STATE->status = STATE::INIT;
break;
}
$_STATE->status = STATE::DONE;
break 2;
default:
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid state=" . $_STATE->status);
}
}
//while & switch
//End Main State Gate
function old_date()
{
global $_DB, $_STATE;
$sql = "SELECT MAX(logdate) as old_date FROM " . $_DB->prefix . "b00_timelog;";
$stmt = $_DB->query($sql);
$row = $stmt->fetchObject();
$old_date = new DateTime($row->old_date);
$stmt->closeCursor();
$days = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
$_STATE->old_date = $days[$old_date->format("w")] . " " . $old_date->format("Y-m-d");
}
示例14: throw_the_bum_out
<?php
if ($_SESSION["person_id"] != 0 && $_SESSION["_SITE_CONF"]["RUNLEVEL"] != 1 || !$_PERMITS->can_pass(PERMITS::_SUPERUSER)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): no permit");
}
phpinfo();
示例15: set_state
public function set_state($ID = -1)
{
global $_DB, $_STATE;
if ($ID > 0) {
//either object construct sees only 1 rec or page has chosen another in list
$this->selected = true;
if (!array_key_exists($ID, $this->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid project id " . $selected);
}
$this->project_id = $ID;
if ($this->select_list[0] == -1) {
$this->select_list[0] = $ID;
}
} elseif (!$this->selected) {
//returned POST
if (isset($_POST["selProject"]) || isset($_POST["btnAll"])) {
if (isset($_POST["btnAll"])) {
$this->select_list = array();
foreach ($this->records as $key => $value) {
if ($value[self::INACTIVE] != '' && !$this->show_inactive) {
continue;
}
$this->select_list[] = $key;
}
} else {
$this->select_list = $_POST["selProject"];
//$_POST[""selProject"] is an array
}
$this->selected = true;
if ($this->select_list[0] == -1) {
//adding
if ($this->multiple) {
$_STATE->project_ids = $this->select_list;
}
$this->project_id = -1;
$_STATE->project_id = $this->project_id;
return;
}
$this->project_id = $this->select_list[0];
}
foreach ($this->select_list as $selected) {
if (!array_key_exists($selected, $this->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid project id " . $selected);
}
}
}
$_STATE->project_id = $this->project_id;
$_STATE->project_ids = $this->select_list;
$sql = "SELECT a10.close_date, a20.accounting_id, a20.name AS accounting\n\t\tFROM " . $_DB->prefix . "a10_project AS a10\n\t\tLEFT OUTER JOIN " . $_DB->prefix . "a20_accounting AS a20\n\t\tON a10.accounting_idref = a20.accounting_id\n\t\tWHERE project_id=" . $_STATE->project_id . ";";
$stmt = $_DB->query($sql);
$row = $stmt->fetchObject();
$_STATE->close_date = new DateTime($row->close_date);
$_STATE->accounting_id = $row->accounting_id;
$_STATE->accounting = $row->accounting;
$stmt->closeCursor();
}