Code Snippets of Garden Center Online Shopping

Added on - Oct 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 6 of 24 pages
Garden Center
Contents1.Implementation Discussion2.Code Snippets3.Limitations4.References
Implementation:The garden enter online shopping website is built using the technologies like HTML, CSS, PHP,JavaScript. The SQLite is used to store the data of plants like the price size and description ofeach plant. The solution ha 3 pages catalog, cart, invoice.Catalog:The catalog page is used to display the listing of plants retrieved from database.The cataloglisting includes the name, description , price , size and image of each plant with add to cartbutton which adds the product to the current shopping basket. Each product has three sizes.Cart:The cart page shows the list of products added to the cart . te cart page also allows to add orremove the quantity of products. We can also use multiple currencies to buy the product. Thecart uses the session global variable of the PHP in order to persist the cart data.Invoice:The invoice page shows the list of products we have purchased from the website including theemail of the customer. To purchase the customer have submit the email.Currency:The three currency option is given to the user to select in the cart page.Database:Two database table is created in the database to store the catalog data.Plants :Plants table is used to store the plant name , description and image.Plant Sizes:Plant sizes table store the plant_is, price and size of the plant.
Code Snippets:DB.php<?phpClass DB {private $dbpath = 'plants.db';private $con;const PATH_TO_SQLITE_FILE = '../plants.db';public function __construct(){$this->con = new PDO("sqlite:". $this->dbpath); //initializingmysql db conection//var_dump($d =$this->con->query("SELECT * FROMplants")->fetchAll(PDO::FETCH_ASSOC));exit;}public function getProducts(){// for getting all saved products from db$query="SELECT * , as size_id FROM plantsLEFT OUTER JOIN plant_sizes ON";$q = $this->con->prepare($query);
$q->execute();$data = $q->fetchAll(PDO::FETCH_ASSOC);return $data;}}Footer.php<footer style="position: absolute; bottom: 0; width: 100%; height:50px; background-color:#7979ff"><div class="container"><span style="text-align: center; padding: 10px; color: white;">&copy; Garden Center – All Rights Reserved</span><span class="pull-right" style="text-align: center; color:white;font-size:32px;"><i class="fa fa-envelope"></i><i class="fa fa-twitter"></i>
<i class="fa fa-facebook"></i><i class="fa fa-youtube"></i></span></div></footer><script src="./js/jquery-2.2.4.min.js"></script><script src="./js/bootstrap.min.js" type="text/javascript"></script><script src="./js/scripts.js"></script></body></html>Header.php<?phpinclude './DB.php';$obj = new DB;//$categories = $obj->getCategories();//$sub_categories = $obj->getSubCategories();?><!DOCTYPE html><html lang="en" style="position: relative; min-height: 100%;">
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access