本文整理汇总了PHP中replace_public函数的典型用法代码示例。如果您正苦于以下问题:PHP replace_public函数的具体用法?PHP replace_public怎么用?PHP replace_public使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了replace_public函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save()
{
$data = $_POST;
foreach ($data as $k => $v) {
if ($k == "description") {
$data[$k] = replace_public(btrim($v));
} else {
$data[$k] = strim($v);
}
}
$data['user_id'] = intval($GLOBALS['user_info']['id']);
$mode = "INSERT";
$where = "";
if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "user_company WHERE user_id=" . intval($GLOBALS['user_info']['id'])) > 0) {
$mode = "UPDATE";
$where = "user_id=" . intval($GLOBALS['user_info']['id']);
}
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_company", $data, $mode, $where);
if ($GLOBALS['db']->affected_rows() > 0) {
$user_info_re = array();
$user_info_re['enterpriseName'] = $data['enterpriseName'];
$user_info_re['bankLicense'] = $data['bankLicense'];
$user_info_re['orgNo'] = $data['orgNo'];
$user_info_re['businessLicense'] = $data['businessLicense'];
$user_info_re['taxNo'] = $data['enterpriseName'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "user", $user_info_re, "UPDATE", "id=" . intval($GLOBALS['user_info']['id']));
}
app_redirect(url("index", "uc_company#index"));
}
示例2: index
public function index()
{
$root = array();
$ajax = intval($_REQUEST['ajax']);
$root['ajax'] = $ajax;
$email = strim($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
if ($user_id > 0) {
$id = intval($_REQUEST['id']);
$deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and is_effect = 1 and user_id = " . intval($GLOBALS['user_info']['id']));
if (!$deal_info) {
$root['info'] = "不能更新该项目的动态";
output($root);
} else {
$data['log_info'] = strim($_REQUEST['log_info']);
if ($data['log_info'] == "") {
$root['info'] = "请输入更新的内容";
output($root);
}
$data['image'] = strim($_REQUEST['image']) != "" ? replace_public($_REQUEST['image']) : "";
$data['vedio'] = strim($_REQUEST['vedio']);
if ($data['vedio'] != "") {
require_once APP_ROOT_PATH . "system/utils/vedio.php";
$vedio = fetch_vedio_url($_REQUEST['vedio']);
if ($vedio != "") {
$data['source_vedio'] = $vedio;
} else {
$root['info'] = "非法的视频地址";
output($root);
}
}
$data['user_id'] = intval($GLOBALS['user_info']['id']);
$data['deal_id'] = $id;
$data['create_time'] = NOW_TIME;
$data['user_name'] = $GLOBALS['user_info']['user_name'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_log", $data);
$GLOBALS['db']->query("update " . DB_PREFIX . "deal set log_count = log_count + 1 where id = " . $deal_info['id']);
showSuccess("", $ajax, url("deal#update", array("id" => $deal_info['id'])));
}
} else {
$root['user_login_status'] = 0;
output($root);
}
}
示例3: do_add_quota
public function do_add_quota()
{
$data['user_id'] = $GLOBALS['user_info']['id'];
$data['name'] = strim($_REQUEST['name']);
$data['borrow_amount'] = floatval($_REQUEST['borrow_amount']);
$data['description'] = replace_public(btrim($_REQUEST['description']));
$data['description'] = valid_tag($data['description']);
$data['is_effect'] = 1;
$user_view_info = $GLOBALS['user_info']['view_info'];
$user_view_info = unserialize($user_view_info);
$new_view_info_arr = array();
for ($i = 1; $i <= intval($_REQUEST['file_upload_count']); $i++) {
$img_info = array();
$img = replace_public(strim($_REQUEST['file_' . $i]));
if ($img != "") {
$img_info['name'] = strim($_REQUEST['file_name_' . $i]);
$img_info['img'] = $img;
$img_info['is_user'] = 1;
$user_view_info[] = $img_info;
$ss = $user_view_info;
end($ss);
$key = key($ss);
$new_view_info_arr[$key] = $img_info;
}
}
$datas['view_info'] = serialize($user_view_info);
$GLOBALS['db']->autoExecute(DB_PREFIX . "user", $datas, "UPDATE", "id=" . $GLOBALS['user_info']['id']);
$data['view_info'] = array();
foreach ($_REQUEST['file_key'] as $k => $v) {
if (isset($user_view_info[$v])) {
$data['view_info'][$v] = $user_view_info[$v];
}
}
foreach ($new_view_info_arr as $k => $v) {
$data['view_info'][$k] = $v;
}
$data['view_info'] = serialize($data['view_info']);
$data['create_time'] = TIME_UTC;
//申请时间
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_quota_submit", $data);
if ($GLOBALS['db']->insert_id()) {
showSuccess('提交成功,等待管理员审核', 0, url("index", "uc_deal_quota"));
} else {
showErr('提交失败', 0, url("index", "uc_deal_quota"));
}
}
示例4: save
public function save()
{
$data = $_POST;
foreach ($data as $k => $v) {
if ($k == "description") {
$data[$k] = replace_public(btrim($v));
} else {
$data[$k] = strim($v);
}
}
$data['user_id'] = intval($GLOBALS['user_info']['id']);
$mode = "INSERT";
$where = "";
if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "user_company WHERE user_id=" . intval($GLOBALS['user_info']['id'])) > 0) {
$mode = "UPDATE";
$where = "user_id=" . intval($GLOBALS['user_info']['id']);
}
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_company", $data, $mode, $where);
app_redirect(url("index", "uc_company#index"));
}
示例5: update
public function update()
{
if (intval($_POST['id']) == 0) {
showErr($GLOBALS['lang']['ERROR_TITLE'], 0, url("biz", "profile"));
exit;
}
$id = intval($_POST['id']);
$s_account_info = es_session::get("account_info");
$location_ids = $s_account_info['location_ids'];
$info = $GLOBALS['db']->getRow(" SELECT * FROM " . DB_PREFIX . "supplier_location WHERE id = " . intval($id) . " and id in (" . implode(",", $s_account_info['location_ids']) . ")");
if (!$info) {
showErr("门店不存在或者没有编辑该门店的权限");
}
$data['preview'] = str_replace(get_domain() . APP_ROOT, ".", addslashes(htmlspecialchars(trim($_POST['preview']))));
$data['tags'] = addslashes(htmlspecialchars(trim($_POST['tags'])));
$data['address'] = addslashes(htmlspecialchars(trim($_POST['address'])));
$data['route'] = addslashes(htmlspecialchars(trim($_POST['route'])));
$data['tel'] = addslashes(htmlspecialchars(trim($_POST['tel'])));
$data['contact'] = addslashes(htmlspecialchars(trim($_POST['contact'])));
$data['open_time'] = addslashes(htmlspecialchars(trim($_POST['open_time'])));
$data['api_address'] = addslashes(htmlspecialchars(trim($_POST['api_address'])));
$data['xpoint'] = $_POST['xpoint'];
$data['ypoint'] = $_POST['ypoint'];
$data['sms_content'] = addslashes(htmlspecialchars(trim($_POST['sms_content'])));
$data['brief'] = addslashes(trim(replace_public($_POST['brief'])));
$data['brief'] = valid_tag($data['brief']);
$data['id'] = intval($_POST['id']);
$data['seo_title'] = addslashes(htmlspecialchars(trim($_POST['seo_title'])));
$data['seo_keyword'] = addslashes(htmlspecialchars(trim($_POST['seo_keyword'])));
$data['seo_description'] = addslashes(htmlspecialchars(trim($_POST['seo_description'])));
$rs = $GLOBALS['db']->autoExecute(DB_PREFIX . "supplier_location", $data, "UPDATE", " id = " . intval($_POST['id']));
if ($rs) {
//更新统计
syn_supplier_locationcount($data);
syn_supplier_location_match($data['id']);
$cache_id = md5("store" . "view" . $data['id']);
$GLOBALS['tmpl']->clear_cache('store_view.html', $cache_id);
showSuccess($GLOBALS['lang']['SUPPLIER_MODIFY_SUCCESS'], 0, url("biz", "profile#modify", array("id" => intval($_POST['id']))));
}
}
示例6: do_save_publish
//.........这里部分代码省略.........
// 根据tag计算免预约
if ($t == 1) {
$data['auto_order'] = 1;
}
$deal_tag = $deal_tag | $t2;
}
$data['deal_tag'] = $deal_tag;
foreach ($deal_tags as $t) {
if ($t == 0) {
$data['is_lottery'] = 1;
}
// 根据tag计算免预约
if ($t == 1) {
$data['auto_order'] = 1;
}
// 随时退
if ($t == 6) {
$data['any_refund'] = 1;
}
// 过期退
if ($t == 5) {
$data['expire_refund'] = 1;
}
}
if ($data['any_refund'] == 1 || $data['expire_refund'] == 1) {
$data['is_refund'] = 1;
}
$icon = strim($_REQUEST['img_icon']);
// 缩略图
$focus_imgs = $_REQUEST['focus_imgs'];
// 图集
if ($id > 0) {
//更新操作需要替换图片地址
$icon = replace_public($icon);
foreach ($focus_imgs as $k => $v) {
$v = replace_public($v);
$focus_imgs[$k] = $v;
}
}
$data['icon'] = $icon;
// 主图
foreach ($focus_imgs as $k => $v) {
if ($v != '') {
$data['img'] = $v;
break;
}
}
$location_id = $_REQUEST['location_id'];
// 支持门店
$data['cache_location_id'] = serialize($location_id);
//支持门店缓存
$data['cache_focus_imgs'] = serialize($focus_imgs);
//图集缓存
// 开始处理属性
$deal_attr = $_REQUEST['deal_attr'];
$deal_attr_price = $_REQUEST['deal_attr_price'];
$deal_add_balance_price = $_REQUEST['deal_add_balance_price'];
$deal_attr_stock_hd = $_REQUEST['deal_attr_stock_hd'];
foreach ($deal_attr as $goods_type_attr_id => $arr) {
foreach ($arr as $k => $v) {
if ($v != '') {
$deal_attr_item['goods_type_attr_id'] = $goods_type_attr_id;
$deal_attr_item['name'] = $v;
$deal_attr_item['price'] = $deal_attr_price[$goods_type_attr_id][$k];
$deal_attr_item['add_balance_price'] = $deal_add_balance_price[$goods_type_attr_id][$k];
$deal_attr_item['is_checked'] = intval($deal_attr_stock_hd[$goods_type_attr_id][$k]);
示例7: do_save_publish
public function do_save_publish()
{
$account_info = $GLOBALS['account_info'];
$supplier_id = $account_info['supplier_id'];
$account_id = $account_info['id'];
$edit_type = intval($_REQUEST['edit_type']);
$id = intval($_REQUEST['id']);
if ($edit_type == 1 && $id > 0) {
//判断是否有存在修改
$event_submit_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event_biz_submit where event_id = " . $id . " and supplier_id = " . $supplier_id);
if ($event_submit_info && $event_submit_info['admin_check_status'] == 0) {
//存在未审核数据
$result['status'] = 0;
$result['info'] = "已经存在申请操作,请先删除避免重复申请";
ajax_return($result);
exit;
} else {
$event_info = $GLOBALS['db']->getRow("select e.* from " . DB_PREFIX . "event e\n\t left join " . DB_PREFIX . "event_location_link ell on ell.event_id = e.id \n where is_effect = 1 and id=" . $id . " and supplier_id = " . $supplier_id . "\n and ell.location_id in(" . implode(",", $account_info['location_ids']) . ")");
if (empty($event_info)) {
$result['status'] = 0;
$result['info'] = "数据不存在或没有权限操作该数据";
ajax_return($result);
exit;
}
$new_data = $event_info;
$new_data['event_id'] = $event_info['id'];
unset($new_data['id']);
$new_data['supplier_id'] = $supplier_id;
$new_data['account_id'] = $account_id;
//如果数据已经有存在,通过审核的数据,先清除掉在进行插入更新操作
if ($event_submit_info && $event_submit_info['admin_check_status'] != 0) {
//删除已审核 或 拒绝的数据
$GLOBALS['db']->query("delete from " . DB_PREFIX . "event_biz_submit where id=" . $event_submit_info['id']);
}
//先建立数据
$GLOBALS['db']->autoExecute(DB_PREFIX . "event_biz_submit", $new_data);
$event_submit_id = $GLOBALS['db']->insert_id();
}
}
// 白名单过滤
require_once APP_ROOT_PATH . 'system/model/no_xss.php';
//数据验证
$this->check_event_publish_data($_REQUEST);
$data['supplier_id'] = $supplier_id;
// 所属商户
$data['account_id'] = $account_id;
$data['name'] = strim($_REQUEST['name']);
// 名称
//供应商标志图片
$icon = strim($_REQUEST['icon']);
// 活动图片
if ($id > 0) {
//更新操作需要替换图片地址
$icon = replace_public($icon);
}
$data['icon'] = $icon;
$data['event_begin_time'] = strim($_REQUEST['event_begin_time']) == '' ? 0 : to_timespan($_REQUEST['event_begin_time'], "Y-m-d H:i");
$data['event_end_time'] = strim($_REQUEST['event_end_time']) == '' ? 0 : to_timespan($_REQUEST['event_end_time'], "Y-m-d H:i");
$data['submit_begin_time'] = strim($_REQUEST['submit_begin_time']) == '' ? 0 : to_timespan($_REQUEST['submit_begin_time'], "Y-m-d H:i");
// 报名开始时间:
$data['submit_end_time'] = strim($_REQUEST['submit_end_time']) == '' ? 0 : to_timespan($_REQUEST['submit_end_time'], "Y-m-d H:i");
// 报名结束时间
$data['total_count'] = intval($_REQUEST['total_count']);
//名额
$data['score_limit'] = intval($_REQUEST['score_limit']);
//消耗积分
$data['point_limit'] = intval($_REQUEST['point_limit']);
//经验限制
$data['city_id'] = intval($_REQUEST['city_id']);
// 城市
$area_id = $_REQUEST['area_id'];
// 地区列表
$data['cache_event_area_link'] = serialize($area_id);
$data['cate_id'] = intval($_REQUEST['cate_id']);
// 分类
$location_id = $_REQUEST['location_id'];
// 支持门店
$data['cache_event_location_link'] = serialize($location_id);
$data['address'] = strim($_REQUEST['address']);
// 地址
$data['api_address'] = strim($_REQUEST['api_address']);
// 地图定位的地址
$data['xpoint'] = strim($_REQUEST['xpoint']);
// 经度
$data['ypoint'] = strim($_REQUEST['ypoint']);
// 纬度
$data['brief'] = strim($_REQUEST['brief']);
// 部门简介
$data['content'] = btrim(no_xss($_REQUEST['content']));
//内容
//字段配置
foreach ($_REQUEST['field_id'] as $k => $field_id) {
$event_field = array();
$event_field['event_id'] = 0;
$event_field['field_show_name'] = $_REQUEST['field_show_name'][$k];
$event_field['field_type'] = $_REQUEST['field_type'][$k];
$event_field['value_scope'] = $_REQUEST['value_scope'][$k];
$event_field['sort'] = $k;
$cache_event_field[] = $event_field;
}
//.........这里部分代码省略.........
示例8: credit_save
function credit_save()
{
$authorized_info = es_session::get("authorized_info");
$type = strim($_REQUEST['type']);
$credit_type = load_auto_cache("credit_type");
if (!isset($credit_type['list'][$type])) {
showErr('认证类型不存在', $this->is_ajax);
}
$field_array = array("credit_identificationscanning" => "idcardpassed", "credit_contact" => "workpassed", "credit_credit" => "creditpassed", "credit_incomeduty" => "incomepassed", "credit_house" => "housepassed", "credit_car" => "carpassed", "credit_marriage" => "marrypassed", "credit_titles" => "skillpassed", "credit_videoauth" => "videopassed", "credit_mobilereceipt" => "mobiletruepassed", "credit_residence" => "residencepassed", "credit_seal" => "sealpassed");
$u_c_data[$field_array[$type]] = 0;
//身份认证
if ($type == "credit_identificationscanning") {
$u_c_data['real_name'] = strim($_REQUEST['real_name']);
$u_c_data['idno'] = strim($_REQUEST['idno']);
if (getIDCardInfo($u_c_data['idno']) == 0) {
showErr("提交失败,身份证号码错误!", $this->is_ajax);
}
if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where idno = '" . $u_c_data['idno'] . "' and id <> " . intval($authorized_info['id'])) > 0) {
showErr("提交失败,身份证号码已使用!", $this->is_ajax);
}
$u_c_data['sex'] = intval($_REQUEST['sex']);
$u_c_data['byear'] = intval($_REQUEST['byear']);
$u_c_data['bmonth'] = intval($_REQUEST['bmonth']);
$u_c_data['bday'] = intval($_REQUEST['bday']);
$u_c_data['bday'] = intval($_REQUEST['bday']);
}
//汽车认证
if ($type == "credit_car") {
$u_c_data['car_brand'] = strim($_REQUEST['carbrand']);
$u_c_data['car_year'] = intval($_REQUEST['caryear']);
$u_c_data['car_number'] = strim($_REQUEST['carnumber']);
$u_c_data['carloan'] = intval($_REQUEST['carloan']);
}
//房产认证
if ($type == "credit_house") {
$u_c_data['houseloan'] = intval($_REQUEST['houseloan']);
}
//结婚认证
if ($type == "credit_marriage") {
$u_c_data['haschild'] = intval($_REQUEST['haschild']);
}
//学历认证
if ($type == "credit_graducation") {
$u_c_data['edu_validcode'] = strim($_REQUEST['validcode']);
$u_c_data['graduation'] = strim($_REQUEST['graduation']);
$u_c_data['university'] = strim($_REQUEST['university']);
$u_c_data['graduatedyear'] = intval($_REQUEST['graduatedyear']);
}
//视频认证
if ($type == "credit_videoauth") {
$u_c_data['has_send_video'] = intval($_REQUEST['usemail']);
}
//居住地证明
if ($type == "credit_residence") {
$u_w_data['province_id'] = intval($_REQUEST['province_id']);
$u_w_data['city_id'] = intval($_REQUEST['city_id']);
if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "user_work where user_id=" . $authorized_info['id']) > 0) {
$u_w_data['user_id'] = $authorized_info['id'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_work", $u_w_data, "INSERT");
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_work", $u_w_data, "UPDATE", "user_id=" . $authorized_info['id']);
}
$u_c_data['address'] = htmlspecialchars($_REQUEST['address']);
$u_c_data['phone'] = htmlspecialchars($_REQUEST['phone']);
$u_c_data['postcode'] = htmlspecialchars($_REQUEST['postcode']);
}
$GLOBALS['db']->autoExecute(DB_PREFIX . "user", $u_c_data, "UPDATE", "id=" . $authorized_info['id']);
$file = array();
if ($credit_type['list'][$type]['file_count'] > 0) {
for ($i = 1; $i <= $credit_type['list'][$type]['file_count']; $i++) {
if (trim($_REQUEST['file' . $i]) != "") {
$file[] = replace_public(strim($_REQUEST['file' . $i]));
}
}
if (count($file) == 0) {
exit;
}
}
$mode = "INSERT";
$condition = "";
$temp_info = $GLOBALS['db']->getRow("SELECT user_id,`type`,`file` FROM " . DB_PREFIX . "user_credit_file WHERE user_id=" . $authorized_info['id'] . " AND type='" . $type . "'");
if ($temp_info) {
$file_list = unserialize($temp_info['file']);
//认证是否过期
$time = TIME_UTC;
$expire_time = $credit_type['list'][$type]['expire'] * 30 * 24 * 3600;
switch ($type) {
case "credit_contact":
if ($authorized_info['workpassed'] == 1) {
if ($time - $authorized_info['workpassed_time'] > $expire_time) {
$authorized_info['workpassed'] = 0;
$GLOBALS['db']->query("update " . DB_PREFIX . "user set workpassed=0 WHERE id=" . $authorized_info['id']);
es_session::set('user_info', $authorized_info);
}
}
break;
case "credit_credit":
if ($authorized_info['creditpassed'] == 1) {
if ($time - $authorized_info['creditpassed_time'] > $expire_time) {
$authorized_info['creditpassed'] = 0;
//.........这里部分代码省略.........
示例9: investor_save_data
public function investor_save_data($from = 'web')
{
if (!$GLOBALS['user_info']) {
if ($from == 'web') {
app_redirect(url("user#login"));
} elseif ($from == 'wap') {
app_redirect(url_wap("user#login"));
}
}
if (!check_ipop_limit(get_client_ip(), "user_investor_result", 5)) {
showErr("提交太快", 1);
}
$id = intval($_REQUEST['id']);
$ajax = intval($_POST['ajax']);
$identify_name = strim($_POST['identify_name']);
$identify_number = strim($_POST['identify_number']);
$image1['url'] = replace_public(strim($_POST['idcard_zheng_u']));
$image2['url'] = replace_public(strim($_POST['idcard_fang_u']));
$data = investor_save($id, $ajax = '', $identify_name, $identify_number, $image1['url'], $image2['url']);
ajax_return($data);
return false;
}
示例10: save_deal_item
public function save_deal_item()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
showErr("", $ajax, url("user#login"));
}
$id = intval($_REQUEST['id']);
$data['price'] = doubleval($_REQUEST['price']);
if ($data['price'] <= 0) {
showErr("请输入正确的价格", $ajax);
}
$data['description'] = strim($_REQUEST['description']);
$data['is_delivery'] = intval($_REQUEST['is_delivery']);
$data['delivery_fee'] = doubleval($_REQUEST['delivery_fee']);
$data['is_limit_user'] = intval($_REQUEST['is_limit_user']);
$data['limit_user'] = intval($_REQUEST['limit_user']);
$data['repaid_day'] = intval($_REQUEST['repaid_day']);
$data['deal_id'] = intval($_REQUEST['deal_id']);
if (count($_REQUEST['image']) > 4) {
showErr("图片不能超过四张", $ajax);
}
if ($id == 0) {
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_item", $data, "INSERT", "", "SILENT");
$result_id = intval($GLOBALS['db']->insert_id());
if ($result_id > 0) {
if (count($_REQUEST['image']) >= 0) {
foreach ($_REQUEST['image'] as $k => $v) {
$image_data['deal_id'] = $data['deal_id'];
$image_data['deal_item_id'] = $result_id;
$image_data['image'] = replace_public($v);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_item_image", $image_data);
}
}
showSuccess("保存成功", $ajax, get_gopreview());
} else {
showErr("保存失败", $ajax);
}
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_item", $data, "UPDATE", "id=" . $id, "SILENT");
if (count($_REQUEST['image']) >= 0) {
$GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_item_image where deal_item_id = " . $id);
foreach ($_REQUEST['image'] as $k => $v) {
$image_data['deal_id'] = $data['deal_id'];
$image_data['deal_item_id'] = $id;
$image_data['image'] = replace_public(strim($v));
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_item_image", $image_data);
}
}
showSuccess("保存成功", $ajax, get_gopreview());
}
}
示例11: index
public function index()
{
$root = array();
$email = strim($GLOBALS['request']['email']);
//用户名或邮箱
$pwd = strim($GLOBALS['request']['pwd']);
//密码
//检查用户,用户密码
$user = user_check($email, $pwd);
$user_id = intval($user['id']);
if ($user_id > 0) {
$root['user_login_status'] = 1;
$id = intval($_REQUEST['id']);
$is_edit = $GLOBALS['db']->getOne("select is_edit from " . DB_PREFIX . "deal where id = " . $id);
$is_effect = $GLOBALS['db']->getOne("select is_effect from " . DB_PREFIX . "deal where id = " . $id);
if ($id > 0 && $is_effect == 1) {
$root['info'] = "项目已提交,不能更改";
}
$data['name'] = strim($_REQUEST['name']);
if ($data['name'] == "") {
$root['info'] = "请填写项目名称";
}
if (msubstr($data['name'], 0, 25) != $data['name']) {
$root['info'] = "项目名称不超过25个字";
}
$data['cate_id'] = intval($_REQUEST['cate_id']);
if ($data['cate_id'] == 0) {
$root['info'] = "请选择项目分类";
}
$data['province'] = strim($_REQUEST['province']);
if ($data['province'] == '') {
$root['info'] = "请选择省份";
}
$data['city'] = strim($_REQUEST['city']);
if ($data['city'] == '') {
$root['info'] = "请选择城市";
}
$data['brief'] = strim($_REQUEST['brief']);
$data['image'] = replace_public(addslashes(trim($_REQUEST['image'])));
if ($data['image'] == "") {
$root['info'] = "上传封面图片";
}
require_once APP_ROOT_PATH . "system/libs/words.php";
$data['tags'] = implode(" ", words::segment($data['name']));
$data['description'] = replace_public(addslashes(trim(valid_tag($_REQUEST['description']))));
//
$data['vedio'] = strim($_REQUEST['vedio']);
if ($data['vedio'] != "") {
require_once APP_ROOT_PATH . "system/utils/vedio.php";
$vedio = fetch_vedio_url($data['vedio']);
if ($vedio != "") {
$data['source_vedio'] = $vedio;
} else {
$root['info'] = "非法的视频地址";
}
}
$data['limit_price'] = doubleval($_REQUEST['limit_price']);
if ($data['limit_price'] <= 0) {
$root['info'] = "请输入正确的目标金";
}
$data['deal_days'] = doubleval($_REQUEST['deal_days']);
if ($data['deal_days'] <= 0) {
$root['info'] = "请输入正确的上线天数";
}
$data['is_edit'] = 1;
if ($id > 0) {
$savenext = intval($_REQUEST['savenext']);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, "UPDATE", "id=" . $id, "SILENT");
//追加faq
$GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_faq where deal_id = " . $id);
$sort = 1;
foreach ($_REQUEST['question'] as $kk => $question_item) {
if (strim($_REQUEST['question'][$kk]) != "" && strim($_REQUEST['answer'][$kk]) != "" && strim($_REQUEST['question'][$kk]) != "请输入问题" && strim($_REQUEST['answer'][$kk]) != "请输入答案") {
$faq_item['deal_id'] = $id;
$faq_item['question'] = strim($_REQUEST['question'][$kk]);
$faq_item['answer'] = strim($_REQUEST['answer'][$kk]);
$faq_item['sort'] = $sort;
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_faq", $faq_item);
$sort++;
}
}
$GLOBALS['db']->query("update " . DB_PREFIX . "deal set deal_extra_cache = '' where id = " . $id);
if ($savenext == 0) {
showSuccess($id, $ajax, "");
} else {
showSuccess("", $ajax, url("project#add_item", array("id" => $id)));
}
} else {
$data['user_id'] = intval($GLOBALS['user_info']['id']);
$data['user_name'] = $GLOBALS['user_info']['user_name'];
$data['create_time'] = NOW_TIME;
$savenext = intval($_REQUEST['savenext']);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, "INSERT", "", "SILENT");
$data_id = intval($GLOBALS['db']->insert_id());
if ($data_id == 0) {
$root['info'] = "保存失败,请联系管理员";
} else {
es_session::delete("deal_image");
//追加faq
$sort = 1;
//.........这里部分代码省略.........
示例12: investor_two_save
public function investor_two_save()
{
$ajax = intval($_REQUEST['ajax']);
if (!$GLOBALS['user_info']) {
showErr("", $ajax, url_wap("user#login"));
}
$id = intval($_REQUEST['id']);
$is_effect = $GLOBALS['db']->getOne("select is_effect from " . DB_PREFIX . "deal where id = " . $id);
if ($id > 0 && $is_effect == 1) {
showErr("项目已提交,不能更改", $ajax, "");
}
$data['description_2'] = replace_public(addslashes(trim($_REQUEST['description_2'])));
$data['description_3'] = replace_public(addslashes(trim($_REQUEST['description_3'])));
$data['description_4'] = replace_public(addslashes(trim($_REQUEST['description_4'])));
$data['description_5'] = replace_public(addslashes(trim($_REQUEST['description_5'])));
$data['description_6'] = replace_public(addslashes(trim($_REQUEST['description_6'])));
$data['description_7'] = replace_public(addslashes(trim($_REQUEST['description_7'])));
if ($id == 0) {
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, "INSERT", "", "SILENT");
$result_id = intval($GLOBALS['db']->insert_id());
if ($result_id > 0) {
$GLOBALS['db']->query("update " . DB_PREFIX . "deal set deal_extra_cache = '' where id = " . $result_id);
showSuccess("保存成功", $ajax, url_wap("project#investor_three", array("id" => $result_id)));
} else {
showErr("保存失败", $ajax);
}
} else {
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, "UPDATE", "id=" . $id, "SILENT");
$GLOBALS['db']->query("update " . DB_PREFIX . "deal set deal_extra_cache = '' where id = " . $id);
$investor_edit = $GLOBALS['db']->getOne("select investor_edit from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and user_id = " . intval($GLOBALS['user_info']['id']));
if ($investor_edit == 1) {
showSuccess("保存成功", $ajax, url_wap("project#investor_edit", array("id" => $id)));
} else {
showSuccess("保存成功", $ajax, url_wap("project#investor_three", array("id" => $id)));
}
}
}
示例13: investor_agency_save_data
public function investor_agency_save_data($from = 'web')
{
if (!$GLOBALS['user_info']) {
if ($from == 'web') {
app_redirect(url("user#login"));
} elseif ($from == 'wap') {
app_redirect(url_wap("user#login"));
}
}
if (!check_ipop_limit(get_client_ip(), "user_investor_result", 5)) {
showErr("提交太快", 1);
}
$id = intval($_REQUEST['id']);
$ajax = intval($_POST['ajax']);
$identify_business_name = strim($_POST['identify_business_name']);
$identify_business_licence = es_session::get("identify_business_licence");
$identify_business_code = es_session::get("identify_business_code");
$identify_business_tax = es_session::get("identify_business_tax");
$image1['url'] = replace_public(strim($_POST['identify_business_licence_u']));
$image2['url'] = replace_public(strim($_POST['identify_business_code_u']));
$image3['url'] = replace_public(strim($_POST['identify_business_tax_u']));
$data = investor_agency_save($id, $ajax = '', $identify_business_name, $identify_business_licence, $identify_business_code, $identify_business_tax, $image1['url'], $image2['url'], $image3['url']);
ajax_return($data);
return false;
}
示例14: update
public function update()
{
if (intval($_POST['pid']) == 0) {
showErr($GLOBALS['lang']['ERROR_TITLE'], 0, url("biz", "publish"));
exit;
}
$pid = intval($_POST['pid']);
$id = intval($_POST['id']);
$s_account_info = es_session::get("account_info");
$location_ids = $s_account_info['location_ids'];
$info = $GLOBALS['db']->getRow(" SELECT * FROM " . DB_PREFIX . "supplier_location_images WHERE id = " . intval($pid) . " and supplier_location_id in (" . implode(",", $s_account_info['location_ids']) . ")");
if (!$info) {
showErr("门店不存在或者没有编辑该门店的权限");
}
$data['brief'] = addslashes(htmlspecialchars(trim($_POST['brief'])));
$data['image'] = replace_public($_POST['image']);
$data['images_group_id'] = intval($_POST['images_group_id']);
$data['sort'] = intval($_POST['sort']);
$data['create_time'] = get_gmtime();
$rs = $GLOBALS['db']->autoExecute(DB_PREFIX . "supplier_location_images", $data, "UPDATE", " id = " . intval($_POST['pid']));
if ($rs) {
//更新统计
$supplier_info['id'] = $_POST['id'];
syn_supplier_locationcount($supplier_info);
$cache_id = md5("store" . "view" . $_POST['id']);
$GLOBALS['tmpl']->clear_cache('store_view.html', $cache_id);
showSuccess($GLOBALS['lang']['MODIFY_SUCCESS'], 0, url("biz", "publish#modify", array("id" => intval($_POST['id']), "pid" => intval($_POST['pid']))));
}
}
示例15: submit_modify
public function submit_modify()
{
$s_account_info = es_session::get("account_info");
$account_id = intval($s_account_info['id']);
$id = intval($_REQUEST['id']);
$data = $GLOBALS['db']->getRow("select d.* from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_location_link as l on l.deal_id = d.id where d.id = " . $id . " and publish_wait = 1 and l.location_id in (" . implode(",", $s_account_info['location_ids']) . ")");
if (!$data) {
showErr("产品不存在或者没有编辑该产品的权限");
}
$data['name'] = addslashes(htmlspecialchars(trim($_REQUEST['name'])));
$data['sub_name'] = addslashes(htmlspecialchars(trim($_REQUEST['sub_name'])));
$data['origin_price'] = doubleval($_REQUEST['origin_price']);
$data['balance_price'] = doubleval($_REQUEST['balance_price']);
$data['max_bought'] = intval($_REQUEST['max_bought']);
$data['brief'] = addslashes(htmlspecialchars(trim($_REQUEST['brief'])));
$data['is_shop'] = intval($_REQUEST['is_shop']);
$data['any_refund'] = intval($_REQUEST['any_refund']);
$data['expire_refund'] = intval($_REQUEST['expire_refund']);
$data['auto_order'] = intval($_REQUEST['auto_order']);
if ($data['is_shop'] == 1) {
$data['is_coupon'] = 0;
$data['shop_cate_id'] = intval($_REQUEST['shop_cate_id']);
$data['cate_id'] = 0;
} else {
$data['is_coupon'] = 1;
$data['shop_cate_id'] = 0;
$data['cate_id'] = intval($_REQUEST['cate_id']);
}
$data['city_id'] = intval($_REQUEST['city_id']);
$data['icon'] = addslashes(htmlspecialchars(trim(replace_public($_REQUEST['icon']))));
$data['img'] = addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img']))));
$data['description'] = trim(replace_public($_REQUEST['descript']));
$data['description'] = valid_tag($data['description']);
$data['account_id'] = intval($account_id);
$data['publish_wait'] = 1;
$data['create_time'] = get_gmtime();
$data['is_effect'] = 0;
$data['supplier_id'] = intval($s_account_info['supplier_id']);
$data['begin_time'] = trim($_REQUEST['begin_time']) == '' ? 0 : to_timespan($_REQUEST['begin_time']);
$data['end_time'] = trim($_REQUEST['end_time']) == '' ? 0 : to_timespan($_REQUEST['end_time']);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, "UPDATE", "id=" . $data['id']);
$deal_id = $data['id'];
if ($deal_id > 0) {
$GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_gallery where deal_id = " . $deal_id . " and sort < 6");
if ($_REQUEST['img0'] != '') {
$deal_gallery_0 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img0'])))), "deal_id" => $deal_id, "sort" => 0);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_0);
}
if ($_REQUEST['img1'] != '') {
$deal_gallery_1 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img1'])))), "deal_id" => $deal_id, "sort" => 1);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_1);
}
if ($_REQUEST['img2'] != '') {
$deal_gallery_2 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img2'])))), "deal_id" => $deal_id, "sort" => 2);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_2);
}
if ($_REQUEST['img3'] != '') {
$deal_gallery_3 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img3'])))), "deal_id" => $deal_id, "sort" => 3);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_3);
}
if ($_REQUEST['img4'] != '') {
$deal_gallery_4 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img4'])))), "deal_id" => $deal_id, "sort" => 4);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_4);
}
if ($_REQUEST['img5'] != '') {
$deal_gallery_5 = array("img" => addslashes(htmlspecialchars(trim(replace_public($_REQUEST['img5'])))), "deal_id" => $deal_id, "sort" => 5);
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_gallery", $deal_gallery_5);
}
$GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_cate_type_deal_link where deal_id = " . $deal_id);
foreach ($_REQUEST['deal_cate_type_id'] as $deal_cate_type_id) {
if ($deal_cate_type_id > 0) {
$deal_cate_type_link = array("deal_id" => $deal_id, "deal_cate_type_id" => intval($deal_cate_type_id));
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_cate_type_deal_link", $deal_cate_type_link);
}
}
showSuccess("提交成功,请等待管理员审核");
} else {
showErr("发布失败");
}
}