$prefix = 'price=' . $price . '&'; if ($price <= 0) { $title = '免费捐赠专区'; } else { $title = $price . '元以下的商品'; } } else { $total = get_all_products_total($page, $pagesize); $maxpage = ceil($total / $pagesize); if ($maxpage < $page) { $page = $maxpage; } if ($page < 1) { $page = 1; } $goods = get_all_products($page, 12, $is_order_by_price, $desc); } } } } } } ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content="二手,吉大,二手市场,吉林大学,二手网,跳蚤市场,易物,吉大易物网,长春"/>
$inventories = array_filter(get_inventories()); //Gets tags for checkbox creation $get_output = get_products(); $response = $get_output[0]; $tags = $get_output[1]; if (isset($_GET['post_products'])) { if (!empty($inventories)) { $post_tags = $_GET['checkbox_name']; post_products($response, $post_tags, $inventories); } else { $error_msg = "Error: No product available"; echo $error_msg; } if (isset($_GET['post_all_products'])) { if (!empty($inventories)) { get_all_products($inventories); } else { $error_msg = "Error: No product available"; echo $error_msg; } } } elseif (isset($_GET['pull_customers'])) { get_customers(); } elseif (isset($_GET['update_customers'])) { update_get_customers(); } elseif (isset($_GET['pull_invoices'])) { if (!empty($inventories)) { $results = get_invoices($inventories); } else { $error_msg = "Error: No product available"; echo $error_msg;
$description = str_replace(array("\r\n", "\r", "\n"), '<br/>', htmlspecialchars($detail['description'])); } } } else { $pid = 0; } if ($pid == 0) { header('HTTP/1.1 404 Not Found'); echo '<html>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'; echo '<h1>啊哦,该商品不存在或已经下架,记得下次早点哦</h1>'; echo '<h2><a href="index.php">返回首页</a></h2>'; echo '</html>'; exit; } $goods = get_all_products(1, 2, false, true); $profile = get_user_information($detail['owner']); if ($profile != null) { $owner = htmlspecialchars($profile['username']); $u_campus = $area_array[$profile['campus']]; $gender = $profile['gender']; switch ($gender) { case 'm': $gender = '帅哥'; break; case 'f': $gender = '美女'; break; default: $gender = '保密'; break;
function render_product_names() { $html = ""; $products = get_all_products(); $data = array(); foreach ($products as $product) { $html .= $product['name'] . ";"; array_push($data, array("name" => $product['name'], "id" => $product['productid'])); } //echo json_encode($data); echo $html; exit; }
<div class="container"> <div class="starter-template"> <h1>Our Products <?php echo $_GET['category']; ?> </h1> <div class="row"> <?php // $products = get_all_products(); if (isset($_GET['category'])) { $products = get_products_by_category($_GET['category']); } else { if (isset($_GET['all']) && $_GET['all'] == 1) { $products = get_all_products(); } else { $products = get_latest_products(); } } foreach ($products as $product) { ?> <div class="col-lg-4"> <img class="img-rounded" src="images/<?php echo $product['image']; ?> " alt="Generic placeholder image" height="140" width="140"> <h2><?php