<?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); } }
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 = 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; }
<?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();
</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);
<?php require "../../frame.php"; $nid = intval($_POST['nid']); $pid = intval($_POST['pid']); $type = $_POST['type']; $db = get_db(); if ($type == 'publish') { $relation = new table_class("fb_magazine_relation"); $relation->magazine_id = $pid; $relation->resource_id = $nid; $relation->save(); } elseif ($type == 'revocation') { $relation = new table_class("fb_magazine_relation"); $relation->delete($nid); } elseif ($type == 'set_down') { $relation = new table_class("fb_magazine_relation"); $relation->find($nid); $relation->is_show = 0; $relation->save(); } elseif ($type == 'set_up') { $relation = new table_class("fb_magazine_relation"); $relation->find($nid); $relation->is_show = 1; $relation->save(); } 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--) {
$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']) {
<?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;
<?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]); }
<?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;
<?php require_once "../../frame.php"; $item = new table_class($tb_view_modules); if ($item->delete($_POST['id'])) { echo 'ok'; }
<?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); } }
<?php include_once '../../frame.php'; if ($_POST['post_type'] == "del") { $post = new table_class("eb_comment"); $post->delete($_POST['del_id']); }
<?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, '评论通过审批'); } }
<?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;
<?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']); }
<?php require "../../frame.php"; $id = $_POST['id']; $fb_gs = new table_class('fb_company_industry'); $fb_gs->delete($id);
<?php include_once '../../frame.php'; $id = $_POST['id']; $fortune = new table_class('fb_rich_fortune'); $fortune->delete($id);