代码拉取完成,页面将自动刷新
同步操作将从 王东祥/HongYuDSC 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
//zend by QQ:1527200768 鸿宇科技 禁止倒卖 一经发现停止任何服务
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
include 'includes/cls_json.php';
$json = new JSON();
$result = array('error' => 0, 'content' => '', 'msg' => '');
$id = (isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0);
$order_id = (isset($_REQUEST['order_id']) ? intval($_REQUEST['order_id']) : 0);
$goods_id = (isset($_REQUEST['goods_id']) ? intval($_REQUEST['goods_id']) : 0);
if ($_REQUEST['act'] == 'ajax_return_images') {
$img_file = (isset($_FILES['SWFUpload']) ? $_FILES['SWFUpload'] : array());
if (!empty($_SESSION['user_id'])) {
include_once ROOT_PATH . '/includes/cls_image.php';
$image = new cls_image($_CFG['bgcolor']);
$img_file = $image->upload_image($img_file, 'single_img_temp');
$img_thumb = $image->make_thumb($img_file, $GLOBALS['_CFG']['single_thumb_width'], $GLOBALS['_CFG']['single_thumb_height'], DATA_DIR . '/single_img_temp/thumb/');
$return = array('order_id' => $order_id, 'goods_id' => $goods_id, 'user_id' => $_SESSION['user_id'], 'img_file' => $img_file, 'img_thumb' => $img_thumb);
$sql = 'select count(*) from ' . $ecs->table('single_sun_images') . ' where user_id = \'' . $_SESSION['user_id'] . '\' and order_id = \'' . $order_id . '\' and goods_id = \'' . $goods_id . '\'';
$img_count = $db->getOne($sql);
if (($img_count < 10) && $img_file) {
$db->autoExecute($ecs->table('single_sun_images'), $return, 'INSERT');
}
else {
$result['error'] = 1;
}
}
else {
$result['error'] = 2;
}
$sql = 'select id, img_file, img_thumb from ' . $ecs->table('single_sun_images') . ' where user_id = \'' . $_SESSION['user_id'] . '\' and order_id = \'' . $order_id . '\' and goods_id = \'' . $goods_id . '\' order by id desc';
$img_list = $db->getAll($sql);
$result['currentImg_path'] = $img_list[0]['img_thumb'];
$smarty->assign('img_list', $img_list);
$result['content'] = $smarty->fetch('library/single_sun_img.lbi');
exit($json->encode($result));
}
else if ($_REQUEST['act'] == 'ajax_return_images_list') {
$sql = 'select id, img_file, img_thumb from ' . $ecs->table('single_sun_images') . ' where user_id = \'' . $_SESSION['user_id'] . '\' and order_id = \'' . $order_id . '\' and goods_id = \'' . $goods_id . '\' order by id desc';
$img_list = $db->getAll($sql);
if ($img_list) {
$smarty->assign('img_list', $img_list);
$result['content'] = $smarty->fetch('library/single_sun_img.lbi');
}
else {
$result['error'] = 1;
}
exit($json->encode($result));
}
else if ($_REQUEST['act'] == 'del_pictures') {
if (empty($_SESSION['user_id'])) {
$result['error'] = 1;
}
$sql = 'select id, img_file, img_thumb from ' . $ecs->table('single_sun_images') . ' where user_id = \'' . $_SESSION['user_id'] . '\' order by id desc';
$img_list = $db->getAll($sql);
foreach ($img_list as $key => $val) {
@unlink(ROOT_PATH . $val['img_file']);
@unlink(ROOT_PATH . $val['img_thumb']);
if ($id == $val['id']) {
$sql = 'delete from ' . $ecs->table('single_sun_images') . ' where id = \'' . $id . '\'';
$db->query($sql);
}
else {
$sql = 'delete from ' . $ecs->table('single_sun_images') . ' where user_id=\'' . $_SESSION['user_id'] . '\'';
$db->query($sql);
}
}
$smarty->assign('img_list', $img_list);
$result['content'] = $smarty->fetch('library/single_sun_img.lbi');
exit($json->encode($result));
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。