Example #1
0
 /**
  * @var $date datetime
  * @uses the constructor of Order class
  * @return new instance of Order class
  * @author ROUINEB Hamza
  * */
 public function __construct($date)
 {
     $this->date_order = new DateTime();
     $this->date_order->createFromFormat('d/m/y', $date);
     $this->valid = false;
     $this->order_book = new ArrayCollection();
 }
Example #2
0
 public function Book($title, $year, $price, $img = '../../img/Small/php.jpg')
 {
     $this->title = $title;
     $this->year = new DateTime();
     $this->year->createFromFormat('d/d/m/y', $year);
     $this->price = $price;
     $this->img = $img;
     $this->authors = new ArrayCollection();
     $this->categories = new ArrayCollection();
 }
Example #3
0
 public function grabar($fila)
 {
     var_dump($fila);
     $codigo = $fila['_codigo'];
     $titulo = $fila['_titulo'];
     $fecha = datetime::createFromFormat('d-m-Y', $fila['_fechaCurriculo']);
     $fechaTxt = $fecha->format('Y-m-d');
     $sql = "UPDATE estudio " . " SET codigo = '{$codigo}'," . " titulo='{$titulo}'," . " fechaCurriculo='{$fechaTxt}' " . " WHERE id=" . $fila['_id'];
     $resultado = $this->_db->query($sql);
     if ($this->_db->errno) {
         die('Error en la consulta UPDATE' . '<br>' . $sql);
     }
 }
Example #4
0
 function getExpectedShippingDate($shippingDate = NULL)
 {
     $products = $this->getProducts();
     $maxShippingSla = 0;
     foreach ($products as $productrecord) {
         $product_id = (int) $productrecord['id_product'];
         $product = new Product($product_id, true, 1);
         if ($maxShippingSla < $product->shipping_sla) {
             $maxShippingSla = $product->shipping_sla;
         }
     }
     $maxShippingSla = $maxShippingSla + $this->getCartCustomizationSLA();
     if (empty($shippingDate)) {
         $shippingDate = new DateTime();
     } else {
         $shippingDate = datetime::createFromFormat("Y-m-d H:i:s", (string) $shippingDate);
     }
     $shippingDate = Tools::getNextWorkingDate($maxShippingSla, $shippingDate);
     return $shippingDate;
 }