Пример #1
0
 public function deleteOrder()
 {
     $po = new CartModel();
     $po_id = isset($_GET['po']) ? addslashes($_GET['po']) : die('no id');
     $po->getByID($po_id);
     if ($po->userid != Account::getMyID()) {
         die('Hacking Attempt');
     }
     $po->payment_status = 4;
     $po->load = 1;
     $po->save();
     CartWeb::kurangiStok($po_id, 0, 0);
     header("Location:" . _SPPATH . "myorder");
     exit;
 }
Пример #2
0
 public function sendOrderBulk()
 {
     $err = 0;
     $name = addslashes($_POST['name']);
     if ($name == "") {
         $err = 1;
     }
     /*$email = addslashes($_POST['email']);
       if($email==""){
           $err = 1;
       }
       if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
           $err = 1;
       }*/
     $mobile = addslashes($_POST['mobile']);
     if ($mobile == "") {
         $err = 1;
     }
     $address = addslashes($_POST['address']);
     if ($address == "") {
         $err = 1;
     }
     //prop:prop,city:kota,pengirim_name:pengirim_name,pengirim_mobile:pengirim_mobile
     $prop = addslashes($_POST['prop']);
     if ($prop == "") {
         $err = 1;
     }
     $city = addslashes($_POST['city']);
     if ($city == "") {
         $err = 1;
     }
     $pengirim_name = addslashes($_POST['pengirim_name']);
     if ($pengirim_name == "") {
         $err = 1;
     }
     $pengirim_mobile = addslashes($_POST['pengirim_mobile']);
     if ($pengirim_mobile == "") {
         $err = 1;
     }
     //total_goodcost:total_goodcost,berat_total:berat_total,jne_type:jne_type,jne_price:jne_price
     //total_shipcost:total_shipcost,total_cost:total_cost
     $total_goodcost = addslashes($_POST['total_goodcost']);
     if ($total_goodcost == "") {
         $err = 1;
     }
     $berat_total = addslashes($_POST['berat_total']);
     if ($berat_total == "") {
         $err = 1;
     }
     $jne_type = addslashes($_POST['jne_type']);
     if ($jne_type == "") {
         $err = 1;
     }
     $jne_price = addslashes($_POST['jne_price']);
     if ($jne_price == "") {
         $err = 1;
     }
     $total_shipcost = addslashes($_POST['total_shipcost']);
     if ($total_shipcost == "") {
         $err = 1;
     }
     $total_cost = addslashes($_POST['total_cost']);
     if ($total_cost == "") {
         $err = 1;
     }
     if (self::hasCart() < 1) {
         $err = 1;
     }
     $arrOOS = self::cekStok();
     $kurang_stok = count($arrOOS);
     if ($kurang_stok) {
         $err = 1;
     }
     if (!$err) {
         $cm = new CartModel();
         $cm->po_address = $address;
         $cm->po_name = $name;
         $cm->po_mobile = $mobile;
         $cm->po_date = leap_mysqldate();
         $cm->po_email = $email;
         $cm->po_pesanan_retail = json_encode(self::getCart());
         $cm->po_ip_address = $_SERVER['REMOTE_ADDR'];
         //baru
         $cm->prop = $prop;
         $cm->city = $city;
         $cm->pengirim_mobile = $pengirim_mobile;
         $cm->pengirim_name = $pengirim_name;
         $cm->total_goodcost = $total_goodcost;
         $cm->total_cost = $total_cost;
         $cm->total_shipcost = $total_shipcost;
         $cm->jne_price = $jne_price;
         $cm->jne_type = $jne_type;
         $cm->berat_total = $berat_total;
         $cm->jumlah_item = self::hasCart();
         $cm->po_pesanan_bulk = json_encode(self::getCartBulk());
         $arrm = array("retail" => self::getCart(), "bulk" => self::getCartBulk());
         $cm->po_pesanan = json_encode($arrm);
         $cm->userid = Account::getMyID();
         $cm->user_email = Account::getMyEmail();
         $po_id = $cm->save();
         if ($po_id) {
             self::kurangiStok($po_id);
             $json['bool'] = 1;
             $json['po'] = $po_id;
             //leap mail
             $lm = new Leapmail();
             $lm->senderMail = "*****@*****.**";
             $isi .= "Terima Kasih Anda Telah Melakukan Pemesanan \n\n";
             $isi .= "";
             $isi .= "Detail Pesanan : " . _BPATH . "CartOrder/details?po={$po_id} \n";
             $isi .= "Konfirmasi Sukses : " . _BPATH . "ordersuccesspage?po={$po_id} \n";
             $isi .= "Order History : " . _BPATH . "myorder \n\n";
             $isi .= "Terima Kasih Atas Pemesanan Anda, Silahkan Melakukan Transfer ke Rek \n";
             $isi .= str_replace("<br>", "\n", Efiwebsetting::getData('rek_bca'));
             $isi .= "\n\n Dengan berita 'Payment NR " . $po_id . "'";
             $isi .= "\n\n Pembayaran dengan Nama Rekening yang berbeda dengan Nama Account B3L1 Anda, HARUS melampirkan BERITA Transfer.";
             $isi .= "\n\n Barang akan kami process setelah pembayaran diterima. \n Pengiriman akan dilakukan setelah itu. ";
             $isi .= "\n\n Lama delivery sesuai JNE delivery sekitar 3-4 hari untuk paket REGULAR dan 1 hari untuk paket Yakin Esok Sampai.";
             $isi .= "\n\n Untuk Informasi lebih lanjut bisa melakukan email ke info@b3l1.com";
             $lm->sendEmail($cm->user_email, "Pemesanan Produk B3l1.COM", $isi);
             //$to = "*****@*****.**";
             //$subject = "Pemesanan b3l1";
             //$message = "Tgl : ".$cm->po_date."\n Nama : ".$name."\n Email :".$email."\n Mobile : ".$mobile."\n Address : ".$address."\n Pesanan : ".$cm->po_pesanan;
             //mail($to, $subject, $message);
             //header("Location:"._SPPATH."ordersuccesspage");
             //exit();
             $cm->getByID($po_id);
             $cm->load = 1;
             $cm->iden_nr = Account::getMyEmail() . " ORDER NR : " . $po_id;
             $cm->save();
         }
     } else {
         $json['bool'] = 0;
     }
     echo json_encode($json);
     exit;
 }
Пример #3
0
 public function setStatus()
 {
     $payment_status = isset($_GET['ps']) ? addslashes($_GET['ps']) : die('no ps');
     $po_id = isset($_GET['po']) ? addslashes($_GET['po']) : die('no po');
     $po = new CartModel();
     $po->getByID($po_id);
     $payment_status_lama = $po->payment_status;
     if ($payment_status_lama == '3') {
         //canceled ke gak canceled
         // kurangi stok
         CartWeb::kurangiStok($po_id, 1, 0);
     }
     if ($payment_status == '3') {
         //gak canceled ke canceled
         // release stok //tambah stok
         CartWeb::kurangiStok($po_id, 0, 0);
     }
     if ($payment_status == '1') {
         //leap mail
         $lm = new Leapmail();
         $lm->senderMail = "*****@*****.**";
         $isi .= "Terima Kasih Anda Telah Melakukan Pembayaran \n\n";
         $isi .= "";
         $isi .= "Detail Pesanan : " . _BPATH . "CartOrder/details?po={$po_id} \n";
         $isi .= "Order History : " . _BPATH . "myorder \n\n";
         $isi .= "\n\n Pengiriman akan kami jalankan secepatnya.";
         $isi .= "\n\n Lama delivery sesuai JNE delivery sekitar 3-4 hari untuk paket REGULAR dan 1 hari untuk paket Yakin Esok Sampai.";
         $isi .= "\n\n Untuk Informasi lebih lanjut bisa melakukan email ke info@b3l1.com";
         $lm->sendEmail($po->user_email, "Konfirmasi Pemrosesan Pemesanan Produk B3l1.COM", $isi);
     }
     if ($payment_status == '2') {
         //leap mail
         $lm = new Leapmail();
         $lm->senderMail = "*****@*****.**";
         $isi .= "Pengiriman Produk Pesanan Anda Sudah Dilakukan \n\n";
         $isi .= "";
         $isi .= "Detail Pesanan : " . _BPATH . "CartOrder/details?po={$po_id} \n";
         $isi .= "Order History : " . _BPATH . "myorder \n\n";
         $isi .= "\n\n Lama delivery sesuai JNE delivery sekitar 3-4 hari untuk paket REGULAR dan 1 hari untuk paket Yakin Esok Sampai.";
         $isi .= "\n\n Untuk Informasi lebih lanjut bisa melakukan email ke info@b3l1.com";
         $lm->sendEmail($po->user_email, "Pengiriman Produk B3l1.COM", $isi);
     }
     $po->payment_status = $payment_status;
     $po->load = 1;
     $po->save();
 }