Location: PHPKode > scripts > O-Module Easy Order Form > o-module-easy-order-form/order.php
<?php
####################################
#                       Powered by LoginetSolutions                              #
#                         www.loginetsolutions.com                                  #
####################################
include_once 'config.php';

// Generate security code.
function Random( ) {
	$chars = "ABCDEFGHJKLMNPQRSTUVWZYZ23456789";
	srand( ( double )microtime( )*1000000 );
	$i = 0;
	$pass = '';
while( $i <= 4 ) {
	$num = rand( ) % 32;
	$tmp = substr( $chars, $num, 1 );
	$pass = $pass . $tmp;
	$i++; 
} 
	return $pass; 
}

$random_code = Random();
?>
<html>
<head>
<title><?=$myCompanyName?> - O-Module Order Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
include_once 'default.css';
?>
<script language="javascript">

function validateForm() {
	var txt = "";
	var valid = false;
	str = document.orderform.email.value;
	security_code = document.orderform.security_code.value.toLowerCase();
	randomness = document.orderform.randomness.value.toLowerCase();
	
    if (document.orderform.clientname.value == "") {
        txt = txt + "Please enter your name." + "\n" ;
        document.orderform.clientname.focus();
        valid = false;

    } else if (security_code == "") {
        txt = txt + "Please enter security code." ;
        document.orderform.security_code.focus();
        valid = false;  		

    } else if (security_code != randomness) {
        txt = txt + "Please verify security code." ;
        document.orderform.security_code.focus();
        valid = false;
<?if ($shipping == 'yes'){?>
    } else if (document.orderform.address.value == "") {
        txt = txt + "Please enter the shipping address." ;
        document.orderform.address.focus();
        valid = false;
    } else if (document.orderform.city.value == "") {
        txt = txt + "Please enter the shipping city." ;
        document.orderform.city.focus();
        valid = false;
    } else if (document.orderform.zip.value == "") {
        txt = txt + "Please enter the shipping zip." ;
        document.orderform.zip.focus();
        valid = false;
    } else if (document.orderform.state.value == "") {
        txt = txt + "Please enter the shipping state." ;
        document.orderform.state.focus();
        valid = false;
    } else if (document.orderform.country.value == "") {
        txt = txt + "Please enter the shipping country." ;
        document.orderform.country.focus();
        valid = false;		
<?}?>		
    } else if (document.orderform.email.value == "") {
        txt = txt + "Please enter your email address." ;
        document.orderform.email.focus();
        valid = false;       
 
    } else if (str.length > 0) {
	 			i=str.indexOf("@")
	 			j=str.indexOf(".",i)
	 			k=str.indexOf(",")
	 			kk=str.indexOf(" ")
	 			jj=str.lastIndexOf(".")+1
	 			aa=str.lastIndexOf("@")+1
	 			len=str.length

 				if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-aa >=6) && (len-jj >=2) && (len-jj<=4)) {
 						valid = true;
 				}else {
 						alert("Please verify your email\n" + str + " isn't valid\n");
 						document.orderform.email.focus();
						valid = false; 
 				}
 				

         				
    }
    
    if (txt != "") alert (txt);		
    return valid;
}
</script>  
</head>


<body>
<form action="sendmail.php" method="post" name="orderform" onsubmit="return validateForm()">
<input name="randomness" type="hidden" id="randomness" value="<?php print $random_code; ?>" />	
<table border="0" cellspacing="0" cellpadding="0" width="624" height="26" align="center">
	<tr bgcolor="#CCCCCC" valign="middle">
		<td valign="middle" width="520" bgcolor="#F6F6F6">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td nowrap><font color="#000000"><b>&nbsp;<?=$myCompanyName?></b></font></td>
				</tr>
			</table>
		</td>
		<td valign="middle" width="80" bgcolor="#F6F6F6">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="20">
				<tr>
					<td bgcolor="#d3d3d3" nowrap align="center"><font color="#ffffff"><b>Order Form</b></font></td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC" bordercolor="#F6F6F6" width="600" align="center">
        
<tr bgcolor="#FFFFFF" valign="middle"> 
          
<td valign="middle">
	<table border="0" cellspacing="6" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#F6F6F6" width="100%" align="center">
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;Personal Information
			</td>
		</tr>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Your name<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" id="clientname" name="clientname">
			</td>
		</tr>
		<?if ($company == 'yes'){?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Company
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="company" id="company">
			</td>
		</tr>
		<?}
		if ($website == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Website
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="website" id="website">
			</td>
		</tr>
		<?}		
		if ($phone == 'yes'){
		?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Phone
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="phone" id="phone">
			</td>
		</tr>
		<?}?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Email<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="email" id="email">
			</td>
		</tr>
		<?
		if ($contactmeby == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Contact me by
			</td>          
			<td valign="middle" width="480">
		             <SELECT id="howcontact" name="howcontact">
                		<option value="Email">Email</option>
                		<option value="Phone">Phone</option>
              		     </SELECT>
			</td>
		</tr>
		<?}
		if ($shipping == 'yes'){
		?>
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;Shipping address
			</td>
		</tr>			
		<?
		if ($ship_address == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Address<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="address" id="address">
			</td>
		</tr>
		<?}		
		if ($ship_city == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;City<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="city" id="city">
			</td>
		</tr>
		<?}		
		if ($ship_zip == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Zip<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="zip" id="zip">
			</td>
		</tr>
		<?}			
		if ($ship_state == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;State<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="state" id="state">
			</td>
		</tr>
		<?}					
		if ($ship_country == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;Country<font color="red">*</font>
			</td>          
			<td valign="middle" width="480">
				<input type="text" name="country" id="country">
			</td>
		</tr>
		<?}}	
		?>
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;Product Description 
			</td>
		</tr>		
		<?
		if ($interestedin > 0){
		?>		
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="120">
				&nbsp;I'm interested in 
			</td>          
			<td valign="middle" width="480">
			    <SELECT id="interest" name="interest">
				<?for ( $i = 1; $i <= $interestedin; $i += 1){?>
                		<option value="<?=$interestedInOpt[$i]?>"><?=$interestedInOpt[$i]?></option>
				<?}?>		
       		    </SELECT>
			</td>
		</tr>
		<tr valign="middle">       
			<td valign="middle" width="600" colspan="2">
			<table width="600" cellpadding="2" cellspacing="2" style="border:1px solid #000000;"><tr>
			<td valign="middle" width="120">Image
			</td>
			<td valign="middle" width="440">&nbsp;Description
			</td>
			<td valign="middle" align="center" width="20">Qty
			</td>			
			<td valign="middle" width="20">
			</td>
			</tr></table>
			</td>
		</tr>		
		<?}
		if ($category1 > 0) {
		?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="600" colspan="2">
				&nbsp;<?=$cat1Name;?> 
			</td>          
		</tr>			
		<? for ( $i = 1; $i <= $category1; $i += 1) {?>
		<tr valign="middle">       
			<td valign="middle" width="600" colspan="2">
			<table width="600" cellpadding="2" cellspacing="2" style="border:1px solid #000000;"><tr>
			<td valign="middle" width="120"><img alt="" border="0" src="<?=$path.$cat1Imgs[$i];?>" />
			</td>
			<td valign="middle" width="440"><?=$cat1OptDesc[$i];?>
			</td>
			<td valign="middle" align="center" width="20"><?=$cat1Qty[$i];?>
			</td>			
			<td valign="middle" width="20">
				<input type="checkbox" style="width:20px;background:#FFFFFF;border:0px;" name="cat1[]" value="<?=$cat1OptDesc[$i];?>">
			</td>
			</tr></table>
			</td>
		</tr>		
		
		<?}
		}
		if ($category2 > 0) {
		?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="600" colspan="2">
				&nbsp;<?=$cat2Name;?> 
			</td>          
		</tr>		
		<? for ( $i = 1; $i <= $category2; $i += 1) {?>
		<tr valign="middle">       
			<td valign="middle" width="600" colspan="2">
			<table width="600" cellpadding="2" cellspacing="2" style="border:1px solid #000000;"><tr>
			<td valign="middle" width="120"><img alt="" border="0" src="<?=$path.$cat2Imgs[$i];?>" />
			</td>
			<td valign="middle" width="440"><?=$cat2OptDesc[$i];?>
			</td>
			<td valign="middle" align="center" width="20"><?=$cat2Qty[$i];?>
			</td>			
			<td valign="middle" width="20">
				<input type="checkbox" style="width:20px;background:#FFFFFF;border:0px;" name="cat2[]" value="<?=$cat2OptDesc[$i];?>">
			</td>
			</tr></table>
			</td>
		</tr>		
		
		<?}		
		}
		if ($category3 > 0) {
		?>
		<tr valign="middle"> 
			<td valign="middle" bgcolor="#F6F6F6" width="600" colspan="2">
				&nbsp;<?=$cat3Name;?> 
			</td>          
		</tr>			
		<? for ( $i = 1; $i <= $category3; $i += 1) {?>
		<tr valign="middle">       
			<td valign="middle" width="600" colspan="2">
			<table width="600" cellpadding="2" cellspacing="2" style="border:1px solid #000000;"><tr>
			<td valign="middle" width="120"><img alt="" border="0" src="<?=$path.$cat3Imgs[$i];?>" />
			</td>
			<td valign="middle" width="440"><?=$cat3OptDesc[$i];?>
			</td>
			<td valign="middle" align="center" width="20"><?=$cat3Qty[$i];?>
			</td>			
			<td valign="middle" width="20">
				<input type="radio" style="width:20px;background:#FFFFFF;border:0px;" name="cat3[]" value="<?=$cat3OptDesc[$i];?>">
			</td>
			</tr></table>
			</td>
		</tr>		
		
		<?}			
		}
		if ($uploadFiles > 0) {
		?>
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;File(s) Upload(s) | *.zip, *.rar, *.gif, *.jpg <br>&nbsp;Max file size: 1024kb. | Total upload: 2048kb.
			</td>
		</tr>
		<?}
		if ($miscInfo == "yes") {
		?>		
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;Miscellaneous Information
			</td>
		</tr>			
		<?
		}
		if ($comments == 'yes'){
		?>		
		<tr valign="middle"> 
			<td valign="top" bgcolor="#F6F6F6" width="120">
				&nbsp;Commnents 
			</td>          
			<td valign="middle" width="480">
			    <TEXTAREA id="comments" name="comments" rows="3"></TEXTAREA>
			</td>
		</tr>	
		<?}?>	
		<tr valign="middle"> 
			<td valign="top" bgcolor="#F6F6F6" width="120" height="32">
				&nbsp;Enter security code<br>
				<center><b><span style="font-size:21px;color:red;"><?php echo $random_code; ?></span></b></center>
			</td>          
			<td valign="top" width="480">
			    <input name="security_code" type="text" id="security_code" size="5">
			</td>
		</tr>	
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#f6f6f6" width="600" colspan="2">&nbsp;<font color="red">*</font> = required fields
			</td>
		</tr>		
		
		<?if ($terms != "") {?>	
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#d8d8d8" width="600" colspan="2">&nbsp;Terms & Conditions
			</td>
		</tr>
		<tr valign="middle"> 
			<td valign="middle" height="20" bgcolor="#f6f6f6" width="600" colspan="2">
			<?=$terms;?>
			<br>
			</td>
		</tr>
		<?}?>
		<tr height="40" valign="top"> 
			<td valign="middle" align="center" width="120"><a href="http://loginetsolutions.com"><img src="images/omodule.jpg" alt="" border="0"></a></td>
			<td valign="middle" align="center" width="480">
				<input type="submit" name="Submit" value="Send Order">
			</td>          
		</tr>										
	</table>		
</td>
</tr>
</table>
<br>
</form>
</body>
</html>
Return current item: O-Module Easy Order Form