/www/profile.php
PHP | 172 lines | 161 code | 11 blank | 0 comment | 11 complexity | b63089fcfda3d0544e23d642e3aabfc4 MD5 | raw file
- <?php
- session_start();
- if($_SESSION['status']!='admin')
- {
- $_SESSION['status']='';
- header('location: login.php?typ=5');
- }
- ?>
- <!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" />
- <title>Inmate list</title>
- <link rel="stylesheet" type="text/css" href="home.css" >
- </head>
- <?php include("adminPart1.php");?>
- <body>
- <?php
- $id=$_GET['id'];
- $aid=$_GET['id'];
- $sid=$_GET['id'];
- $gid=$_GET['id'];
- $inmate=$_GET['inmate'];
- if($inmate=='student')
- {
- $query="SELECT * FROM student WHERE uid='$id'";
- $result=mysql_query($query);
- ?>
- <table class="form"><tr>
-
-
- <?php
- echo "<table border='1'>";
- while($row=mysql_fetch_array($result))
- {
- ?>
- <td align="center" colspan=2><img name='studentpic' src='dispImageStudent.php?num=<?php echo $id; ?>' width='171' height='170' alt='' /></td></tr>
- <?php
- echo "<tr><td><div align='left'>Id</div></td><td><div align='left'>";
- echo $row['uid'];
- echo "</div></td></tr><tr><td><div align='left'>Name</div></td><td><div align='left'>";
- echo $row['name'];
- echo "</div></td></tr><tr><td><div align='left'>Current address</div></td><td><div align='left'>";
- echo $row['curr_address'];
- echo "</div></td></tr><tr><td><div align='left'>permanent address</div></td><td><div align='left'>";
- echo $row['per_address'];
- echo "</div></td></tr><tr><td><div align='left'>Course</div></td><td><div align='left'>";
- echo $row['course_of_study'];
- echo "</div></td></tr><tr><td><div align='left'>Branch</div></td><td><div align='left'>";
- echo $row['branch'];
- echo "</div></td></tr><tr><td><div align='left'>Blood Group</div></td><td><div align='left'>";
- echo $row['blood_group'];
- echo "</div></td></tr><tr><td><div align='left'>Email id</div></td><td><div align='left'>";
- echo $row['emailid'];
- echo "</div></td></tr><tr><td><div align='left'>Parents contact number</div></td><td><div align='left'>";
- echo $row['parent_cont_num'];
- echo "</div></td></tr><tr><td><div align='left'>Student contact number</div></td><td><div align='left'>";
- echo $row['stud_cont_num'];
-
- }
- echo "</table>";
- }
- if($inmate=='admin')
- {
- $sqlquery=mysql_query("SELECT * FROM admin WHERE aid = '$aid';");
- $row = mysql_fetch_array($sqlquery);
- if (mysql_affected_rows() == 1)
- {
- ?>
- <table width="221" border="1">
- <tr><td align="center" colspan=2><img name='studentpic' src='dispImageAdmin.php?num=<?php echo $aid; ?>' width='171' height='170' alt='' /></td></tr>
- <tr>
- <td width="119"><div align="left">Admin id</div></td>
- <td width="86" align="left" ><div align="left"><?php echo $row['aid']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Name</div></td>
- <td align="left" ><div align="left"><?php echo $row['name']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Designation</div></td>
- <td align="left" ><div align="left"><?php echo $row['designation']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Contact number</div></td>
- <td align="left" ><div align="left"><?php echo $row['cntact_no']?></div></td>
- </tr>
- </table>
- <?php
-
- }
- }
- ?>
- <?php
- if($inmate=='staff')
- {
- $sqlquery=mysql_query("SELECT * FROM staff WHERE id = '$sid';");
- $row = mysql_fetch_array($sqlquery);
- if (mysql_affected_rows() == 1)
- {
- ?>
- <table width="221" border="1">
- <tr><td align="center" colspan=2><img name='studentpic' src='dispImageStaff.php?num=<?php echo $aid; ?>' width='171' height='170' alt='' /></td></tr>
- <tr>
- <td width="119"><div align="left">Staff id</div></td>
- <td width="86" align="left" ><div align="left"><?php echo $row['id']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Name</div></td>
- <td align="left"><div align="left"><?php echo $row['name']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Address</div></td>
- <td align="left" ><div align="left"><?php echo $row['address']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Contact number</div></td>
- <td align="left" ><div align="left"><?php echo $row['cont_num']?></div></td>
- </tr>
- </table>
- <?php
-
- }
- }
- ?>
- <?php
- if($inmate=='guest')
- {
- $sqlquery=mysql_query("SELECT * FROM guest WHERE id = '$gid';");
- $row = mysql_fetch_array($sqlquery);
- if (mysql_affected_rows() == 1)
- {
- ?>
- <table width="221" border="1">
- <tr>
- <td width="119"><div align="left">Guest id</div></td>
- <td width="86" align="left" ><div align="left"><?php echo $row['id']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Name</div></td>
- <td align="left" ><div align="left"><?php echo $row['name']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Address</div></td>
- <td align="left"><div align="left"><?php echo $row['room_num']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Address</div></td>
- <td align="left" ><div align="left"><?php echo $row['address']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Address</div></td>
- <td align="left" ><div align="left"><?php echo $row['purpose_of_stay']?></div></td>
- </tr>
- <tr>
- <td><div align="left">Contact number</div></td>
- <td align="left"><div align="left"><?php echo $row['cont_num']?></div></td>
- </tr>
- </table>
- <?php
-
- }
- }
- include("adminPart2.php");
- ?>
- </body>
- </html>