Advertisement
Guest User

admin_select.php

a guest
Jan 10th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.17 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. $firstname = $_SESSION['firstname'];
  5. $lastname = $_SESSION['lastname'];
  6. $email1 = $_SESSION['email'];
  7.  
  8. $inactive = 60;
  9.  
  10. // check to see if $_SESSION["timeout"] is set
  11. if (isset($_SESSION["timeout"])) {
  12.     // calculate the session's "time to live"
  13.     $sessionTTL = time() - $_SESSION["timeout"];
  14.     if ($sessionTTL > $inactive) {
  15.         session_destroy();
  16.         header("Location: /index.html");
  17.     }
  18. }
  19. $_SESSION["timeout"] = time();
  20. ?>
  21.  
  22.  
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <!-- meta -->
  27. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  28. <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
  29. <meta http-equiv="Pragma" content="no-cache" />
  30.  
  31. <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.22.custom.css">
  32.     <link rel ="stylesheet" type ="text/css" href ="css/style.css">
  33.    
  34.     <script src="js/jquery.js"></script>   
  35.     <script src="js/jquery-ui.js"></script>
  36.    
  37.     <link rel="stylesheet" href="development-bundle/demos.css">
  38.     <style>
  39.         body { font-size: 62.5%; }
  40.         label, input { display:block; }
  41.         input.text { margin-bottom:12px; width:95%; padding: .4em; }
  42.         fieldset { padding:0; border:0; margin-top:25px; }
  43.         h1 { font-size: 1.2em; margin: .6em 0; }
  44.    
  45.         .ui-dialog .ui-state-error { padding: .3em; }
  46.         .validateTips { border: 1px solid transparent; padding: 0.3em; }
  47.     </style>
  48.  
  49.        
  50. <!-- title -->
  51. <title> Report selection </title>
  52. <link rel="shortcut icon" type="image/x-icon" href="images/base.gif" />
  53.        
  54. <!-- css -->
  55. <link rel="stylesheet" href="css/main.css" type="text/css" media="screen, projection" />
  56. </head>
  57.  
  58. <body>
  59.  
  60.  
  61. <!-- begin container to center layout in middle of page -->
  62. <div id="container">
  63.  
  64. <!-- begin header which contains our heading and navigation -->
  65. <div id="header">
  66.  
  67. <h1> <img src="images/main_logo.png" border="1" style="position:relative;left:-35px;top:8px;"  />  </h1>
  68.                
  69. <!-- begin navigation -->
  70. <div id="nav">
  71.    
  72.     <ul class="clearfix">
  73.        
  74.     </ul>
  75.    
  76. </div><!-- end navigation -->
  77.  
  78. </div><!-- end header -->
  79.            
  80.             <!-- begin content which houses our two columns and footer -->
  81. <div id="content" class="clearfix">
  82.            
  83. <div id="main"><div id="main-inner">
  84.    
  85. <br>
  86.     <font size = '4'; face = 'calibri'; color='blue'> <center> <i> <a style='position:relative;left:26px;top:20px'> Choose an option to view the report </a> </i> </center> </font>
  87.  
  88.  
  89.     <br><br>
  90.  
  91.        
  92.    
  93.      
  94.     <tr>
  95.     <form name = 'select_environment'  method = 'POST'  action = './nav_admin.php'>
  96.     <td>
  97.    
  98.     <tr>
  99.        
  100.     <?php
  101.  
  102. $host=****;
  103. $username=****;
  104. $password=*****;
  105. $database=******;
  106. $connection=mysql_connect(***,***,***);
  107. mysql_connect($host,$username,$password);
  108. @mysql_select_db($database) or die( "Unable to select database");
  109.  
  110. $sql="SELECT company FROM admin WHERE (email = '".$email1."' )";
  111. $result_type = mysql_query($sql,$connection) or die(mysql_error());
  112. $env = $row['company'];
  113. ?>
  114.     </tr>
  115.    
  116. <select name='env_select' id = 'env_select' style  = 'position:relative;left:240px;top:35px;'>
  117.  
  118. <?php
  119.  
  120. while ($row = mysql_fetch_assoc($result_type))
  121.    
  122.     {
  123.         echo "<option value = '" .$row['company']."' >".$row['company']."</option>";
  124.        
  125.        
  126.        
  127.     }
  128.    
  129.  ?>
  130. </select>
  131.  
  132.  
  133.    
  134.  <br /><br><br>
  135.  
  136. <input type='submit' name='view' id='view' value='View' onClick= './nav_admin.php' style  = 'position:relative;left:260px;top:38px;'>
  137.  
  138.  
  139.     </table>
  140.  </form>
  141.     </td></tr>
  142.     </table>
  143.     <br> <br> <br>
  144.        
  145.    
  146. </div></div><!-- end main column -->
  147.  
  148.  
  149.  
  150.  
  151.                
  152. <!-- begin side column -->
  153. <div id="side"><div id="side-inner">
  154.     <tr>
  155.     <img src="images/logo1.png" alt="H" class="img-right" />
  156.     <br> <br><br><br>
  157.  
  158.     <br>
  159.     </tr>
  160.     <tr> </tr>
  161.     <p style= "color:#153E7E;font-size:14pt;font-family:calibri;font-align:justify;"> ***** </p>
  162.  
  163.    
  164.    
  165. </div></div><!-- end side column -->
  166.            
  167. <!-- begin footer -->
  168. <div id="footer">
  169.    
  170.     <p>*********</p>
  171.    
  172. </div><!-- end footer -->
  173.  
  174. </div><!-- end content -->
  175.        
  176. </div><!-- end container -->
  177.  
  178.  
  179.    
  180.  
  181. </body>
  182. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement