D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
listprogrammes.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="administratoroftheduresult2018byto")){?> <?php include("Connecter/dataconn.php"); ?> <?php $query_dio=sprintf("select * from departments"); $dio = mysql_query($query_dio, $csn) or die(mysql_error()); $row_dio = mysql_fetch_assoc($dio); $totalRows_dio = mysql_num_rows($dio); ?> <?php if (isset($_GET['deltab'])) { unset($temp); if(isset($_GET['deltab'])){ $_GET['deltab']=trim($_GET['deltab']); if(preg_match('/^[0-9]/u',$_GET['deltab'])){ settype($_GET['deltab'], 'int'); $temp=(int)$_GET['deltab']; } } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $deltab=$temp; $sql=sprintf("delete from programmes where sn = %s", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } if (isset($_GET['arhtab'])) { unset($temp); if(isset($_GET['arhtab'])){ $_GET['arhtab']=trim($_GET['arhtab']); if(preg_match('/^[0-9]/u',$_GET['arhtab'])){ settype($_GET['arhtab'], 'int'); $temp=(int)$_GET['arhtab']; } } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $deltab=$temp; $sql=sprintf("update programmes set archived='Yes' where sn = %s", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } if (isset($_GET['unarhtab'])) { unset($temp); if(isset($_GET['unarhtab'])){ $_GET['unarhtab']=trim($_GET['unarhtab']); if(preg_match('/^[0-9]/u',$_GET['unarhtab'])){ settype($_GET['unarhtab'], 'int'); $temp=(int)$_GET['unarhtab']; } } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $deltab=$temp; $sql=sprintf("update programmes set archived='No' where sn = %s", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } $query_dio1 = "SELECT * FROM programmes where archived='No' order by namer"; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); $query_dio2 = "SELECT * FROM programmes where archived='Yes' order by namer"; $dio2 = mysql_query($query_dio2, $csn) or die(mysql_error()); $row_dio2 = mysql_fetch_assoc($dio2); $totalRows_dio2 = mysql_num_rows($dio2); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php include("head.php"); ?> </head> <body> <?php include("top.php"); ?> <?php include("dtable0.php"); ?> <?php include("nav.php"); ?> <?php include("dtable1.php"); ?> <?php include("topcontainer.php"); ?> <!--Content Goes Here--> <div class="headingbiggest">Programmes of Study</div> <hr /> <p style="color:#990000"><b>Existing Programmes</b></p> <div class="post"> <?php if ($totalRows_dio1>0) { ?> <table width="98%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio1['namer']; ?></td> <td style="border-bottom:1px solid #333333;"> <?php $sql="select * from departments where sn = " . $row_dio1['departmentsn']; $result=mysql_query($sql); $row=mysql_fetch_array($result); echo $row['namer']; ?></td> <td style="border-bottom:1px solid #333333;"> <?php $sql="select * from faculties where sn = " . $row['facultysn']; $result=mysql_query($sql); $row=mysql_fetch_array($result); echo $row['namer']; ?></td> <td width="90px"><a href="editprogramme.php?tab=<?php echo $row_dio1['sn']; ?>">Edit</a> <a href="listprogrammes.php?arhtab=<?php echo $row_dio1['sn']; ?>&tab=<?php echo $row_dio['sn']; ?>">Archive</a> </td></tr> <?php } while ($row_dio1 = mysql_fetch_assoc($dio1)); ?> </table> <?php } else { echo ("None Found!"); } ?> </div><div class="post-bot"></div> <p style="color:#990000"><b>Archived Programmes</b></p> <div class="post"> <?php if ($totalRows_dio2>0) { ?> <table width="98%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio2['namer']; ?></td> <td style="border-bottom:1px solid #333333;"> <?php $sql="select * from departments where sn = " . $row_dio2['departmentsn']; $result=mysql_query($sql); $row=mysql_fetch_array($result); echo $row['namer']; ?></td> <td style="border-bottom:1px solid #333333;"> <?php $sql="select * from faculties where sn = " . $row['facultysn']; $result=mysql_query($sql); $row=mysql_fetch_array($result); echo $row['namer']; ?></td> <td width="75px"> <a href="listprogrammes.php?unarhtab=<?php echo $row_dio2['sn']; ?>&tab=<?php echo $row_dio['sn']; ?>">UnArchive</a> </td></tr> <?php } while ($row_dio2 = mysql_fetch_assoc($dio2)); ?> </table> <?php } else { echo ("None Found!"); } ?> </div><div class="post-bot"></div> <p><a href="dadmin.php">Back to Admin Page</a></p> <!--Content Ends Here--> <?php include("bottomcontainer.php"); ?> <?php include("dtable2.php"); ?> <?php include("side.php"); ?> <?php include("dtable3.php"); ?> <?php include("foot.php"); ?> </body> </html> <?php } else { include("ddadmin.php"); }?>