<?php require_once('Connections/ameritek.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['textfield'])) {
  $loginUsername=$_POST['textfield'];
  $password=$_POST['textfield2'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "admin_home.php";
  $MM_redirectLoginFailed = "admin_fail.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_ameritek, $ameritek);
  
  $LoginRS__query=sprintf("SELECT username, password FROM users WHERE username=%s AND password=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $ameritek) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ameritek ||  Exporter &amp; Suppliers of Beauty  Instruments</title>
<link rel="stylesheet" href="c/reset.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="c/screen.css" type="text/css" media="screen, projection" />
        <!--[if lte IE 6]>
		<link rel="stylesheet" href="/c/ie6.css" type="text/css" />
	<![endif]-->
        <link rel="stylesheet" href="c/p.css" type="text/css" media="print" />

        <link rel="stylesheet" href="c/slimbox2.css" type="text/css" media="screen, projection" />
        <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="./jquery.effects.core.min.js"></script>
<script type="text/javascript" src="./jquery.effects.blind.min.js"></script>
<script type="text/javascript" src="./jquery.effects.bounce.min.js"></script>
<script type="text/javascript" src="./jquery.effects.clip.min.js"></script>
<script type="text/javascript" src="./jquery.effects.drop.min.js"></script>
<script type="text/javascript" src="./jquery.effects.fold.min.js"></script>
<script type="text/javascript" src="./jquery.effects.scale.min.js"></script>
<script type="text/javascript" src="./jquery.effects.slide.min.js"></script>
<script type="text/javascript" src="./wb.slideshow.js"></script>
<script type="text/javascript">
<!--
function PreloadImages()
{
   var imageObj = new Image();
   var images = new Array();
   images[0]="./images/1 copy.jpg";
   images[1]="./images/2 copy.jpg";
   images[2]="./images/3 copy.jpg";
   images[3]="./images/4 copy.jpg";
   for (var i=0; i<=3; i++)
   {
      imageObj.src = images[i];
   }
}
// -->
</script>
<script type="text/javascript">
$(document).ready(function()
{
   $("#SlideShow1").slideshow(
   {
      interval: 3000,
      type: 'sequence',
      effect: 'clip',
      direction: 'horizontal',
      effectlength: 1000
   });
});
</script>
</head>
<body>
<div id="main">
        
  <div class="container">
    <div class="logo"><img src="images/ameritek_01.jpg"/></div>
    <div class="menu_header"><img src="images/ameritek_02.jpg" alt="" /></div>
	<div class="manu_active"> <a href="index.html" class="zee"> <img src="images/ameritek_03.jpg" /></a> </div>
    <div class="manu_item"> <a href="about_us.html" class="zee"> <img src="images/ameritek_04.jpg" /> </a> </div>
	<div class="manu_item"> <a href="products.html" class="zee"> <img src="images/ameritek_05.jpg" /> </a> </div>
    <div class="manu_item"> <a href="sitemap.html" class="zee"> <img src="images/ameritek_06.jpg" /></a> </div>
    <div class="manu_item"> <a href="gallery.html" class="zee"> <img src="images/ameritek_07.jpg" /> </a> </div>
	<div class="manu_item"> <a href="contact_us.html" class="zee"> <img src="images/ameritek_08.jpg" /> </a> </div>
	<div class="manu_item"><img src="images/ameritek_09.jpg" /></div>
	<div class="menu_footer"><img src="images/ameritek_10.jpg" alt="" /></div>
  </div>
  
  
  <div class="b_container">
  	<div class="b_pic"><img src="images/ameritek_11.jpg"/></div>
	<div class="b"><img src="images/ameritek_12.jpg"/></div>
	<div class="b_text"><div id="wb_Flash2" style="margin:0;padding:0;position:absolute;left:450px;top:150px;width:586px;height:58px;text-align:left;z-index:7;">
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="586" height="58" id="Flash2">
	<param name="movie" value="wel.swf">
	<param name="quality" value="High">
	<param name="scale" value="ExactFit">
	<param name="wmode" value="Transparent">
	<param name="play" value="true">
	<param name="loop" value="true">
	<param name="menu" value="false">
	<param name="allowfullscreen" value="false">
	<param name="allowscriptaccess" value="sameDomain">
	<param name="sAlign" value="tl">
	<embed src="wel.swf" width="586" height="58" quality="High" wmode="Transparent" loop="true" play="true" menu="false" allowfullscreen="false" allowscriptaccess="sameDomain" scale="ExactFit" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
	</embed>
	</object>
	</div></div>  					  		    
  </div>
 	
	<div id="content">
		<div class="content_img"><img src="images/ameritek_14.jpg" alt=""/></div>
		<div class="content_imgn"></div>
		<div class="content_img"><img src="images/ameritek_17.jpg" alt=""/></div>
	</div>
	<div><img src="images/ameritek_18.jpg" alt="" /></div>
	<div id="content2">
		<div class="content_img"><img src="images/ameritek_19.jpg" alt=""/></div>
		<div class="content_imgm"><table width="660">
  <tr>
    <td align="left" class="td" width="330">*Because of good and reliable customer service</td>
	<td align="left" class="td" width="330">*A special discount for bulk orders</td>
  </tr>
  <tr>
    <td align="left" class="td">*Risk free sale</td>
    <td align="left" class="td">*A complete satisfaction</td>
   
  </tr>
  <tr>
    <td align="left" class="td">*A large range of variety</td>
    <td align="left" class="td">*Dn't forget to get you free gift hamper on sale over £8</td>
    
  </tr>
   <tr>
    <td align="left" class="td">*Reasonable prices</td>
    <td align="left" class="td">*Replacement Warranty </td>
  </tr>
  
</table>
	</div>
		<div class="content_img"><img src="images/ameritek_21.jpg" alt=""/></div>
		<div class="content_imgp"><marquee behavior="alternate" direction="up"><p align="center">News & Events goes here</p></marquee></div>
		<div class="content_img"><img src="images/ameritek_23.jpg" alt=""/></div>
	</div>
	<div><img src="images/ameritek_24.jpg" alt="" /></div>
	<div id="content3">
		<div class="content_img"><img src="images/ameritek_25.jpg" alt=""/></div>
		<div class="content_imgq">
		<table width="660">
  <tr>
    <td align="center" class="td" colspan="3"><p align="center"><strong>ADMIN LOGIN</strong></p>
    <p><form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
          <table border="0" style="border:none;">
            <tr border="0">
              <td style="border:none;" class="td">User Name</td>
              <td style="border:none;"><input type="text" name="textfield" id="textfield" /></td>
            </tr>
            <tr>
              <td style="border:none;" class="td">Password</td>
              <td style="border:none;"><input type="password" name="textfield2" id="textfield2" /></td>
            </tr>
            <tr>
              <td style="border:none;" class="td">&nbsp;</td>
              <td style="border:none;"><input type="submit" name="button" id="button" value="Submit" style="width:80px; color:#FFF; background-color:#999;" /></td>
            </tr>
          </table>
        </form></td>
  </tr>
</table>
</div>
		<div class="content_img"><img src="images/ameritek_27.jpg" alt=""/></div>
		<div class="content_img"><img src="images/ameritek_28.jpg" alt=""/></div>
	</div>				  
	 <div class="box">
        <div class="box_text" align="center">
			  <p align="center"><a href="index.html"> Home</a> | <a href="about_us.html">About Us</a> |
			   <a href="products.html">Product</a> | <a href="sitemap.html">Sitemap</a> |
			    <a href="gallery.html">Inquiry</a> | <a href="contact_us.html">Contact Us</a></p>
			  Copyright 2011-2015 Ameritek, All Rights Reserved.<br />email: info@ameritek.com<br />
			  Developed By: Rameez Javed | Umair Yaqub</p>
		</div>
	 </div>
	 
	 
      
</div>
<div id="SlideShow1" style="position:absolute;left:544px;top:222px;width:502px;height:179px;z-index:5">
<img style="border-width:0;left:0px;top:0px;width:502px;height:179px;" src="images/1_copy.jpg" alt="">
<img style="border-width:0;left:0px;top:0px;width:502px;height:179px;" src="images/2_copy.jpg" alt="">
<img style="border-width:0;left:0px;top:0px;width:502px;height:179px;" src="images/3_copy.jpg" alt="">
<img style="border-width:0;left:0px;top:0px;width:502px;height:179px;" src="images/4_copy.jpg" alt=""></div>
<div id="wb_Flash1" style="margin:0;padding:0;position:absolute;left:66px;top:380px;width:862px;height:131px;text-align:left;z-index:6;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="862" height="131" id="Flash1">
<param name="movie" value="trans_star.swf">
<param name="quality" value="High">
<param name="scale" value="ExactFit">
<param name="wmode" value="Transparent">
<param name="play" value="true">
<param name="loop" value="true">
<param name="menu" value="false">
<param name="allowfullscreen" value="false">
<param name="allowscriptaccess" value="sameDomain">
<param name="sAlign" value="tl">
<embed src="trans_star.swf" width="862" height="131" quality="High" wmode="Transparent" loop="true" play="true" menu="false" allowfullscreen="false" allowscriptaccess="sameDomain" scale="ExactFit" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
</div>	

</body>
</html>
