Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <script type="text/javascript">
  2. function toggle_display(id)
  3. {
  4. obj = document.getElementById(id);
  5. if(typeof(obj) != "undefined")
  6. {
  7. if(obj.style.display == "none")
  8. obj.style.display = "";
  9. else
  10. obj.style.display = "none";
  11. }
  12. }
  13. </script>
  14. <style type="text/css">
  15. form.NA{
  16. text-decoration: none;
  17. }
  18. </style>
  19. <?php
  20. require_once("classes/classes.main.php");
  21.  
  22. $page = basename($_SERVER['PHP_SELF']);
  23. $id = $_SESSION['ID'];
  24. $user = new User($id);
  25. $signedin = $user->check_login();
  26. if ($signedin){
  27. $user = new User((int)$_SESSION['ID']);
  28. $result = mysql_query("SELECT count(ID) FROM `messages` WHERE `read`=0 AND `to`='$user->ID';");
  29. $row = mysql_fetch_array($result);
  30. $count = $row['count(ID)'];
  31. if ($count) $inbox = "Inbox ($count)";
  32. else $inbox = "Inbox";
  33.  
  34. $pages = array('index'=>'Home', 'sell'=>'Sell', 'inbox'=>$inbox, 'contactus'=>'Contact Us', 'signin'=>$user->get_username(), 'logout'=>'Logout');
  35. $links = array("<a href='index.php'>", "<a href='sell.php'>", "<a href='inbox.php'>", "<a href='contactus.php'>",
  36. "<a href='user.php?uid=$user->ID'>", "<a href='logout.php'>");
  37.  
  38. }else{
  39. $pages = array('index'=>'Home', 'signin'=>'Sign In', 'register'=>'Register', 'contactus'=>'Contact Us');
  40. $links = array("<a href='index.php'>", "<a href=\"#signin\" onclick=\"javascript:toggle_display('signin')\">",
  41. "<a href='register.php'>", "<a href='contactus.php'>");
  42. }
  43.  
  44. $i=0;
  45. $max = count($pages)-1;
  46. foreach ($pages as $key=>$value){
  47. $_page = $key.".php";
  48. if ($i < $max){
  49. $end = " &middot; ";
  50. }else $end = NULL;
  51. if ($page == $_page) echo "<b class='menu'>$value</b></a>$end";
  52. else echo $links[$i]."<b class='menu'>$value</b></a>$end";
  53. $i++;
  54. }
  55. ?>
  56. <!--<b>Home</b></a> &middot; <b>Sell</b> &middot; <b><a href='#signin' onclick="javascript:toggle_display('signin')">Sign In</a></b>
  57. &middot; <b>Register</b> &middot; <b>Inbox</b> &middot; <a href="contactus.php"><b>Contact Us</b></a>-->
  58. <a name="signin"></a>
  59. <div style="display: none;" id="signin">
  60. <form method="post" action="redirect.php">
  61. <br /><table class="NA" border=0 style="position:absolute; left:425px">
  62. <tr><td><p>Username: </p></td><td><input type="text" name="username"></td></tr>
  63. <tr><td>Password: </td><td><input type="password" name="password"></td></tr>
  64. <input type="hidden" name="page" value="<?php echo $page ;?>">
  65. <tr><td colspan=2><center><input type="submit" value="Sign In"></center></td></tr>
  66. </form>
  67. </table>
  68. <br /><br /><br /><br /><pre>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="passrecov.php">Forget my password?</a></pre>
  69. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement