-
Notifications
You must be signed in to change notification settings - Fork 0
/
member_question.php
43 lines (36 loc) · 1.32 KB
/
member_question.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Member_question extends MiisWidget {
public function init() {
parent::init();
}
public function run() {
parent::run();
if(isset($_POST['submit_reply'])){
$id = $_POST['hid'];
$model = new Mquestion;
$model->content = Yii::app()->request->getPost('content_reply',true);
$model->parent = $_POST['hid'];
$model->user_id = $this->_session['login_id'];
$model->state = 0;
if(Libraries::get_vip($model->user_id)!=0){
$model->state = 1;
}
$model->date_create = new CDbExpression('NOW()');
$model->save();
}
$data['question'] = Mquestion::model()->findAll(array("condition"=>"state = 1 and parent = 0 ","order" => "date_create desc","limit"=>1));
$data['u_log'] = $this->_session['login_id'];
$this->render('member_question',$data);
}
public function actionAjaxComplete() {
if(isset($_POST['submit_reply']) & isset($_POST['type']) ){
var_dump($_POST);
die();
}
}
}
?>