EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Interests_confirmation_functionController.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 new_confirm($subtopicid)
18  {
20 
21 
22  $subtopicname = mysql_query("SELECT * FROM interests_subtopics_confirmation WHERE id=$subtopicid");
23 
24  while($row2= mysql_fetch_array($subtopicname))
25  {
26  $subname = $row2['name'];
27  $subtopic_name = $row2['name'];
28  $sql_insert_subtopic="INSERT IGNORE INTO interests_subtopics (name)
29  VALUES
30  ('$subname')";
31  mysql_query($sql_insert_subtopic) or die (mysql_error());
32 
33  $topics = mysql_query("SELECT * FROM interests_topics_confirmation WHERE id IN
34  (SELECT DISTINCT topicid FROM topic_subtopic_confirmation WHERE subtopicid=$subtopicid)");
35 
36 
37  while($row = mysql_fetch_array($topics))
38  {
39  $topic_name = $row['name'];
40  $topicid = $row['id'];
41  $topicexists = mysql_query("SELECT * FROM interests_topics WHERE name='$topic_name'");
42 
43  if(mysql_num_rows($topicexists)!=0) {}
44  else{
45  $sql_insert_topic="INSERT IGNORE INTO interests_topics ( name)
46  VALUES
47  ('$topic_name')";
48  mysql_query($sql_insert_topic) or die (mysql_error());
49  }
50 
51  }
52  }
53 /*
54  $sql_accept_referee="DELETE FROM conference_user_type WHERE conferenceid=$confid AND userid=$usid AND usertype=$type";
55  mysql_query($sql_accept_referee) or die (mysql_error());
56 */
57 
58  $sql_edit_request="UPDATE topic_subtopic_confirmation SET accepted=1 WHERE topicid=$topicid AND subtopicid=$subtopicid";
59  mysql_query($sql_edit_request) or die (mysql_error());
60 
61  $topid = mysql_query("SELECT * FROM interests_topics WHERE name='$topic_name'");
62 
63  while($row3=mysql_fetch_array($topid))
64  {
65  $topicid = $row3['id'];
66 
67  $subid = mysql_query("SELECT * FROM interests_subtopics WHERE name='$subtopic_name'");
68 
69  while($row4=mysql_fetch_array($subid))
70  {
71  $subtopid = $row4['id'];
72 
73  $sql_insert_topic_subtopic="INSERT INTO topic_subtopic (topicid, subtopicid)
74  VALUES
75  ('$topicid', '$subtopid' )";
76  mysql_query($sql_insert_topic_subtopic) or die (mysql_error());
77 
78  }
79 
80  }
81 
82 
83 
84  echo $subname . "<br>" . $topic_name . "<br><br><br>";
85 
86  }
87 
88 
89  public function existing_confirm($subtopicid)
90  {
91 
93 
94 
95  $subtopicname = mysql_query("SELECT * FROM interests_subtopics_confirmation WHERE id=$subtopicid");
96 
97  while($row2= mysql_fetch_array($subtopicname))
98  {
99  $subname = $row2['name'];
100  $subtopic_name = $row2['name'];
101  $sql_insert_subtopic="INSERT IGNORE INTO interests_subtopics (name)
102  VALUES
103  ('$subname')";
104  mysql_query($sql_insert_subtopic) or die (mysql_error());
105 
106  $topics = mysql_query("SELECT * FROM interests_topics WHERE id IN
107  (SELECT DISTINCT topicid FROM topic_subtopic_existing_confirmation WHERE subtopicid=$subtopicid)");
108 
109 
110  while($row = mysql_fetch_array($topics))
111  {
112  $topic_name = $row['name'];
113  $topicid = $row['id'];
114 
115 
116  }
117  }
118 
119 
120  $sql_edit_request="UPDATE topic_subtopic_existing_confirmation SET accepted=1 WHERE topicid=$topicid AND subtopicid=$subtopicid";
121  mysql_query($sql_edit_request) or die (mysql_error());
122 
123  $topid = mysql_query("SELECT * FROM interests_topics WHERE name='$topic_name'");
124 
125  while($row3=mysql_fetch_array($topid))
126  {
127  $topicid = $row3['id'];
128 
129  $subid = mysql_query("SELECT * FROM interests_subtopics WHERE name='$subtopic_name'");
130 
131  while($row4=mysql_fetch_array($subid))
132  {
133  $subtopid = $row4['id'];
134 
135  $sql_insert_topic_subtopic="INSERT INTO topic_subtopic (topicid, subtopicid)
136  VALUES
137  ('$topicid', '$subtopid' )";
138  mysql_query($sql_insert_topic_subtopic) or die (mysql_error());
139 
140  }
141 
142  }
143 
144 
145 
146  echo $subname . "<br>" . $topic_name . "<br><br><br>";
147 
148 
149 
150  }
151 
152  // Uncomment the following methods and override them if needed
153  /*
154  public function filters()
155  {
156  // return the filter configuration for this controller, e.g.:
157  return array(
158  'inlineFilterName',
159  array(
160  'class'=>'path.to.FilterClass',
161  'propertyName'=>'propertyValue',
162  ),
163  );
164  }
165 
166  public function actions()
167  {
168  // return external action classes, e.g.:
169  return array(
170  'action1'=>'path.to.ActionClass',
171  'action2'=>array(
172  'class'=>'path.to.AnotherActionClass',
173  'propertyName'=>'propertyValue',
174  ),
175  );
176  }
177  */
178 }