<?php
$session  =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));
?>

<?php 
$db =& JFactory::getDBO();
$id = $db->insertid();

?>

</script>

<?php
$script = "
var text_9_val = new LiveValidation('postalcode', {
  validMessage: ''
});
text_9_val.add(
  Validate.Format, {
    pattern: /(^s*([a-z](\s)?\d(\s)?){3}$)s*/i,
    failureMessage: 'A9A 9A9 Format!'
});
var homephone = new LiveValidation('homephone', {
  validMessage: ''
});
homephone.add(
  Validate.Format, {
              
    pattern: /^\({1}[2-9]\d{2}\){1}\s?\d{3}\-\d{4}$/,
    failureMessage: '(999)999-9999 Format!'
});
var workphone = new LiveValidation('workphone', {
  validMessage: ''
});
workphone.add(
  Validate.Format, {
      
    pattern: /^\({1}[2-9]\d{2}\){1}\s?\d{3}\-\d{4}$/,
    failureMessage: '(999)999-9999 Format!'
});
var emg_homeph = new LiveValidation('emg_homeph', {
  validMessage: ''
});
emg_homeph.add(
  Validate.Format, {
      
    pattern: /^\({1}[2-9]\d{2}\){1}\s?\d{3}\-\d{4}$/,
    failureMessage: '(999)999-9999 Format!'
});
var emg_workph = new LiveValidation('emg_workph', {
  validMessage: ''
});
emg_workph.add(
  Validate.Format, {
      
    pattern: /^\({1}[2-9]\d{2}\){1}\s?\d{3}\-\d{4}$/,
    failureMessage: '(999)999-9999 Format!'
});


var account_no = new LiveValidation('account_no', {
  validMessage: ''
});
account_no.add(
  Validate.Format, {
      pattern: /^[0-9]{4} {0,1}[0-9]{4} {0,1}[0-9]{4} {0,1}[0-9]{4}?/,
    //pattern: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
    failureMessage: 'Invalid Account Number'
});
var firstname = new LiveValidation('firstname', {
  validMessage: ''
});
firstname.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var lastname = new LiveValidation('lastname', {
  validMessage: ''
});
lastname.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var birthdate = new LiveValidation('birthdate', {
  validMessage: ''
});
birthdate.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});

var startdate = new LiveValidation('startdate', {
  validMessage: ''
});
startdate.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var tstartdt = new LiveValidation('tstartdt', {
  validMessage: ''
});
tstartdt.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var tenddt = new LiveValidation('tenddt', {
  validMessage: ''
});
tenddt.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var papstartdt = new LiveValidation('papstartdt', {
  validMessage: ''
});
papstartdt.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
var expirydate = new LiveValidation('expirydate', {
  validMessage: ''
});
expirydate.add(
  Validate.Format, {
      
    pattern: /[^ ]$/,
    failureMessage: 'Space should not be accepted'
});
";

jimport('joomla.environment.browser');
$browser = JBrowser::getInstance();
if ( $browser->getBrowser() == 'msie' ) {
  $loader = 'load';
} else {
  $loader = 'domready';
}
$doc =& JFactory::getDocument();
$script = "window.addEvent('$loader', function() { $script });";
$doc->addScriptDeclaration($script);
?>
<?php
$user =& JFactory::getUser();
?>
<input type='hidden' name='cf_user_id' value='<?php echo $user->id; ?>' />
<table>
	<tr>
		<td style="padding-left:7px;">
			<fieldset style="width:600px;">
				<legend>Student Name</legend>
				<table>
				       <tr>
						<td>
							<label>First</label>
							<input type="text" size="10" name="firstname" id="firstname" style="border-top:1px solid #767676;
  border-left:1px solid #767676;"/>
						</td>
						<td>
							<label>Last</label>
							<input type="text" size="10" name="lastname" id="lastname" style="border-top:1px solid #767676;
  border-left:1px solid #767676;"/>
						</td>
						<td>
							<label>Birth</label>
							<input type="text" size="15" name="birthdate" id="birthdate" style="border-top:1px solid #767676;
  border-left:1px solid #767676;"/>
						</td>
						<td>
							
						</td>
					</tr>
				</table>
			</fieldset>
		</td>
	</tr>
	<tr>
		<td style="padding-left:7px;">
			<fieldset style="width:600px;">
				<legend>Address</legend>
				<table>
					<tr>
						<td><div style="float:left;padding-right:3px; text-align:left;"><label>Suite</label><br/><input type="text" size="7" name="suite" id="suite"  style="border-top:1px solid #767676;border-left:1px solid #767676;"/></div><div style="float:left;"><label>Address</label><br/><input type="text" size="10" name="address" id="address" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></div></td>
						
						<td><label>Street</label><br/><input type="text" size="25" name="street" id="street" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></td>
						<td><label>Home Phone(Evening)</label><br/><input type="text" size="15" name="homephone" id="homephone" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></td>
					</tr>
				
					<tr>
						<td><label>City</label><br/><input type="text" size="20" name="city" id="city" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></td>
						<td><div style="float:left; padding-right:3px;"><label>Province</label><br/><input type="text" size="10" name="province" id="province" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></div><div style="float:left;"><label>Postal Code</label><br/><input type="text" size="12" name="postalcode" id="postalcode" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></div></td>
				                <td><label>Work Phone(Daytime)</label><br><input type="text" size="15" name="workphone" id="workphone" style="border-top:1px solid #767676;border-left:1px solid #767676;"/></td>
					</tr>
				</table>
			</fieldset>
	     </td>
	</tr>
	<tr>
	     <td>
			<table>
			     <tr>
			     	  <td>
			     	    	<table>
			     	    		<tr>
			     	    			<td>
							     	<fieldset>
									<legend>Emergency Contact</legend>
										<table width="100%">
											<tr>
												<td>
													<div style="float:left; padding-right:20px; text-align:left;">
													<label>First Name</label></div>
													<div style="float:left;text-align:left;">
													<input type="text" size="20" name="emg_fname" id="emg_fname" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
												</td>
											</tr>
											<tr>
											   	<td>
											   		<div style="float:left; padding-right:21px;">
											   		<label>Last Name</label></div>
											   		<div style="float:left;">
											   		<input type="text" size="20" name="emg_lname" id="emg_lname" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
											   		</div>
											   	</td>
											</tr>
											<tr>
											 	<td>
											 		<div style="float:left; padding-right:10px;">
											 		<label>Home Phone(Evening)</label></div>
											 		<div style="float:left;">
											 		<input type="text" size="13" name="emg_homeph" id="emg_homeph" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
											 		</div>
											 	</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:14px;">
													<label>Work Phone(Daytime)</label></div>
													<div style="float:left;">
													<input type="text" size="13" name="emg_workph" id="emg_workph" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
												</td>
											</tr>
										</table>
								</fieldset>
				     			</td>
				 		</tr>
				 		<tr>
				 			<td>
								<fieldset>
									<legend>Membership Info</legend>
										<table>
											<tr>
												<td>
													<div style="float:left; padding-right:20px; padding-left:41px;">
													<label>Start Date</label>
													</div>
													<div style="float:left;">
													<input type="text" size="15" name="startdate" id="startdate" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
    
  </div>
												</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:28px; padding-left:40px;">
													        <label>Program</label></div>
													<div style="float:left;">
														<select name="program" style="width:140px;" title="Please select a program">
 							            						    <option value="none">none</option>
		                         									     <option value="30 Minute Hit">30 Minute Hit</option>
														</select>
													</div>
												</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:40px; padding-left:40px;">
													        <label>Status</label></div>
													<div style="float:left;">
														<select name="status" style="width:140px;" title="Please select a status">
					<option value="none">none</option>										   <option value="active">active</option>
															   <option value="onhold">on hold</option>
															   <option value="expired">expired</option>
															   <option value="potential">potential</option>
														</select>
													</div>
												</td>
											</tr>
                                            <tr>
												<td>
													<div style="float:left; padding-right:40px; padding-left:40px;">
													        <label>Hold Start Date</label></div>
													<div style="float:left;">
													<input type="text" size="15" name="hold_start_date" id="hold_start_date" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
												</td>
											</tr>
                                            <tr>
												<td>
													<div style="float:left; padding-right:40px; padding-left:40px;">
													        <label>Hold End Date</label></div>
													<div style="float:left;">
													<input type="text" size="15" name="hold_end_date" id="hold_end_date" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
												</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:30px;">
													    <label>Term Start Date</label></div>
													<div style="float:left;">
													   <input type="text" size="15" name="tstartdt" id="tstartdt" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div> 
												</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:45px;">
													        <label>Term Length</label></div>
													<div style="float:left;">
														<select name="tlength" style="width:140px;" title="Please select a term length">
																 <option value="">none</option>
																 <option value="6months">6months</option>
														</select>
													</div>
												</td>
											</tr>
											<tr>
												<td>
													<div style="float:left; padding-right:32px;">
													      <label>Term End Date</label></div>
													<div style="float:left;">
													      <input type="text" size="15" name="tenddt" id="tenddt" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
													</div>
												</td>
											</tr>
										</table>
								</fieldset>
				 			</td>
				 		</tr>
				 	</table>
				 </td>
				 <td>
				    	<table>
				    	      <tr>
				    	           <td>
                                                  <label>Student E-mail</label>
                                                   </td>
                                              </tr>
                                               <tr>
                                                 <td>
<input type="text" size="30" name="email" id="email" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
                 </td>
				    	      </tr>
				    	     
				    	</table>
				    	<fieldset>
						<legend>Financial</legend>
							<table>
								<tr>
									<td>
										<div style="float:left; padding-right:35px;">
										    <label>Sign-up Fee</label>
										</div>
										<div style="float:left;">

											<input type="text" size="15" value="$0.00" name="signfee" id="signfee" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div style="float:left; padding-right:10px;">
											<label>Payment Method</label></div>
										<div style="float:left;">
											<select name="payment_method" style="width:140px;" title="Please select a payment method">
											      <option value="">none</option>
											      <option value="PAP">PAP</option>
											      <option value="cheque">Cheque</option>
											      <option value="cash">Cash</option>
											      <option value="contra">Contra</option>
											      <option value="visa">Visa</option>
											      <option value="mastercard">Mastercard</option>
											      <option value="American-Express">American Express</option>
											      <option value="debit">Debit</option>
											</select>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div style="float:left; padding-right:30px;">
										      <label>Monthly Rate</label></div>
										<div style="float:left;">
										      <input type="text" size="15" value="$0.00" name="monthly_rate" id="monthly_rate" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div style="float:left; padding-right:10px;">
										    <label>Payment Method</label></div>
										<div style="float:left;">
											<select name="monthly_pmethod" style="width:140px;" title="Please select a payment method">
											      <option value="">none</option>
											      <option value="PAP">PAP</option>
											      <option value="cheque">Cheque</option>
											      <option value="cash">Cash</option>
											      <option value="contra">Contra</option>
											      <option value="visa">Visa</option>
											      <option value="mastercard">Mastercard</option>
											      <option value="American-Express">American Express</option>
											      <option value="debit">Debit</option>
											</select>
										</div>
									</td>
								</tr>
								<tr>
									<td>
									     <div style="float:left; padding-right:22px;">
									          <label>PAP Start Date</label></div>
									     <div style="float:left;">
									     	<input type="text" size="15" value="" name="papstartdt" id="papstartdt" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
									     </div>
									</td>
								</tr>
<tr>
									<td>
										<div style="float:left;">
										   <label>Card Account Number</label></div><br/>
										<div style="float:left;">
										   <input type="text" size="33" value="" name="account_no" id="account_no" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div style="float:left; padding-right:40px;">
										    <label>Expiry Date</label></div>
										<div style="float:left;">
										   <input type="text" size="15" value="" name="expirydate" id="expirydate" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div style="float:left; padding-right:15px;">
											<label>Student Number</label></div>
										<div>
	<input type="text" size="15" value="" name="student_no" id="student_no" style="border-top:1px solid #767676;border-left:1px solid #767676;"/>
  	    							      
										</div>
									</td>
								</tr>

<tr>
    <td>
										       <div style="float:left; padding-right:15px;">
	<label>Prepaid</label>
       </div>
										      <div style="float:left; padding-left:45px;">
<select name="prepaid" style="width:140px;" title="Please select a prepaid">
											      <option>select</option>
                <option value="Yes">Yes</option>
                  <option value="No">No</option>

</select>

<input type="hidden" name="freetrial_id" id="freetrail_id" value="{ freetrial_id}">									     </div>
     </td>
</tr> 

							</table>
					</fieldset>
				 </td>
				 <td>
				 	<table>
				 		<tr>
				 			<td>
				 			   	<label>Notes</label>
				 			</td>
				 		</tr>
				 		<tr>
				 			<td>
				 			   	<textarea name="notes" id="notes" cols="23" rows="8"></textarea>
				 			</td>
				 		</tr>
				 	</table>
				 </td>
			     </tr>
			 
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<div style="padding-left:300px;"><input value="Accept Information" name="undefined" type="submit" onclick="javascript:return validate();"></div>
		</td>
	</tr>
</table>