function searchPrice_orig($parSat, $parSensor, $parDate, $parProd, $parLang) { // Verifica se produto $sql = "SELECT * FROM priceorig WHERE Satellite = '" . $parSat . "'"; $sql .= " and Sensor = '" . $parSensor . "' and Date < '" . $parDate; $sql .= "' order by Date desc"; if (!$this->bd->query($sql)) { $this->bd->error(); return 0; } $num = $this->bd->numRows(); if ($this->bd->numRows() >= 1) { $row = $this->bd->fetchRow(); $this->sat = $row["Satellite"]; $this->sensor = $row["Sensor"]; $this->date = $row["Date"]; $this->real1 = $row["Real"]; $this->dollar = $row["Dollar"]; $this->disc = $row["DiscountProduct"]; if ($parLang == "PT") { $price = $this->real1; } else { $price = $this->dollar; } if (trim($parProd) != "") { $prod = new Product($this->bd); $prod->fill($parProd); if ($prod->avai == 'F') { $price = 0; } else { $price -= $price * $this->disc / 100; } } return $price; } else { return 0; } }
echo $strBands; ?> </th><th><?php echo $strFormat; ?> </th><th><?php echo $strAction; ?> </th> </tr> <?php } for ($i = 0; $i < $nProds; $i++) { $prodRow = $dbcat->fetchRow($i); $prod = new Product($dbcat); $prod->fill($prodRow["Id"]); $varProd = "prodId" . $i; $varSub = "action" . $i; ?> <tr> <td><?php echo $prod->Id; ?> <td><?php echo $prod->sceneShift; ?> </td><td><?php echo $prod->correctioLevel; ?> </td> <td><?php
<?php #1. LOGIC Auth::kickout_non_admin('/pokecart/'); if (Input::posted()) { $product = new Product(); $product->fill(Input::all()); if ($_FILES) { $files = upload::to_folder('assets/uploads/'); if ($files[0]['error_message'] == false) { $product->image = $files[0]['filepath']; } } $product->save(); URL::redirect('/pokecart/admin'); } $title = 'Add Product' . $product->name; #2. LOAD VIEWS include VIEWS . 'header.php'; include VIEWS . 'product_form.php'; include VIEWS . 'footer.php';