EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Paper_keywordController.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_topics()
18  {
19 
21 
22  $ar = mysql_query("SELECT * FROM interests_topics");
23 
24  $i=0;
25 
26  while($row = mysql_fetch_array($ar))
27  {
28  $nam[$i] = $row['name'];
29 
30  $i++;
31  }
32 
33  return $nam;
34 
35  }
36 
40  public function view_subtopics()
41  {
42 
43 
45 
46  $topname = $_POST['topic'];
47 
48  $confid = $_GET['va'];
49 
50  echo "</form>";
51  echo "<form action='index.php?r=interest_selection_paper/index' method='post'>";
52 
53  $topics = mysql_query("SELECT * FROM interests_topics WHERE name='$topname'");
54 
55  $i=0;
56  $k=0;
57  $o=0;
58  if(mysql_num_rows($topics)!=0)
59  {
60  while($row = mysql_fetch_array($topics))
61  {
62  $as[$o] = $row['name'];
63  $asd[$o] = $row['id'];
64  $result1 = mysql_query("SELECT subtopicid FROM topic_subtopic WHERE topicid='$asd[$o]'");
65  echo "<h3>$as[$o]</h3>" . "";
66 
67  while($row2 = mysql_fetch_array($result1))
68  {
69  $asd2 = $row2['subtopicid'];
70 
71  $result2 = mysql_query("SELECT name FROM interests_subtopics WHERE id='$asd2'");
72 
73  while($row3 = mysql_fetch_array($result2))
74  {
75 
76  $asd3[$k] = $row3['name'];
77 
78  echo "<B>".($k+1)."</B>" . ") ";
79 
80  echo "<input type='checkbox' name='topicid[]' value=$asd2>";
81 
82 // echo "<a href=\" ./index.php?r=user_profile/index&username=$asd3[$k]\">" . $asd3[$k] . "</a><br><br>";
83  echo $asd3[$k] . "</a><br><br>";
84 
85 
86  }
87  $k++;
88 
89  }
90  $co = $row2['subtopicid'];
91  $k=0;
92  $o++;
93  $i++;
94  }
95 
96  $j=0;
97  $l=0;
98  echo "<input hidden name='paperid' value=$confid />";
99  echo "<br>";
100  echo "<input type='submit' name=\'formSubmit' value='Select Interests' />";
101  echo "</form><br>";
102 
103 
104  echo "<form action='index.php?r=interests_request/index' method='post'>";
105  echo "<input hidden name='paperid' value=$confid />";
106  echo "<textarea hidden name='topname'>" . $topname . "</textarea>";
107  echo "<input type='submit' name=\'formSubmit2' value='Add Subtopics For This Interest' />";
108  echo "</form>";
109 
110  }
111 
112  else if($topname!=null)
113  {
114  echo "</form>";
115  echo "<form action='index.php?r=interests_request/index' method='post'>";
116  echo "No Subtopics For " . $topname . "<br><br>";
117  echo "<input hidden name='paperid' value=$confid />";
118 
119 //echo "<input hidden name='topname' value=$topname >";
120  echo "<textarea hidden name='topname'>" . $topname . "</textarea>";
121  echo "<input type='submit' name=\'formSubmit2' value='Add Subtopics For This Interest' />";
122  echo "</form>";
123  }
124  else
125  {
126  echo "</form>";
127  echo "No Topic Specified.";
128  }
129 
130  }
131  // Uncomment the following methods and override them if needed
132  /*
133  public function filters()
134  {
135  // return the filter configuration for this controller, e.g.:
136  return array(
137  'inlineFilterName',
138  array(
139  'class'=>'path.to.FilterClass',
140  'propertyName'=>'propertyValue',
141  ),
142  );
143  }
144 
145  public function actions()
146  {
147  // return external action classes, e.g.:
148  return array(
149  'action1'=>'path.to.ActionClass',
150  'action2'=>array(
151  'class'=>'path.to.AnotherActionClass',
152  'propertyName'=>'propertyValue',
153  ),
154  );
155  }
156  */
157 }