本文整理汇总了PHP中CRUD::dataDel方法的典型用法代码示例。如果您正苦于以下问题:PHP CRUD::dataDel方法的具体用法?PHP CRUD::dataDel怎么用?PHP CRUD::dataDel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRUD
的用法示例。
在下文中一共展示了CRUD::dataDel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
private static function delete($id)
{
$rs = CRUD::dataDel('feedback', array('id' => $id));
if (!empty(DB::$error)) {
$msg = DB::$error;
$path = CORE::$manage . 'feedback/';
}
if (!$rs) {
$msg = self::$lang["del_error"];
$path = CORE::$manage . 'feedback/';
} else {
$msg = self::$lang["del_done"];
$path = CORE::$manage . 'feedback/';
}
CORE::msg($msg, $path);
}
示例2: del
private static function del()
{
$path = CORE::$manage . 'rewrite/';
if (empty($_POST['call'])) {
echo self::$lang['no_args'];
return false;
}
CRUD::dataDel('rewrite', array('id' => $_POST['call']));
if (!empty(DB::$error)) {
$msg = DB::$error;
} else {
$msg = self::$lang['del_done'];
}
echo $msg;
}
示例3: level_del
private static function level_del()
{
CRUD::dataDel('level', array('id' => $_POST["call"]));
if (!empty(DB::$error)) {
echo DB::$error;
} else {
echo 'DONE';
}
}
示例4: multi
public static function multi($tb_name = false, $path = false)
{
list($func, $action, $args) = CORE::$args;
CHECK::is_array_exist($_POST["id"]);
CHECK::is_must($action);
if (CHECK::is_pass() && $tb_name !== false) {
# 依照排序要求更改陣列排序, 以符合自動排序邏輯
if ($action == "sort") {
asort($_POST["sort"]);
foreach ($_POST["sort"] as $id => $sort) {
if (isset($_POST["id"][$id]) && !empty($_POST["id"][$id])) {
$new_args[] = $_POST["id"][$id];
}
}
} else {
$new_args = $_POST["id"];
}
foreach ($new_args as $key => $id) {
switch ($action) {
case "sort":
CRUD::dataUpdate($tb_name, array('id' => $id, 'sort' => $_POST["sort"][$id]));
if (!empty(DB::$error)) {
$msg = DB::$error;
}
break;
case "status":
CRUD::dataUpdate($tb_name, array('id' => $id, 'status' => $args));
if (!empty(DB::$error)) {
$msg = DB::$error;
}
break;
case "clone":
/*
$rsnum = CRUD::dataFetch($tb_name,array('id' => $id));
if(!empty($rsnum)){
list($row) = CRUD::$data;
unset($row["id"]);
CRUD::dataInsert($tb_name,$row);
if(!empty(DB::$error)){
$msg = DB::$error;
}
}else{
$msg = self::$lang["no_args"];
}
*/
break;
case "del":
$rs = CRUD::dataDel($tb_name, array('id' => $id));
if (!empty(DB::$error)) {
$msg = DB::$error;
}
if (!$rs) {
$msg = self::$lang["del_error"];
}
break;
}
if (!empty($msg)) {
break;
}
}
} else {
$msg = self::$lang["no_args"];
}
if (empty($msg)) {
$msg = self::$lang["modify_done"];
} else {
$path = self::$temp_option["MSG"];
}
CORE::msg($msg, $path);
}