//pagination setting $limit = getSettingsValue('npagination_limit'); $page = isset($_GET['page']) ? trim($_GET['page']) : 1; if (empty($page)) { $page = 1; } $result = mysql_query($sql) or die(mysql_error()); $totalrows = mysql_num_rows($result); $limitvalue = ($page - 1) * $limit; $query_string = " LIMIT {$limitvalue}, {$limit}"; //get results with pagination $sql = $sql . $query_string; $rs = mysql_query($sql) or die(mysql_error()); $numofpages = ceil($totalrows / $limit); //fetch all products to display in search dropdown $all_products = getAllProducts(); include "../includes/htmltop.php"; ?> <script language="JavaScript" type="text/JavaScript"> //search feature in listing page function clickSearch() { document.frmProductViewed.submit(); } $(document).ready(function() { var a_href = $('.clsExportLink').attr('href'); var paging =1 ; $(".clsCheck").change(function() { if($('#chkPaging').attr('checked')) { var paging =0 ; } else{
</div> <div class="form-group"> <label>Address</label> <input class="form-control" name="cAddress" required="required" type="text" value="<?php echo @$_POST['cAddress']; ?> "> </div> <div class="form-group"> <label>Choose a Category</label> <select class="form-control" name="pId"> <?php $qry = getAllProducts(); while ($row = mysql_fetch_object($qry)) { ?> <option value="<?php echo $row->pId; ?> "> <?php echo $row->pName; ?> </option> <?php } ?> </select>
<?php header('Content-type: application/json'); require_once __DIR__ . '/dbService.php'; session_start(); if (isset($_SESSION["username"])) { $result = getAllProducts(); if ($result['message'] == 'OK') { echo json_encode($result); } else { die(json_encode($result)); } } else { // return error $response = array('error' => 'Favor de iniciar sesion'); header("HTTP/1.1 417 SESSION NOT SET"); die(json_encode($response)); }
?> </option> <?php } ?> </select> <br /> <input type="submit" value="Submit" /> </form> <?php if (isset($_POST['category_id'])) { ?> <?php $products = getAllProducts($category_id); ?> <table class="table"> <thead> <tr> <th>Products</th> </tr> </thead> <?php foreach ($products as $row) { ?> <tr> <td><?php echo $row['product']; ?>
<html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="../../css/bootstrap.css"> <title></title> </head> <body> <?php require_once '../../includes/session-start.php'; require_once '../../includes/access-required.html.php'; include_once '../../functions/dbConn.php'; include_once '../../functions/categoryFunctions.php'; include_once '../../functions/productsFunctions.php'; include_once '../../functions/until.php'; $products = getAllProducts(); $results = ''; if (isPostRequest()) { $product_id = filter_input(INPUT_POST, 'product_id'); deleteProduct($product_id); if (deleteProduct($product_id) == true) { $results = 'Product deleted'; } else { $results = 'Product was not deleted'; } } ?> <center> <h1>Delete Product</h1> <?php
echo $row['category_id']; ?> "<?php if ($row['category_id'] == filter_input(INPUT_POST, "category_id")) { echo "selected"; } ?> > <?php echo $row['category']; ?> </option> <?php } ?> </select> <br /> <input type="submit" value="Submit" class="btn btn-default" /> </form> <hr> <?php //narrow products to only chosen category by calling different function and filling same array if (isset($chosenCategory)) { $allProducts = getAllProducts($chosenCategory); } } ?>
$pic = $_REQUEST['pic']; if (!$product->updateProduct($fid, $fname, $fcateg, $fprice, $pic)) { echo '{"result":0,"message":"Could not add the product"}'; return; } echo '{"result":1,"message":"Succesfully added product"}'; } switch ($cmd) { case 1: addProduct(); break; case 2: updateProduct(); break; case 3: getAllProducts(); break; case 4: getByCategory(); break; case 5: getProductById(); break; case 6: deleteProduct(); break; case 7: searchProduct(); break; default: echo '{"cmd":"none","message":"No command issued"}';
?> /> <label for="healthyChoice">Healthy Choice</label> <br /> <br /> <input type="submit" value="Search Products" name="searchForm" /> </fieldset> </form> <div id="item-list"> <?php //Displays all products by default if (!isset($_GET['searchForm'])) { $records = getAllProducts(); } else { $records = filterProducts(); } foreach ($records as $record) { echo "<a target='descriptionFrame' href='getProductInfo.php?productId=" . $record['productId'] . "'>"; echo $record['productName']; echo "</a>"; echo "- \$" . $record['price'] . "<br>"; } ?> </div> <div id="description-frame"> <iframe src="getProductInfo.php" name="descriptionFrame" width="250" height="300" frameborder="0"/> </iframe> </div>
$pagenum = 1; } $limit = getSettingsValue('npagination_limit'); $page = isset($_GET['page']) ? trim($_GET['page']) : 1; if (empty($page)) { $page = 1; } $result = mysql_query($sql) or die(mysql_error()); $totalrows = mysql_num_rows($result); $limitvalue = ($page - 1) * $limit; $query_string = " LIMIT {$limitvalue}, {$limit}"; $sql = $sql . $query_string; $rs = mysql_query($sql) or die(mysql_error()); $numofpages = ceil($totalrows / $limit); //fetch all products to display in search dropdown $all_products = getAllProducts($artistid); include "../includes/htmltop.php"; ?> <script language="JavaScript" type="text/JavaScript"> function clickSearch() { document.frmProductViewed.submit(); } </script> <body> <center> <div align="left" id="layout">
// echo "id".$ids; //print_r($ids); $productsB = getProductByIds($ids, $sort); } if (!empty($keyWords) && !empty($labels)) { foreach ($productsA as $value) { foreach ($productsB as $val) { if ($value == $val) { $products[] = $value; } } } $products = multiSort($products, $sort); } else { if (empty($keyWords) && empty($labels)) { $products = getAllProducts($sort); } else { $products = $productsA + $productsB; $products = multiSort($products, $sort); } } //print_r($products); $page_num = ceil(count($products) / 35); $productsNum = count($products); if (empty($products)) { $productsNum = 0; } else { $productsNum = count($products); } $page_num = ceil($productsNum / 35); $products = array_slice($products, ($page - 1) * 35, 35);