Esempio n. 1
0
<?php 
include_once "./header.php";
include_once "./commonlib.php";
$conn = getConnection("ibabymall");
$ary = getStarStore($conn, $_SESSION['user_id']);
$storelist = getStoreList($conn);
$stores = array();
$stores_id = array();
for ($i = 0; $i < sizeof($storelist); $i++) {
    $stores[] = $storelist[$i]['chinese_name'];
    $stores_id[] = $storelist[$i]['id'];
}
?>
<script>
$( document ).ready(function(){
    $("#store_group").removeClass("has-error");
    stores=<?php 
echo json_encode($stores);
?>
;
    stores_id=<?php 
echo json_encode($stores_id);
?>
;
    $("#store").autocomplete({
        source: stores
    });
    $("#addStoreForm").submit(function(){
        store_name = $("#store").val();
        url = $("#addStoreForm").attr("action");
        idx = $.inArray(store_name, stores);
Esempio n. 2
0
<?php 
include_once "./header.php";
include_once "./commonlib.php";
$conn = getConnection("ibabymall");
$ary = getStoreList($conn);
$source_ary = getSourceList();
/* process page */
$showpage = (int) $_GET['page'] ? (int) $_GET['page'] : 1;
$each_page_count = 50;
$page_max = ceil(sizeof($ary) / $each_page_count);
$showpage = max(1, min($showpage, $page_max));
?>

    <table class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th>#</th>
                <th>店家名稱</th>
                <th>店家縮圖</th>
                <th>商城</th>
                <th>商品數量</th>
            </tr>
        </thead>
        <tbody>
        
        <?php 
for ($i = ($showpage - 1) * $each_page_count; $i < min($showpage * $each_page_count, sizeof($ary)); $i++) {
    $url = $ary[$i]["url"];
    $id = $ary[$i]["id"];
    $photo = $ary[$i]["photo"];
    echo "<td>" . ($i + 1) . "</td>" . "<td><a href='./store.php?id={$id}' >" . $ary[$i]["chinese_name"] . "</a></td>" . "<td><a href='{$photo}' download><img src='{$photo}'></td></a>" . "<td><a href='{$url}' target='_blank'>" . $source_ary[$ary[$i]["source"]] . "</a></td>" . "<td>" . $ary[$i]["count"] . "</td>" . "</tr>";
Esempio n. 3
0
<?php 
include_once "./header.php";
include_once "./commonlib.php";
$conn = getConnection("ibabymall");
$store_id = (int) $_GET['id'] ? (int) $_GET['id'] : 1;
$showpage = (int) $_GET['page'] ? (int) $_GET['page'] : 1;
$total = getProductTotalByStoreId($conn, $store_id);
$each_page_count = 50;
$page_max = ceil($total / $each_page_count);
$showpage = max(1, min($showpage, $page_max));
$start = ($showpage - 1) * $each_page_count;
$ary = getProductListByStoreId($conn, $store_id, $start, $each_page_count);
/* calc this store in which page */
$store_ary = getStoreList($conn);
for ($i = 0; $i < sizeof($store_ary); $i++) {
    if ($store_ary[$i][0] == $store_id) {
        $store_list_page = $i;
    }
}
$store_list_page = floor($store_list_page / 50) + 1;
?>


<style>
.small.photo{
    height: 50px;
    width: 50px;
}
</style>
    <nav>
      <ul class="pager">