<?php
error_reporting(0);
session_start();
ob_start();
include('config.php');
?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Tailor Invoice System</title>
<meta name="description" content="#">
<meta name="author" content="">
<meta name="robots" content="#">
<meta name="viewport" content="#">
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-touch-icon-57x57-precomposed.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-precomposed.png">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/plugins.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
<body class="login">
<div id="login-container">
  <div id="login-logo" ><img src="img/tailor_logo.jpg" alt="logo"> </div>
  <?php
  if(isset($_REQUEST['login']))
{

	$username = $_REQUEST['username'];
	$password = $_REQUEST['password'];
	 $utype = $_REQUEST['utype']; 
	
	 // $data = mysql_query("select * from adminmaster where username='$username' and password='$password' and utype='$utype'") or die(mysql_error());	
	  $data = mysql_query("select * from adminmaster where username='$username' and password='$password'") or die(mysql_error());		
	  $aarry = mysql_fetch_array($data);
			
		$ue = $aarry['username'];
		$_SESSION['admin'] = $ue;
		
		$en = $aarry['emp_name'];
		$_SESSION['emp_name'] = $en; 
		
		$up = $aarry['password'];
		
		$ut = $aarry['utype']; 
		$_SESSION['utype'] = $ut; 
		
		$ui = $aarry['adminid'];	
	    $_SESSION['adminid'] = $ui; 
	
	//	if($username == $ue && $password == $up && $utype == $ut)
		if($username == $ue && $password == $up)
		  {		
		  $loginid = $_SESSION['adminid'];  
		  $logintype = $_SESSION['utype']; 
		  $loginname = $_SESSION['username']; 
		  $emp_name = $_SESSION['emp_name']; 
		  
		  
		
	?>
    <?php //if($utype == 'Succ-Director') { ?>
  <script language="javascript">window.location.href="generate_extra_invoice_add.php";</script>
  <?php //} elseif($utype == 'HK-Director') {?>
<!--  <script language="javascript">window.location.href="generate_extra_invoice_add.php";</script>-->
  <?php //} ?>
  <?php
	}
	 else 
	 {
	  echo'<script language="javascript">alert("Invalid Admin name Or Password Or Type");</script>';
	  }
   }
?>
  <form method="post" class="form-inline">
    <br>
    <div class="control-group">
      <div class="input-append">
        <input type="text" id="login-email" name="username" placeholder="Username.." required class="form-control">
        <span class="add-on"><i class="icon-envelope-alt"></i></span> </div>
    </div>
    <div class="control-group">
      <div class="input-append">
        <input type="password" id="login-password" name="password" placeholder="Password.." required class="form-control">
        <span class="add-on"><i class="icon-asterisk"></i></span> </div>
    </div>
     <!--<div class="control-group">
      <div class="input-append">
        <select id="val_skill" name="utype" style="width:280px">
<option value="">Select Type</option>
<option value="Succ-Director">Succ-Director</option>
<option value="Succ-Employee">Succ-Employee	</option>
<option value="HK-Director">HK-Director	</option>
<option value="HK-Employee">HK-Employee	</option>
                            </select>
        </div>
    </div>-->
    <div class="control-group remove-margin clearfix">
      <div class="btn-group pull-right">
        <input type="submit" class="btn btn-success" value="Login" name="login" style="margin-right:10px;">
      </div>
      <!--<a href="#" style="text-decoration:none">Forgot Password?</a>-->
    </div>
  </form>
</div>
<script src="js/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/vendor/jquery-1.9.1.min.js"%3E%3C/script%3E'));</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script>$(function(){var t=$("#login-buttons"),e=$("#login-form");$("#login-btn-email").click(function(){t.slideUp(600),e.slideDown(450)}),$(".login-back").click(function(){e.slideUp(450),t.slideDown(600)})});</script>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16158021-6']);
  _gaq.push(['_setDomainName', 'pixelcave.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>
