当前位置: 首页>>代码示例>>PHP>>正文


PHP printError函数代码示例

本文整理汇总了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;
                }
            }
        }
    }
}
开发者ID:rivetweb,项目名称:old-auto-catalog,代码行数:31,代码来源:HandleMoveNode.php

示例2: do_page

function do_page()
{
    handleActions();
    printError();
    printAddCardSet();
    printChangePasswordForm();
}
开发者ID:jamuraa,项目名称:gatherling,代码行数:7,代码来源:admincp.php

示例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);
}
开发者ID:davidpoulos,项目名称:SchoolWork,代码行数:27,代码来源:asg9Requests.php

示例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>';
}
开发者ID:Cogax,项目名称:dbclient,代码行数:27,代码来源:func.php

示例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;
}
开发者ID:ecomotion,项目名称:pollencms,代码行数:27,代码来源:se_smarty_fct.php

示例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');
 }
开发者ID:terrasystems,项目名称:csgobattlecom,代码行数:28,代码来源:Controller.php

示例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);
}
开发者ID:jamuraa,项目名称:gatherling,代码行数:28,代码来源:seriescp.php

示例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);
        }
    }
}
开发者ID:rivetweb,项目名称:old-auto-catalog,代码行数:60,代码来源:HandleRemoveNode.php

示例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>";
}
开发者ID:rivetweb,项目名称:old-auto-catalog,代码行数:35,代码来源:HandleViewSite.php

示例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;
 }
开发者ID:h4xnoodle,项目名称:cs348,代码行数:31,代码来源:treatment.class.php

示例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);
}
开发者ID:rivetweb,项目名称:old-auto-catalog,代码行数:28,代码来源:HandleAddItem.php

示例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);
}
开发者ID:rivetweb,项目名称:old-auto-catalog,代码行数:25,代码来源:HandleAddNode.php

示例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;
}
开发者ID:tapananand,项目名称:trackingDemo,代码行数:12,代码来源:dbfunctions.php

示例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);
}
开发者ID:fgrosse,项目名称:gitlab-api,代码行数:16,代码来源:cli_helper.php

示例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;
        }
    }
}
开发者ID:Edwin504,项目名称:cesamo_Amapala,代码行数:19,代码来源:login.php


注:本文中的printError函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。