EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Interests_selectionController.php
Go to the documentation of this file.
1 <?php
2 
8 {
9  public function actionIndex()
10  {
11  $this->render('index');
12  }
13 
17  public function selectfunction($topicid)
18  {
19 
21 
22  if(Yii::app()->user->id != NULL)
23  $usid = Yii::app()->user->id;
24  else
25  $usid = 0;
26 
27  $knowledge=$_POST["knowledge"];
28 
29  $sql_delete_interest_user="DELETE FROM interest_user
30  WHERE userid=$usid AND interestid=$topicid";
31 mysql_query($sql_delete_interest_user) or die (mysql_error());
32 
33 
34  $sql_insert_interest_user="INSERT INTO interest_user ( userid, interestid, knowledge)
35 VALUES
36 ('$usid', '$topicid', '$knowledge')";
37 mysql_query($sql_insert_interest_user) or die (mysql_error());
38 
39 
40 
41  }
42 
43  // Uncomment the following methods and override them if needed
44  /*
45  public function filters()
46  {
47  // return the filter configuration for this controller, e.g.:
48  return array(
49  'inlineFilterName',
50  array(
51  'class'=>'path.to.FilterClass',
52  'propertyName'=>'propertyValue',
53  ),
54  );
55  }
56 
57  public function actions()
58  {
59  // return external action classes, e.g.:
60  return array(
61  'action1'=>'path.to.ActionClass',
62  'action2'=>array(
63  'class'=>'path.to.AnotherActionClass',
64  'propertyName'=>'propertyValue',
65  ),
66  );
67  }
68  */
69 }