EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Interests_requestController.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 autocomplete_subtopics()
18  {
19 
21  if(isset($_POST['topname']))
22  {
23  $topname = $_POST['topname'];
24  $ar = mysql_query("SELECT * FROM interests_subtopics WHERE id IN
25  (SELECT subtopicid FROM topic_subtopic WHERE topicid IN
26  (SELECT id FROM interests_topics WHERE name='$topname'))");
27 
28  $i=0;
29 
30  if(mysql_num_rows($ar)!=0)
31  {
32  while($row = mysql_fetch_array($ar))
33  {
34  $nam[$i] = $row['name'];
35  echo "<b>" . ($i+1) . ")</b>" . $row['name'] . "<br>";
36  $i++;
37  }
38  echo "<br>";
39 
40  return $nam;
41  }
42  }
43 
44  }
45 
49  public function autocomplete_alltopics()
50  {
51 
53 
54  $ar = mysql_query("SELECT * FROM interests_topics");
55 
56  $i=0;
57 
58  if(mysql_num_rows($ar)!=0)
59  {
60  while($row = mysql_fetch_array($ar))
61  {
62  $nam2[$i] = $row['name'];
63  $i++;
64  }
65 
66  return $nam2;
67 
68  }
69 
70  }
71 
75  public function autocomplete_allsubtopics()
76  {
77 
79 
80  $ar = mysql_query("SELECT * FROM interests_subtopics");
81 
82  $i=0;
83 
84  if(mysql_num_rows($ar)!=0)
85  {
86  while($row = mysql_fetch_array($ar))
87  {
88  $nam[$i] = $row['name'];
89  $i++;
90  }
91 
92  return $nam;
93  }
94 
95  }
96 
100  public function view_subtopics()
101  {
102 
103 
105 
106  $topname = $_POST['topic'];
107 
108 
109  echo "<form action='index.php?r=interests_selection/index' method='post'>";
110 
111  $topics = mysql_query("SELECT * FROM interests_topics WHERE name='$topname'");
112 
113  $i=0;
114  $k=0;
115  $o=0;
116  if(mysql_num_rows($topics)!=0)
117  {
118  while($row = mysql_fetch_array($topics))
119  {
120  $as[$o] = $row['name'];
121  $asd[$o] = $row['id'];
122  $result1 = mysql_query("SELECT subtopicid FROM topic_subtopic WHERE topicid='$asd[$o]'");
123  echo "<h3>$as[$o]</h3>" . "";
124 
125  while($row2 = mysql_fetch_array($result1))
126  {
127  $asd2 = $row2['subtopicid'];
128 
129  $result2 = mysql_query("SELECT name FROM interests_subtopics WHERE id='$asd2'");
130 
131  while($row3 = mysql_fetch_array($result2))
132  {
133 
134  $asd3[$k] = $row3['name'];
135 
136  echo "<B>".($k+1)."</B>" . ") ";
137 
138  echo "<input type='checkbox' name='topicid[]' value=$asd2>";
139 
140 // echo "<a href=\" ./index.php?r=user_profile/index&username=$asd3[$k]\">" . $asd3[$k] . "</a><br><br>";
141  echo $asd3[$k] . "</a><br><br>";
142 
143 
144  }
145  $k++;
146 
147  }
148  $co = $row2['subtopicid'];
149  $k=0;
150  $o++;
151  $i++;
152  }
153  }
154  else echo "No Subtopics For This Topic<br><br>";
155 
156  $j=0;
157  $l=0;
158 
159 
160  echo "<input type='radio' name='knowledge' value='1' /> Mediocre Knowledge";
161  echo "<input type='radio' name='knowledge' value='2' /> Good Knowledge";
162  echo "<input type='radio' name='knowledge' value='3' /> Excellent Knowledge";
163  echo "<br>";
164  echo "<input type='submit' name=\'formSubmit' value='Select Interests' />";
165  echo "</form>";
166 
167  }
168  // Uncomment the following methods and override them if needed
169  /*
170  public function filters()
171  {
172  // return the filter configuration for this controller, e.g.:
173  return array(
174  'inlineFilterName',
175  array(
176  'class'=>'path.to.FilterClass',
177  'propertyName'=>'propertyValue',
178  ),
179  );
180  }
181 
182  public function actions()
183  {
184  // return external action classes, e.g.:
185  return array(
186  'action1'=>'path.to.ActionClass',
187  'action2'=>array(
188  'class'=>'path.to.AnotherActionClass',
189  'propertyName'=>'propertyValue',
190  ),
191  );
192  }
193  */
194 }