예제 #1
0
 public function index()
 {
     if (!APP_DEBUG) {
         exit("can't do it.\n");
     }
     DBBackup(array("zip", "sendmail"));
     $tables = array("data_model_data", "express", "finance_receive_plan", "finance_record", "finance_pay_plan", "goods", "goods_craft", "orders", "orders_detail", "produce_boms", "produce_plan", "produce_plan_detail", "product_tpl", "product_tpl_detail", "purchase", "purchase_detail", "relationship_company", "relationship_company_linkman", "returns", "returns_detail", "session", "stockin", "stockin_detail", "stockout", "stockout_detail", "stock_product_list", "workflow_process");
     $model = M();
     foreach ($tables as $table) {
         $sql = sprintf("TRUNCATE TABLE %s%s", C("DB_PREFIX"), $table);
         $model->execute($sql);
     }
 }
예제 #2
0
 public function insert()
 {
     $options = array();
     if ($_POST["options"]["send_email"]) {
         array_push($options, "sendmail");
     }
     if ($_POST["options"]["packit"]) {
         array_push($options, "zip");
     }
     if ($_POST["options"]["autodelete"]) {
         array_push($options, "autodelete");
     }
     $rs = DBBackup($options);
     //        print_r($options);
     //        var_dump($rs);
     echo true === $rs ? "success" : $rs;
 }
예제 #3
0
 public function index()
 {
     DBBackup(array("zip", "sendmail"));
 }