EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
User_profileController.php
Go to the documentation of this file.
1 <?php
2 
8 {
9  public function actionIndex()
10  {
11  $this->render('index');
12  }
13 
18  public function set_interests()
19  {
20 
22 
23  if(Yii::app()->user->id != NULL)
24  $usid = Yii::app()->user->id;
25  else
26  $usid = 0;
27 
28  $userid = $_GET['usid'];
29 
30 
31  if($usid!=$userid)
32  {
33  echo "<br/>";
34  }
35  else
36  {
37  echo "<br><br>";
38  echo "<a href=\" ./index.php?r=interests/index\">Update Your Interests </a>";
39  echo "<br><br>";
40 
41  }
42 
43  }
44 
48  public function send_message()
49  {
50 
52 
53  if(Yii::app()->user->id != NULL)
54  $usid = Yii::app()->user->id;
55  else
56  $usid = 0;
57 
58  $userid = $_GET['usid'];
59 
60 
61  if($usid==$userid)
62  {
63 
64  }
65  else
66  {
67  echo "<br>";
68  echo "<a href=\" ./index.php?r=viewusermessage/index&userid=$userid\">Send Message To This User </a>";
69  echo "<br><br>";
70 
71  }
72 
73 
74  }
75 
79  public function username()
80  {
81 
83 
84  $usid = $_GET['usid'];
85 
86  $result = mysql_query("SELECT * FROM users WHERE userid=$usid");
87 
88  while($row = mysql_fetch_array($result))
89  {
90  echo $row['firstname'] . " " . $row['lastname'];
91  }
92 
93  }
94 
98  public function viewUser()
99  {
100 
102 
103  $usid = $_GET['usid'];
104 
105  $result = mysql_query("SELECT * FROM users WHERE userid=$usid");
106 
107  while($row = mysql_fetch_array($result))
108  {
109 
110  $this->widget('zii.widgets.CDetailView', array(
111  'data'=>$row,
112  'attributes'=>array(
113  'userid',
114  'username',
115  'firstname',
116  'lastname',
117  'email',
118 
119  ),
120  ));
121  }
122 
123  }
124 
128  public function viewInterests()
129  {
130 
132 
133  if(Yii::app()->user->id != NULL)
134  $usid = Yii::app()->user->id;
135  else
136  $usid = 0;
137 
138  $userid = $_GET['usid'];
139 
140  if($usid==$userid)
141  {
142 
143  }
144  else
145  {
146  $usid=$userid;
147 
148  }
149 
150  $topicname = mysql_query("SELECT * FROM interests_topics WHERE id IN
151  (SELECT topicid FROM topic_subtopic WHERE subtopicid IN
152  (SELECT interestid FROM interest_user WHERE userid=$usid))");
153 
154  $i=0;
155  while ($row4 = mysql_fetch_array($topicname))
156  {
157 
158  echo "<b>" . $row4['name'] . "</b><br>";
159  $topid = $row4['id'];
160 
161  $interest = mysql_query("SELECT * FROM interests_subtopics WHERE id IN
162  (SELECT subtopicid FROM topic_subtopic WHERE topicid=$topid AND subtopicid IN
163  (SELECT interestid FROM interest_user WHERE userid=$usid))");
164 
165  while($row5 = mysql_fetch_array($interest))
166  {
167 
168  echo $row5['name'] . " ";
169  $subid = $row5['id'];
170  $know = mysql_query("SELECT * FROM interest_user WHERE interestid=$subid AND userid=$usid");
171 
172  while($row6 = mysql_fetch_array($know))
173  {
174 
175  // echo "(" . $row6['knowledge'] . ")<br>";
176 
177  $knowledge = $row6['knowledge'];
178 
179  if($knowledge==1) echo "( mediocre )<br>";
180  else if($knowledge==2) echo "( good )<br>";
181  else echo "( excellent )<br>";
182 
183  }
184  }
185 
186  echo "<br>";
187  $i++;
188  }
189  /*
190  $interestname = mysql_query("SELECT name FROM interests_subtopics WHERE id IN (SELECT interestid FROM interest_user WHERE userid=$usid)");
191 
192  while ($row3 = mysql_fetch_array($interestname))
193  {
194 
195  echo $row3['name'] . "<br>";
196 
197  }
198  */
199  if($i==0) echo "This user has no interests.";
200 
201  }
202 
206  public function user_conferences()
207  {
208 
210 
211  $usid = $_GET['usid'];
212 
213  //select all conferences that the user has admin as his user type
214  $participating = mysql_query("SELECT DISTINCT conferenceid FROM conference_user_type WHERE userid='$usid'");
215 
216  $i=0;
217 
218  while($row = mysql_fetch_array($participating))
219  {
220 
221  $asd = $row['conferenceid'];
222  $result1 = mysql_query("SELECT name FROM conference WHERE conferenceid='$asd'");
223 
224  while($row2 = mysql_fetch_array($result1))
225  {
226  echo "<B>".($i+1)."</B>" . ") Conference Name : " . $row2['name'];
227  echo " ";
228  }
229 
230  // echo "<br />";
231  // echo "Conference ID : " . $row['conferenceid'];
232  $co = $row['conferenceid'];
233  echo "<br />";
234  // echo CHtml::link("View Conference",array('conference/index', '&va'=>$co));
235  echo "<a href=\" ./index.php?r=conference/view&id=$co\">View Conference </a>";
236  echo "<br />";
237  echo "<br />";
238  $i++;
239  }
240 
241  if($i==0) echo "This user is not participating in any conference.";
242 
243  }
244 
248  public function user_papers()
249  {
250 
252 
253  $usid = $_GET['usid'];
254 
255  //select all conferences that the user has admin as his user type
256  $papers = mysql_query("SELECT DISTINCT id FROM paper WHERE author_id='$usid'");
257 
258  $i=0;
259  if($papers!=NULL){
260  while($row = mysql_fetch_array($papers))
261  {
262 
263  $asd = $row['id'];
264  $result1 = mysql_query("SELECT * FROM paper WHERE id='$asd'");
265 
266  while($row2 = mysql_fetch_array($result1))
267  {
268  echo "<B>".($i+1)."</B>" . ") Paper Name : " . $row2['name'];
269  echo " ";
270  }
271 
272 
273  $co = $row['id'];
274  echo "<br />";
275  echo "<a href=\" ./index.php?r=paper/view&id=$co\">View Paper </a>";
276  echo "<br /><br />";
277  $i++;
278  }
279  }
280  if($i==0) echo "This user does not have any papers.";
281 
282 
283 
284 
285  }
286 
287  // Uncomment the following methods and override them if needed
288  /*
289  public function filters()
290  {
291  // return the filter configuration for this controller, e.g.:
292  return array(
293  'inlineFilterName',
294  array(
295  'class'=>'path.to.FilterClass',
296  'propertyName'=>'propertyValue',
297  ),
298  );
299  }
300 
301  public function actions()
302  {
303  // return external action classes, e.g.:
304  return array(
305  'action1'=>'path.to.ActionClass',
306  'action2'=>array(
307  'class'=>'path.to.AnotherActionClass',
308  'propertyName'=>'propertyValue',
309  ),
310  );
311  }
312  */
313 }