define('IN_HHS', true);

require(dirname(__FILE__) . '/includes/init.php');

$act = trim($_GET['act']);

if ($act == 'create') {

$square = trim($_POST['square']);

if(empty($square)){

$res = array(

'isError' => 1,

'message' => '评论内容不能为空!'

);

echo json_encode($res);

exit();

}

$order_id = intval($_POST['order_id']);

$user_id = $_SESSION['user_id'];

$sql = "update ".$hhs->table('order_info')." set `square` = '".$square."' where user_id = '".$user_id."' and `order_id` = '".$order_id."'";

$db->query($sql);

$res = array(

'isError' => 0

);

echo json_encode($res);

exit();

}

/* 缓存编号 */

$cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang']));

assign_template();

$position = assign_ur_here();

$smarty->assign('page_title', $position['title']); // 页面标题

$smarty->assign('ur_here', $position['ur_here']); // 当前位置

$smarty->assign('categories', get_categories_tree()); // 分类树

/* meta information */

$smarty->assign('action', $action);

$loading=$smarty->fetch('loading.html');

$smarty->assign('loading', $loading);

$keywords = isset($_GET['keywords']) ? trim($_GET['keywords']) : '';

$smarty->assign('keywords', $keywords);

$smarty->assign('goods_list', get_goodslist('best'));

$smarty->display('square.dwt');

function get_goodslist()

{

global $hhs,$db;

$keywords = isset($_GET['keywords']) ? trim($_GET['keywords']) : '';

$orderby = isset($_GET['orderby']) ? trim($_GET['orderby']) : '';

if($orderby == 'hot'){

$orderby = 'need asc';

}

else{

$orderby = 'order_id desc';

}

$where = " AND o.`square`<> '' ";

if (!empty($keywords))

{

$where = " AND g.goods_name LIKE '%" . mysql_like_quote($keywords) . "%'";

$sql = "select o.square,o.order_id,o.team_sign,o.team_num,o.teammen_num,(team_num - teammen_num) as need, o.add_time,u.uname,u.headimgurl from ".$hhs->table('order_info')." as o,".$hhs->table('order_goods')." as g,".$hhs->table('users')." as u where o.show_square = 1 and o.user_id = u.user_id and o.team_status = 1 and o.team_first = 1 AND g.`order_id` = o.`order_id` ".$where." order by " . $orderby;

}

else{

$sql = "select o.square,o.order_id,o.team_sign,o.team_num,o.teammen_num,(team_num - teammen_num) as need, o.add_time,u.uname,u.headimgurl from ".$hhs->table('order_info')." as o,".$hhs->table('users')." as u where o.show_square = 1 and o.user_id = u.user_id and o.team_status = 1 and o.team_first = 1 ".$where." order by " . $orderby;

}

$res = $GLOBALS['db']->getAll($sql);

$arr = array();

foreach ($res AS $idx => $row)

{

$sql = "select g.goods_name,g.goods_id, g.goods_number, g.goods_thumb,g.little_img,g.goods_img, g.market_price, g.shop_price,g.team_price from ".$hhs->table('order_goods')." as o,".$hhs->table('goods')." as g where g.`goods_id` = o.`goods_id` and o.`order_id` = '".$row['order_id']."'";

$goods = $db->getRow($sql);

$arr[$idx]['goods_id'] = $goods['goods_id'];

$arr[$idx]['goods_name'] = $goods['goods_name'];

$arr[$idx]['goods_number'] = $goods['goods_number'];

$arr[$idx]['market_price'] = price_format($goods['market_price'],false);

$arr[$idx]['shop_price'] = price_format($goods['shop_price'],false);

$arr[$idx]['goods_thumb'] = get_image_path($goods['goods_id'], $goods['goods_thumb'], true);

$arr[$idx]['little_img'] = get_image_path($goods['goods_id'], $goods['little_img'], true);

$arr[$idx]['goods_img'] = get_image_path($goods['goods_id'], $goods['goods_img']);

$arr[$idx]['url'] = build_uri('goods', array('gid'=>$goods['goods_id']), $goods['goods_name']);

$arr[$idx]['team_price'] = price_format($goods['team_price'],false);

$arr[$idx]['team_num'] = $row['team_num'];

$arr[$idx]['need'] = $row['team_num'] - $row['teammen_num'];

$arr[$idx]['square'] = $row['square'];

$arr[$idx]['team_id'] = $row['team_sign'];

$arr[$idx]['uname'] = $row['uname'];

$arr[$idx]['headimgurl'] = $row['headimgurl'];

$arr[$idx]['add_time'] = local_date("Y-m-d H:i:s",$row['add_time']);

$arr[$idx]['team_discount'] = @number_format($goods['team_price']/$goods['market_price']*10,1);

$arr[$idx]['buy_nums'] = $db->getOne("select count(*) from ".$hhs->table('order_goods')." where goods_id = '".$goods['goods_id']."'");

$arr[$idx]['gallery'] = $db->getAll("select thumb_url,img_url from ".$hhs->table('goods_gallery')." where goods_id = '".$goods['goods_id']."' limit 3");

}

return $arr;

}

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

php中square是什么意思,square.php相关推荐

  1. matlab中0.1见方,square,square怎么读?

    square怎么读? square的读音为英[2113skweə(r)]5261美[skwer].具体释义4102如下: square英[skweə(r)]美[skwer] n.平方:广场:正方165 ...

  2. square enix服务器维护,Square Enix解决《最终幻想14》的服务器问题

    在最近数字版售罄之后,<最终幻想14>制作人兼导演吉田直树已经解决了玩家在 "新玩家极度涌入 "之后所面临的问题. 在<最终幻想14>网站的一篇新闻报道中, ...

  3. square enix服务器维护,SQUARE ENIX账号注册教程

    SQUARE ENIX的新作<Outriders>在Steam平台开放DEMO测试,玩家需要用SE的账号才可以登陆游戏,SE的账号注册十分麻烦,并且中文界面并不能注册,因此3DM将会带来S ...

  4. magic square java_测试Magic Square Java的.txt文件

    我不想问,但我无法弄清楚这个任务,当我寻求帮助时,助教也不会. 我必须从文本文件中获取输入,将文件中的整数输入到数组列表中,然后测试它是否是anxn幻方.n等于数组列表长度的平方根.如果不是理想的正方 ...

  5. UA MATH571B 试验设计IV RCBD与Latin Square上

    UA MATH571B 试验设计IV RCBD与Latin Square上 RCBD Latin Square Design Graeco-Latin Square Design BIBD RCBD ...

  6. Square:从今天開始抛弃Fragment吧!

    原文链接 : Advocating Against Android Fragments 原文作者 : Pierre-Yves Ricau 译文出自 : 开发技术前线 www.devtf.cn 译者 : ...

  7. Square:从今天开始抛弃Fragment吧!

    Square:从今天开始抛弃Fragment吧! 原文链接 : Advocating Against Android Fragments 原文作者 : Pierre-Yves Ricau 译文出自 : ...

  8. Marching Square 笔记

    Marching Square学习笔记 Marching Square是一种等值线轮廓的算法,具体可以参考wiki Marching Square 算法解释 英语好的可以直接看wiki中的解释,还可以 ...

  9. The Sandbox 和 Square Enix 合作,将《末日危城》RPG 体验带入元宇宙

    <末日危城>土地将作为冒险的起点,创作者将能够使用授权内容建立他们自己的新的<末日危城>体验. 我们很高兴地宣佈,The Sandbox 与 SQUARE ENIX® 建立了新 ...

最新文章

  1. puppet自动化运维之puppet的资源基础知识
  2. Laravel Ioc容器singleton和bind方法的区别
  3. 设置APP版本跟新提示
  4. php的cookie的函数,php setcookie()函数的使用简介
  5. ASP.NET中的状态管理
  6. arraylist如何检测某一元素是否为空_java学习笔记:【ArrayList集合】
  7. fedora 20下使用gcc 4.8.2编译gcc-4.4.1的错误
  8. LDAP第三天 MySQL+LDAP 安装
  9. poj2109 Power of Cryptography(数学题)
  10. IDA远程调试Android中so文件
  11. 30分钟一部动画短片!从MMD入门3D世界,边玩边学的3D教程!(一)“MMD快速入门教程CSDN”
  12. MessageBox用法大全
  13. 【历史上的今天】12 月 26 日:现代计算机鼻祖诞生;手机之父出生;美国史上最大信息盗窃案
  14. 《Linux内核分析》期末总结
  15. usbos在服务器上不能引导,USBOS V3.0.2021.07.10
  16. 计算机音乐说散就散,说散就散(精彩音乐汇)
  17. 成功解决Unable to allocate xxx MiB for an array with shape (xxxx, xxxx)
  18. 软件需求说明书(文档模板)
  19. 更改iPhone手机铃声详细教程(简单易学,无需付费软件)!
  20. java桌宠安装_桌宠软件下载_桌宠软件电脑版下载安装v2.0_全球下载

热门文章

  1. 牛客java选择题每日打卡Day17
  2. 用户体验之认知地图、思维导图和概念图
  3. 扇贝编程python学习笔记-基础篇6
  4. MORRORART音箱对比当贝音乐哪个好用?
  5. PlatoFarm链上数据优异,最真实的元宇宙
  6. FreeType 2的设计——《The design of FreeType 2》中译版
  7. 网页视差滚动效果html,30个使用视差滚动效果的时尚网页设计欣赏
  8. DIV+CSS IE6/IE7/IE8/FF兼容问题汇总
  9. c语言 打印星号金字塔
  10. 批量验证ssh账号密码登录shell脚本