示例#1
0
 public function createAccount($user_name, $email, $password)
 {
     foreach (get_defined_vars() as $var) {
         if (!isset($var)) {
             $data['status'] = 'bad data';
             echo json_encode($data);
             die;
         }
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . '/model/user.model.php';
     $userModel = new userModel();
     //check if user name is taken
     if ($userModel->checkIfUserNameExists($user_name)) {
         $data['status'] = 'username exists';
         echo json_encode($data);
         die;
     }
     //check if email is taken
     if ($userModel->checkIfEmailExists($email)) {
         $data['status'] = 'email exists';
         echo json_encode($data);
         die;
     }
     $verification = md5(uniqid(rand(), true));
     $password_hash = $userModel->hashPlainText($password);
     $userModel->addPlayer($email, $user_name, $password_hash, $verification);
     $data['status'] = 'ok';
     echo json_encode($data);
 }
 function accounts($ids = null)
 {
     $user = new userModel();
     $id = $user->getId();
     $authLevel = $user->getAuthLevel();
     $accounts = new userModel();
     $users = $accounts->listActive();
     $data = array();
     if ($ids == null) {
         if (count($users) > 0) {
             foreach ($users as $user) {
                 if ($user['type'] == 'part') {
                     $type = 'Part Time';
                 }
                 if ($user['type'] == 'full') {
                     $type = 'Full Time';
                 }
                 if ($user['supervisorId'] == $id) {
                     $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " ({$type})";
                 } elseif ($authLevel >= 900) {
                     $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " ({$type})";
                 }
             }
         }
     } else {
         if (count($users) > 0) {
             foreach ($users as $user) {
                 $data[] = $user['id'];
             }
         }
     }
     return $data;
 }
示例#3
0
 public function loginIn()
 {
     //判断参数是否合法
     $email = $_POST['em'];
     $passwd = $_POST['pass'];
     $check = $_POST['check'];
     $email = filter_var($email, FILTER_SANITIZE_EMAIL);
     $regex = '/[^A-Za-z0-9]/';
     if (!filter_var($email, FILTER_VALIDATE_EMAIL) || preg_match($regex, $passwd) || strlen($passwd) < 6) {
         $result['errNum'] = '0006';
         $result['errMsg'] = errorcode::$error[$result['errNum']];
         $this->renderJson($result);
     }
     //读取mysql
     $userModel = new userModel();
     $passwd = md5($passwd);
     $ret = $userModel->select($email, $passwd);
     $retEmail = null;
     if (is_object($ret)) {
         $retEmail = $ret->fetch_array()['email'];
     }
     if (!$ret || !$retEmail) {
         $result['errNum'] = '0001';
         $result['errMsg'] = errorcode::$error[$result['errNum']];
         $this->renderJson($result);
     }
     //写入session
     if ($check == "yes") {
         $_SESSION['email'] = $email;
     }
     $result['email'] = $retEmail;
     $result['errNum'] = '0000';
     $result['errMsg'] = errorcode::$error[$result['errNum']];
     $this->renderJson($result);
 }
 private function detail()
 {
     $user = new userModel();
     if (isset($_GET['id'])) {
         $this->model->id = $_GET['id'];
         $oneOrder = $this->model->getOneOrder();
         switch ($oneOrder->payed) {
             case 0:
                 $oneOrder->payed = "<span style='color:red;'>[未付]</span>";
                 break;
             case 1:
                 $oneOrder->payed = "<span style='color:green;'>[已付]</span>";
         }
         switch ($oneOrder->sent) {
             case 0:
                 $oneOrder->sent = "<span style='color:red;'>[未发货]</span>";
                 break;
             case 1:
                 $oneOrder->sent = "<span style='color:green;'>[已发货]</span>";
         }
         $user->id = $oneOrder->uid;
         $oneUser = $user->getOneUserByID();
         $oneOrder->username = $oneUser->username;
         $this->smarty->assign("oneOrder", $oneOrder);
     }
     $this->smarty->assign("back", $_SERVER['HTTP_REFERER']);
     $this->smarty->assign("detail", true);
 }
示例#5
0
文件: Index.php 项目: otkinlife/yaf
 /**
  * admin
  */
 public function indexAction()
 {
     $test = new userModel();
     $res = $test->test();
     $this->getView()->assign('test', $res);
     $this->getView()->display('index/index.phtml');
 }
示例#6
0
 public function post()
 {
     $this->check_input();
     if (!(0 + $this->data('event'))) {
         $this->error(31);
     }
     $event = $this->event()->get($this->data('event'));
     if ($event['id'] != $this->data('event')) {
         $this->error(31);
     }
     if (!(0 + $this->data('persons'))) {
         $this->error(33);
     }
     $eventController = new eventController();
     $userController = new userController();
     $user = new userModel();
     $user->get($event['user']);
     $event = $eventController->public_data($event, true);
     $event['id'] = $this->data('event');
     $event['host'] = $userController->public_data($user->data(), true);
     $event['free_slots'] = $this->event()->getSlots();
     $data = ['event' => $event, 'persons' => $this->data('persons')];
     if ($event['fb_friends']) {
         Bootstrap::$main->session('fb_friends', 1);
     }
     return $this->status(Bootstrap::$main->session('book', $data));
 }
示例#7
0
 public function accounts($ids = null)
 {
     $user = new userModel();
     $id = $user->getId();
     $authLevel = $user->getAuthLevel();
     $accounts = new userModel();
     $users = $accounts->listAll();
     $data = array();
     if ($ids == null) {
         if ($user->getAuthLevel() >= 900) {
             $data['all'] = "All Accounts";
         }
         foreach ($users as $user) {
             if ($user['supervisorId'] == $id) {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " (" . $user['type'] . ")";
             } elseif ($authLevel >= 900) {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " (" . $user['type'] . ")";
             }
         }
     } else {
         $data[] = "all";
         foreach ($users as $user) {
             $data[] = $user['id'];
         }
     }
     return $data;
 }
示例#8
0
 public function edit()
 {
     $userID = $_POST['userID'];
     $userModel = new userModel();
     $userData = $userModel->getUserByUserID($userID);
     $userData = mysqli_fetch_array($userData, MYSQLI_ASSOC);
     $this->view->render('user/edit', $userData);
 }
示例#9
0
 public function loginform($parameters = array())
 {
     require FRAMEWORK . DS . 'conf' . DS . 'auth.php';
     require FRAMEWORK . DS . 'conf' . DS . 'dispatcher.php';
     $currentuser = myauth::getCurrentuser();
     $groups = $currentuser->getGroupid();
     $groupfound = false;
     foreach ($groups as $groupname => $groupid) {
         if (isset($defaultPageids[$groupname])) {
             $groupfound = true;
             $defaultPageid = $defaultPageids[$groupname];
         }
     }
     if (!$groupfound) {
         $defaultPageid = $defaultPageids['default'];
     }
     if ($currentuser->getId() == $defaultUserid) {
         $form = new form($parameters);
         $username = new textField('username', 'Gebruiker', '', array('required'));
         $password = new passwordField('password', 'Wachtwoord', array('required'));
         $form->addField($username);
         $form->addField($password);
         $form->setSubmittext('Log in');
         $form->setResettext('Herbegin');
         $template = new ui($this);
         if ($form->validate()) {
             $usermodel = new userModel();
             $authuser = $usermodel->auth($parameters['username'], $parameters['password']);
             if ($authuser instanceof userObject) {
                 myauth::setCurrentuser($authuser);
                 //	Refresh the page
                 $this->response->redirect('?pageid=' . $defaultPageid);
             } else {
                 $this->response->assign('formerror_' . $form->getId(), 'innerHTML', 'De ingevulde gegevens zijn niet correct.', true);
             }
         } elseif (!$form->isSent()) {
             $template->assign('form', $form);
             $this->response->assign($this->self, 'innerHTML', $template->fetch($parameters['viewprefix'] . 'myauth_loginform.tpl'));
         } else {
             $this->response->assign('formerror_' . $form->getId(), 'innerHTML', 'Alle velden moeten ingevuld worden.', true);
         }
     } else {
         $template = new ui($this);
         $defrequest = new pagerequest($defaultPageid);
         $template->assign('defrequest', $defrequest);
         $template->assign('logoutRequest', myauth::getLogoutrequest());
         $template->assign('currentuser', $currentuser);
         $this->response->assign($this->self, 'innerHTML', $template->fetch($parameters['viewprefix'] . 'myauth_loginform_loggedin.tpl'));
         //$this->response->assign($this->self , 'innerHTML' , '');
     }
 }
示例#10
0
 public function deleteUser()
 {
     $userID = $_POST['userID'];
     $userModel = new userModel();
     $status = true;
     $msg = "user deleted successfully";
     $result = $userModel->deleteUser($userID);
     if (!$result) {
         $status = false;
         $msg = "user deleted unsuccessfully";
     }
     $resultArray = array('status' => $status, 'msg' => $msg);
     echo json_encode($resultArray);
 }
示例#11
0
 public static function getUid()
 {
     if (!isset($_SESSION['email'])) {
         return false;
     }
     $userModel = new userModel();
     $ret = $userModel->selectUid($_SESSION['email']);
     if (!is_object($ret)) {
         return false;
     }
     $retID = $ret->fetch_array()['userId'];
     if (!$retID) {
         return false;
     }
     return $retID;
 }
示例#12
0
 public function accounts($ids = null)
 {
     $accounts = new userModel();
     $users = $accounts->listAll();
     $data = array();
     foreach ($users as $user) {
         if ($user['authLevel'] >= 500) {
             if ($ids == 1) {
                 $data[] = $user['id'];
             } else {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . "";
             }
         }
     }
     return $data;
 }
示例#13
0
 public function login($data)
 {
     $this->loadView(get_class($this) . $this->view . 'login', $data);
     if (isset($_POST['submit'])) {
         $userlogin = userModel::login($_POST['username'], $_POST['password']);
     }
 }
 public function loadCity()
 {
     $provincia = trim($_POST["provincia"]);
     $losMunicipios = userModel::cargaMunicipios($provincia);
     foreach ($losMunicipios as $key => $value) {
         $elementos_json[] = "\"{$value->id_municipio}\": \"{$value->nombre}\"";
     }
     echo "{" . implode(",", $elementos_json) . "}";
 }
 public function check()
 {
     $nowTime = time();
     $data = request::postParam('appuser');
     $backurl = request::postParam('backurl');
     $userExtData = array('truename' => $data['truename'], 'province_id' => $data['address'][0], 'city_id' => isset($data['address'][1]) ? $data['address'][1] : 0, 'towns_id' => isset($data['address'][2]) ? $data['address'][2] : 0, 'address' => $data['addressInfo']);
     $userExtObj = new userExtModel();
     $userExtObj->save($userExtData, 'user_id=?', array($data['userid']));
     $userData = array('identity' => $data['identity']);
     $userObj = new userModel();
     $userObj->save($userData);
     $applicatioinData = array('return_message' => $data['return_message'], 'ext' => $data['ext'], 'id' => $data['id'], 'checktime' => $nowTime);
     if (isset($data['appliation_status'])) {
         $applicatioinData['appliation_status'] = $data['appliation_status'];
     }
     $this->userApplicationObj->save($applicatioinData);
     $this->tip('操作成功', base64_decode($backurl));
 }
示例#16
0
 function getYears()
 {
     $db = Staple_DB::get();
     //Get user ID from Auth
     $user = new userModel();
     $userId = $user->getId();
     //$sql = "SELECT YEAR(FROM_UNIXTIME(inTime)) AS 'year' FROM timeEntries WHERE userId = $userId GROUP BY year ORDER by year ASC";
     $sql = "SELECT YEAR(FROM_UNIXTIME(inTime)) AS 'year' FROM timeEntries GROUP BY year ORDER by year ASC";
     if ($db->query($sql)->num_rows > 0) {
         $query = $db->query($sql);
         $data = array();
         while ($result = $query->fetch_assoc()) {
             $data[$result['year']] = $result['year'];
         }
         return $data;
     } else {
         return array();
     }
 }
示例#17
0
 function login()
 {
     if (isset($_POST['inputName']) && isset($_POST['inputPassword'])) {
         $name = $_POST['inputName'];
         $pass = $_POST['inputPassword'];
         require_once 'models/userModel.php';
         $users = new userModel();
         $results = $users->checkUser($name, $pass);
         if (!empty($results->id)) {
             $_SESSION['islogged'] = true;
             $_SESSION['user_id'] = $results->id;
             $_SESSION['user_name'] = $results->name;
             $_SESSION['user_prof'] = $results->profile;
             header("Location:" . $GLOBALS['ADMIN_ROOT'] . $GLOBALS['tmp_controller'] . '/' . $GLOBALS['tmp_method'] . '/');
         } else {
             $_SESSION['islogged'] = false;
             echo "<p class='errmsg'>Wrong Username or Password.</p>";
         }
     }
     require 'views/dashboard/users/login.php';
 }
示例#18
0
 public function find_on_url($user, $url, $except = 0)
 {
     if ($user + 0 == 0) {
         $user_model = new userModel();
         $u = $user_model->find_one_by_url($user);
         if ($u && isset($u['id'])) {
             $user = $u['id'];
         }
     }
     if (!$user) {
         return false;
     }
     $sql = "SELECT " . $this->_table . ".*," . self::$left_join_images;
     $sql .= " FROM " . $this->_table;
     $sql .= " LEFT JOIN images ON images.id=" . $this->_table . ".img";
     $sql .= " WHERE " . $this->_table . ".user=? AND " . $this->_table . ".url=?\n                AND " . $this->_table . ".parent IS NULL\n                AND " . $this->_table . ".id <>?";
     $args = [$user, $url, $except];
     $ret = $this->conn->fetchRow($sql, $args);
     $this->image_array($ret);
     return $ret;
 }
示例#19
0
 function AuthenticateAction()
 {
     $username = addslashes($_REQUEST['username']);
     $password = sha1($_REQUEST['password']);
     $isRememberme = $_REQUEST['rememberme'];
     $user_result = userModel::userAuthentication($username, $password, $login);
     if ($user_result == true && $isRememberme == "true") {
         $credentials = $username . ',' . $password;
         setcookie("TareControl", $credentials, time() + 3600);
     }
     echo json_encode(array("status" => $user_result));
 }
示例#20
0
 private function welcome()
 {
     $article = new articleModel();
     $articleNum = $article->getArticleNum();
     $user = new userModel();
     $dict = new dictModel();
     $feedback = new feedbackModel();
     $entryNum = $dict->getAllEntryTotal2();
     //echo ($articleNum);
     $userNum = $user->getAllUserTotal();
     $examination = new examinationModel();
     $examNum = $examination->getExamNum();
     $this->smarty->assign("aaa", $dict->getAllEntryTotal2());
     $this->smarty->assign("rrr", $dict->getAllReportWordsTotal2());
     //Tools::dump($feedback->getAllNewFeedbackTotal());
     $this->smarty->assign("fff", $feedback->getAllNewFeedbackTotal());
     $this->smarty->assign("examNum", $examNum);
     $this->smarty->assign("userNum", $userNum);
     $this->smarty->assign("articleNum", $articleNum);
     $this->smarty->display("admin/welcome.html");
     exit;
 }
示例#21
0
 public function account()
 {
     $user = new userModel();
     if ($user->getAuthLevel() >= 500) {
         $form = new newMessageForm();
         $form->setAction($this->_link(array("messages", "account")));
         if ($form->wasSubmitted()) {
             $form->addData($_POST);
             if ($form->validate()) {
                 $data = $form->exportFormData();
                 if ($data['account'] == 'all') {
                     $message = new messageModel();
                     $message->setMessage($data['message']);
                     $message->setExpireDate($data['expireDate']);
                     $message->save();
                 } else {
                     $message = new privateMessageModel();
                     $message->setMessage($data['message']);
                     $message->setExpireDate($data['expireDate']);
                     $message->setUserId($data['account']);
                     $message->save();
                 }
                 $form = new newMessageForm();
                 $form->setAction($this->_link(array("messages", "account")));
                 $this->view->form = $form;
             } else {
                 $this->view->form = $form;
                 $this->layout->addScriptBlock('$(document).ready(function() { $("#newMessage").foundation("reveal", "open"); }); ');
             }
         } else {
             $this->view->form = $form;
         }
         $messages = new messagesModel();
         $this->view->messages = $messages;
     } else {
         header("location: " . $this->_link(array("messages", "account")) . "");
     }
 }
示例#22
0
 public function index($currentUser = null)
 {
     if (array_key_exists('items', $_GET)) {
         $_SESSION['items'] = $_GET['items'];
     }
     if (array_key_exists('items', $_SESSION)) {
         $items = $_SESSION['items'];
     } else {
         $items = 20;
     }
     if (array_key_exists('page', $_GET)) {
         $page = $_GET['page'];
     } else {
         $page = 1;
     }
     $accounts = new userModel();
     $this->view->accounts = $accounts->listAll($currentUser);
     $this->view->currentUser = $currentUser;
     $audit = new auditModel();
     $auditLog = $audit->getAll($currentUser, $page, $items);
     $this->view->audit = $auditLog;
     $this->view->pager = $audit->getPager();
 }
示例#23
0
 public function auth($username, $password)
 {
     require FRAMEWORK . DS . 'conf' . DS . 'datastore.php';
     $config = $datastore[$this->datastore];
     $con = @ldap_connect($config['protocol'] . $config['domain']);
     if (!$con) {
         throw new connectException('Could not connect to the Active Directory.');
     }
     ldap_set_option($con, LDAP_OPT_REFERRALS, 0);
     ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
     if (!@ldap_bind($con, $username . '@' . $config['domain'], $password)) {
         $config2 = $datastore[$this->datastore2];
         $con2 = @ldap_connect($config2['protocol'] . $config2['domain']);
         ldap_set_option($con2, LDAP_OPT_REFERRALS, 0);
         ldap_set_option($con2, LDAP_OPT_PROTOCOL_VERSION, 3);
         if (!$con2) {
             throw new connectException('Could not connect to the Active Directory.');
         }
         if (!@ldap_bind($con2, $username . '@' . $config2['domain'], $password)) {
             return false;
         } else {
             $model = new userModel();
             $users = $model->getfromUsername($username);
             if (count($users) == 1) {
                 return $users[0];
             } else {
                 return false;
             }
         }
     } else {
         $model = new userModel();
         $users = $model->getfromUsername($username);
         if (count($users) == 1) {
             return $users[0];
         } else {
             return false;
         }
     }
 }
示例#24
0
 public function _start()
 {
     $user = new userModel();
     $this->authLevel = $user->getAuthLevel();
     $this->userId = $user->getId();
 }
function showUserById($idUser)
{
    $userModel = new userModel();
    $user = $userModel->getUser($idUser);
    include 'view/viewProfile.php';
}
示例#26
0
    // var_dump($this->get('basic_auth'));
    // $db = $GLOBALS['app']->getContainer()->get('db');
    // $db = new medoo([
    // 	'database_type' => 'mysql',
    // 	'database_name' => 'test',
    // 	'server' => 'localhost',
    // 	'username' => 'root',
    // 	'password' => '',
    // ]);
    // $r = $db->insert("user", ["username" => "", "email" => ""]);
    // var_dump($r);
    // var_dump($db->log());
    // var_dump($db->error());
    // $model = new roleModel();
    // $result = $model->listview();
    // var_dump($result);
    $model = new userModel();
    // $result = $model->getPermission(1);
    $result = $model->addAccess(1, [1, 2]);
    var_dump($result);
    // foreach ($result as $key => $value) {
    // 	$value['displayname'] = $value['username'];
    // 	$model->update($value);
    // }
    // $route = $req->getAttribute('route');
    // var_dump($route);
    // })->add(AuthMiddleware::class);
});
$app->post('/', function ($req, $res, $args) {
    var_export($req->getAttribute('token'));
});
示例#27
0
 public function set_agreement($host = true)
 {
     $this->requiresLogin();
     $user = new userModel(Bootstrap::$main->user['id']);
     $field = $host ? 'd_host_agreement' : 'd_guest_agreement';
     if ($user->{$field}) {
         return;
     }
     $user->{$field} = Bootstrap::$main->now;
     $user->save();
     Bootstrap::$main->user = $user->data();
     Bootstrap::$main->session('user', $user->data());
 }
 public function lijst($parameters)
 {
     $starget = new securitytarget();
     $starget->setId('voorinschrijving_lijst');
     if (!myacl::isAllowed(myauth::getCurrentuser(), $starget, 'view')) {
         return;
     }
     $template = new ui($this);
     $uurModel = new uurModel();
     $ingeschrevenModel = new ingeschrevenModel();
     $trajectModel = new trajectModel();
     $userModel = new userModel();
     $form = new form($parameters);
     $select = new selectField('wat', '', '');
     $select->addOption(new selectoptionField('Alles', '9990'));
     $daggroup = new selectoptgroupField('Dagen');
     $daggroup->addOption(new selectoptionField('Zaterdag', '6661'));
     $daggroup->addOption(new selectoptionField('Zondag', '4442'));
     $select->addOptgroup($daggroup);
     $trajecten = $trajectModel->get();
     $trajectgroup = new selectoptgroupField('Trajecten');
     foreach ($trajecten as $tr) {
         $trajectgroup->addOption(new selectoptionField($tr->getName(), 888 . $tr->getId()));
     }
     $select->addOptgroup($trajectgroup);
     $typegroup = new selectoptgroupField('Type');
     $typegroup->addOption(new selectoptionField('Personeel', '1114'));
     $typegroup->addOption(new selectoptionField('VIP', '1115'));
     $select->addOptgroup($typegroup);
     $uren = $uurModel->get();
     $uurgroup = new selectoptgroupField('Uren - Zaterdag');
     $uurgroup2 = new selectoptgroupField('Uren - Zondag');
     foreach ($uren as $uur) {
         if ($uur->getDag() == 1) {
             $uurgroup->addOption(new selectoptionField($uur->getUur(), 777 . $uur->getId()));
         } else {
             $uurgroup2->addOption(new selectoptionField($uur->getUur(), 555 . $uur->getId()));
         }
     }
     $select->addOptgroup($uurgroup);
     $select->addOptgroup($uurgroup2);
     $form->addField($select);
     $template->assign('form', $form);
     $terug = new pagerequest(1);
     $template->assign('terug', $terug);
     if (!$form->isSent()) {
         $wat = 9990;
     } else {
         $wat = $form->getFieldvalue('wat');
     }
     $mode = substr($wat, 0, 3);
     $modevalue = substr($wat, 3);
     if ($mode == 999 || $mode == 888) {
         $dag = 0;
     } elseif ($mode == 777 || $mode == 666) {
         $dag = 1;
     } elseif ($mode == 555 || $mode == 444) {
         $dag = 2;
     }
     if ($dag == 0) {
         $lijst[0]['dag'] = 'Zaterdag';
         $lijst[1]['dag'] = 'Zondag';
     } elseif ($dag == 1) {
         $lijst[0]['dag'] = 'Zaterdag';
     } elseif ($dag == 2) {
         $lijst[1]['dag'] = 'Zondag';
     }
     foreach ($lijst as $dag => $lijstelement) {
         $dag++;
         if ($mode == 888) {
             $uurCond = array('AND' => array('dag' => array('mode' => '=', 'value' => $dag), 'trajectid' => array('mode' => '=', 'value' => $modevalue)));
         } elseif ($mode == 777 || $mode == 555) {
             $uurCond = array('AND' => array('id' => array('mode' => '=', 'value' => $modevalue)));
         } else {
             $uurCond = array('AND' => array('dag' => array('mode' => '=', 'value' => $dag)));
         }
         $uren = $uurModel->get($uurCond);
         foreach ($uren as $uur) {
             $tempuur = array();
             $tempuur['uur'] = $uur;
             $gasten = $ingeschrevenModel->getfromUurid($uur->getId());
             $tempuur['aantal'] = 0;
             foreach ($gasten as $gast) {
                 $tempgast = array();
                 $tempgast['gast'] = $gast;
                 if ($mode == 111) {
                     if ($gast->getUserid() != $modevalue) {
                         continue;
                     }
                 }
                 if ($gast->getRegistrationtime() > time() - 60 * 60 * 24) {
                     $tempgast['new'] = 'true';
                 } else {
                     $tempgast['new'] = 'false';
                 }
                 $sameip = $ingeschrevenModel->getfromIpaddress($gast->getIpaddress());
                 if (count($sameip) > 1) {
                     $tempgast['sameip']['aantal'] = count($sameip);
                     $tempgast['sameip']['wie'] = $sameip;
                     $showrequest = new ajaxrequest('myvoorinschrijving', 'showsameip', array('id' => $gast->getId()));
                     $hiderequest = new ajaxrequest('myvoorinschrijving', 'hidesameip', array('id' => $gast->getId()));
                     $tempgast['sameip']['showrequest'] = $showrequest;
                     $tempgast['sameip']['hiderequest'] = $hiderequest;
                 } else {
                     $tempgast['sameip'] = 0;
                 }
                 $showmorerequest = new ajaxrequest('myvoorinschrijving', 'showmore', array('id' => $gast->getId()));
                 $hidemorerequest = new ajaxrequest('myvoorinschrijving', 'hidemore', array('id' => $gast->getId()));
                 $tempgast['showmorerequest'] = $showmorerequest;
                 $tempgast['hidemorerequest'] = $hidemorerequest;
                 $deleterequest = new ajaxrequest('myvoorinschrijving', 'deletegast', array('gastid' => $gast->getId()));
                 $tempgast['deleterequest'] = $deleterequest;
                 $user = $userModel->getfromId($gast->getUserid());
                 $tempgast['user'] = $user[0];
                 $tempuur['aantal'] += $gast->getAantal();
                 $tempuur['gasten'][] = $tempgast;
             }
             if (count($tempuur['gasten']) > 0) {
                 if (!isset($lijst[$dag - 1]['trajecten'][$uur->getTrajectid()]['traject'])) {
                     $traject = $trajectModel->getfromId($uur->getTrajectid());
                     $lijst[$dag - 1]['trajecten'][$uur->getTrajectid()]['traject'] = $traject[0];
                 }
                 $lijst[$dag - 1]['trajecten'][$uur->getTrajectid()]['uren'][] = $tempuur;
             }
         }
     }
     foreach ($lijst as $id => $dag) {
         if (count($dag['trajecten']) == 0) {
             unset($lijst[$id]);
         }
     }
     $template->assign('lijst', $lijst);
     $this->response->assign($this->self, 'innerHTML', $template->fetch('myvoorinschrijving_lijst.tpl'));
 }
示例#29
0
//IDとパスワードチェック
if (!isID($_POST["KEYWORD1"], 40, 1)) {
    $result = 1;
} elseif (!isPW($_POST["KEYWORD2"], 10, 1)) {
    $result = 1;
} else {
    $ActType = $_POST["ActionType"];
    $Key0 = $_POST["KEYWORD0"];
    //ID
    $Key1 = $_POST["KEYWORD1"];
    //ID
    $Key2 = $_POST["KEYWORD2"];
    $Key3 = $_POST["KEYWORD3"];
    //パスワード
    //DB問い合わせ
    $obj = new userModel();
    $result = $obj->GETLogin($ActType, $Key1, $Key2, $dspUserInfo);
}
//画面表示
if ($result == 0) {
    $request_0 = 'request_edit.php';
    $request_pur = 'request_pur.php';
    $request_old = 'requestOld.php';
    include "request.html";
} else {
    if ($_POST["ActionType"] != "TgRSPInf") {
        $error = "";
    } elseif ($result == 1) {
        $error = "入力内容に誤りがあります。再度入力してください。";
    } else {
        $error = "ただいまサーバーが込み合っております。";
示例#30
0
 private function show()
 {
     $user = new userModel();
     $upload = new UploadFile("pic", "public/uploads/member");
     if (isset($_POST['send'])) {
         $user->id = $_POST['id'];
         $user->email = $_POST['email'];
         if ($_POST['pwd'] == $_POST['newpwd']) {
             $user->pwd = $_POST['newpwd'];
         } else {
             $user->pwd = md5($_POST['newpwd']);
         }
         if (is_uploaded_file($_FILES['pic']['tmp_name'])) {
             if ($upload->upload("pic")) {
                 $user->icon = $upload->getNewName();
             }
         } else {
             $user->icon = $_POST['newpic'];
             //echo "没有上传".$_POST['newpic'];
         }
         //Tools::dump($_POST);
         if ($user->updateUser()) {
             //echo "ok";
             Tools::Redirect("会员资料修改成功", $_SERVER['HTTP_REFERER']);
         } else {
             if ($user->updateUser() == 0) {
                 Tools::Redirect("会员资料没有修改", $_SERVER['HTTP_REFERER']);
                 //echo "not changed";
             } else {
                 Tools::Redirect("会员资料修改失败", $_SERVER['HTTP_REFERER'], 2);
             }
         }
     }
     $comment = new commentModel();
     $article = new articleModel();
     $product = new productModel();
     $ask = new askModel();
     $quiz = new quizModel();
     if ($_GET['id']) {
         $user->id = $_GET['id'];
         $oneUser = $user->getOneUserByID();
         $this->smarty->assign("oneUser", $oneUser);
         /////////////////////////////////
         $comment->uid = $_GET['id'];
         $allComments = $comment->getAllCommentsByUID();
         foreach ($allComments as $key => $value) {
             $article->id = $value->aid;
             $oneArticle = $article->getOneArticle();
             $value->title = $oneArticle->title;
         }
         $product->uid = $_GET['id'];
         $allOrders = $product->getAllOrdersByUID();
         foreach ($allOrders as $value) {
             $pids = explode(",", $value->pid);
             $str = null;
             foreach ($pids as $v) {
                 $product->id = $v;
                 //Tools::dump($v);
                 $oneProduct = $product->getOneProduct();
                 //Tools::dump($oneProduct);
                 $str .= $oneProduct->name . ",";
             }
             $str = rtrim($str, ",");
             //Tools::dump($str);
             $value->pid = $str;
             switch ($value->payed) {
                 case 0:
                     $value->payed = "<span style='color:red;'>[未付]</span>";
                     break;
                 case 1:
                     $value->payed = "<span style='color:green;'>[已付]</span>";
             }
             switch ($value->sent) {
                 case 0:
                     $value->sent = "<span style='color:red;'>[未发货]</span>";
                     break;
                 case 1:
                     $value->sent = "<span style='color:green;'>[已发货]</span>";
             }
         }
         $ask->aid = $_GET['id'];
         $allAsks = $ask->getAllAskByAID();
         $this->smarty->assign("allAsks", $allAsks);
         $this->smarty->assign("allOrders", $allOrders);
         $this->smarty->assign("allComments", $allComments);
         $quiz->uid = $_GET["id"];
         $allScores = $quiz->getAllScoresByUID();
         $course = new courseModel();
         foreach ($allScores as $key => $value) {
             $course->id = $value->cid;
             $oneCourse = $course->getOneCourse();
             $value->cid = $oneCourse->name;
         }
         $this->smarty->assign("allScores", $allScores);
     }
     $this->smarty->assign("show", true);
 }