<?php
	include("config.php");
	error_reporting(0);
	include("include/functions.php");
	
	if(isset($_REQUEST['submit']))
	{
		$cname=$_REQUEST['cname'];
		$con_person=$_REQUEST['con_person'];
		$posting=$_REQUEST['posting'];
		$email=$_REQUEST['email'];
		$contact=$_REQUEST['contact'];
		
		$insert=mysql_query("insert into bulk_order(cname,con_person,posting,email,contact) values('$cname','$con_person','$posting','$email','$contact')");
		
		
	$to ="rosetoryan@infostech.com";
       $subject = "Amarasudhan-Bulk Orders";
	   

	$headers  = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
       $headers .= 'From:<'.$email.'>'."\r\n";
       $headers .= 'Cc: ' . "\r\n";
       $headers .= 'Bcc: ' . "\r\n";
       
       $headers .= '"Content-type: text/plain; charset=iso-8859-1"'; 
       $headers.="X-Priority: 3\r\n"; 
       $headers.="X-Mailer: smail-PHP ".phpversion()."\r\n"; 
	   
	   
	
	  $body = "
	   <html><head></head><body>
<table width=500 align=center border=1 bgcolor=#ffffff rules=none bordercolor=#669423>
<th colspan=2 bgcolor=#9ea900><font color=#ecf9ac>Bulk Order</font></th>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>Company Name:</b></td><td align=center><b>$cname</b></td></tr>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>Contact person:</b></td><td align=center><b>$con_person</b></td></tr>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>Posting:</b></td><td align=center><b>$posting</b></td></tr>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>Contact Number:</b></td><td align=center><b>$contact</b></td></tr>
</table></body></html> <br>
	  
	  Hello..,\n\n We have received your bulk order.We will contact u soon.  \n\nThanks!<br>
	   
	   ";

              	mail($to,$subject,$body,$headers);
				
				
		header("Location:bulk_order.php?ad=ad");
		
	}
?>
<script language="javascript">
	function addtocart(pid){
		document.form1.productid.value=pid;

		document.form1.command.value='add';
		document.form1.submit();
	}
</script>
<!DOCTYPE HTML>
<html>
	<head>
		<title><?php echo $tittle;?></title>
		<link href="css/style.css" rel='stylesheet' type='text/css' />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
		</script>
		<!----webfonts---->
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
		<!----//webfonts---->
		<!----start-alert-scroller---->
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery.easy-ticker.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){
			$('#demo').hide();
			$('.vticker').easyTicker();
		});
		</script>
		<!----start-alert-scroller---->
		<!-- start menu -->
		<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
		<script type="text/javascript" src="js/megamenu.js"></script>
		<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
		<script src="js/menu_jquery.js"></script>
		<!-- //End menu -->
		<!---slider---->
		<link rel="stylesheet" href="css/slippry.css">
		<script src="js/jquery-ui.js" type="text/javascript"></script>
		<script src="js/scripts-f0e4e0c2.js" type="text/javascript"></script>
		<script>
			  jQuery('#jquery-demo').slippry({
			  // general elements & wrapper
			  slippryWrapper: '<div class="sy-box jquery-demo" />', // wrapper to wrap everything, including pager
			  // options
			  adaptiveHeight: false, // height of the sliders adapts to current slide
			  useCSS: false, // true, false -> fallback to js if no browser support
			  autoHover: false,
			  transition: 'fade'
			});
		</script>
		<!----start-pricerage-seletion---->
		<script type="text/javascript" src="js/jquery-ui.min.js"></script>
		<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
		<script type='text/javascript'>//<![CDATA[ 
			$(window).load(function(){
			 $( "#slider-range" ).slider({
			            range: true,
			            min: 0,
			            max: 500,
			            values: [ 100, 400 ],
			            slide: function( event, ui ) {  $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
			            }
			 });
			$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) );
			
			});//]]>  
		</script>
		<!----//End-pricerage-seletion---->
		<!---move-top-top---->
		<script type="text/javascript" src="js/move-top.js"></script>
		<script type="text/javascript" src="js/easing.js"></script>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				$(".scroll").click(function(event){		
					event.preventDefault();
					$('html,body').animate({scrollTop:$(this.hash).offset().top},1200);
				});
			});
		</script>
		<!---//move-top-top---->
        
	</head>
	<body>
		<!---start-wrap---->
			<!---start-header---->
			<?php include("include/header.php"); ?>
			<!---//End-header---->
		<!--- start-content---->
		<div class="content login-box">
        
			<div class="login-main">
<?php
if($_REQUEST['ad']=='ad')
{ ?>
<font color='green' style="margin-left:400px; margin-top:20px;"> Added successfully.</font>
<?php } ?>
				<div class="wrap">
					<h1>BULK ORDER</h1>
					<div class="register-grids">
						<form method="post" id="chgpass1" enctype="multipart/form-data" action="">
           	   <script src="prototype.js" type="text/javascript"></script>
               <script src="validation.js" type="text/javascript"></script> 
								<div class="register-top-grid">
										<!--<h3>PERSONAL INFORMATION</h3>-->
										<div>
						<span>Company Name<label>*</label></span>
						<input type="text" name="cname" class="required"> 
					 </div>
					 <div>
						<span>Contact Person<label>*</label></span>
						<input type="text" name="con_person" class="required"> 
					 </div>
                     
                     
                      <div>
						<span>Posting<label>*</label></span>
						<input type="text" name="posting" class="required"> 
					 </div>
					 <div>
						<span>Email<label>*</label></span>
						<input type="text" name="email" class="required"> 
					 </div>
                     
                     <div>
						<span>Contact Number<label>*</label></span>
						<input type="text" name="contact" class="required"> 
					 </div>
					
                    
                     
					<div class="clear"> </div>
					 			<div class="clear"> </div>
								</div>
								<div class="clear"> </div>
								
								<div class="clear"> </div>
								<input type="submit" value="submit" name="submit" />
						</form>
                        <script type="text/javascript">
						function formCallback(result, form) 
						{
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}
						
						var valid = new Validation('chgpass1', {immediate : true, onFormValidate : formCallback});
						Validation.addAllThese([
							['validate-password', 'Your password must be more than 6 characters and not be \'password\' or the same as your name', {
								minLength : 7,
								notOneOf : ['password','PASSWORD','1234567','0123456'],
								notEqualToField : 'field1'
							}],
							['validate-password-confirm', 'Your confirmation password does not match your first password, please try again.', {
								equalToField : 'field39'

							}]
						]);
					</script>    
					</div>
				</div>
			</div>
		</div>
		<!---- start-bottom-grids---->
		<?php include("include/footer.php"); ?>
