Exemplo n.º 1
0
 public function details($arg = null)
 {
     $data = array();
     if (!empty($arg[0])) {
         $order = new Orders();
         $orders = $order->getOrdersByDetailsId($arg[0]);
         foreach ($orders as $key => $o) {
             $data[$key]['name'] = $o->getProductName();
             $data[$key]['quantity'] = $o->getQuantity();
             $data[$key]['price'] = $o->getPrice();
             $data[$key]['product_id'] = $o->getProductId();
         }
     }
     $this->render('order_details', array('categories' => $this->categories, 'd_product' => $this->d_product, 'orders' => $data, 'ids' => $this->category_ids));
 }
Exemplo n.º 2
0
 public function orderDetails()
 {
     $http = new Http();
     $id = $http->post('id');
     $orders_m = new Orders();
     $orders = $orders_m->getOrdersByDetailsId($id);
     $order_det = new Order_details($id);
     $order_data = array();
     $order_details = array();
     $shippment = new Shippment($order_det->getShippingMethodId());
     $order_details['shipping_method'] = $shippment->getShippingName();
     $order_details['address'] = $order_det->getAddress();
     if (!empty($orders)) {
         foreach ($orders as $key => $o) {
             $order_data[$key]['product_name'] = $o->getProductName();
             $order_data[$key]['product_quantity'] = $o->getQuantity();
             $order_data[$key]['product_price'] = $o->getPrice();
             $order_data[$key]['product_id'] = $o->getProductId();
         }
     }
     echo $this->render('adminorder', array('order_data' => $order_data, 'order_details' => $order_details, 'order_nr' => $order_det->getOrderNr()));
 }
Exemplo n.º 3
0
 public function deleteOrder($id, $user = true)
 {
     $details = new Order_details($id);
     if (!empty($details)) {
         if ($user) {
             $details->setDisplayUser(false);
             $details->writeData(true);
         } else {
             $details->setDisplaySeller(false);
             $details->writeData(true);
         }
         if (!$details->getDisplaySeller() && !$details->getDisplayUser()) {
             $ord = new Orders();
             $to_delate = $ord->getOrdersByDetailsId($details->getId());
             foreach ($to_delate as $d) {
                 $d->delete();
             }
             $details->delete();
             return;
         }
     }
 }