示例#1
0
        if ($lb_count_row['count_num'] >= 10) {
            $smarty->assign('lb_man', 1);
            $time_12 = strtotime(date('Y-m-d', $current_time + 24 * 3600) . ' 12:00:00');
        } else {
            $time_12 = strtotime(date('Y-m-d', $current_time) . ' 12:00:00');
        }
        $time_cha = $time_12 - $current_time;
        $smarty->assign('time_cha', $time_cha);
        $smarty->setLayout('')->setTpl('mobile/templates/detail_lb.html')->display();
    } else {
        $smarty->setLayout('')->setTpl('mobile/templates/detail.html')->display();
    }
}
if ($_REQUEST['a'] == 'index') {
    //获取商品类别
    $cateModel = new Model_ApplistHptShopCate();
    $smarty->assign('cateList', $cateModel->findAll(" id>0 "));
    //获取幻灯片
    $picModel = new Model_ApplistHptShopPic();
    $smarty->assign('picList', $picModel->fetchAll("select * from applist_hpt_shop_pic order by ordernum desc"));
    //数据列表
    $condition = array();
    $url = array();
    $condition[] = " state=2 ";
    //在售
    if ($_GET['keyword']) {
        $condition[] = " name like '%" . common_pg('keyword') . "%' ";
    }
    if ($_GET['cid']) {
        $condition[] = " cid=" . common_pg('cid') . " ";
    }
示例#2
0
<?php

include_once "../../../includes/config.inc.php";
check_login();
//验证是否登录
$model = new Model_ApplistHptShopGoods();
$cateModel = new Model_ApplistHptShopCate();
$smarty->assign('cateName', '商品');
//数据保存
if ($_REQUEST['a'] == 'add') {
    //$tagModel=new Model_ApplistHptShopTag();
    if (method_is('post')) {
        $data = $_POST;
        $res = $model->add($data);
        echo json_encode('success');
        die;
    } else {
        $id = (int) $_GET['id'];
        if ($id) {
            $smarty->assign('vo', $model->find($id));
        }
        //获取商品类别
        $smarty->assign('cateList', $cateModel->findAll(" id>0 "));
        /* //获取商品标签
        			$smarty->assign('tagList',$tagModel->findAll(" gid=$id ")); */
        $smarty->setTpl('app/hptshop/templates/goods_add.html')->display();
        die;
    }
}
//数据删除
if ($_REQUEST['a'] == 'del') {
示例#3
0
<?php

include_once "../../../includes/config.inc.php";
check_login();
//验证是否登录
$model = new Model_ApplistHptShopCate();
$smarty->assign('cateName', '类别');
//数据保存
if ($_REQUEST['a'] == 'add') {
    if (method_is('post')) {
        $data = $_POST;
        $res = $model->add($data);
        echo json_encode($res);
        die;
    } else {
        $id = (int) $_GET['id'];
        if ($id) {
            $smarty->assign('vo', $model->find($id));
        }
        $smarty->setTpl('app/hptshop/templates/cate_add.html')->display();
        die;
    }
}
//数据删除
if ($_REQUEST['a'] == 'del') {
    $res = $model->del($_POST['id']);
    echo json_encode($res);
    die;
}
//数据列表
$condition = array();