Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function toggle_display(id)
- {
- obj = document.getElementById(id);
- if(typeof(obj) != "undefined")
- {
- if(obj.style.display == "none")
- obj.style.display = "";
- else
- obj.style.display = "none";
- }
- }
- </script>
- <style type="text/css">
- form.NA{
- text-decoration: none;
- }
- </style>
- <?php
- require_once("classes/classes.main.php");
- $page = basename($_SERVER['PHP_SELF']);
- $id = $_SESSION['ID'];
- $user = new User($id);
- $signedin = $user->check_login();
- if ($signedin){
- $user = new User((int)$_SESSION['ID']);
- $result = mysql_query("SELECT count(ID) FROM `messages` WHERE `read`=0 AND `to`='$user->ID';");
- $row = mysql_fetch_array($result);
- $count = $row['count(ID)'];
- if ($count) $inbox = "Inbox ($count)";
- else $inbox = "Inbox";
- $pages = array('index'=>'Home', 'sell'=>'Sell', 'inbox'=>$inbox, 'contactus'=>'Contact Us', 'signin'=>$user->get_username(), 'logout'=>'Logout');
- $links = array("<a href='index.php'>", "<a href='sell.php'>", "<a href='inbox.php'>", "<a href='contactus.php'>",
- "<a href='user.php?uid=$user->ID'>", "<a href='logout.php'>");
- }else{
- $pages = array('index'=>'Home', 'signin'=>'Sign In', 'register'=>'Register', 'contactus'=>'Contact Us');
- $links = array("<a href='index.php'>", "<a href=\"#signin\" onclick=\"javascript:toggle_display('signin')\">",
- "<a href='register.php'>", "<a href='contactus.php'>");
- }
- $i=0;
- $max = count($pages)-1;
- foreach ($pages as $key=>$value){
- $_page = $key.".php";
- if ($i < $max){
- $end = " · ";
- }else $end = NULL;
- if ($page == $_page) echo "<b class='menu'>$value</b></a>$end";
- else echo $links[$i]."<b class='menu'>$value</b></a>$end";
- $i++;
- }
- ?>
- <!--<b>Home</b></a> · <b>Sell</b> · <b><a href='#signin' onclick="javascript:toggle_display('signin')">Sign In</a></b>
- · <b>Register</b> · <b>Inbox</b> · <a href="contactus.php"><b>Contact Us</b></a>-->
- <a name="signin"></a>
- <div style="display: none;" id="signin">
- <form method="post" action="redirect.php">
- <br /><table class="NA" border=0 style="position:absolute; left:425px">
- <tr><td><p>Username: </p></td><td><input type="text" name="username"></td></tr>
- <tr><td>Password: </td><td><input type="password" name="password"></td></tr>
- <input type="hidden" name="page" value="<?php echo $page ;?>">
- <tr><td colspan=2><center><input type="submit" value="Sign In"></center></td></tr>
- </form>
- </table>
- <br /><br /><br /><br /><pre> <a href="passrecov.php">Forget my password?</a></pre>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement