dadfe2036b316defc56c426c847ac0f98d7af0ec
[atutor.git] / mods / calendar / index_admin.php
1 <?php\r
2 /*\r
3 This is the ATutor webcalendar module page. It allows an admin user\r
4 to set or edit  the URL for the webcalendar installation for ATutor and\r
5 synchronize the ATutor and WebCalendar databases\r
6 \r
7 */\r
8 define('AT_INCLUDE_PATH', '../../include/');\r
9 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
10 \r
11 //////////\r
12 //Check to see if the url to webcalendar exists in the db \r
13 $sql = 'SELECT * from '.TABLE_PREFIX.'config WHERE name="webcalendar"';\r
14 $result = mysql_query($sql, $db);\r
15 while($row = mysql_fetch_array($result)){\r
16         $webcalendar_url_db = $row[1];\r
17 }\r
18 if($webcalendar_url_db == ''){\r
19 \r
20         $msg->addInfo('WEBCALENDAR_URL_ADD_REQUIRED');\r
21         require (AT_INCLUDE_PATH.'header.inc.php');\r
22         require (AT_INCLUDE_PATH.'footer.inc.php');\r
23 \r
24 }else{\r
25 \r
26         require (AT_INCLUDE_PATH.'header.inc.php');\r
27         $sql="SELECT *  FROM ".TABLE_PREFIX."admins WHERE login='$_SESSION[login]'";\r
28         $result = mysql_query($sql, $db);\r
29         \r
30         while($row = mysql_fetch_array($result)){\r
31                 $pw =  $row[1];\r
32         }\r
33         \r
34         ?>\r
35         <iframe name="calendar" id="calendar" title="WebCalendar" scrolling="yes" src="<?php echo $webcalendar_url_db; ?>week.php" height="800" width="100%" align="center" style="border:thin white solid; align:center;"></iframe>\r
36         <?php \r
37         \r
38         \r
39         require (AT_INCLUDE_PATH.'footer.inc.php'); \r
40 \r
41 }?>