本文整理汇总了PHP中throw_the_bum_out函数的典型用法代码示例。如果您正苦于以下问题:PHP throw_the_bum_out函数的具体用法?PHP throw_the_bum_out怎么用?PHP throw_the_bum_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了throw_the_bum_out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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";
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:30,代码来源:task.php
示例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;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:25,代码来源:org_select.php
示例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;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:29,代码来源:project_edit.php
示例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;
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:9,代码来源:continue.php
示例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"]);
}
开发者ID:bbogin,项目名称:sr2s,代码行数:11,代码来源:accounting_edit.php
示例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"]);
}
开发者ID:bbogin,项目名称:sr2s,代码行数:11,代码来源:org_edit.php
示例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";
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:12,代码来源:date_list.php
示例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;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:15,代码来源:subtask_edit.php
示例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;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:47,代码来源:assign_permits.php
示例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;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:18,代码来源:org_select.php
示例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;
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:20,代码来源:save_csv.php
示例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);
开发者ID:bbogin,项目名称:sr2s,代码行数:31,代码来源:head.php
示例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");
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:31,代码来源:upyear_timelog.php
示例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();
开发者ID:bbogin,项目名称:sr2s,代码行数:6,代码来源:phpinfo.php
示例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();
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:56,代码来源:project_select.php
示例16: change_activity
function change_activity(&$state)
{
global $_DB;
if ($state->activity_id == 0) {
//creating a new one
add_activity($state);
} else {
activity_list($state);
//restore the record list
if (!array_key_exists($state->activity_id, $state->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid activity id " . $state->activity_id, true);
}
}
log_list($state, $state->row);
//find this row's records
$record = reset($state->records);
$old_activity = $record["activity_id"];
if ($state->activity_id == $old_activity) {
return;
}
foreach ($state->records as $ID => $record) {
if ($record["column"] < $state->columns[COL_OPEN]) {
continue;
}
$sql = "UPDATE " . $_DB->prefix . "b00_timelog\n\t\t\t\tSET activity_idref=" . $state->activity_id . " WHERE timelog_id=" . $ID . ";";
$_DB->exec($sql);
}
$sql = "SELECT COUNT(*) AS count FROM " . $_DB->prefix . "b00_timelog WHERE activity_idref=" . $old_activity . "";
$stmt = $_DB->query($sql);
if ($stmt->fetchObject()->count == 0) {
$sql = "DELETE FROM " . $_DB->prefix . "b02_activity WHERE activity_id=" . $old_activity . "";
$_DB->exec($sql);
}
$stmt->closeCursor();
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:35,代码来源:timelog.php
示例17: save_input
function save_input()
{
global $_STATE;
$_STATE->new_rate = array("ID" => $_POST["ID"], "rate" => $_POST["rate"], "eff" => $_POST["eff"], "exp" => $_POST["exp"]);
person_list();
if (!array_key_exists($_STATE->record_id, $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid person id");
}
//we're being spoofed
$rates = $_STATE->records[$_STATE->record_id]["rates"];
$ndx = 0;
if ($_POST["ID"] == 0) {
$rate_rec = array("ID" => 0);
array_unshift($rates, $rate_rec);
//add to beginning
} else {
$found = false;
foreach ($rates as $rate_rec) {
if ($rate_rec["ID"] == $_STATE->new_rate["ID"]) {
$found = true;
break;
}
++$ndx;
}
if (!$found) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid rate id");
}
}
$_STATE->rates = $rates;
//rates for this person
$_STATE->rate_ndx = $ndx;
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:32,代码来源:set_rates.php
示例18: new_info
function new_info(&$db, &$state)
{
if (!isset($_POST["recID"])) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid POST", true);
}
if (!audit_counts($db, $state)) {
return false;
}
$recID = $_POST["recID"];
if ($recID == 0) {
//adding
add_log($db, $state);
return true;
}
log_list($db, $state);
if (!array_key_exists(strval($recID), $state->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid recID " . $recID, true);
}
if ($state->records[$recID]["event_id"] != $_POST["event"]) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
}
if ($_POST["sessions"] == 0) {
delete_log($db, $state);
} else {
update_log($db, $state);
}
return true;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:28,代码来源:event_count+(another+copy).php
示例19: record_select
function record_select()
{
global $_DB, $_STATE;
list_setup();
//restore the record list
if (!array_key_exists(strval($_POST["selEvent"]), $_STATE->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid event id " . $_POST["selEvent"]);
//we're being spoofed
}
$_STATE->record_id = intval($_POST["selEvent"]);
$sql = "SELECT name, description FROM " . $_DB->prefix . "a30_event\n\t\t\tWHERE event_id=" . $_STATE->record_id . ";";
$row = $_DB->query($sql)->fetchObject();
$_STATE->forwho = $row->name . ": " . $row->description;
//PROPERTIES wants to see this
}
开发者ID:fortyspokes,项目名称:ProjectLogs,代码行数:15,代码来源:event_edit.php
示例20: 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 person id " . $selected);
}
$this->person_id = $ID;
} elseif (!$this->selected) {
//returned POST or superduper user
if (isset($_POST["selPerson"]) || isset($_POST["btnAll"])) {
if (isset($_POST["btnAll"])) {
$this->select_list = array_keys($this->records);
} else {
$this->select_list = $_POST["selPerson"];
//$_POST[""selPerson"] is an array
}
$this->selected = true;
if ($this->select_list[0] == -1) {
//adding
if ($this->multiple) {
$_STATE->person_ids = $this->select_list;
}
$this->person_id = -1;
$_STATE->person_id = $this->person_id;
return;
}
$this->person_id = $this->select_list[0];
} else {
//it's the superduper user
if ($_SESSION["person_id"] != 0) {
//or is it
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid person id " . $this->selected);
}
$_STATE->person_id = 0;
$_STATE->person_organization_id = 0;
$sql = "SELECT lastname, firstname FROM " . $_DB->prefix . "c00_person WHERE person_id=0;";
$row = $_DB->query($sql)->fetchObject();
$_STATE->person_name = $row->firstname . " " . $row->lastname;
return;
}
foreach ($this->select_list as $selected) {
if (!array_key_exists($selected, $this->records)) {
throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid person id " . $selected);
}
}
}
$_STATE->person_id = $this->person_id;
if ($this->multiple) {
$_STATE->person_ids = $this->select_list;
}
$_STATE->person_name = $this->records[$this->person_id][1] . " " . $this->records[$this->person_id][0];
$sql = "SELECT person_organization_id FROM " . $_DB->prefix . "c10_person_organization\n\t\t\tWHERE organization_idref=" . $_SESSION["organization_id"] . " AND person_idref=" . $_STATE->person_id . ";";
$stmt = $_DB->query($sql);
$row = $stmt->fetchObject();
$_STATE->person_organization_id = $row->person_organization_id;
$stmt->closeCursor();
// $_STATE->person_organization_id = $_DB->query($sql)->fetchObject()->person_organization_id;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:61,代码来源:person_select.php
注:本文中的throw_the_bum_out函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论