<?php 
/********************************************************************************* 
 *  This file is part of Sentrifugo.
 *  Copyright (C) 2014 Sapplica
 *   
 *  Sentrifugo is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sentrifugo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sentrifugo.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Sentrifugo Support <support@sentrifugo.com>
 ********************************************************************************/
?>

<?php $baseUrl = $this->serverUrl().$this->baseUrl();

?>
<div id="error_message" style="display:none;"></div>
<div class="poc-ui-data-control">
<?php echo $this->form->id; ?>
<?php
$issueddate = $this->form->issued_date->getValue(); 
sapp_Helper::viewHeader();
sapp_Helper::viewBody('alt','Course Name',(!empty($this->data[0]['course_name']))?$this->data[0]['course_name']:"...",'Course Level',(!empty($this->data[0]['course_level']))?$this->data[0]['course_level']:"...");
sapp_Helper::viewBody('nor','Course Offered By',(!empty($this->data[0]['course_offered_by']))?$this->data[0]['course_offered_by']:"...",'Description',(!empty($this->data[0]['description']))?$this->data[0]['description']:"...");
sapp_Helper::viewBody('alt','Certification Name',(!empty($this->data[0]['certification_name']))?$this->data[0]['certification_name']:"...",'Issued Date',(!empty($issueddate))?$this->form->issued_date->getValue():"...");
sapp_Helper::viewFooter();
?>
        <div class="new-form-ui-submit" id="formSubmit">
        <input onclick="closeiframepopup('trainingandcertificationdetails','cancel');" type="button" value="close"  />
        </div>
  		</div>      
</form>

<script type='text/javascript'>
$(document).ready(function(){
	//To get the Calender image...
	var yearrange = <?php echo "'".date("Y", strtotime("-30 years")).':'.date('Y')."'"; ?>;

	$('#from_date,#to_date').datepicker({
					showOn:'both',
					maxDate: new Date, 
					yearRange: yearrange,
					dateFormat:"<?php echo DATEFORMAT_JS;?>",
					buttonImage: "<?php echo $this->baseUrl("public/media/images/cal.jpg");?>",
					buttonImageOnly: true,
					buttonText: "",
					changeMonth: true,
                                        showButtonPanel: true ,
					changeYear: true 
	});
	
	 });
	 $("#certification_name").blur(function()
	 {
		if( $("#certification_name").val() != "")
		{
			$("#issuedDate").addClass("required");
		}
		else
		{
			$("#issuedDate").removeClass("required");
		}
	 });
</script>