<?php /*** file index.php ***/ define('AICN', true); session_start(); if (isset($_SESSION['username']) && $_SESSION['username'] == 'jingling0101') { require '../include/init.php'; $gds_id = $_GET['goods_id'] + 0; //print_r($gds_id); $good = new goodsmodel(); $g = array(); $g = $good->findsingle($gds_id); $xq = $good->findsinglexq($gds_id); //print_r($g); //print_r($xq); $cat = new Catmodel(); $catlist = $cat->select(); $catlist = $cat->getcattree($catlist); //print_r($catlist); include ROOT . 'hment/goodsdit.html'; }
<?php /*** file index.php ***/ define('AICN', true); session_start(); if (isset($_SESSION['username']) && $_SESSION['username'] == 'jingling0101') { require '../include/init.php'; if (isset($_GET['act']) && $_GET['act'] == 'show') { $goods = new goodsmodel(); $goodslist = $goods->gettrash(); include ROOT . 'hment/goodstrashlist.html'; } else { $goods_id = $_GET['goods_id'] + 0; $goods = new goodsmodel(); if ($goods->trash($goods_id)) { echo '回收成功'; } else { echo '失败'; } } }
} if ($goods_imgarr[0] !== '') { $ing_img = ROOT . $goods_imgarr[0]; $twoh_img = $uptool->img_scale($ing_img, 0.2, 'X200.jpg'); $data['smatu_img1'] = str_replace(ROOT, '', $twoh_img); } } //print_r($goods_imgarr); foreach ($goods_imgarr as $key => $value) { $data['thumb_img' . $key] = $value . 'X400.jpg'; $ing_img = ROOT . $goods_imgarr[$key]; $thumb_img = $uptool->img_scale($ing_img, 0.5, 'X400.jpg'); $thum_imgbarr[] = str_replace(ROOT, '', $thumb_img); } } $goodsdit = new goodsmodel(); if ($goodsdit->update($data, $gds_id)) { echo '修改成功'; } else { echo '修改失败'; } // $uptool = new uptool(); // $goods_img=$uptool->upfile('goods_img'); } /*** if($goods_img){ $thumb_img=$goods_img.'X400.jpg'; $ori_img=$goods_img.'X200.jpg'; $data['goods_img']=$goods_img; $data['thumb_img']=$thumb_img; $data['ori_img']=$ori_img;
<?php /*** file index.php ***/ define('AICN', true); session_start(); if (isset($_SESSION['username']) && $_SESSION['username'] == 'jingling0101') { require '../include/init.php'; $goods_id = $_GET['goods_id'] + 0; $goods = new goodsmodel(); $goodslist = $goods->trashbk($goods_id); include ROOT . 'hment/goodstrashlist.html'; }
<?php /*** file .php ***/ define('AICN', true); require './include/init.php'; $act = isset($_GET['car']) ? $_GET['car'] : 'buy'; $uscart = carttool::getcart(); if (!isset($uscart)) { echo ''; } $goods = new goodsmodel(); if ($act == 'buy') { $goods_id = isset($_POST['goods_id']) ? $_POST['goods_id'] + 0 : 0; $num = isset($_GET['num']) ? $_GET['num'] + 0 : 1; if ($goods_id) { $gods = $goods->find($goods_id); if (!empty($gods)) { //print_r($gods); if ($gods['is_delete'] == 1 || $gods['is_sale'] == 0) { $msg = '此商品已下架不能购买'; include ROOT . 'view/front/msg.html'; exit; } $uscart->additem($goods_id, $gods['goods_name'], $gods['shop_price'], $num); $items = $uscart->all(); print_r($items); if ($items[$goods_id]['num'] > $gods['goods_number']) { $uscart->decnum($goods_id, $num); $msg = '此商品库存不足';
<?php /*** file index.php ***/ session_start(); define('AICN', true); if (isset($_SESSION['username']) && $_SESSION['username'] == 'jinglingcos') { require './include/init.php'; $goods = new goodsmodel(); //$newlist = $goods->getgoodshow(); //print_r($newlist); // 栏目下的商品 $bar_id = 3; $barlist = $goods->catGoods($bar_id); //print_r($barlist); // 栏目下的商品 ob_start(); include ROOT . 'view/front/indexpro.html'; if (file_put_contents(ROOT . 'view/front/indexs.html', ob_get_clean())) { echo '缓存更新ok'; exit; } else { header('Location: login.php'); exit; } }
<?php /*** file .php ***/ define('AICN', true); session_start(); require './include/init.php'; $cat_id = isset($_GET['cat_id']) ? $_GET['cat_id'] + 0 : 1; $page = isset($_GET['page']) ? $_GET['page'] + 0 : 1; if ($page < 1) { $page = 1; } $goodsModel = new goodsmodel(); $total = $goodsModel->catGoodsCount($cat_id); //每页取*条 $perpage = 12; if ($page > ceil($total / $perpage)) { $page = 1; } $offset = ($page - 1) * $perpage; $pagenow = new pagetool($total, $page, $perpage); $pagecode = $pagenow->show(); $pageleft = $page - 1; $pageright = $page + 1; $cat = new catmodel(); $catgory = $cat->find($cat_id); if (empty($catgory)) { header('location:index.php'); exit; }
<?php /*** file index.php ***/ define('AICN', true); session_start(); if (isset($_SESSION['username']) && $_SESSION['username'] == 'jingling0101') { require '../include/init.php'; $page = isset($_GET['page']) ? $_GET['page'] + 0 : 1; if ($page < 1) { $page = 1; } $goods = new goodsmodel(); $total = $goods->catGoodsCount(1); //每页取*条 $perpage = 15; if ($page > ceil($total / $perpage)) { $page = 1; } $offset = ($page - 1) * $perpage; $pagenow = new pagetool($total, $page, $perpage); $pagecode = $pagenow->show(); $pageleft = $page - 1; $pageright = $page + 1; /* 菜单 所有栏目 */ $goodslist = $goods->catGoods(0, $offset, $perpage); //print_r($goodslist); include ROOT . 'hment/goodslist.html';
} $data['goods_img' . $key] = $value; } if ($goods_imgarr[0] !== '') { $ing_img = ROOT . $goods_imgarr[0]; $twoh_img = $uptool->img_scale($ing_img, 0.2, 'X200.jpg'); $data['smatu_img1'] = str_replace(ROOT, '', $twoh_img); } } //print_r($goods_imgarr); foreach ($goods_imgarr as $key => $value) { $data['thumb_img' . $key] = $value . 'X400.jpg'; $ing_img = ROOT . $goods_imgarr[$key]; $thumb_img = $uptool->img_scale($ing_img, 0.5, 'X400.jpg'); $thum_imgbarr[] = str_replace(ROOT, '', $thumb_img); } } $goodsq = new goodsmodel(); $goodsxq = array(); $goodsxq['goods_brief'] = $_POST['goods_brief']; $goodsxq['description'] = $_POST['description']; //print_r($data); //print_r($goodsxq); if ($goods->add($data) && $goodsq->add($goodsxq)) { echo 'OK '; exit; } else { echo 'shibai'; exit; } }
<?php /*** file .php ***/ define('AICN', true); session_start(); require './include/init.php'; $goods_id = $_GET['goods_id'] + 0; $good = new goodsmodel(); $gods = $good->findsingle($goods_id); print_r($gods); $godsxq = $good->findsinglexq($goods_id); //print_r($godsxq); if (empty($gods)) { // header('location: index.php'); exit; } //$cat = new Catmodel(); //$nav = $cat->getTree($gods['cat_id']); include ROOT . 'view/front/single.html';