コード例 #1
0
 public function submit()
 {
     $ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
     if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
         $this->error('您的IP被永久禁止登陆!');
     } else {
         $user_name = mc_magic_in(mc_remove_html($_POST['user_name'], 'all'));
         if ($user_name == '') {
             $this->error('账号必须填写!');
         } else {
             $user_login = M('meta')->where("meta_key='user_name' AND type ='user'")->getField('meta_value', true);
             if (in_array(strip_tags($_POST['user_name']), $user_login)) {
                 $this->error('账号已存在!');
             }
         }
         $user_email = mc_magic_in(mc_remove_html($_POST['user_email'], 'all'));
         if (empty($user_email)) {
             $this->error('邮箱必须填写!');
         } else {
             $user_email = M('meta')->where("meta_key='user_email' AND type ='user'")->getField('meta_value', true);
             if (in_array(strip_tags($_POST['user_email']), $user_email)) {
                 $this->error('邮箱已存在!');
             }
         }
         if (empty($_POST['user_pass'])) {
             $this->error('密码必须填写!');
         }
         if ($_POST['user_pass'] != $_POST['user_pass2']) {
             $this->error('两次密码必须一致!');
         }
         $user['title'] = I('param.user_name');
         $user['content'] = '';
         $user['type'] = 'user';
         $user['date'] = strtotime("now");
         $result = M("page")->data($user)->add();
         if ($result) {
             mc_add_meta($result, 'user_name', $user_name, 'user');
             $user_pass = md5(I('param.user_pass') . mc_option('site_key'));
             mc_add_meta($result, 'user_pass', $user_pass, 'user');
             mc_add_meta($result, 'user_email', $user_email, 'user');
             mc_add_meta($result, 'user_level', '1', 'user');
             cookie('user_name', I('param.user_name'), 36000000000);
             cookie('user_pass', $user_pass, 36000000000);
             $ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
             if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
             } else {
                 if (!mc_is_admin()) {
                     mc_add_action(mc_user_id(), 'ip', mc_user_ip());
                 }
             }
             if ($_POST['comefrom']) {
                 $this->success('注册成功', $_POST['comefrom']);
             } else {
                 $this->success('注册成功', U('user/index/edit?id=' . mc_user_id()));
             }
         } else {
             $this->error('注册失败');
         }
     }
 }
コード例 #2
0
 public function add_post($id = false, $number = false)
 {
     if (mc_user_id()) {
         if ($_GET['wish'] == 1) {
             if (is_numeric($id) && is_numeric($number) && $number > 0) {
                 if (mc_get_meta($id, 'kucun') <= 0) {
                     $this->error('商品库存不足!');
                 } else {
                     if ($_POST['parameter']) {
                         $this->assign('parameter', $_POST['parameter']);
                         $this->assign('cart', $number);
                     } else {
                         //本商品不存在多种型号
                         $this->assign('cart', $number);
                     }
                 }
             } else {
                 $this->error('参数错误!');
             }
         }
         $this->theme(mc_option('theme'))->display('Publish/add_post');
     } else {
         $this->success('请先登陆', U('User/login/index'));
     }
 }
コード例 #3
0
 public function submit()
 {
     $ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
     if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
         $this->error('您的IP被永久禁止登陆!');
     } else {
         $page_id = M('meta')->where("meta_key='user_name' AND meta_value='" . mc_magic_in(I('param.user_name')) . "' AND type='user'")->getField('page_id');
         $user_pass_true = mc_get_meta($page_id, 'user_pass', true, 'user');
         if ($_POST['user_name'] && $_POST['user_pass'] && md5($_POST['user_pass'] . mc_option('site_key')) == $user_pass_true) {
             $user_pass = md5(I('param.user_pass') . mc_option('site_key'));
             cookie('user_name', I('param.user_name'), 36000000000);
             cookie('user_pass', $user_pass, 36000000000);
             $ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
             if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
             } else {
                 if (!mc_is_admin()) {
                     mc_add_action(mc_user_id(), 'ip', mc_user_ip());
                 }
             }
             if ($_POST['comefrom']) {
                 $this->success('登陆成功', $_POST['comefrom']);
             } else {
                 if (mc_is_mobile()) {
                     $this->success('登陆成功', U('user/index/pro?id=' . mc_user_id()));
                 } else {
                     $this->success('登陆成功', U('user/index/index?id=' . mc_user_id()));
                 }
             }
         } else {
             $this->error('用户名与密码不符!');
         }
     }
 }
コード例 #4
0
 public function index()
 {
     if (mc_user_id()) {
         $this->success('您已经登陆', U('home/index/index'));
     } else {
         $this->theme(mc_option('theme'))->display('User/lostpass');
     }
 }
コード例 #5
0
 public function index($page = 1)
 {
     if (mc_site_url()) {
         $site_url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER['PHP_SELF'];
         $site_url = preg_replace("/\\/[a-z0-9]+\\.php.*/is", "", $site_url);
         if ($site_url != mc_site_url()) {
             $url = mc_site_url();
             Header("Location:{$url}");
         } else {
             if (is_numeric($page)) {
                 if ($_GET['keyword']) {
                     if ($_GET['stype'] == 'article') {
                         $condition['type'] = 'article';
                     } elseif ($_GET['stype'] == 'publish') {
                         $condition['type'] = 'publish';
                     } else {
                         $condition['type'] = 'pro';
                     }
                     $where['content'] = array('like', "%{$_GET['keyword']}%");
                     $where['title'] = array('like', "%{$_GET['keyword']}%");
                     $where['_logic'] = 'or';
                     $condition['_complex'] = $where;
                     $this->page = M('page')->where($condition)->order('id desc')->page($page, mc_option('page_size'))->select();
                     $count = M('page')->where($condition)->count();
                     $this->assign('count', $count);
                     $this->assign('page_now', $page);
                     if ($_GET['stype'] == 'article') {
                         $this->theme(mc_option('theme'))->display('Article/search');
                     } elseif ($_GET['stype'] == 'publish') {
                         $this->theme(mc_option('theme'))->display('Post/search');
                     } else {
                         $this->theme(mc_option('theme'))->display('Pro/search');
                     }
                 } else {
                     if (is_numeric($_GET['ref'])) {
                         session('mc_reffer', $_GET['ref']);
                         if (mc_user_id() && mc_user_id() != session('mc_reffer') && session('mc_reffer')) {
                             $user_id = mc_user_id();
                             $ref_a = mc_get_meta($user_id, 'ref', true, 'user');
                             if (!is_numeric($ref_a)) {
                                 mc_add_meta($user_id, 'ref', session('mc_reffer'), 'user');
                             }
                         }
                     }
                     $this->theme(mc_option('theme'))->display('Home/index');
                 }
             } else {
                 $this->error('参数错误!');
             }
         }
     } else {
         $site_url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER['PHP_SELF'];
         $site_url = preg_replace("/\\/[a-z0-9]+\\.php.*/is", "", $site_url);
         $url = $site_url . '/install.php';
         Header("Location:{$url}");
     }
 }
コード例 #6
0
 public function checkout($id, $price)
 {
     if (mc_user_id()) {
         if (is_numeric($price)) {
             $this->theme(mc_option('theme'))->display('Post/checkout');
         } else {
             $this->error('价格必须为数字!');
         }
     } else {
         $this->success('请先登陆!', U('User/login/index'));
     }
 }
コード例 #7
0
 public function index()
 {
     if (mc_user_id()) {
         if (mc_is_mobile()) {
             $this->success('登陆成功', U('user/index/pro?id=' . mc_user_id()));
         } else {
             $this->success('登陆成功', U('user/index/index?id=' . mc_user_id()));
         }
     } else {
         $this->theme(mc_option('theme'))->display('User/lostpass');
     }
 }
コード例 #8
0
 public function index($id, $page = 1)
 {
     if (is_numeric($id)) {
         if (mc_user_id() == $id) {
             $args_id = M('meta')->where("meta_key='ref' AND meta_value='{$id}'")->getField('page_id', true);
             $condition['id'] = array('in', $args_id);
             $this->page = M('page')->where($condition)->order('id desc')->page($page, mc_option('page_size'))->select();
             $count = M('page')->where($condition)->count();
             $this->assign('id', $id);
             $this->assign('count', $count);
             $this->assign('page_now', $page);
             $this->theme(mc_option('theme'))->display('User/reffer');
         } else {
             $this->error('您无权查看其他人的推荐记录!');
         }
     } else {
         $this->error('参数错误!');
     }
 }
コード例 #9
0
 public function huifu($page = 1)
 {
     if (mc_user_id()) {
         if (mc_is_admin()) {
             if ($_POST['msg'] && $_POST['return']) {
                 mc_add_option($_POST['msg'], $_POST['return'], 'wx_huifu');
                 $this->success('添加成功!', U('control/weixin/huifu'));
             } elseif ($_POST['del']) {
                 M('option')->where("id = '" . $_POST['del'] . "'")->delete();
                 $this->success('删除成功!', U('control/weixin/huifu'));
             } else {
                 $this->theme('admin')->display('Control/huifu');
             }
         } else {
             $this->error('您没有权限访问此页面!');
         }
     } else {
         $this->success('请先登陆', U('User/login/index'));
     }
 }
コード例 #10
0
    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
    //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表
    //商户订单号
    $out_trade_no = $_GET['out_trade_no'];
    //支付宝交易号
    $trade_no = $_GET['trade_no'];
    //交易状态
    $trade_status = $_GET['trade_status'];
    if ($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
        //判断该笔订单是否在商户网站中已经做过处理
        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
        //如果有做过处理,不执行商户的业务程序
    } else {
        if ($_GET['trade_status'] == 'TRADE_FINISHED') {
            //判断该笔订单是否在商户网站中已经做过处理
            //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
            //如果有做过处理,不执行商户的业务程序
        } else {
            //echo "trade_status=".$_GET['trade_status'];
        }
    }
    //echo "验证成功<br />";
    $this->success('支付成功!', mc_option('site_url') . '?m=user&c=index&a=pro&id=' . mc_user_id());
    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
    //验证失败
    //如要调试,请看alipay_notify.php页面的verifyReturn函数
    //echo "验证失败";
    $this->error('支付失败!', mc_option('site_url'));
}
コード例 #11
0
 public function cart_number($id, $number, $for = false)
 {
     if (mc_user_id()) {
         if (is_numeric($id) && is_numeric($number)) {
             $cart_number = M('action')->where("id='{$id}'")->getField('action_value');
             if (mc_cart_kucun($id) > $cart_number) {
                 $number_now = M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->getField('action_value');
                 if ($for) {
                     $number = -$number;
                 }
                 $action['action_value'] = $number_now + $number;
                 M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->save($action);
                 $this->success('更改数量成功!');
             } else {
                 $action['action_value'] = mc_cart_kucun($id);
                 M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->save($action);
                 $this->success('商品库存不足!');
             }
         } else {
             $this->error('参数错误!');
         }
     } else {
         $this->error('请先登陆!');
     }
 }
コード例 #12
0
ファイル: callback.php プロジェクト: xiaowei521/vamshop
            $user_id = M('page')->where("title='" . $user_message['screen_name'] . "' AND type ='user'")->getField('id', true);
            if ($user_id) {
                $user['title'] = $user_name_test;
            } else {
                $user['title'] = $user_message['screen_name'];
            }
        } else {
            $user['title'] = $user_name_test;
        }
        $user['content'] = '';
        $user['type'] = 'user';
        $user['date'] = strtotime("now");
        $result = M("page")->data($user)->add();
        if ($result) {
            mc_add_meta($result, 'user_name', $user_name_test, 'user');
            $user_pass = md5($uid . mc_option('site_key'));
            mc_add_meta($result, 'user_pass', $user_pass, 'user');
            mc_add_meta($result, 'user_wboid', $uid, 'user');
            mc_add_meta($result, 'user_level', '1', 'user');
            cookie('user_name', $user_name_test, 36000000000);
            cookie('user_pass', $user_pass, 36000000000);
            $this->success('登陆成功', mc_option('site_url') . '?m=user&c=index&a=edit&id=' . mc_user_id());
        } else {
            $this->error('登陆失败');
        }
    }
} else {
    ?>
授权失败。
<?php 
}
コード例 #13
0
ファイル: header.php プロジェクト: xiaowei521/vamshop
    ?>
">
							<?php 
    echo $val['meta_key'];
    ?>
						</a>
					</li>
					<?php 
}
?>
					<?php 
if (mc_user_id()) {
    ?>
					<li>
						<a href="<?php 
    echo U('user/index/index?id=' . mc_user_id());
    ?>
">
							用户中心
							<?php 
    if (mc_user_trend_count()) {
        ?>
(<span class="count"><?php 
        echo mc_user_trend_count();
        ?>
</span>)<?php 
    }
    ?>
						</a>
					</li>
					<!--li>
コード例 #14
0
ファイル: single.php プロジェクト: dalinhuang/shouzhangmall
    ?>
				</div>
				<hr>
			</div>
		</div>
	</div>
	<div class="home-main">
		<h4 class="title mb-0">
			<i class="icon-comments"></i> 商品评论
		</h4>
	</div>
	<div id="pro-single">
		<div class="row">
			<div class="col-sm-12 pt-0" id="single">
				<?php 
    if (mc_user_id()) {
        ?>
				<form role="form" method="post" action="<?php 
        echo U('home/perform/comment');
        ?>
">
					<div class="form-group">
						<textarea name="content" class="form-control" rows="3" placeholder="请输入评论内容"></textarea>
					</div>
					<div class="text-center">
						<button type="submit" class="btn btn-block btn-warning">
							<i class="glyphicon glyphicon-ok"></i> 提交
						</button>
					</div>
					<input type="hidden" name="id" value="<?php 
        echo $val['id'];
コード例 #15
0
ファイル: index.php プロジェクト: xiaowei521/vamshop
            ?>
 <a href="<?php 
            echo mc_get_url($page_id);
            ?>
"><?php 
            echo mc_get_page_field($page_id, 'title');
            ?>
</a> 中,回复:
									<?php 
        } elseif ($key == 'wish') {
            ?>
										<?php 
            $author = mc_get_meta($page_id, 'author', true);
            ?>
										<?php 
            if ($author == mc_user_id()) {
                ?>
										支持了你的心愿 <a href="<?php 
                echo mc_get_url($page_id);
                ?>
"><?php 
                echo mc_get_page_field($page_id, 'title');
                ?>
</a>:
										<?php 
            } else {
                ?>
										支持了心愿 <a href="<?php 
                echo mc_get_url($page_id);
                ?>
"><?php 
コード例 #16
0
 public function index()
 {
     $this->page = M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart'")->order('id desc')->select();
     $this->theme(mc_option('theme'))->display('Pro/cart');
 }
コード例 #17
0
 public function images($page = 1)
 {
     if (mc_user_id()) {
         if (mc_is_admin()) {
             $this->content = M('attached')->order('id desc')->page($page, 20)->select();
             $count = M('page')->where($condition)->count();
             $this->assign('count', $count);
             $this->assign('page_now', $page);
             $this->theme(mc_option('theme'))->display('Control/images');
         } else {
             $this->error('您没有权限访问此页面!');
         }
     } else {
         $this->success('请先登陆', U('User/login/index'));
     }
 }
コード例 #18
0
ファイル: coins.php プロジェクト: xiaowei521/vamshop
积分
						<?php 
    } elseif ($val['action_value'] < 0) {
        ?>
						于 <?php 
        echo date('Y-m-d H:i', $val['date']);
        ?>
 提现 <?php 
        echo -$val['action_value'];
        ?>
积分
						<div class="pull-right"><?php 
        echo M('action')->where("action_key='shoukuan' AND page_id='" . mc_user_id() . "' AND user_id='" . mc_user_id() . "' AND date='" . $val['date'] . "'")->getField('action_value');
        ?>
 <span class="text-danger"><?php 
        $zhuangtai = M('action')->where("action_key='zhuangtai' AND page_id='" . mc_user_id() . "' AND user_id='" . mc_user_id() . "' AND date='" . $val['date'] . "'")->getField('action_value');
        if ($zhuangtai == 1) {
            echo '等待处理';
        } elseif ($zhuangtai == 2) {
            echo '体现成功';
        } elseif ($zhuangtai == 3 || $zhuangtai == 4) {
            echo '收款信息有误';
        } else {
            echo '未知状态,请联系管理员';
        }
        ?>
</span></div>
						<?php 
    }
    ?>
					</li>
コード例 #19
0
 public function tixian()
 {
     if ($_POST['shoukuan'] == '') {
         $this->error('收款方式必须填写!');
     } elseif ($_POST['tixian'] < 100) {
         $this->error('提现金额必须大于100元!');
     } elseif ($_POST['tixian'] > mc_coins(mc_user_id())) {
         $this->error('您没有足够的余额!');
     } else {
         $coins = -$_POST['tixian'];
         mc_update_coins(mc_user_id(), $coins);
         $action['page_id'] = mc_user_id();
         $action['user_id'] = mc_user_id();
         $action['date'] = strtotime("now");
         //积分记录
         $action['action_key'] = 'coins';
         $action['action_value'] = $coins;
         M('action')->data($action)->add();
         //收款方式
         $action['action_key'] = 'shoukuan';
         $action['action_value'] = I('param.shoukuan');
         M('action')->data($action)->add();
         //收款状态
         $action['action_key'] = 'zhuangtai';
         $action['action_value'] = 1;
         M('action')->data($action)->add();
         $this->success('提现成功!');
     }
 }
コード例 #20
0
 public function hdfk()
 {
     if (mc_user_id()) {
         if (!$_POST['buyer_name']) {
             $this->error('请填写收货人姓名');
         } elseif (!$_POST['buyer_city']) {
             $this->error('请选择省份和城市');
         } elseif (!$_POST['buyer_address']) {
             $this->error('请填写详细地址');
         } elseif (!$_POST['buyer_phone']) {
             $this->error('请填写联系电话');
         } else {
             $now = strtotime("now");
             $cart = M('action')->field('id,page_id,action_value')->where(array("user_id" => mc_user_id(), "action_key" => 'cart'))->select();
             //dump($cart);die;
             if ($cart) {
                 $item = '';
                 //保存商品名
                 $sumPrice = '';
                 //保存商品总价
                 foreach ($cart as $key => $val) {
                     //echo $val['page_id'].':'.$val['action_value'].'<br />';
                     $itemTitle = M('page')->field('title')->where(array('id' => $val['page_id']))->find();
                     $item .= $itemTitle['title'] . '、';
                     $itemPrice = M('meta')->field('meta_value')->where(array('page_id' => $val['page_id'], 'meta_key' => 'price'))->find();
                     $sumPrice += floatval($itemPrice['meta_value']) * intval($val['action_value']);
                     //dump($itemPrice);
                 }
                 $action['date'] = $now;
                 $action['action_key'] = 'wait_hdfk';
                 M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart'")->save($action);
                 M('action')->where("user_id='" . mc_user_id() . "' AND action_key='address_pending'")->delete();
                 M('action')->where("user_id='" . mc_user_id() . "' AND action_key='trade_pending'")->delete();
                 $action['page_id'] = mc_user_id();
                 $action['user_id'] = mc_user_id();
                 $action['action_key'] = 'address_wait_hdfk';
                 $action['action_value'] = '<h4>' . I('param.buyer_name') . '</h4><p>' . I('param.buyer_province') . ',' . I('param.buyer_city') . ',' . I('param.buyer_address') . '</p><p>' . I('param.buyer_phone') . '</p>';
                 M('action')->data($action)->add();
                 $action['action_key'] = 'trade_wait_hdfk';
                 $action['action_value'] = $out_trade_no;
                 M('action')->data($action)->add();
                 $id = mc_user_id();
                 mc_delete_meta($id, 'buyer_name', 'user');
                 if (I('param.buyer_name')) {
                     mc_add_meta($id, 'buyer_name', I('param.buyer_name'), 'user');
                 }
                 mc_delete_meta($id, 'buyer_province', 'user');
                 if (I('param.buyer_province')) {
                     mc_add_meta($id, 'buyer_province', I('param.buyer_province'), 'user');
                 }
                 mc_delete_meta($id, 'buyer_city', 'user');
                 if (I('param.buyer_city')) {
                     mc_add_meta($id, 'buyer_city', I('param.buyer_city'), 'user');
                 }
                 mc_delete_meta($id, 'buyer_address', 'user');
                 if (I('param.buyer_address')) {
                     mc_add_meta($id, 'buyer_address', I('param.buyer_address'), 'user');
                 }
                 mc_delete_meta($id, 'buyer_phone', 'user');
                 if (I('param.buyer_phone')) {
                     mc_add_meta($id, 'buyer_phone', I('param.buyer_phone'), 'user');
                 }
                 $mobaddrname = I('param.buyer_name') . "(" . I('param.buyer_phone') . ")";
                 $mobaddr = I('param.buyer_province') . I('param.buyer_city') . I('param.buyer_address');
                 //给下单人员和商家发送短信通知
                 $this->PHPSMS(I('param.buyer_phone'), I('param.buyer_phone'), rtrim($item, '、'), $sumPrice, $mobaddrname, $mobaddr);
                 $this->PHPSMS('15214328120', I('param.buyer_phone'), rtrim($item, '、'), $sumPrice, $mobaddrname, $mobaddr);
                 $this->success('货到付款订单提交成功!', U('User/index/pro?id=' . mc_user_id()));
             } else {
                 $this->error('购物车里没有任何商品!');
             }
         }
     } else {
         $this->success('请先登陆', U('User/login/index'));
     }
 }
コード例 #21
0
 public function delete($id)
 {
     if (is_numeric($id)) {
         if (mc_is_admin()) {
             if (mc_get_meta($id, 'user_level', true, 'user') != 10) {
                 mc_delete_page($id);
                 $this->success('删除成功', U('Home/index/index'));
             } else {
                 $this->error('请不要伤害管理员', U('user/index/manage?id=' . mc_user_id()));
             }
         } else {
             $this->error('哥们,请不要放弃治疗!', U('Home/index/index'));
         }
     } else {
         $this->error('参数错误!');
     }
 }
コード例 #22
0
        echo 'class="active"';
    }
    ?>
>
		<a href="<?php 
    echo U('user/index/edit?id=' . $_GET['id']);
    ?>
">
			<i class="glyphicon glyphicon-cog"></i> 资料
		</a>
	</li>
	<?php 
}
?>
	<?php 
if (mc_user_id() == $_GET['id'] && mc_option('pro_close') != 1) {
    ?>
	<li <?php 
    if (ACTION_NAME == 'pro') {
        echo 'class="active"';
    }
    ?>
>
		<a href="<?php 
    echo U('user/index/pro?id=' . $_GET['id']);
    ?>
">
			<i class="glyphicon glyphicon-shopping-cart"></i> 商品
		</a>
	</li>
	<?php 
コード例 #23
0
ファイル: pro.php プロジェクト: xiaowei521/vamshop
					<?php 
    $conis = M('action')->where("action_key='conis_wait_finished' AND date='" . $trade['date'] . "'")->getField('action_value');
    if ($conis > 0) {
        ?>
					<span class="pull-right">
						使用积分:<?php 
        echo $conis;
        ?>
					</span>
					<?php 
    }
    ?>
				</div>
				<ul class="list-group" id="cart">
				<?php 
    $cart = M('action')->where("user_id='" . mc_user_id() . "' AND action_key IN ('wait_send','wait_cofirm','wait_finished','wait_hdfk') AND date='" . $trade['date'] . "'")->order('id desc')->select();
    ?>
				<?php 
    foreach ($cart as $val) {
        ?>
				<li class="list-group-item pr">
					<div class="media">
						<a class="pull-left img-div" href="<?php 
        echo U('pro/index/single?id=' . $val['page_id']);
        ?>
">
							<?php 
        $fmimg_args = mc_get_meta($val['page_id'], 'fmimg', false);
        ?>
							<img class="media-object" src="<?php 
        echo $fmimg_args[0];
コード例 #24
0
ファイル: header.php プロジェクト: dalinhuang/shouzhangmall
if (mc_user_id()) {
    ?>
<div class="modal fade" id="qiandaoModal" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">
			<div class="modal-header">
				
			</div>
			<div class="modal-body">
				<div id="mycoins" class="text-center">
					<h4>我的积分:<span id="mycoinscount"><?php 
    echo mc_coins(mc_user_id());
    ?>
</span></h4>
					<p><a href="<?php 
    echo U('user/index/coins?id=' . mc_user_id());
    ?>
">查看积分记录</a></p>
					<p>每日签到最多可获得<span class="text-danger">3</span>积分!</p>
					<?php 
    if (mc_is_qiandao()) {
        ?>
					<a href="javascript:;" id="qiandao" class="btn btn-warning mb-10">已签到</a>
					<?php 
    } else {
        ?>
					<a href="javascript:mc_qiandao();" id="qiandao" class="btn btn-warning mb-10">签到</a>
					<script>
					function mc_qiandao() {
						$.ajax({
							url: '<?php 
コード例 #25
0
ファイル: notify_url.php プロジェクト: xiaowei521/vamshop
            $action['action_key'] = 'coins_wait_finished';
            M('action')->where("user_id='{$user_id}' AND action_key='coins_pending'")->save($action);
            //库存、销量
            $parameter = M('action')->where("page_id='" . $val['page_id'] . "' AND user_id='{$user_id}'")->order('id asc')->getField('action_value', true);
            if ($parameter) {
                foreach ($parameter as $par) {
                    list($par_name, $par_value) = explode('|', $par);
                    $kucun = mc_get_meta($val['page_id'], $par_name, 'kucun') - 1;
                    mc_update_meta($val['page_id'], $par_name, $kucun, 'kucun');
                }
            }
            $xiaoliang = mc_get_meta($val['page_id'], 'xiaoliang') + 1;
            mc_update_meta($val['page_id'], 'xiaoliang', $xiaoliang);
            //积分
            $coins = M('action')->where("user_id='{$user_id}' AND action_key='coins_wait_finished'")->order('id desc')->select();
            mc_update_coins(mc_user_id(), -$coins);
            mc_add_action(mc_user_id(), 'coins', -$coins);
            //调试用,写文本函数记录程序运行情况是否正常
            //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
        }
    }
    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
    echo "success";
    //请不要修改或删除
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
    //验证失败
    echo "fail";
    //调试用,写文本函数记录程序运行情况是否正常
    //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
}
コード例 #26
0
ファイル: comment.php プロジェクト: xiaowei521/vamshop
</a>
				<?php 
        if (mc_get_meta($val['user_id'], 'user_level', true, 'user') == 10) {
            ?>
<span class="btn btn-danger btn-xs">管理员</span><?php 
        } elseif (mc_get_meta($val['user_id'], 'user_level', true, 'user') == 6) {
            ?>
<span class="btn btn-info btn-xs">网站编辑</span><?php 
        }
        ?>
				<small class="pull-right hidden-xs"><?php 
        echo date('Y-m-d H:i:s', $val['date']);
        ?>
</small>
				<?php 
        if (mc_get_meta(mc_user_id(), 'user_level', true, 'user') > 5) {
            ?>
				<form class="inline hidden-xs" method="post" action="<?php 
            echo U('home/perform/comment_delete');
            ?>
">
					<button type="submit" class="btn btn-danger btn-xs pull-right">删除</button>
					<input type="hidden" name="id" value="<?php 
            echo $val['id'];
            ?>
">
				</form>
				<?php 
        }
        ?>
			</h4>
コード例 #27
0
ファイル: pro_all.php プロジェクト: dalinhuang/shouzhangmall
        ?>
"><?php 
        echo mc_get_page_field($val['page_id'], 'title');
        ?>
</a>
							</h4>
							<span class="btn btn-danger btn-sm">单价:<?php 
        echo mc_cart_price($val['id']);
        ?>
 元</span>
							<span class="btn btn-info btn-sm">数量:<?php 
        echo $val['action_value'];
        ?>
</span>
							<?php 
        $parameter = M('action')->where("page_id='" . $val['id'] . "' AND user_id='" . mc_user_id() . "'")->order('id asc')->getField('action_value', true);
        if ($parameter) {
            ?>
							<ul class="list-inline mt-10">
							<?php 
            foreach ($parameter as $par) {
                list($par_name, $par_value) = explode('|', $par);
                ?>
							<li><span class="btn btn-success btn-sm"><?php 
                echo $par_name;
                ?>
:<?php 
                echo $par_value;
                ?>
</span></li>
							<?php 
コード例 #28
0
ファイル: checkout.php プロジェクト: xiaowei521/vamshop
echo mc_total() * 50;
?>
) {
					    	$(this).val('');
					    	$('#total-true span').text(<?php 
echo mc_total();
?>
);
					    	$('#coins-after').css('display','none');
				    	} else {
					    	$('#total-true span').text(<?php 
echo mc_total();
?>
-coins/100);
					    	$('#coins-after span').text(<?php 
echo mc_coins(mc_user_id());
?>
-coins);
					    	if(coins>0) {
						    	$('#coins-after').css('display','inline');
					    	} else {
					    		$('#coins-after').css('display','none');
					    	}
				    	}
				    });
				});
				</script>
			</div>
			<div class="panel-footer">
				<a href="<?php 
echo U('pro/cart/index');
コード例 #29
0
ファイル: edit.php プロジェクト: xiaowei521/vamshop
				    			<input name="buyer_city" type="text" class="form-control" value="<?php 
echo mc_get_meta(mc_user_id(), 'buyer_city', true, 'user');
?>
" placeholder="城市/地区/自治区">
				    		</div>
				    	</div>
				    </div>
				    <div class="form-group">
				        <textarea name="buyer_address" class="form-control" rows="3" placeholder="区县、街道、门牌号"><?php 
echo mc_get_meta(mc_user_id(), 'buyer_address', true, 'user');
?>
</textarea>
				    </div>
				    <div class="form-group">
				        <input name="buyer_phone" type="text" class="form-control" value="<?php 
echo mc_get_meta(mc_user_id(), 'buyer_phone', true, 'user');
?>
" placeholder="联系电话,非常重要">
				    </div>
				    <div class="text-center">
					    <button type="submit" class="btn btn-warning">
					        <i class="glyphicon glyphicon-ok"></i> 保存
					    </button>
				    </div>
				</form>
				</div>
			</div>
		</div>
	</div>
<?php 
mc_template_part('footer');
コード例 #30
0
        }
        M('action')->data($action)->add();
    }
} else {
    $this->error('购物车里没有任何商品!');
}
//订单名称
$subject = mc_option('site_name') . '订单';
//必填
//付款金额
if (mc_total() < mc_option('m_youfei')) {
    $mc_total = mc_total() + mc_option('youfei');
} else {
    $mc_total = mc_total();
}
if (I('param.coins') > 0 && I('param.coins') <= mc_coins(mc_user_id())) {
    //积分需大于0,且小于等于现有积分
    $coins_topthis = mc_total() * 50;
    if (I('param.coins') > $coins_topthis) {
        $mc_total2 = $mc_total;
    } else {
        $mc_total2 = $mc_total - I('param.coins') / 100;
    }
} else {
    $mc_total2 = $mc_total;
}
$price = $mc_total2;
//必填
//商品数量
$quantity = "1";
//必填,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品