本文整理汇总了PHP中printError函数的典型用法代码示例。如果您正苦于以下问题:PHP printError函数的具体用法?PHP printError怎么用?PHP printError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HandleMoveNode
function HandleMoveNode()
{
define("CMD_MOVE_CATEGORY", <<<SQL
\t\tUPDATE site_categories SET our_category_id = ? WHERE id = ?
SQL
);
define("CMD_MOVE_ITEM", <<<SQL
\t\tUPDATE items SET our_category_id = ?, mdate = NOW() WHERE id = ?
SQL
);
global $db;
$srcNodes = explode(",", $_REQUEST["srcNodes"]);
foreach ($srcNodes as $nodeStr) {
list($nodeId, $nodeType) = explode(":", $nodeStr);
if ($nodeType == NODE_SITE_CATEGORY) {
$res =& $db->query(CMD_MOVE_CATEGORY, array($_REQUEST["destNodeId"], $nodeId));
if (PEAR::isError($res)) {
printError($res);
exit;
}
} else {
if ($nodeType == NODE_SITE_ITEM) {
$res =& $db->query(CMD_MOVE_ITEM, array($_REQUEST["destNodeId"], $nodeId));
if (PEAR::isError($res)) {
printError($res);
exit;
}
}
}
}
}
示例2: do_page
function do_page()
{
handleActions();
printError();
printAddCardSet();
printChangePasswordForm();
}
示例3: retrieveOrder
function retrieveOrder($resultT, $db)
{
$row = $resultT->FetchRow();
$name = $row['name'];
$customerId = $row['customerId'];
$phone = htmlentities($_GET['phone'], ENT_QUOTES);
//BRIDGE TABLE
$query1 = "select * from customerToOrder where customerId ='{$customerId}'";
$result1 = $db->Execute($query1);
if (!$result1) {
printError();
return;
}
//PIZZA ORDER TABLE
$row1 = $result1->FetchRow();
$orderId = $row1['orderId'];
$query2 = "select * from pizzaOrder where orderId ='{$orderId}'";
$result2 = $db->Execute($query2);
if (!$result2) {
printError();
return;
}
$row2 = $result2->FetchRow();
$toppings = $row2['toppingId'];
$size = $row2['sizeId'];
showOrderForm($phone, $name, $toppings, $size);
}
示例4: getTableFromStmt
function getTableFromStmt($stmt)
{
global $db;
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($results) == 0) {
printError("Keine Einträge vorhanden");
return false;
}
echo '<table>';
echo '<thead>';
echo '<tr>';
foreach ($results[0] as $key => $val) {
echo '<th>' . $key . '</th>';
}
echo '</tr>';
echo '</thead>';
echo '<tbody>';
foreach ($results as $arr) {
echo '<tr>';
foreach ($arr as $val) {
echo '<td>' . $val . '</td>';
}
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
}
示例5: se_search
function se_search($params, &$smarty)
{
$keyword = isset($params['keywords']) ? $params['keywords'] : 'null';
$modifytext = isset($params['modifytext']) ? $params['modifytext'] : true;
$modifyscore = isset($params['modifyscore']) ? $params['modifyscore'] : true;
/* library */
require dirname(__FILE__) . SLASH . 'include/lib.searchengine.php';
$result_search_engine = query_search_engine($keyword);
if ($result_search_engine === false) {
printError();
return;
}
$iScoreMax = $result_search_engine[0]['score'];
foreach ($result_search_engine as &$elem) {
if ($modifyscore) {
$pourcent = intval($elem['score'] * 100 / $iScoreMax);
$elem['score'] = $pourcent;
}
if ($modifytext) {
$elem['texte'] = substr(strongText($elem['texte'], $keyword), 0, 400) . ' ...';
$elem['nom'] = strongText($elem['nom'], $keyword);
}
}
$smarty->assign('RESULT_SEARCH_SIZE', sizeof($result_search_engine));
$smarty->assign('RESULT_SEARCH', $result_search_engine);
//return true;
}
示例6: indexAction
public function indexAction()
{
$model = new SettingsModel();
$form = Call::form('Index');
$countrysList = $model->getCountryList();
if (isPost()) {
if ($form->isValid(allPost()) and (isset($form->data["email"]) or isset($form->data["password"]) and isset($form->data["password1"]))) {
if (Request::getParam('user')->password == md5($form->data['password'])) {
$data = [];
if ($form->data['password1'] != '') {
$data['password'] = md5($form->data['password1']);
}
if (isset($form->data['email'])) {
$data['email'] = $form->data["email"];
}
if ($form->data['news'] == 1) {
$data['newsletter'] = $form->data["news"];
}
$model->setSettings(Request::getParam('user')->id, $data);
redirect(url('settings'));
}
} else {
$this->view->error = printError($form->error, 'INDEX_ERROR_');
}
}
$this->view->countrysList = $countrysList;
$this->view->title = Lang::translate('INDEX_TITLE');
}
示例7: do_page
function do_page()
{
handleActions();
$player_series = Player::getSessionPlayer()->stewardsSeries();
if (count($player_series) == 0) {
printNoSeries();
return;
}
if (isset($_POST['series'])) {
$_GET['series'] = $_POST['series'];
}
if (!isset($_GET['series'])) {
$_GET['series'] = $player_series[0];
}
$active_series_name = $_GET['series'];
if (count($player_series) > 1) {
printStewardSelect($player_series, $active_series_name);
} else {
echo "<center> Managing {$active_series_name} </center>";
}
$active_series = new Series($active_series_name);
printError();
printSeriesForm($active_series);
printLogoForm($active_series);
printRecentEventsTable($active_series);
printPointsForm($active_series);
printStewardsForm($active_series);
}
示例8: HandleRemoveNode
function HandleRemoveNode()
{
define("CMD_SEL_MOVED_SITECATEGORIES_IDS", <<<SQL
\t\tSELECT id FROM site_categories WHERE our_category_id = ?
SQL
);
define("CMD_SEL_MOVED_ITEMS_IDS", <<<SQL
\t\tSELECT id FROM items WHERE our_category_id = ?
SQL
);
define("CMD_DEL_OURSITE_CATEGORY", <<<SQL
\t\tDELETE FROM our_categories WHERE id = ?
SQL
);
define("CMD_SEL_SUBCATEGORIES_IDS", <<<SQL
\t\tSELECT id FROM our_categories WHERE parent_id = ? ORDER BY id
SQL
);
define("CMD_DEL_CATEGORY_FROMNEW", <<<SQL
\t\tUPDATE site_categories SET our_category_id = 0 WHERE id = ?
SQL
);
define("CMD_DEL_ITEM_FROMNEW", <<<SQL
\t\tUPDATE items SET our_category_id = 0 WHERE id = ?
SQL
);
global $db;
$srcNodes = explode(",", $_REQUEST["destNodes"]);
foreach ($srcNodes as $nodeStr) {
list($nodeId, $nodeType) = explode(":", $nodeStr);
// Удаление скопированного узла или элемента
if (strlen($nodeType) > 0) {
if ($nodeType == NODE_SITE_CATEGORY) {
$res =& $db->query(CMD_DEL_CATEGORY_FROMNEW, array($nodeId));
if (PEAR::isError($res)) {
printError($res);
exit;
}
} else {
if ($nodeType == NODE_SITE_ITEM) {
$res =& $db->query(CMD_DEL_ITEM_FROMNEW, array($nodeId));
if (PEAR::isError($res)) {
printError($res);
exit;
}
} else {
if ($nodeType == NODE_SITE_OURITEM) {
$res =& $db->query("DELETE FROM our_items WHERE id = ?", array($nodeId));
if (PEAR::isError($res)) {
printError($res);
exit;
}
}
}
}
} else {
removeNodeWithChilds($nodeId);
}
}
}
示例9: HandleViewSite
function HandleViewSite()
{
define("CMD_SEL_ITEMSCOUNT", <<<SQL
\t\tSELECT count(*) FROM items
\t\t\tWHERE category_id = ? AND our_category_id = 0
\t\t\tORDER BY status DESC, mdate DESC
SQL
);
define("CMD_SEL_SITECATEGORIES", <<<SQL
\t\tSELECT * FROM site_categories
\t\t\tWHERE site_id = ? AND our_category_id = 0
SQL
);
global $db;
$res =& $db->query(CMD_SEL_SITECATEGORIES, array($_REQUEST["siteId"]));
if (PEAR::isError($res)) {
printError($res);
exit;
}
$categories = array();
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
$catCount =& $db->getOne(CMD_SEL_ITEMSCOUNT, array($row->id));
if (PEAR::isError($catCount)) {
$catCount = 0;
}
$state = null;
if ((int) $catCount > 0) {
$state = "collapsed";
}
$customAttrs = array("siteId" => $_REQUEST["siteId"]);
$categories[] = array("nodeId" => $row->id, "name" => $row->name, "state" => $state, "tp" => NODE_SITE_CATEGORY, "image" => getCategoryImageState($row), "customAttrs" => $customAttrs);
}
printTree($categories, true, true, "TreeCategories");
print "<span id=\"siteId\" siteIdNum=\"" . $_REQUEST["siteId"] . "\" style=\"display: none;\"></span>";
}
示例10: newEDT
public function newEDT($data)
{
if (!$this->isPatient($data['pid']) || !checkFilled($data) || !verifyDate($data['dateperf']) || !checkNumber($data['cost']) || !checkNumber($data['duration']) || !checkNumber($data['pid'])) {
return false;
}
// Verify the physicians mentioned are valid
$a = new Admin();
$physicians = $a->getAllPhysicians();
$enames = explode(',', $data['enames']);
foreach ($enames as $e) {
if (!array_search(trim($e), $physicians)) {
printError("A physician specified in the Physician Names field does not exist.");
return false;
}
}
$success = true;
$pid = $data['pid'];
unset($data['pid']);
$newEDT = 0;
if (!$this->dbh->insert('EDTRecords', $data)) {
$success = false;
} else {
$result = $this->dbh->query('SELECT MAX(edtid) AS last FROM EDTRecords');
$newEDT = $result[0]['last'];
// Could potentially be bad, if the ordering of insertions between users interferes
}
if (!$this->dbh->insert('PatientExaminations', array('pid' => $pid, 'edtid' => $newEDT))) {
$success = false;
}
return $success;
}
示例11: HandleAddItem
function HandleAddItem()
{
define("CMD_ADD_OURITEM", <<<SQL
\t\tINSERT INTO our_items (name, our_category_id, art, mdate)
\t\t\tVALUES (?, ?, ?, NOW())
SQL
);
define("CMD_SEL_OURITEM_NEWID", <<<SQL
\t\tSELECT id FROM our_items
\t\t\tWHERE name = ? AND our_category_id = ? AND art = ?
SQL
);
global $db;
$newItem = iconv("UTF-8", "windows-1251", urldecode($_REQUEST["itemName"]));
$art = "art" . $_REQUEST["parentNodeId"] . "_" . time();
$res =& $db->query(CMD_ADD_OURITEM, array($newItem, $_REQUEST["parentNodeId"], $art));
if (PEAR::isError($res)) {
printError($res);
exit;
}
$newId =& $db->getOne(CMD_SEL_OURITEM_NEWID, array($newItem, $_REQUEST["parentNodeId"], $art));
if (PEAR::isError($newId)) {
printError($newId);
exit;
}
// ¬озвратить номер добавленой категории
print trim($newId);
}
示例12: HandleAddNode
function HandleAddNode()
{
define("CMD_ADD_OURSITE_CATEGORY", <<<SQL
\t\tINSERT INTO our_categories (name, parent_id) VALUES (?, ?)
SQL
);
define("CMD_SEL_OURSITE_NEWCATEGORYID", <<<SQL
\t\tSELECT id FROM our_categories WHERE name = ? AND parent_id = ?
SQL
);
global $db;
$newCategory = iconv("UTF-8", "windows-1251", urldecode($_REQUEST["categName"]));
$res =& $db->query(CMD_ADD_OURSITE_CATEGORY, array($newCategory, $_REQUEST["parentNodeId"]));
if (PEAR::isError($res)) {
printError($res);
exit;
}
$newId =& $db->getOne(CMD_SEL_OURSITE_NEWCATEGORYID, array($newCategory, $_REQUEST["parentNodeId"]));
if (PEAR::isError($newId)) {
printError($newId);
exit;
}
// ¬озвратить номер добавленой категории
print trim($newId);
}
示例13: mysqlConnectDB
function mysqlConnectDB($db)
{
$servername = "localhost";
$username = "root";
$password = "gard3ning";
$dbname = $db;
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
printError();
}
return $conn;
}
示例14: getParameter
function getParameter($name, array $argv)
{
$envName = 'GITLAB_' . preg_replace('/\\s|-/', '_', strtoupper($name));
if (isset($_ENV[$envName])) {
return $_ENV[$envName];
}
$pregName = preg_quote($name);
array_shift($argv);
foreach ($argv as $argument) {
if (preg_match("/^--{$pregName}=(.+)/", $argument, $matches)) {
return $matches[1];
}
}
printError("ERROR: Please provide the parameter --{$name} or set the environment variable {$envName}");
exit(1);
}
示例15: validateError
function validateError()
{
if (isset($_GET["error"])) {
$accion = $_GET["error"];
switch ($accion) {
case 0:
printError(0);
break;
case 1:
printError(1);
break;
case 2:
printError(2);
break;
default:
break;
}
}
}