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


PHP table_class::delete方法代码示例

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


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

示例1: intval

<?php

require "../../frame.php";
$nid = intval($_POST['nid']);
$pid = intval($_POST['pid']);
$type = $_POST['type'];
$db = get_db();
if ($type == 'publish') {
    $pos = new table_class("fb_list_relation");
    $pos->list_id = $pid;
    $pos->rela_id = $nid;
    $pos->save();
} elseif ($type == 'revocation') {
    $pos = new table_class("fb_list_relation");
    $pos->delete($nid);
} elseif ("edit_priority" == $type) {
    $id_str = explode("|", $_POST['id_str']);
    $priority_str = explode("|", $_POST['priority_str']);
    $id_str_num = sizeof($id_str) - 1;
    $priority = 'priority';
    for ($i = $id_str_num - 1; $i >= 0; $i--) {
        if ($priority_str[$i] == "") {
            $priority_str[$i] = "";
        }
        $db = get_db();
        $sql = "update fb_list_relation set " . $priority . "=" . $priority_str[$i] . " where id=" . $id_str[$i];
        $db->execute($sql);
    }
}
开发者ID:sauger,项目名称:forbes_old,代码行数:29,代码来源:relation.post.php

示例2: values

            continue;
        }
        $db->execute("insert into eb_news_keywords (name) values('{$val}') on duplicate key update name='{$val}'");
    }
}
//handle the publish schedule
if (isset($_POST['publish_schedule_date'])) {
    $schedule = new table_class('eb_publish_schedule');
    if ($id) {
        $schedule->find_by_resource_id($id);
    }
    if ($_POST['publish_schedule_date']) {
        $schedule->publish_date = $_POST['publish_schedule_date'];
        $schedule->resource_id = $news->id;
        $schedule->resource_type = 'news';
        $schedule->save();
    } else {
        if ($schedule->id) {
            $schedule->delete();
        }
    }
}
if ($_POST['copy_news']) {
    $news->copy_from = $news->id;
    $news->id = 0;
    $news->category_id = intval($_POST['copy_news']);
    $news->save();
}
$href = "news_list.php";
redirect($href . '?category=' . $_POST['news']['category_id']);
#var_dump($news);
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:news.post.php

示例3: intval

$id = intval($_POST['id']);
if (empty($id)) {
    die("invalid request!");
}
include "../../frame.php";
$list = new table_class('fb_custom_list_type');
$list->find($id);
$errro = 'fail to delete list';
$db = get_db();
if ($list->list_type == 1) {
    $table_name = $list->table_name;
    if (false === $db->execute("drop table `{$table_name}`")) {
        die($errro);
    }
} else {
    if ($list->list_type == 2) {
        if ($db->execute("delete from fb_rich_list_items where list_id={$list->id}") === false) {
            die($errro);
        }
    } else {
        if ($list->list_type == 3) {
            if ($db->execute("delete from fb_famous_list_items where list_id={$list->id}") === false) {
                die($errro);
            }
        }
    }
}
if ($list->delete() === false) {
    echo $errro;
}
开发者ID:sauger,项目名称:forbes_old,代码行数:30,代码来源:delete_list.post.php

示例4:

<?php

require "../../frame.php";
$id = $_POST['id'];
$attr = new table_class('fb_city_list_attribute');
$attr->delete($id);
$db = get_db();
$db->execute("delete from fb_city_list_content where attribute_id=" . $id);
close_db();
开发者ID:sauger,项目名称:forbes_old,代码行数:9,代码来源:del_attr.php

示例5: intval

</head>
<?php 
require_once '../../frame.php';
$question = new table_class('fb_survey_question');
$id = intval($_POST['id']);
if (!empty($_POST['id'])) {
    $question->find($_POST['id']);
} else {
    $question->survey_id = $_POST['p_id'];
}
$question->update_attributes($_POST['post']);
for ($i = 0; $i < count($_POST['item']['id']); $i++) {
    $item = new table_class('fb_survey_item');
    $item->find($_POST['item']['id'][$i]);
    if (empty($_POST['item']['name'][$i])) {
        $item->delete($_POST['item']['id'][$i]);
    } else {
        $item->name = $_POST['item']['name'][$i];
        $item->save();
    }
}
for ($i = 0; $i < count($_POST['item']['new_name']); $i++) {
    $item = new table_class('fb_survey_item');
    if ($_POST['item']['new_name'][$i] != '') {
        $item->name = $_POST['item']['new_name'][$i];
        $item->question_id = $question->id;
        $item->survey_id = $question->survey_id;
        $item->save();
    }
}
redirect('list.php?id=' . $question->survey_id);
开发者ID:sauger,项目名称:forbes_old,代码行数:31,代码来源:edit2.post.php

示例6: elseif

                $post->delete($e_id);
            }
        }
    } elseif ($_POST['db_table'] == 'fb_industry') {
        $db = get_db();
        $db->execute("delete from fb_company_industry where industry_id = {$_POST['del_id']}");
    } elseif ($_POST['db_table'] == 'fb_gs') {
        $db = get_db();
        $db->execute("delete from fb_company_industry where company_id = {$_POST['del_id']}");
    } elseif ($_POST['db_table'] == 'fb_admin_menu') {
        $db = get_db();
        $right = new table_class('fb_rights');
        $right->find('first', array('conditions' => "name='{$_POST['del_id']}' and type=2"));
        if ($right->id) {
            $db->execute("delete from fb_role_rights where rights_id = {$right->id}");
            $right->delete();
        }
    }
    if (isset($_POST['rela'])) {
        $db = get_db();
        $db->execute("delete from fb_position_relation where type='{$_POST['rela']}' and news_id={$_POST['del_id']}");
    }
    $post->delete($_POST['del_id']);
    echo $_POST['del_id'];
} elseif ("edit" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attributes($_POST['post']);
    redirect($_POST['url']);
} elseif ("edit_priority" == $_POST['post_type']) {
开发者ID:sauger,项目名称:forbes,代码行数:31,代码来源:pub.post.php

示例7: elseif

<?php 
require_once "../../frame.php";
if ($_POST['post_type'] == 'del') {
    $db = get_db();
    $sql = 'delete from eb_question where id=' . $_POST['del_id'];
    $db->execute($sql);
    $sql = 'delete from eb_question_item where question_id=' . $_POST['del_id'];
    $db->execute($sql);
    close_db();
    echo $_POST['del_id'];
} elseif ($_POST['post_type'] == 'del_item') {
    $question_item = new table_class('eb_question_item');
    $question_item->delete($_POST['del_id']);
} else {
    #var_dump($_POST);
    $question = new table_class('eb_question');
    if ($_POST['id']) {
        $question->find($_POST['id']);
    } else {
        $question->problem_id = $_POST['pid'];
        $question->create_time = now();
    }
    $question->update_attributes($_POST['question']);
    if ($_POST['question_item']['id']) {
        //处理结果报表
        $len = count($_POST['question_item']['id']);
        $result = new table_class('eb_question_item');
        $result->question_id = $question->id;
        for ($i = 0; $i < $len; $i++) {
            if ($_POST['question_item']['changed'][$i]) {
                $result->id = $_POST['question_item']['id'][$i] ? $_POST['question_item']['id'][$i] : 0;
开发者ID:justin1986,项目名称:eachbb,代码行数:31,代码来源:question.post.php

示例8: intval

<?php

include "../../frame.php";
$id = intval($_POST['id']);
$category = new category_class();
$ids = $category->children_map($id);
for ($i = 0; $i < count($ids); $i++) {
    $cate = new table_class("eb_category");
    $cate->delete($ids[$i]);
}
开发者ID:justin1986,项目名称:eachbb,代码行数:10,代码来源:post.php

示例9:

<?php

require "../../frame.php";
$id = $_POST['del_id'];
$city = new table_class('fb_city');
$city->delete($id);
$db = get_db();
$db->execute("delete from fb_city_list_content where city_id=" . $id);
close_db();
echo $id;
开发者ID:sauger,项目名称:forbes_old,代码行数:10,代码来源:del_city.php

示例10:

<?php

require_once "../../frame.php";
$item = new table_class($tb_view_modules);
if ($item->delete($_POST['id'])) {
    echo 'ok';
}
开发者ID:justin1986,项目名称:frame2,代码行数:7,代码来源:view_item_delete.php

示例11:

<?php

session_start();
include_once '../../frame.php';
judge_role();
$type = $_POST['type'];
$id = $_POST['id'];
$position = new table_class('eb_position');
if ($type == 'add') {
    $position->source_id = $id;
    $position->pos_name = 'hart_news';
    $position->save();
} else {
    if ($type == 'del') {
        $position->delete($id);
    }
}
开发者ID:justin1986,项目名称:eachbb,代码行数:17,代码来源:post.php

示例12:

<?php

include_once '../../frame.php';
if ($_POST['post_type'] == "del") {
    $post = new table_class("eb_comment");
    $post->delete($_POST['del_id']);
}
开发者ID:justin1986,项目名称:eachbb,代码行数:7,代码来源:comment.post.php

示例13: elseif

<?php

include_once '../../frame.php';
if ($_POST['post_type'] == "del") {
    $post = new table_class("fb_comment");
    $post->delete($_POST['comment_id']);
    echo $_POST['comment_id'];
} elseif ($_POST['post_type'] == 'unapprove') {
    $id = intval($_POST['id']);
    $db = get_db();
    $db->execute("update fb_comment set is_approve = 0 where id={$id}");
} elseif ($_POST['post_type'] == 'approve') {
    $id = intval($_POST['id']);
    $db = get_db();
    $db->execute("update fb_comment set is_approve = 1 where id={$id}");
    $db->query("select user_id from fb_comment where id = {$id}");
    $user_id = intval($db->field_by_name('user_id'));
    if ($user_id) {
        adjust_user_score($user_id, 30, '评论通过审批');
    }
}
开发者ID:sauger,项目名称:forbes,代码行数:21,代码来源:comment.post.php

示例14:

<?php

require "../../frame.php";
$id = $_POST['del_id'];
$list = new table_class('fb_city_list');
$list->delete($id);
$db = get_db();
$db->execute("delete from fb_city_list_attribute where list_id=" . $id);
$db->execute("delete from fb_city_list_content where list_id=" . $id);
close_db();
echo $id;
开发者ID:sauger,项目名称:forbes_old,代码行数:11,代码来源:del_list.php

示例15:

<?php

session_start();
include_once '../../frame.php';
judge_role();
$rela = new table_class('fb_investor_news');
if ($_POST['type'] == 'publish') {
    $rela->investor_id = $_POST['investor_id'];
    $rela->news_id = $_POST['news_id'];
    $rela->save();
} else {
    $rela->delete($_POST['id']);
}
开发者ID:sauger,项目名称:forbes,代码行数:13,代码来源:rela_news.php


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