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


PHP Phone::delete方法代码示例

本文整理汇总了PHP中Phone::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Phone::delete方法的具体用法?PHP Phone::delete怎么用?PHP Phone::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phone的用法示例。


在下文中一共展示了Phone::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete()
 {
     if (!Phone::delete($_POST['id'])) {
         $_SESSION['ERROR'] = "Unable to delete phone number.";
     }
     // THIS IS STUPID
     header("LOCATION: " . $_POST['path']);
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:8,代码来源:phone_controller.php

示例2: printf

printf("\r%u / %u", $i, $total);
if ($skipped != 0) {
    printf("\n%u addresses skipped.\n", $skipped);
}
if ($fixed != 0) {
    printf("\n%u addresses fixed.\n", $fixed);
}
print "\nAddress formating done.\n\n";
print "Formats non formated phones. (3/4)\n";
$it = XDB::rawIterator("SELECT  search_tel AS search, display_tel AS display, comment, link_id,\n                                tel_type AS type, link_type, tel_id AS id, pid, pub\n                          FROM  profile_phones\n                         WHERE  search_tel = '' OR search_tel IS NULL\n                      ORDER BY  pid, link_id, tel_id");
$total = $it->total();
$i = 0;
$j = 0;
while ($item = $it->next()) {
    $phone = new Phone($item);
    $phone->delete();
    $phone->save();
    ++$i;
    ++$j;
    if ($j == 100) {
        $j = 0;
        printf("\r%u / %u", $i, $total);
    }
}
printf("\r%u / %u", $i, $total);
print "\nFormating done.\n\n";
print "Deletes duplicated phones. (4/4)\n";
$pids = XDB::rawFetchColumn("SELECT  DISTINCT(pid)\n                               FROM  profile_phones AS p1\n                              WHERE  link_type = 'user' AND EXISTS (SELECT  *\n                                                                      FROM  profile_phones AS p2\n                                                                     WHERE  p2.link_type = 'user' AND p2.pid = p1.pid AND p2.tel_id != p1.tel_id)\n                           ORDER BY  pid");
$total = count($pids);
$done = 0;
$aux = 0;
开发者ID:Ekleog,项目名称:platal,代码行数:31,代码来源:merge_issues.php

示例3: Phone

if (!isset($_GET["order"])) {
    $_GET["order"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$phone = new Phone();
if (isset($_POST["add"])) {
    $phone->check(-1, 'w', $_POST);
    $newID = $phone->add($_POST);
    Event::log($newID, "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . ".");
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_POST["delete"])) {
        $phone->check($_POST["id"], 'd');
        $phone->delete($_POST);
        Event::log($_POST["id"], "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        $phone->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $phone->check($_POST["id"], 'd');
            $phone->restore($_POST);
            Event::log($_POST["id"], "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][23]);
            $phone->redirectToList();
        } else {
            if (isset($_REQUEST["purge"])) {
                $phone->check($_REQUEST["id"], 'd');
                $phone->delete($_REQUEST, 1);
                Event::log($_REQUEST["id"], "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][24]);
                $phone->redirectToList();
            } else {
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:phone.form.php

示例4: Phone

    $_GET["withtemplate"] = "";
}
$phone = new Phone();
if (isset($_POST["add"])) {
    $phone->check(-1, CREATE, $_POST);
    if ($newID = $phone->add($_POST)) {
        Event::log($newID, "phones", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
        if ($_SESSION['glpibackcreated']) {
            Html::redirect($phone->getFormURL() . "?id=" . $newID);
        }
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $phone->check($_POST["id"], DELETE);
        $phone->delete($_POST);
        Event::log($_POST["id"], "phones", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        $phone->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $phone->check($_POST["id"], DELETE);
            $phone->restore($_POST);
            Event::log($_POST["id"], "phones", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            $phone->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $phone->check($_POST["id"], PURGE);
                $phone->delete($_POST, 1);
                Event::log($_POST["id"], "phones", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                $phone->redirectToList();
            } else {
开发者ID:btry,项目名称:glpi,代码行数:31,代码来源:phone.form.php


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