<?
session_start();
include_once "functions.inc.php";
include_once "config.php";

if ($_POST['login'] == 'OK') {
	if ($_POST['user'] != $username && $_POST['psw'] != $password) { $_SESSION['note'] = "User dan passord yang anda masukkan tidak tepat.\\n Silahkan dicoba lagi!"; redirect('gallery_login.php', 0.1); die();}
	else if ($_POST['user'] == $username && $_POST['psw'] == $password) {$_SESSION['username'] = $_POST['user']; $_SESSION['note'] = "Anda berhasil login"; redirect('gallery.php', 0.1); die();}
} 

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Administrasi gallery</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style_gallery.css" rel="stylesheet" type="text/css">

<script>

<!--

active1 = new Image(26,26);
 active1.src = "but1b.jpg";
 inactive1 = new Image(26,26);
 inactive1.src = "but1a.jpg";

active2 = new Image(26,26);
 active2.src = "but2b.jpg";
 inactive2 = new Image(26,26);
 inactive2.src = "but2a.jpg";

active3 = new Image(26,26);
 active3.src = "but3b.jpg";
 inactive3 = new Image(26,26);
 inactive3.src = "but3a.jpg";
 
active4 = new Image(26,26);
 active4.src = "but4b.jpg";
 inactive4 = new Image(26,26);
 inactive4.src = "but4a.jpg";

active5 = new Image(26,26);
 active5.src = "but5b.jpg";
 inactive5 = new Image(26,26);
 inactive5.src = "but5a.jpg";
 
active6 = new Image(26,26);
 active6.src = "but6b.jpg";
 inactive6 = new Image(26,26);
 inactive6.src = "but6a.jpg";


//-->

</script>
</head>
<body>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0"  bordercolor="#111111" width="780" id="AutoNumber1" height="100%">
    <tr>
        <td width="100%" height="243" valign="top"><img src="top.jpg" width="900" height="234"></td>
    </tr>
    <tr>
        <td width="100%" bgcolor="#000000" valign="top">
<table border="0" cellpadding="0" cellspacing="0"  bordercolor="#111111" width="100%" height="100%">
        <tr>
              <td align="center" valign="top" bgcolor="#000000"> 
                <table width="98%" border="0">
                  <tr>
                    <td>
                      <table width="100%" border="0">
                        <tr> 
                          <td width="59%" height="21"> 
                            <div align="left"><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><a href="Index.htm"><font color="#FFFFFF" size="2"><b><font size="3">Home</font></b></font></a></span></font><font color="#FF0000" size="4"><b> 
                              | </b></font><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><a href="clinic.htm"><font color="#FFFFFF" size="2"><b><font size="3">Photography 
                              Clinic</font></b></font></a></span></font><font color="#FF0000" size="4"><b> 
                              | </b></font><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><a href="gallery.php"><font color="#FFFFFF" size="2"><b><font size="3">Gallery 
                              Photo</font></b></font></a></span></font><font color="#FF0000" size="4"><b><font face="Arial" size="2" color="#FFFFFF"> 
                              </font>| </b></font><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><font color="#FFFFFF" size="2"><b><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><a href="Biography.htm"><font color="#FFFFFF" size="2"><b><font size="3">Biography</font></b></font></a></span></font></b></font> 
                              </span></font><font color="#FF0000" size="4"><b><font face="Arial" size="2" color="#FFFFFF"> 
                              </font>| </b></font><font face="Arial" size="1" color="#FFFFFF"><span lang="sk"><a href="ContactMe.htm"><font color="#FFFFFF" size="2"><b><font size="3">Contact 
                              Me</font></b></font></a></span></font></div>
                          </td>
                          <td width="40%" background="ac568.gif" height="21"> 
                            <div align="right"></div>
                          </td>
                          <td width="1%" height="21">&nbsp;</td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </table>
                <table width="98%" border="0">
                  <tr> 
                    <td bgcolor="#CC3300"><font color="#FF0000"><b><font size="4" color="#FFFFFF">Login</font></b></font></td>
                  </tr>
                  <tr> 
                    <td align="left" valign="top"> 
                      <p>Silahkan login untuk melakukan administrasi gallery:</p>
                      <form name="form1" method="post" action="">
                        <table width="725" border="0" cellspacing="0" cellpadding="2">
                          <tr align="left" valign="top"> 
                            <td width="341" align="right">Username:</td>
                            <td width="376"> 
                              <input name="user" type="text" id="user" size="22">
                            </td>
                          </tr>
                          <tr align="left" valign="top"> 
                            <td align="right" width="341">Paswword:</td>
                            <td width="376"> 
                              <input name="psw" type="password" id="psw" size="22">
                            </td>
                          </tr>
                          <tr align="left" valign="top"> 
                            <td align="right" width="341"> 
                              <input name="login" type="hidden" id="login" value="OK">
                            </td>
                            <td width="376"> 
                              <input type="submit" name="Submit" value="Login">
                            </td>
                          </tr>
                        </table>
                        <div align="center"></div>
                      </form>
                      <p>&nbsp;</p>
                    </td>
                  </tr>
                </table>
                <p>&nbsp;</p></td>
            </tr>
      </table>
        </td>
    </tr>
    <tr>
        <td width="100%" bgcolor="#CC3300" height="20" style="border-left-width: 1; border-right-width: 1; border-top: 1px solid #606060; border-bottom-width: 1"> 
          <p align="center"><font size="1" face="Arial" color="#FFFFFF">Copyright 
            © 2012 </font> 
        </td>
    </tr>
  </table>
  </center>
</div>

<!-- script by www.tetuku.com -->
</body>
</html>
<?
$note = $_SESSION['note'] ; 
if ($note != '') {
?>
<script type="text/javascript"> 
<!-----hide from old browsers 
alert('<?php echo $note ;?>'); 
//---------> 
</script> 
<? 
} 
$_SESSION['note'] = ''; $note = '';
?>