<? $pageTitle = 'Careers'; ?>
<? include 'common/header.php';?>


<?	
 $submit=trime($_POST['submit']);
if($submit!=''){

 $name = trime($_POST['name']);
 $profession = trime($_POST['profession']);
 $mobile = trime($_POST['mobile']);
 $email = trime($_POST['email']);
 $cv = trime($_POST['cv']);
 $message = trime($_POST['message']);


 			if($name=='')
				$msg.="- Please enter your Full Name<br>";
			if($mobile=='')
				$msg.="- Please enter your Mobile<br>";
			if($email=='')
				$msg.="- Please enter your email<br>";

			if ($result=file_upload('cv','images/cvs/',$msg)) $cv=$result['name'];



 if ($msg==""):
  $strSQL="cvs set 
  name = '".sqlencode($name)."',
  profession = '".sqlencode($profession)."',
  mobile = '".sqlencode($mobile)."',
  email = '".sqlencode($email)."',
  cv = 'images/cvs/".sqlencode($cv)."',
  message = '".sqlencode($message)."',
  checked = '0'";




$strSQL ="insert into ".$strSQL;
		  mysql_query($strSQL);
		  
		  $msg="Thank you!<br /> We will be in contact with you soon!<br /><br />"; 
		 
		  $to="info@lipsmackingdesign.com";
		  $subject="New Applicant [Website Form]";
$body="Some one has submited a new CV on your website.<br>
To check all your submissions please login to the admin section by following this link: ".HTML_SITE."/admin <br>
<br>
Thank you,<br><br>
Client's Name";
		  
		  sendmail($to,$subject,$body);
		 endif;
	}
?>



<? echo "<br /><p class='form-message'>".$msg."</p>"; ?>
<br /><br />
 <form action="<? echo $filename; ?>" method="post" name="myform" enctype="multipart/form-data">
 <table cellpadding="2">
 <tr>
  <th align="left"><span class="highlight">Full Name:</span></th>
  <td><input class="cust" type="text" name="name" value="<? echo textencode($name) ?>" size="35"></td>
 </tr>
  <tr>
  <th align="left"><span class="highlight">Profession:</span></th>
  <td><input class="cust" type="text" name="profession" value="<? echo textencode($profession) ?>" size="35"></td>
 </tr>
 <tr>
  <th align="left"><span class="highlight">Mobile:</span></th>
  <td><input class="cust" type="text" name="mobile" value="<? echo textencode($mobile) ?>" size="35"></td>
 </tr>
 <tr>
  <th align="left"><span class="highlight">Email:</span></th>
  <td><input class="cust" type="text" name="email" value="<? echo textencode($email) ?>" size="35"></td>
 </tr>
 <tr>
  <th align="left"><span class="highlight">CV to upload:</span></th>
  <td><div class="cust" style="width:100px;"><? file_field_cust('cv','images/cvs',50);?></div></td>
 </tr> 
  <tr>
  <th align="left"><span class="highlight">Message:</span></th>
  <td><textarea class="cust" name='message' id='message' cols='51' rows='6'></textarea></td>
 </tr>
</table>
<div style="text-align:right; width:390px;"><input class="cust" type="submit" name="submit" value="SUBMIT"></div>
 </form>

<br><br>
	
<? get_careers_text(); ?>


<? include 'common/footer.php';?>