Example #1
0
<?php

/**
 * Created by PhpStorm.
 * User: hssh_win8.1
 * Date: 2015/10/4
 * Time: 20:41
 * file: cateedit.php  栏目管理
 */
require_once './common/include.php';
$cate_id = $_GET['cate_id'] + 0;
// 实例化数据库对象
$mu = new ModelUser('bl_cate');
// 获取全部栏目
$field = array('cate_id', 'cate_name', 'parent_id', 'cate_desc');
$res = $mu->select($field, 'is_delete=0 order by cate_id');
$catelist = ToolsInfClassify::ClassifyForOne($res);
//print_r($catelist);
// 获取当前栏目的信息
$sql = "select c1.*,c2.cate_name as parent_name from bl_cate as c1 left join bl_cate as c2 on c1.parent_id=c2.cate_id where c1.cate_id=" . $cate_id;
$cateinfo = $mu->getRow($sql);
//print_r($cateinfo);
require ROOT . 'view/admin/templates/cateedit.html';
Example #2
0
/**
 * Created by PhpStorm.
 * User: hssh_win8.1
 * Date: 2015/10/6
 * Time: 22:29
 * file: goodsedit.php 商品编辑页
 */
require_once './common/include.php';
//实例化数据库
$mu = new ModelUser('bl_goods');
// 获得商品good_id
if (!isset($_GET['goods_id']) || intval($_GET['goods_id']) < 1) {
    exit('商品不存在');
}
$goods_id = intval($_GET['goods_id']);
//获得商品信息
$sql = "select g.*,c.cate_name from bl_goods as g left join bl_cate as c on g.cate_id=c.cate_id where g.goods_id=" . $goods_id;
$gi = $mu->getRow($sql);
//print_r($gi);
if (empty($gi)) {
    exit('商品不存在');
}
// 更改图片的
$gi['goods_img'] = basename($gi['goods_img']);
// 实例栏目数据库
$mu = new ModelUser('bl_cate');
// 获取所有栏目
$res = $mu->select(array('cate_id', 'cate_name', 'parent_id'), "is_delete=0 order by cate_id");
$catelist = ToolsInfClassify::ClassifyForOne($res);
//print_r($catelist);
require ROOT . 'view/admin/templates/goodsedit.html';
Example #3
0
<?php

/**
 * Created by PhpStorm.
 * User: hssh_win8.1
 * Date: 2015/10/7
 * Time: 19:44
 * file: front/loginhandle.php 验证登录信息
 */
require_once './common/include.php';
$mu = new ModelUser('bl_user');
$username = $_POST['username'];
$password = $_POST['password'];
$rem = $_POST['rem'];
$sql = "select * from bl_user where username='******' && password='******'";
$res = $mu->getRow($sql);
//print_r($res);
// 用户名或密码错误
if (!$res) {
    echo "1";
    return;
}
// 未激活
if ($res['is_active'] == 0) {
    echo "2";
    return;
}
// 记住密码  记住一个星期
if ($rem == 'yes') {
    setcookie('name', $username, time() + 3600 * 24 * 7);
} else {