EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
EvaluatePaperFunctionController.php
Go to the documentation of this file.
1 <?php
2 
9 {
10  public function actionIndex()
11  {
12  $this->render('index');
13  }
14 
19  public function comment($paperid, $comment)
20  {
22 
23  $usid = Yii::app()->user->id;
24 
25  $sql_insert_comment="INSERT INTO paper_comment (paperid, content)
26 VALUES
27 ('$paperid', '$comment')";
28 mysql_query($sql_insert_comment) or die (mysql_error());
29 
30  $findcomment = mysql_query("SELECT MAX(comment_id) AS comment_id FROM paper_comment WHERE content='$comment' AND paperid='$paperid'");
31 
32  while($row = mysql_fetch_array($findcomment))
33  {
34  $commentid = $row['comment_id'];
35 
36  $sql_insert_referee_comment="INSERT INTO referee_comment (comment_id, referee_id)
37 VALUES
38 ( '$commentid', '$usid')";
39 mysql_query($sql_insert_referee_comment) or die (mysql_error());
40 
41  }
42  echo "Comment Has Been Sent<br><br>";
43  echo "<b>Your Comment : </b>" . $comment . "<br><br>";
44  }
45 
50  public function evaluate($recommendation, $categorization, $paperid)
51  {
53 
54  $usid = Yii::app()->user->id;
55 
56 
57  $sql_insert_evaluation="INSERT INTO paper_evaluation (recommendation, categorization, paper_id)
58 VALUES
59 ('$recommendation', '$categorization', '$paperid')";
60 mysql_query($sql_insert_evaluation) or die (mysql_error());
61 
62  $findevaluation = mysql_query("SELECT MAX(evaluation_id) AS evaluation_id FROM paper_evaluation WHERE recommendation='$recommendation' AND categorization='$categorization' AND paper_id='$paperid'");
63 
64  while($row = mysql_fetch_array($findevaluation))
65  {
66  $evaluationid = $row['evaluation_id'];
67 
68  $sql_insert_referee_evaluation="INSERT INTO paper_evaluation_referee (referee_id, evaluation_id)
69 VALUES
70 ( '$usid', '$evaluationid')";
71 mysql_query($sql_insert_referee_evaluation) or die (mysql_error());
72 
73  }
74  echo "Evaluation Has Been Sent.<br><br>";
75 
76 
77  }
78 
79  // Uncomment the following methods and override them if needed
80  /*
81  public function filters()
82  {
83  // return the filter configuration for this controller, e.g.:
84  return array(
85  'inlineFilterName',
86  array(
87  'class'=>'path.to.FilterClass',
88  'propertyName'=>'propertyValue',
89  ),
90  );
91  }
92 
93  public function actions()
94  {
95  // return external action classes, e.g.:
96  return array(
97  'action1'=>'path.to.ActionClass',
98  'action2'=>array(
99  'class'=>'path.to.AnotherActionClass',
100  'propertyName'=>'propertyValue',
101  ),
102  );
103  }
104  */
105 }