/**
  * The Controller will take the URLSegment parameter from the URL
  * and use that to look up a record.
  */
 public function __construct($dataRecord = null)
 {
     if (!$dataRecord) {
         $dataRecord = new CatalogueProduct();
         if ($this->hasMethod("Title")) {
             $dataRecord->Title = $this->Title();
         }
         $dataRecord->URLSegment = get_class($this);
         $dataRecord->ID = -1;
     }
     $this->dataRecord = $dataRecord;
     $this->failover = $this->dataRecord;
     parent::__construct();
 }
Ejemplo n.º 2
0
                }
                foreach ($row as $k => $value) {
                    $results[$col][$fields[$k]] = $value;
                }
                $col++;
                unset($row);
            }
            if (!feof($handle)) {
                echo "Erreur: fgets() échoue";
            }
            fclose($handle);
        }
        return $results;
    }
    private function traitementTableau($tableau)
    {
        $i = 0;
        $Feuilles = array();
        foreach ($tableau as $valeur) {
            $i++;
            extract($valeur);
            $Feuilles[$i]["REFERENCE"] = $REFERENCE;
            $Feuilles[$i]["DESIGNATION"] = $DESIGNATION;
            $Feuilles[$i]["PRIXUNITAIRE"] = $PRIXUNITAIRE;
            $Feuilles[$i]["QTE_TARIF_VENTE"] = $QTE_TARIF_VENTE;
        }
        return $Feuilles;
    }
}
$Catalogue = new CatalogueController();
$Catalogue->index();