<?php
$user =& JFactory::getUser();

?>
<div class="form_item">
  <div class="form_element cf_textbox">

  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">Name</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="text_0" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">Address</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_1" name="text_1" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">City</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_9" name="text_9" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">Postal Code</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_5" name="text_5" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">Phone</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_6" name="text_6" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 100px;">Email</label>
    <input class="cf_inputbox validate-email" maxlength="150" size="30" title="" id="text_4" name="text_4" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Referral Type</label>
    <div class="float_left">
      <input value="Walk In" title="" class="radio" id="radio00" name="radio" type="radio" />
      <label for="radio00" class="radio_label">Walk In</label>
      <br />
      
<input value="Web" title="" class="radio" id="radio01" name="radio" type="radio"/>
      <label for="radio01" class="radio_label">Web</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Replied</label>
    <div class="float_left">
      <input value="Yes" title="" class="radio" id="radio001" name="radio0" type="radio" />
      <label for="radio001" class="radio_label">Yes</label>
      <br />
   <input value="No" title="" class="radio" id="radio011" name="radio0" type="radio" />
      <label for="radio011" class="radio_label">No</label>
      <br />

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Contacted By</label>
    <div class="float_left">
      <input value="Phone" title="" class="radio" id="radio10" name="radio1" type="radio" />
      <label for="radio10" class="radio_label">Phone</label>
      <br />
      
<input value="Email" title="" class="radio" id="radio11" name="radio1" type="radio" />
      <label for="radio11" class="radio_label">Email</label>
      <br />
      
<input value="Phone and Email" title="" class="radio" id="radio12" name="radio1" type="radio" />
      <label for="radio12" class="radio_label">Phone and Email</label>
      <br />
    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Contacted When</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" type="text" id="contactedwhen" name="contactedwhen" size="10" />
</div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Booked Time</label>
    	HH: <select name="bookedtimehr">
		<?php
			for($i=0;$i<24;++$i)
			{
				if($i<10)
				{
					echo '<option value="' . $i . '">0' . $i . '</option>';
				}else
				 {
				 	echo '<option value="' . $i . '">' . $i . '</option>';
				 }
			}
		?>
	</select>
	&nbsp;&nbsp;
	MM: <select name="bookedtimemin">
		<?php
			for($j=0;$j<60;++$j)
			{
                            if($j<10)
                            {
				echo '<option value="'. $j . '">0' . $j . '</option>';
                             }else
                                {
                                 echo '<option value="' . $j . '">' . $j . '</option>';
                                 }
                            
			}
		?>
	</select>

</div>
  <div class="cfclear">&nbsp;</div>
</div>



  <div class="form_item">
  <div class="form_element cf_datetimepicker">
    <label class="cf_label" style="width: 150px;">Booked Date </label>
    <input class="cf_datetime" title="" size="20" id="bookeddate" name="bookeddate" type="text" value=""/>
    </div>
  <div class="cfclear">&nbsp;</div>
</div>

<!--<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Book Time</label>
    <div class="float_left">
      <input value="AM" title="" class="radio" id="radio20" name="radio2" type="radio" />
      <label for="radio20" class="radio_label">AM</label>
      <br />
      
<input value="PM" title="" class="radio" id="radio21" name="radio2" type="radio" />
      <label for="radio21" class="radio_label">PM</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>-->

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Came In</label>
    <div class="float_left">
      <input value="Yes" title="" class="radio" id="radio30" name="radio3" type="radio" />
      <label for="radio30" class="radio_label">Yes</label>
      <br />
      
<input value="No" title="" class="radio" id="radio31" name="radio3" type="radio" />
      <label for="radio31" class="radio_label">No</label>
      <br />
      
<input value="Rescheduled" title="" class="radio" id="radio32" name="radio3" type="radio" />
      <label for="radio32" class="radio_label">Rescheduled</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Status</label>
    <div class="float_left">
<input value="none" title="" class="radio" id="radio42a" name="sradio" type="radio"  checked/>
      <label for="radio42a" class="radio_label">None</label>
      <br />
 <input value="active" title="" class="radio" id="radio42" name="sradio" type="radio"  />
      <label for="radio42" class="radio_label">Active</label>
      <br />
<input value="potential" title="" class="radio" id="radio43" name="sradio" type="radio" />
      <label for="radio43" class="radio_label">Potential</label>
      <br />
<input value="follow up" title="" class="radio" id="radio44" name="sradio" type="radio" />
      <label for="radio44" class="radio_label">Follow Up</label>
      <br />     
      <input value="pending" title="" class="radio" id="radio45" name="sradio" type="radio"/>
      <label for="radio45" class="radio_label">Pending</label>
      <br/> 

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<!--<div class="form_item">
  <div class="form_element cf_datetimepicker">
    <label class="cf_label" style="width: 150px;">Date Scheduled</label>
    <input class="cf_datetime" title="" size="20" id="datescheduled" name="datescheduled" type="text" value=""/>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>-->

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Trainer</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_16" name="trainer" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Desk Staff</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_17" name="deskstaff" type="text" value=""/>
  
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Signed Up</label>
    <div class="float_left">
      <input value="Annually" title="" class="radio" id="radio46" name="radio4" type="radio" />
      <label for="radio46" class="radio_label">Annually</label>
      <br />
      
<input value="Monthly" title="" class="radio" id="radio47" name="radio4" type="radio" />
      <label for="radio47" class="radio_label">Monthly</label>
      <br />
      
<input value="No" title="" class="radio" id="radio48" name="radio4" type="radio" />
      <label for="radio48" class="radio_label">No</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textarea">
    <label class="cf_label" style="width: 150px;">Notes</label>
    <textarea class="cf_inputbox" rows="3" id="text_21" title="" cols="30" name="notes" value=""></textarea>
    
  </div>
  <div class="cfclear">&nbsp;</div>
</div>

<div class="form_item">
  <div class="form_element cf_textarea">
    <label class="cf_label" style="width: 150px;">Comments</label>
    <textarea class="cf_inputbox" rows="10" id="text_8" title="" cols="20" name="text_8" value=""></textarea>
    
  </div>
</div>

 <div class="cfclear">&nbsp;</div>
</div>
<?php
if(JRequest::getVar('task')=='editrecord'){
$updatedate=date("Y-m-d H:i:s");
$db             = JFactory::getDBO();
$cids = JRequest::getVar('cids');
$username = $user->username; 
  $query = "UPDATE #__chronoforms_freetrialEdit SET updatedate ='$updatedate' WHERE cf_id = $cids";
  $db->setQuery($query);
  $db->query();
 $uquery = "UPDATE #__chronoforms_freetrialEdit SET USERNAME ='$username' WHERE cf_id = $cids";
  $db->setQuery($uquery);
  $db->query();
echo '<input type="hidden" value="$updatedate" name="recordtime" id="recordtime">';
}else { 
$username = $user->username;
$updatedate=date("Y-m-d H:i:s"); 
?>
<input type="hidden" value="<?php echo date("Y-m-d H:i:s"); ?>" name="updatedate" id="updatedate">
<!--<input type="hidden" value="<?php echo $user->username; ?>" name="USERNAME" id="USERNAME">-->
<input type="hidden" value="<?php echo date("Y-m-d H:i:s"); ?>" name="recordtime" id="recordtime">

<div class="form_item">
 <div class="form_element cf_dropdown">
   <label class="cf_label" style="width: 100px;">Location</label>
   <select class="cf_inputbox validate-selection" id="select_10" size="1" title="{cf_title}"  name="USERNAME">
   <option value="<?php echo $user->username; ?>"><?php echo $user->username; ?></option>
   </select>

 </div>
 <div class="cfclear">&nbsp;</div>
</div>
<?php } ?>
<div class="form_item">
  <div class="form_element cf_button">
<?php $cids = JRequest::getVar('cids'); ?>
<input type="hidden" value="{cf_id}" name="cf_id">
    <input value="Submit" name="undefined" type="submit" />
  </div>
  <div class="cfclear">&nbsp;</div>
</div>
