</script> </head> <body class="body" > <?php include_once 'header.php'; ?> <div id="contain" class="contain contain box-transparent"> <?php if (isset($_REQUEST['productid']) && $_REQUEST['productid'] != null) { include_once $contextPath . "controller/ProductController.php"; include_once $contextPath . "controller/CommentController.php"; include_once $contextPath . "controller/ProductImageController.php"; include_once $contextPath . "controller/UserController.php"; $productid = $_REQUEST['productid']; $product_detail = ProductController::GetProductByID($_REQUEST['productid']); $productImage = ProductImageController::GetImageOfProductFromProductID($productid); $productComment = CommentController::GetCommentFromProductID($productid); $_SESSION["addCart"] = "true"; } else { Utils::redirect("product-list.php"); } ?> <?php require_once 'left-menu.php'; ?> <div > <div class="product-detail-picture"> <div id="image_wrap" >
<?php require_once "../../controller/ProductController.php"; $product = ProductController::GetProductByID($_REQUEST["id"]); ?> <div id="wrapper"> <div id="content"> <div id="box"> <h3 id="adduser">PRODUCT</h3> <form id="form" action="action/action_product.php" method="post"> <fieldset id="personal"> <legend> EDIT </legend> <input name="id" id="id" type="hidden" tabindex="1" value="<?php echo $product["ID"]; ?> "/> <label for="name">Name : </label> <input name="name" id="name" type="text" tabindex="1" value="<?php echo $product["Name"]; ?> "/> <br /> <!-- <label for="description">Description : </label> <textarea name="description" id="description"><?php echo $product["Description"]; ?> </textarea>
array_push($_SESSION["cart"], $cartInDB[$j][2]); } } } //echo "<br>count session cart2=".count($_SESSION["cart"]); } //end check if (count($_SESSION["cart"]) > 0) { include_once $contextPath . "controller/ProductController.php"; include_once $contextPath . "controller/ProductImageController.php"; include_once $contextPath . "controller/CartController.php"; include_once $contextPath . "utility/Utils.php"; $totalmoney = 0; echo "<form action='" . $contextPath . "controller/AddCartProcessor.php' method='post' id='frmCheckOut' name='frmCheckOut'>"; for ($i = 0; $i < count($_SESSION["cart"]); $i++) { $product_detail = ProductController::GetProductByID($_SESSION["cart"][$i]); $productImage = ProductImageController::GetImageOfProductFromProductID($_SESSION["cart"][$i]); $totalmoney += $product_detail[4]; if ($i % 2 == 0) { echo "<tr style='background-color: rgb(239, 239, 239);'>"; } else { echo "<tr style='background-color: rgb(255, 255, 255);'>"; } //Image echo "<td style='border-right:solid 1px #D3D3D3; padding:4px;' width='35px' align='center'><a href='' ><img src='" . $contextPath . $productImage[1] . "'width='80px'/></a></td>"; //productID echo "<td align='center' style='border-right:solid 1px #D3D3D3; padding:4px;' width='20px'>\r\n\t\t\t\t\t\t\t <a href='product-detail.php?productid=" . $product_detail[0] . "&type=" . $product_detail[2] . "'><b style='color:blue;'>" . $product_detail[0] . "</b></a></td>"; //product Name echo "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>" . $product_detail[1] . "</td>"; //Quantity if (isset($_SESSION["curUser"]) && $_SESSION["curUser"][0] > 0) {