EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
HomeController.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
11  public $conferenceid;
12 
13  public function actionIndex()
14  {
15  $userid = Yii::app()->user->id;
16  //$conferenceid = 0;
17  $command = Yii::app()->db->createCommand();
18  $command ->select('conferenceid')
19  ->from('conference_user_type')
20  ->where('userid'==$userid, array($this->conferenceid => 'conferenceid'))
21  ->queryRow();
23  $this->render('index');
24 
25  //$result = mysql_query("SELECT DISTINCT conferenceid FROM conference_user WHERE userid=$userid");
26  }
27 
32  public function viewIfNewMessage()
33  {
34 
36 
37  if(Yii::app()->user->id != NULL)
38  $usid = Yii::app()->user->id;
39  else
40  $usid = 0;
41 
42  //select all conferences that the user has admin as his user type
43  $message = mysql_query("SELECT id FROM message WHERE receiverid='$usid' AND read_unread='0'");
44 
45  $i=0;
46 
47  while($row = mysql_fetch_array($message))
48  {
49  if($i==0) echo " " . "(!)<br>";
50 
51  $i++;
52  }
53 
54  }
55 
60  public function links()
61  {
62 
63  if(Yii::app()->user->id != NULL)
64  $usid = Yii::app()->user->id;
65  else
66  $usid = 0;
67 
68  if($usid == 5)
69  echo "<a href=./index.php?r=interests_confirmation>Confirm New Interest Requests</a> <br/><br/>";
70 
71  echo "<a href=./index.php?r=user_profile&usid=$usid>My Profile</a> <br/><br/>" ;
72  echo "<a href=./index.php?r=site/request_conference>Request Conference</a> <br/><br/>";
73  echo "<a href=./index.php?r=myconferences>My Conferences</a><br/><br/>" ;
74  echo "<a href=./index.php?r=mypapers>My Papers</a><br/><br>";
75  echo "<a href=./index.php?r=myInvitations>My Invitations</a><br/><br>" ;
76  echo "<a href=./index.php?r=mymessages>My Messages</a>" . " " ;
77  echo "<a>" . $this->viewIfNewMessage() . "</a>";
78 
79  }
80 
81 
82 
83  // Uncomment the following methods and override them if needed
84  /*
85  public function filters()
86  {
87  // return the filter configuration for this controller, e.g.:
88  return array(
89  'inlineFilterName',
90  array(
91  'class'=>'path.to.FilterClass',
92  'propertyName'=>'propertyValue',
93  ),
94  );
95  }
96 
97  public function actions()
98  {
99  // return external action classes, e.g.:
100  return array(
101  'action1'=>'path.to.ActionClass',
102  'action2'=>array(
103  'class'=>'path.to.AnotherActionClass',
104  'propertyName'=>'propertyValue',
105  ),
106  );
107  }
108  */
109 }