public function logout() { $unset_data = array('username', 'userip', 'luptime'); $this->load->library('session'); $pig = $this->session->userdata('username'); $this->session->unset_userdata("username"); redirect(pingke_url() . '/pingke_index/'); }
</li> <li> <a href="#">关于我们</a> </li> <?php } else { ?> <li> <a href="<?php echo pingke_url(); ?> /test/">注册</a> </li> <li> <a href="<?php echo pingke_url(); ?> /test/log/">登录</a> </li> <li> <a href="#">关于我们</a> </li> <?php } ?> <script type = "text/javascript"> alert("对不起,没找到这门课") </script> </ul> </div> </nav>
public function score($pig, $score) { $this->load->library('session'); $db1 = $this->load->database('pingke', true); $name = $this->session->userdata('username'); $query = $db1->get_where('anti_shua', array('user_name' => $name, 'course_tea_id' => $pig), 1, 0); if ($query->num_rows() == 0) { $db1->where("id", $pig); $query = $db1->get('course_tea'); foreach ($query->result() as $row) { $people_raw = $row->people; $score_raw = $row->score; } $score_new = $score_raw + $score; $people_new = $people_raw + 1; $db1->where("id", $pig); $db1->update("course_tea", array('people' => $people_new, 'score' => $score_new)); $db1->insert('anti_shua', array('course_tea_id' => $pig, 'user_name' => $name)); } redirect(pingke_url() . '/pingke_index/content/' . $pig . '/1'); }
<a class="btn" href="'; echo pingke_url() . "/pingke_index/content/"; echo $items['sid']; echo "/1"; echo ' ">查看详细 »</a> </p> </div> </div>'; ?> <?php } ?> <?php if ($judge_root == 1) { ?> <?php echo '<p> <a class="btn btn-primary btn-large" href="'; echo pingke_url() . '/pingke_index/add/'; echo $course_id; echo '">增加老师</a> </p>'; ?> <?php } ?> </div> </div> </div> </body></html>