Example #1
0
 function getAllProducts()
 {
     //getting product information
     $list = $_POST["pid"];
     $this->productList = count($list);
     //print_r($list);
     //echo "$this->productList";
     //reorganize posted data
     $pid = $_POST["pid"];
     $qty = $_POST["qty"];
     $sp = $_POST["sp"];
     $cpDoz = $_POST["cpDoz"];
     $descr = $_POST["descr"];
     //print_r($list);
     foreach ($list as $index => $value) {
         //echo "1--";
         $product = new Product("{$pid[$index]}", "{$qty[$index]}");
         $product->sp = $sp[$index];
         $product->cpDoz = $cpDoz[$index];
         $product->descr = $descr[$index];
         $product->qty = $qty[$index];
         $product->setTotalCpSp();
         $this->product[] = $product;
     }
     $this->uploadPhotos();
 }