logo

Code Snippets of Garden Center Online Shopping

24 Pages3944 Words220 Views
   

Added on  2019-10-16

Code Snippets of Garden Center Online Shopping

   Added on 2019-10-16

ShareRelated Documents
Garden Center
Code Snippets of Garden Center Online Shopping_1
Contents1.Implementation Discussion2.Code Snippets3.Limitations4.References
Code Snippets of Garden Center Online Shopping_2
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 of each 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 catalog listing includes the name, description , price , size and image of each plant with add to cart button 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 or remove the quantity of products. We can also use multiple currencies to buy the product. The cart 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 the email 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 of Garden Center Online Shopping_3
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 * FROM plants")->fetchAll(PDO::FETCH_ASSOC));exit;}public function getProducts(){// for getting all saved products from db$query="SELECT * , plant_sizes.id as size_id FROM plants LEFT OUTER JOIN plant_sizes ON plants.id=plant_sizes.plant_id";$q = $this->con->prepare($query);
Code Snippets of Garden Center Online Shopping_4
$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>
Code Snippets of Garden Center Online Shopping_5
<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%;">
Code Snippets of Garden Center Online Shopping_6

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertation
|18
|3297
|356

Desklib - Online Library for Study Material with Solved Assignments, Essays, Dissertations
|44
|9728
|199