Example #1
0
 function feedback()
 {
     $this->load->model('muser');
     $this->muser->check() or noRights();
     $data = $this->input->post('content', TRUE) or errInput();
     $this->db->insert('feedback', ['content' => $data, 'uid' => UID]) ? ajax() : busy();
 }
Example #2
0
 function enroll()
 {
     $this->load->model('muser');
     $this->muser->check() or noRights();
     $id = (int) $this->input->post('id');
     $this->db->insert('yue_people', ['uid' => UID, 'yid' => $id]) ? ajax() : busy();
 }
Example #3
0
 function newVersion()
 {
     if ($data = $this->input->post(NULL, true)) {
         $this->db->insert('version', $data) ? ajax() : busy();
     } else {
         $this->load->view('version');
     }
 }
Example #4
0
 function comment()
 {
     $this->load->model('muser');
     $this->muser->check() or noRights();
     $data = $this->input->post(['bid', 'content'], TRUE) or errInput();
     $bbs = ['time' => time(), 'reply' => 'reply+1'];
     $this->db->where('id', $data['bid'])->set($bbs, '', FALSE)->update('bbs') or ajax(4001, '帖子不存在');
     $data['time'] = $bbs['time'];
     $data['uid'] = UID;
     $this->db->insert('bcomment', $data) ? ajax() : busy();
 }
Example #5
0
 function unPraise()
 {
     $this->load->model('muser', 'user');
     if (!$this->user->check()) {
         noRights();
     }
     $id = $this->input->post('id');
     if (!$id) {
         errInput();
     }
     $this->m->unPraise($id) ? ajax() : busy();
 }
Example #6
0
<?php

require_once LIBPATH . "redfun.php";
require_once LIBPATH . "auth.php";
if (isset($_SESSION['userid'])) {
    if ($_REQUEST['action'] == "name") {
        name($_REQUEST['name'], $_SESSION['userid']);
    } elseif ($_REQUEST['action'] == "busy") {
        busy($_REQUEST['busy'], $_SESSION['userid']);
    } elseif ($_REQUEST['action'] == "contacts") {
        contacts($_REQUEST['phone'], $_REQUEST['email'], $_REQUEST['region'], $_SESSION['userid']);
    } elseif ($_REQUEST['action'] == "description") {
        description($_REQUEST['description'], $_SESSION['userid']);
    } elseif ($_REQUEST['action'] == "password") {
        pass($_REQUEST['pass'], $_REQUEST['oldpass'], $_SESSION['userid']);
    } elseif ($_REQUEST['action'] == "namemail") {
        namemail($_REQUEST['name'], $_REQUEST['email'], $_SESSION['userid']);
    }
} else {
    ?>
<script>alert("Вы не имеете доступа к этой странице, авторизуйтесь!");</script><?php 
    echo "<script>document.location.replace('/main');</script>";
}
Example #7
0
		<link rel="stylesheet" type="text/css" href="dine.css?v=0.1">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src='https://www.google.com/recaptcha/api.js'></script>
    </head>
	<body id="plate">
        <div id="text">
            <form method="get" action="mail_out.php">
            <?php 
$who = name();
$where = place();
$when = when();
$duration = duration();
$hours = plural(duration(), "hour");
$email = email();
$why = swap_subjects(reason());
$busy = busy();
$commitments = plural($busy, "commitment");
$schedule = "<a href='../calendar'>schedule</a>";
if ($busy == -1) {
    $am_free_or_busy = "may be free at that time but am unable to confirm.";
} elseif ($busy) {
    $am_free_or_busy = " am busy with {$busy} {$commitments} during that time.<br>\n                                                       Maybe its because I have to return some videotapes.<br>\n                                                       Feel free to check my {$schedule}.";
} else {
    $am_free_or_busy = "am free at that time.";
}
if (is_valid_email()) {
    $a_valid_email = "valid";
    $may_or_may_not = "may";
} else {
    $a_valid_email = "invalid";
    $may_or_may_not = "may not";
Example #8
0
 function attend()
 {
     if (!$this->m->check()) {
         noRights();
     }
     $id = $this->input->post('id') or errInput();
     $this->db->where(['fromid' => UID, 'toId' => $id])->get('attention')->num_rows() == 0 or ajax(1004, '你已经关注了此用户');
     $this->db->where('id', $id)->step('fans', 'user');
     $this->db->affected_rows() == 1 or attack();
     //此用户不存在
     $this->db->where('id', UID)->step('cared');
     $flag = $this->db->insert('attention', ['fromid' => UID, 'toId' => $id]);
     if (!$flag) {
         busy();
     }
     $this->load->model('notify');
     $this->notify->add(Notify::ATTEND, $this->db->find('user', UID, 'id', 'name'), UID, $id) ? ajax() : busy();
 }
Example #9
0
 function comment()
 {
     $this->load->model('muser', 'user');
     if (!$this->user->check()) {
         noRights();
     }
     $data = $this->input->post(['fid', 'sid', 'content']);
     if (!$data) {
         errInput();
     }
     $data['uid'] = UID;
     $data['time'] = time();
     $flag = $this->db->insert('scomment', $data);
     $this->db->where('id', $data['sid'])->step('commentCount', 'score');
     $flag ? ajax() : busy();
 }
Example #10
0
     $stmt->bind_result($date);
     while ($stmt->fetch()) {
         $busyDate = $date;
     }
     echo $mysqli->error;
     $stmt->close();
     return $busyDate;
 }
 //De neste linjene funker med loop for dato.
 $dateStart = date('Y-m-d', strtotime($date));
 $dateEnd = date('Y-m-d', strtotime($end_date));
 date_default_timezone_set('Europe/Oslo');
 if ($dateStart >= date('Y-m-d')) {
     if ($dateStart < $dateEnd) {
         while ($dateStart < $dateEnd) {
             if (busy($id, $dateStart)) {
                 $errors[] = "Koien er opptatt " . date("d-m-Y", strtotime($dateStart));
                 $available = 0;
             }
             $dateStart = date('Y-m-d', strtotime($dateStart . ' + 1 days'));
         }
         if ($available) {
             $orderId = placeOrder($id, $userId, $date, $end_date);
             $dateStart = date('Y-m-d', strtotime($date));
             $dateEnd = date('Y-m-d', strtotime($end_date));
             while ($dateStart < $dateEnd) {
                 updateBusyDates($orderId, $id, $dateStart);
                 $dateStart = date('Y-m-d', strtotime($dateStart . ' + 1 days'));
             }
             echo "<div class='alert alert-success' role='alert'><p></p>\n                <ul><li>Bestillingen er gjennomført</li></ul></div>";
         }