Пример #1
0
<?php 
include_once "./header.php";
include_once "./commonlib.php";
$conn = getConnection("ibabymall");
$ary = getStarStore($conn, 1);
$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);
Пример #2
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);
Пример #3
0
<?php 
$source = getSourceList();
foreach ($source as $v => $s) {
    echo "<option value='{$v}'>{$s}</option>";
}
?>
                </select>
            </div>
        </div>
        <div class='col-md-6'>
            <div id="store" class="form-group">
                <label>店家</label>
                <select id="select_store" name="store" class="form-control">
                    <option value='0'>全部</option>
<?php 
$star = getStarStore($conn, "1");
for ($i = 0; $i < sizeof($star); $i++) {
    $s = $star[$i]['store_id'];
    $v = $star[$i]['chinese_name'];
    echo "<option value='{$s}'>{$v}</option>";
}
?>
                </select>
            </div>
        </div>
<script>
    store_id=<?php 
echo $store_id;
?>
;
    source_id=<?php