<?
	include("head.php");
	include("../include/db.inc.php");
	include("../include/pager.php");
	$db1=new db;
    $db1->open();mysql_query("SET NAMES 'utf8'");

	if($_SESSION['uid']=='' || $_SESSION['pwd']=='')
	{
		//header("location:login.php");
	}
	
	
	
	if( ( ( isset($_FILES['file1']) && $_FILES['file1']['size'] )  ||
	    ( isset($_FILES['file2']) && $_FILES['file2']['size'] ) ||
		( isset($_FILES['file3']) && $_FILES['file3']['size'] ) || 
		( isset($_FILES['file4']) && $_FILES['file4']['size'] ) ) 
		&& isset($_POST['upload']))
	{
	  	$hotid=$_GET['hotid'];
	
		
		if(is_uploaded_file($_FILES['file1']['tmp_name']) && $_FILES['file1']['name']!='')
		{
			$move=move_uploaded_file($_FILES['file1']['tmp_name'],'../hotspot/'.$_FILES['file1']['name']);
			if($move)
			{
			
				$query = "insert into  hotspot_img set hotid='$hotid',img='".$_FILES['file1']['name']."'";
				$res=mysql_query($query) or die(mysql_error());	
								
			}		
		}
		
			
			
		if(is_uploaded_file($_FILES['file2']['tmp_name']) && $_FILES['file2']['name']!='')
		{
			$move=move_uploaded_file($_FILES['file2']['tmp_name'],'../hotspot/'.$_FILES['file2']['name']);
			if($move)
			{			
				$query = "insert into  hotspot_img set hotid='$hotid',img='".$_FILES['file2']['name']."'";
				$res=mysql_query($query) or die(mysql_error());	
			}		
		}
		
		if(is_uploaded_file($_FILES['file3']['tmp_name']) && $_FILES['file3']['name']!='')
		{
			$move=move_uploaded_file($_FILES['file3']['tmp_name'],'../hotspot/'.$_FILES['file3']['name']);
			if($move)
			{
			    $query = "insert into  hotspot_img set hotid='$hotid',img='".$_FILES['file3']['name']."'";
				$res=mysql_query($query) or die(mysql_error());	
			}
		
		}
		
		if(is_uploaded_file($_FILES['file4']['tmp_name']) && $_FILES['file4']['name']!='')
		{
			$move=move_uploaded_file($_FILES['file4']['tmp_name'],'../hotspot/'.$_FILES['file4']['name']);
			if($move)
			{
				$query = "insert into  hotspot_img set hotid='$hotid',img='".$_FILES['file4']['name']."'";
				$res=mysql_query($query) or die(mysql_error());	
			}
		
		}	
	
	header("location:list_hotspot.php");
}	
	
	

?>
<!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>Hotspots for the site</title>

<style>
.a1{color:#000000}
a:hover {text-decoration: none; color:#000000}
.style3 {
	font-family: "Times New Roman", Times, serif;
	font-size: 24px;
	font-style: italic;
	color: #FFFFFF;
}
</style>

<script language="javascript">
function validate()
{

     if(document.frm.file1.value=='')
	{
		 alert("Browse Your Photo");
		 document.frm.file1.focus();
		return false;

	} 

	

	}
	</script>
	</head>
<body bgcolor="#ffffff">
<div class="admin_wrapper">
<div class="logo_show"><? include("minorlogout.php");?></div>
<div style="float:left; width:200px">
<div class="topg_links_show"><? include("left.php");	?></div>
<div class="top_links_show"><? include("belowleft1.php");	?></div></div>
<div style="float:left; width:800px">
<div class="maximum">

<!-- ImageReady Slices (apanel.psd) -->

<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
	
	<tr>
		<td  width="15%" >
		<!--Start Left Panel-->
		
		<?
			include("left.php");
		?>
		<!--End Left Panel-->
		
		</td>
		<td colspan="2"  width="85%">
		<!--Start Main Body-->
		
		<form name="frm" action="" method="post" enctype="multipart/form-data"  onSubmit="return validate();">
		<table width="92%" border="0" cellpadding="5" cellspacing="5" style="margin-left:50px; margin-top:50px">         
          <tr height="35px">
                <td><input name="file1" type="file" class="whiteselect"  id="file1" style="width:180px" /></td>
              </tr>
              <tr height="35px">
                <td><input name="file2" type="file" class="whiteselect" id="file2" style="width:180px" /></td>
              </tr>
              <tr height="35px">
                <td><input name="file3" type="file" class="whiteselect"  id="file3" style="width:180px" /></td>
              </tr>
              <tr height="35px">
                <td><input name="file4" type="file" class="whiteselect"  id="file4" style="width:180px" /></td>
              </tr>
			  <tr height="35px">
			  <td><input name="upload" type="submit" class="inputsubmit" id="upload" value="Upload Photos" /></td>
			  </tr>
        </table>
		</form>
		<!--End Main Body--></td>
	</tr>
	
</table>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::center ends:::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->

</div></div>
<div class="bottom_links_show"><? include("footer.php");	?></div>
</div>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer ends:::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</body>
</html>






