Example #1
0
File: edit.php Project: noikiy/mdwp
		}

		/* update coupon */
		DB::Update('coupon', array('team_id' => $id), array(
			'expire_time' => $team['expire_time'],
		));
		/* update order */
		DB::Update('order', array('team_id' => $id), array(
			'allowrefund' => $team['allowrefund'],
		));
	}

	//dbx($team);
	$insert = array_unique($insert);
	$table = new Table('team', $team);
	$table->SetStrip('detail', 'systemreview', 'notice', 'teambeizhu', 'teamviewb');

	if ( $team['id'] && $team['id'] == $id ) {
		$table->SetPk('id', $id);
		$table->update($insert);
		
		DB::Update('team',$id,array('dptpl_id'=>$_POST['dptpl_id']));
		
		log_admin('team', '编辑team项目',$insert);
		Session::Set('notice', '编辑项目信息成功');
		redirect( WEB_ROOT . "/manage/team/index.php");
	}
	else if ( $team['id'] ) {
		log_admin('team', '非法编辑team项目',$insert);
		Session::Set('error', '非法编辑');
		redirect( WEB_ROOT . "/manage/team/index.php");
Example #2
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_partner();
$id = abs(intval($_GET['id']));
$condition = array('partner_id' => $partner_id, 'id' => $id);
$count = Table::Count('team', $condition);
if ($count == 0) {
    Session::Set('error', '无权操作');
    redirect(WEB_ROOT . '/biz/index.php');
}
$team = Table::Fetch('team', $id);
if ($_POST) {
    $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'per_number', 'product', 'image', 'detail', 'userreview', 'systemreview', 'image1', 'image2', 'flv', 'card', 'conduser', 'buyonce', 'bonus', 'delivery', 'mobile', 'address', 'fare', 'express', 'credit', 'user_id', 'city_id', 'group_id', 'partner_id', 'team_type');
    $table = new Table('team', $_POST);
    $table->SetStrip('detail', 'systemreview', 'notice');
    $table->begin_time = strtotime($_POST['begin_time']);
    $table->city_id = abs(intval($table->city_id));
    $table->partner_id = abs(intval($partner_id));
    $table->end_time = strtotime($_POST['end_time']);
    $table->expire_time = strtotime($_POST['expire_time']);
    $table->image = upload_image('upload_image', $team['image'], 'team', true);
    $table->image1 = upload_image('upload_image1', $team['image1'], 'team');
    $table->image2 = upload_image('upload_image2', $team['image2'], 'team');
    //team_type == goods
    if ($table->team_type == 'goods') {
        $table->min_number = 1;
    }
    $error_tip = array();
    if (!$error_tip) {
        if ($table->update($insert)) {
Example #3
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('market');
if ($_POST) {
    $table = new Table('partner', $_POST);
    $table->SetStrip('location', 'other');
    $table->create_time = time();
    $table->user_id = $login_user_id;
    $table->password = ZPartner::GenPassword($table->password);
    $table->group_id = abs(intval($table->group_id));
    $table->city_id = abs(intval($table->city_id));
    $table->open = strtoupper($table->open) == 'Y' ? 'Y' : 'N';
    $table->display = strtoupper($table->display) == 'Y' ? 'Y' : 'N';
    $table->image = upload_image('upload_image', null, 'team', true);
    $table->image1 = upload_image('upload_image1', null, 'team');
    $table->image2 = upload_image('upload_image2', null, 'team');
    $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat'));
    $partner = DB::GetTableRow('partner', array('username' => $username, 'password' => $password));
    // 更新商户支付信息
    if ($login_partner) {
        $table = new Table('partner_pay', $_POST);
        $table->SetPk('id', $partner['id']);
        $insert = array('id', 'tenpaymid', 'tenpaysec', 'alipaymid', 'alipaysec');
        $flag = $table->insert($insert);
    }
    Session::Set('notice', '新建商户成功');
    Utility::Redirect(WEB_ROOT . '/manage/partner/index.php');
}
include template('manage_partner_create');
Example #4
0
File: edit.php Project: noikiy/mdwp
<?php
/**
 * 
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_create_edit');

$id = abs(intval($_GET['id']));
$partner = Table::Fetch('partner', $id);

if ( $_POST && $id==$_POST['id'] && $partner) {
	$table = new Table('partner', $_POST);
	$table->SetStrip('location', 'other', 'psjjs');
	$table->group_id = abs(intval($table->group_id));
	$table->city_id = abs(intval($table->city_id));
	$table->open = (strtoupper($table->open)=='Y') ? 'Y' : 'N';
	$table->display = (strtoupper($table->display)=='Y') ? 'Y' : 'N';
	$table->image = upload_image('upload_image', $partner['image'], 'team', true);
	$table->image1 = upload_image('upload_image1', $partner['image1'], 'team');
	$table->image2 = upload_image('upload_image2', $partner['image2'], 'team');
	$table->image3 = upload_image('upload_image3', $partner['image3'], 'team');
	$table->image4 = upload_image('upload_image4', $partner['image4'], 'team');
	$table->image5 = upload_image('upload_image5', $partner['image5'], 'team');
	$table->image6 = upload_image('upload_image6', $partner['image6'], 'team');

	$up_array = array(
			'username', 'pass','title','yysj','skfs','jtxl', 'bank_name','bank_user_xm',  'bank_user', 'bank_no',
			'location', 'other','psjjs','homepage', 'contact', 'mobile', 'phone',
			'address', 'group_id', 'open', 'city_id', 'display','cycle_calculate',
Example #5
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$pages = array('help_tour' => '玩转' . $INI['system']['abbreviation'], 'help_faqs' => '常见问题', 'help_zuitu' => '什么是' . $INI['system']['abbreviation'], 'help_api' => '开发API', 'about_contact' => '联系方式', 'about_us' => '关于' . $INI['system']['abbreviation'], 'about_job' => '工作机会', 'about_terms' => '用户协议', 'about_privacy' => '隐私声明');
$id = strval($_GET['id']);
if ($id && !in_array($id, array_keys($pages))) {
    Utility::Redirect(WEB_ROOT . "/manage/system/page.php");
}
$n = Table::Fetch('page', $id);
if ($_POST) {
    $table = new Table('page', $_POST);
    $table->SetStrip('value');
    if ($n) {
        $table->SetPk('id', $id);
        $table->update(array('id', 'value'));
    } else {
        $table->insert(array('id', 'value'));
    }
    Session::Set('notice', "页面:{$pages[$id]}编辑成功");
    Utility::Redirect(WEB_ROOT . "/manage/system/page.php?id={$id}");
}
$value = $n['value'];
include template('manage_system_page');
Example #6
0
File: edit.php Project: noikiy/mdwp
	$news['id'] = 0;
	$news['begin_time'] = strtotime('+0 days');

}
else if ( is_post() ) {
	$news = $_POST;
	$insert = array(
		'title', 
		'begin_time', 
		'detail',
		);
	
	$news['begin_time'] = strtotime($news['begin_time']);
	$insert = array_unique($insert);
	$table = new Table('news', $news);
	$table->SetStrip('detail');

	if ( $news['id'] && $news['id'] == $id ) {
		$table->SetPk('id', $id);
		$table->update($insert);
		Session::Set('notice', '添加新闻成功!');
		redirect( WEB_ROOT . "/manage/news/index.php");
	} 
	else if ( $news['id'] ) {
		Session::Set('error', '非法编辑');
		redirect( WEB_ROOT . "/manage/news/index.php");
	}

	if ( $table->insert($insert) ) {
		Session::Set('notice', '添加新闻成功');
		redirect( WEB_ROOT . "/manage/news/index.php");
 /**
  * 同步项目
  */
 function sync_team($data)
 {
     $city_id = DB::Exist('category', array('name' => $data['city']));
     if (!$city_id) {
         return $this->response('sync_team', '1002', '合作方没有开通该城市!');
     }
     $team_id = DB::Exist('team', array('serv_code' => $data['zhongyu_id']));
     if ($team_id) {
         return $this->response('sync_team', '1003', '已同步过,第三方ID为:' . $team_id);
     }
     /* 此处特别注意,分类ID请对应 */
     switch ($data['group']) {
         case '餐饮美食':
             $group_id = 2;
             break;
         case '休闲娱乐':
             $group_id = 37;
             break;
         case '生活服务':
             $group_id = 39;
             break;
             //…………
         //…………
         default:
             $group_id = 42;
             break;
     }
     $partners = $data['partners']['partner'];
     if (isset($partners['title'])) {
         //这里表示只有一个商家分店信息
         $partner = array('username' => $partners['title'], 'password' => '123456', 'title' => $partners['title'], 'phone' => $partners['tel'], 'address' => $partners['address'], 'route' => $partners['route']);
     } else {
         $partner = array('username' => $partners[0]['title'], 'password' => '123456', 'title' => $partners[0]['title'], 'phone' => $partners[0]['tel'], 'address' => $partners[0]['address'], 'route' => $partners[0]['route']);
     }
     $partner_id = DB::Exist('partner', array('title' => $partner['title']));
     if (!$partner_id) {
         $item['business']['password'] = '******';
         $table = new Table('partner', $partner);
         $table->SetStrip('location', 'other');
         $table->username = $partner['title'];
         $table->title = $partner['title'];
         $table->location = "客服预约:" . $partner['phone'] . "<br/>" . "地址:" . $partner['address'] . "<br/>交通:" . $partner['route'];
         $table->create_time = time();
         $table->user_id = 1;
         $table->password = ZPartner::GenPassword($table->password);
         $table->group_id = 0;
         $table->city_id = 0;
         $table->open = 'N';
         $table->display = 'N';
         $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display'));
         $partner_id = DB::GetInsertId();
     }
     $team = array('title' => $data['title'], 'product' => $data['product'], 'group_id' => intval($group_id), 'city_id' => intval($city_id), 'notice' => $data['notice'], 'summary' => $data['summary'], 'begin_time' => intval($data['begin_time']), 'end_time' => intval($data['end_time']), 'expire_time' => intval($data['expire_time']), 'min_number' => intval($data['min_number']), 'max_number' => intval($data['max_number']), 'permin_number' => intval($data['user_min_number']), 'per_number' => intval($data['user_per_number']), 'market_price' => floatval(sprintf("%0.2f", $data['market_price'])), 'team_price' => floatval(sprintf("%0.2f", $data['team_price'])), 'partner_id' => intval($partner_id), 'user_id' => 1, 'system' => 'Y', 'now_number' => 0, 'pre_number' => 0, 'credit' => 0, 'card' => 0, 'fare' => 0, 'farefree' => 0, 'bonus' => 0, 'state' => 'none', 'conduser' => 'N', 'buyonce' => 'N', 'sort_order' => 0, 'team_type' => 'normal', 'delivery' => 'thirdpart', 'codeform' => 'zhongyu', 'serv_code' => $data['zhongyu_id']);
     $regex = '%<img[^>]*?src="(http://.*?)"[^>]*?>%ie';
     $replace = "'<a target=\"_blank\" href=\"'.(\$src=downremote_image('\$1')).'\"><img src=\"'.\$src.'\" /></a>'";
     $team['detail'] = preg_replace($regex, $replace, $data['detail']);
     $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'per_number', 'product', 'flv', 'now_number', 'detail', 'userreview', 'card', 'systemreview', 'conduser', 'buyonce', 'bonus', 'sort_order', 'delivery', 'mobile', 'address', 'fare', 'express', 'credit', 'farefree', 'pre_number', 'user_id', 'city_id', 'group_id', 'partner_id', 'team_type', 'sort_order', 'farefree', 'state', 'condbuy', 'codeform', 'serv_code');
     $insert = array_unique($insert);
     $table = new Table('team', $team);
     $table->SetStrip('detail', 'systemreview', 'notice');
     $team_id = $table->insert($insert);
     if (!$team_id) {
         return $this->response('sync_team', '1004', '插入团购失败!');
     }
     return $this->response('sync_team', '0000', '同步成功!');
 }
Example #8
0
File: edit.php Project: noikiy/mdwp
		'image',
		'lianjie',
		'mltadw',
		'sort_mltad',
		'xs_mltad',
		
		);
	
	$mltad['begin_time'] = strtotime($mltad['begin_time']);
	$mltad['end_time'] = strtotime($mltad['end_time']);

	$mltad['image'] = upload_image('upload_image',$eteam['image'],'team');

	$insert = array_unique($insert);
	$table = new Table('mltad', $mltad);
	$table->SetStrip('detail');
	$table->SetStrip('mltadw');
	$table->SetStrip('sort_mltad');
	$table->SetStrip('xs_mltad');




	if ( $mltad['id'] && $mltad['id'] == $id ) {
		$table->SetPk('id', $id);
		$table->update($insert);
		Session::Set('notice', '添加广告成功!');
		redirect( WEB_ROOT . "/manage/mltad/index.php");
	} 
	else if ( $mltad['id'] ) {
		Session::Set('error', '非法编辑');