Exemple #1
0
 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);
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 private static function level_del()
 {
     CRUD::dataDel('level', array('id' => $_POST["call"]));
     if (!empty(DB::$error)) {
         echo DB::$error;
     } else {
         echo 'DONE';
     }
 }
Exemple #4
0
 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);
 }