<?php include_once '../../base.php'; if (!Yike\AccessControl::roleAllow(array(Yike\AccessControl::USER))) { //检查权限 header('HTTP/1.1 403 Forbidden'); header("location: /app/user/login.php"); exit; } $msgs = Model\Message::findUserMsg(); $myUnuses = Model\OwnedThing::myUnuseThing(10); $myRequires = Model\DemandThing::myRequireThing(10); $statuses = Model\Status::all(); ?> <!DOCTYPE html > <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>用户中心</title> <?php echo View\Home::$styles . "\n"; echo View\Home::addStyle("user/index.css"); ?> <style> </style> </head> <body> <?php echo View\Home::getNav();
<?php include_once '../../base.php'; /* if( !Yike\AccessControl::roleAllow(array(Yike\AccessControl::USER)) ){ //检查权限 header('HTTP/1.1 403 Forbidden'); header("location: /app/user/login.php"); exit; } */ if (!isset($_GET['id'])) { header('HTTP/1.1 404 Not Found'); exit; } $id = intval($_GET['id']); $require = Model\DemandThing::findRequire($id); if (!$require) { //不存在,送出404头,跑到 404 页面 header('HTTP/1.1 404 Not Found'); exit; } $require->addClickCount(); //增加点击量 ?> <!DOCTYPE html > <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>需要 <?php echo $require->demandthing_title; ?> </title> <?php
header('HTTP/1.1 403 Forbidden'); header("location: /app/user/login.php"); exit; } */ if (!isset($_GET['id'])) { header('HTTP/1.1 404 Not Found'); exit; } $id = intval($_GET['id']); $user = Model\User::findUser($id); if (!$user) { header('HTTP/1.1 404 Not Found'); exit; } $unuses = Model\OwnedThing::userUnuseThings($id, 10); $requires = Model\DemandThing::userRequireThings($id, 10); ?> <!DOCTYPE html > <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo $user->user_name; ?> 的空间</title> <?php echo View\Home::$styles . "\n"; echo View\Home::addStyle("user/user.css"); ?> </head>
<?php include_once '../../base.php'; if (Yike\AccessControl::roleAllow(array(Yike\AccessControl::USER))) { //检查权限 $data = array_map("trim", $_REQUEST); $json['status'] = 0; if (Model\Catalogue::exists(intval($data['cat']))) { //检查分类是否存在 $require = new Model\DemandThing(); $require->init(array('demandthing_title' => strip_tags($data['thingtitle']), 'demandthing_detail' => $data['thingdetail'], 'catalogue_id' => $data['cat'], 'demandthing_pic' => strip_tags($data['cover']), 'demandthing_money' => intval($data['value']))); $result = $require->save(); if ($result) { $json['status'] = 1; $json['message'] = "需求 {$require->demandthing_title} 发布成功。"; } else { $json['message'] = "保存失败,请重试。"; } } else { $json['message'] = "分类选择错误哦~"; } } else { $json['message'] = "请登陆哦~亲"; } echo json_encode($json);
<?php include '../base.php'; if (!isset($_POST['keyword'])) { header("location: /app/user/index.php"); exit; } $keyword = strip_tags($_REQUEST['keyword']); //过滤标签 $unuses = Model\OwnedThing::search($keyword); $requires = Model\DemandThing::search($keyword); $users = Model\User::search($keyword); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>查找 <?php echo $keyword; ?> </title> <?php echo View\Home::$styles . "\n"; ?> </head> <body> <?php echo View\Home::getNav(); ?> <div class="accordion" id="searchResult" style="width: 800px; margin: 0 auto; ">