public function addProduct( Sellable $product ) { $this->_productList[] = $product; } public function stockUp() { foreach ( $this->_productList as $product ) { $product->addStock( 100 ); } } } $tv = new Television; $tv->setScreenSize( 42 ); $ball = new TennisBall; $ball->setColor( "yellow" ); $manager = new StoreManager(); $manager->addProduct( $tv ); $manager->addProduct( $ball ); $manager->stockUp(); echo "<p>There are ". $tv->getStockLevel() . " " . $tv->getScreenSize(); echo "-inch televisions and " . $ball->getStockLevel() . " " . $ball->getColor(); echo " tennis balls in stock.</p>"; echo "<p>Selling a television...</p>"; $tv->sellItem(); echo "<p>Selling two tennis balls...</p>"; $ball->sellItem(); $ball->sellItem(); echo "<p>There are now ". $tv->getStockLevel() . " " . $tv->getScreenSize(); echo "-inch televisions and " . $ball->getStockLevel() . " " . $ball->getColor(); echo " tennis balls in stock.</p>"; ?>
<?php ini_set('display_errors', 1); require 'StoreManager.php'; require_once __DIR__ . '/vendor/phpexcel/PHPExcel.php'; require_once __DIR__ . '/vendor/phpexcel/PHPExcel/IOFactory.php'; $databaseStores = array('name' => '', 'domain' => '', 'store_type' => '', 'store_default' => '', 'description_fr' => '', 'description_en' => '', 'enabled' => '', 'telephone' => '', 'email' => '', 'first_name' => '', 'last_name' => ''); $storeManager = StoreManager::loadStoresFromFileAndDatabaseStoreInArray('storelist.xls', $databaseStores); echo '<pre>'; print_r($storeManager->fetchAllStores()); die;
<?php include '../incl/header.php'; include '../incl/StoreManager2.class.inc'; $output = ''; $error_msg = ''; $storeManager = new StoreManager(); if (isset($_POST['submit_bttn'])) { $username = $_POST['username']; $password = $_POST['userpass']; } $categories = $storeManager->getCategories(); ?> <!DOCTYPE html> <html lang="en"> <head> <title>add a category</title> <link rel="stylesheet" href="http://<?php echo DOMAIN; ?> /design/bootstrap.min.css"> </head> <body> <h1> add a category</h1> <?php include '../incl/navbar.php'; ?>