</table> <input id="supplier_id" type="hidden" value="" /> </form> </div> </body> </html> <?php if (isset($_POST['btnSave'])) { $path = constant("IMG_PATH"); $name = date('YmdHis') . floor(microtime() * 10000); $name .= rand(100, 999); $pathinfo = pathinfo($_FILES["txtEditUrl"]["name"]); $name .= "." . $pathinfo['extension']; move_uploaded_file($_FILES["txtEditUrl"]["tmp_name"], "../" . $path . "/" . $name); $path .= "/" . $name; $service = new HatService(); $sql = ' insert into hat '; $url = $path; $title = $_POST["txtEditTitle"]; $price = $_POST["txtEditPrice"]; $category = $_POST["txtEditCatetoryId"]; $suppliers = $_POST["txtEditSupplierId"]; $keyword = $_POST["txtEditKeyword"]; $hot = $_POST["ishotsale"]; $descr = $_POST["txtEditDesc"]; $dataArray = array("hat_title" => "'" . $title . "'", "hat_category_id" => "'" . $category . "'", "hat_price" => "'" . $price . "'", "hat_description" => "'" . $descr . "'", "hat_search_keyword" => "'" . $keyword . "'", "is_hot_sale" => "'" . $hot . "'", "hat_path" => "'" . $url . "'"); $sql .= $service->GetInsertSQL($dataArray); $id = $service->SaveHat($sql, $suppliers); if ($id != 0) { alertRedirect(true, 'DisplayHat.php'); } else {
} } if (isset($_POST["curType"])) { $type = $_POST["curType"]; $id = $_POST["curId"]; if ($type == "addToOrder") { } else { if (isset($mcart)) { $mcart->OperateCart($id, $type); } } } if (isset($_POST["btnCart"])) { $hat_id = $_POST["hat_id"]; $sql = "select * from hat where hat_id='" . $hat_id . "'"; $hatservice = new HatService(); $list = $hatservice->GetRows($sql); if ($list) { $hat = new Hat(); $hat->HatId = $list[0]["hat_id"]; $hat->HatName = $list[0]["hat_title"]; $hat->Price = $list[0]["hat_price"]; $hat->ImgUrl = $list[0]["hat_path"]; $hat->Quantity = 1; if (isset($mcart)) { $mcart->AddHat($hat); } else { $mcart = new MyCart(); $mcart->AddHat($hat); $_SESSION[constant("SESSION_CART")] = $mcart; }
<script type="text/javascript" src="../js/Common.js"></script> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/ddsmoothmenu.js"></script> </head> <body> <?php $nav = ""; if (isset($_GET["logout"])) { if (isset($_SESSION["customer"])) { unset($_SESSION["customer"]); } } global $hats; $sql = "select * from hat"; $service = new HatService(); $hats = $service->GetRows($sql); ?> <div id="body_wrapper"> <div id="wrapper"> <?php include_once 'Header.php'; ?> <div id="main"> <?php include_once 'Category.php'; ?> <div id="content" class="float_r"> <h1>All Products</h1> <?php if ($hats) {
<meta name="description" content="CRAZY HATS" /> <link rel="stylesheet" href="../css/style.css" type="text/css" /> <link rel="stylesheet" href="../css/nivo-slider.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../css/ddsmoothmenu.css" type="text/css" /> <script type="text/javascript" src="../js/Common.js"></script> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/ddsmoothmenu.js"></script> </head> <body> <div id="body_wrapper"> <div id="wrapper"> <?php if (isset($_GET["hatId"])) { $hatId = $_GET["hatId"]; $service = new HatService(); $sql = "select h.hat_id,h.hat_path,h.hat_description,h.hat_price,c.category_title,h.hat_title,c.category_id, "; $sql .= " (select group_concat( t.supplier_name ) from (select m.map_hat_id, s.supplier_name from map_hat_supplier m, supplier s where m.map_supplier_id = s.supplier_id ) t where t.map_hat_id =h.hat_id) as suppliers "; $sql .= " from hat h, category c where h.hat_category_id = c.category_id and hat_id='" . $hatId . "'"; $rows = $service->GetRows($sql); global $hat; $hat = $rows[0]; $nav = "> <a href='DisplayCategory.php?cateName=" . urlencode($hat["category_title"]) . "&cateId=" . urlencode($hat["category_id"]) . "'>" . $hat["category_title"] . "</a>"; $nav .= "> <span>" . $hat["hat_title"] . "</span>"; } include_once 'Header.php'; ?> <div id="main"> <?php include_once 'Category.php'; ?>