		
		<style type="text/css">
		
			body .modal {
	    /* new custom width */
	    width: 750px;
	    /* must be half of the width, minus scrollbar on the left (30px) */
	    margin-left: -375px;
			}

			</style>
            
            <form role="form" class="form-horizontal" id="create_fixed_assets_form" action="#" method="post">
<input type="hidden" value="<?php echo $type;?>" name="type" id="type"/>
<input type="hidden" value="<?php echo $fxd_ass_id;?>" name="fxd_ass_id" id="fxd_ass_id"/>
<form role="form" class="form-horizontal" id="create_fixed_assets_form" action="#">

<div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title"><?php echo $pageName ?></h4>
            <font style="color:#333;">Please fill in the information below. The field labels marked with * are required input fields.</font>
            </div>
    
            
            <div class="modal-body">
            <div id="error"></div>
                <div class="row">
                <div class="col-md-12">
                    <div class="col-md-5">
                    <!-- <div class="form-group">
                        <h5>Code*</h5>
                       <input type="text" class="form-control" name="fxd_ass_serial_no" id="fxd_ass_serial_no" <?php echo (isset($fixed_assets['fxd_ass_serial_no']))?'value="'.$fixed_assets['fxd_ass_serial_no'].'"':null;?>>
                        </div>-->
                       <div class="form-group">
                        <h5>Name *</h5>
                        <input type="text" class="form-control" name="fxd_ass_name" id="fxd_ass_name" <?php echo (isset($fixed_assets['fxd_ass_name']))?'value="'.$fixed_assets['fxd_ass_name'].'"':null;?>>
                        </div>
                        <div class="form-group">
                        <h5>Type * </h5>
                            <select class="select2-container form-control" id="fa_type_id" name="fa_type_id">
                          <option value="">-- Select Fixed Assets Type--</option>
						  <?php foreach($fixed_assets_type as $row){
							  $sel='';
					  if(isset($fixed_assets['fa_type_id'])){
						  if($fixed_assets['fa_type_id']==$row['fa_type_id']){
						  $sel='selected="selected"';
						  }
						  } ?>
                          <option <?php echo $sel; ?> value="<?php echo $row['fa_type_id'];?>"><?php echo $row['fa_type_name'];?></option>
                          <?php }?>
                            </select>
                        </div>
                       
                      <!--<div class="form-group">
                        <h5>Fixed Assets Amount*</h5>
                       <input type="text" class="form-control" name="fxd_ass_amount" id="fxd_ass_amount" <?php echo (isset($fixed_assets['fxd_ass_amount']))?'value="'.$fixed_assets['fxd_ass_amount'].'"':null;?>>
                        </div>-->
                      
                        </div>
                  <div class="col-md-5 pull-right">
                   <div class="form-group" style="display:none;">
                               <h5> Date *</h5>
                              <?php $nowdate=date("Y-m-d H:i:s");?>
                              <input id="fxd_ass_added_date" name="fxd_ass_added_date" type='text' class="form-control date"  value=""/> 
                    </div> 
                   <div class="form-group">
                        <h5>Details</h5>
                       <textarea type="text" class="form-control" name="fxd_ass_details" id="fxd_ass_details" ><?php if(isset($fixed_assets['fxd_ass_details'])){echo htmlentities($fixed_assets['fxd_ass_details']);}?> </textarea>
                       </div>
                
       
       <div class="form-group">
		 <h5>Debit/Credit*</h5>
                 
         <label>
            <input type="radio" id="debit_credit" name="debit_credit" value="Debit" <?php if($type=='A'){echo 'checked';}else if($type=='E'){if($fixed_assets['debit_credit']=='Debit'){echo 'checked';}}?> >
            &nbsp;&nbsp;Debit
          </label>
        
          <label>
            <input type="radio" id="debit_credit" name="debit_credit" value="Credit" <?php if($type=='E'){if($fixed_assets['debit_credit']=='Credit'){echo 'checked="checked"';}}?>>
          &nbsp;&nbsp; Credit
          </label>
          	 </div>
                         
         <div class="form-group">
		 <h5>Status*</h5>
                    
         <label>
            <input type="checkbox" id="fxd_ass_status" name="fxd_ass_status" value="1" <?php if($type=='A'){echo 'checked';}else if($type=='E'){if($fixed_assets['fxd_ass_status']==1){echo 'checked';}}?> >
            &nbsp;&nbsp;Enable
          </label>
        
          <label>
            <input type="checkbox" id="fxd_ass_status" name="fxd_ass_status" value="0" <?php if($type=='E'){if($fixed_assets['fxd_ass_status']==0){echo 'checked';}}?>>
          &nbsp;&nbsp; Disable
          </label>
          	 </div>
              
                
                
         
                </div>
                
                </div> <!--col-md-12-->
            </div>
            <div class="modal-footer">
            <input type="submit" name="add_category" value="<?php echo $btnText; ?>" class="btn btn-primary">
            </div>
</form>
		<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION -->
		<script src="<?php echo base_url(); ?>thems/js/form-validation-fix-assets.js"></script>
		<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION-->
      
        
<script type="text/javascript">
jQuery(document).ready(function() {
				FormValidator.init();
				//$("#fa_type_id").select2();
				var currentDate = new Date();
				if($('#type').val()=="E"){
				$('#fxd_ass_added_date').datetimepicker({
				 format: 'YYYY/MM/DD',
				defaultDate:"<?php if(isset($fixed_assets['fxd_ass_added_date'])){ echo $fixed_assets['fxd_ass_added_date'];}?>"
				});
				 }
				 if($('#type').val()=="A"){
				$('#fxd_ass_added_date').datetimepicker({
				 format: 'YYYY/MM/DD',
				defaultDate:currentDate
				});
				 }
			});
			
			
			
function insertFixedAssetsData(){
var fields=$('#create_fixed_assets_form').serialize();
//alert(fields);
$.post( "<?php echo base_url('fixed_assets/save_fixed_assets'); ?>",fields)
	  .done(function( data ) {
		
	  var obj = jQuery.parseJSON(data);
	 if (obj.status==0) 
	{
		$('div#error').html('<div class="alert alert-block alert-danger fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4 class="alert-heading"><i class="fa fa-times-circle"></i> Error!</h4>'+obj.validation+'</div>');
		$('body').modalmanager('removeLoading');
		$('body').attr('class','');
	} else {
	  $('div#ajax-modal').modal('hide');
	  loadGrid();// load customer data
	  if(obj.type=='E'){
		 displayNotice('page','Fixed Assets has been updated successfully!');
	  }
	  if(obj.type=='A'){
		displayNotice('page','Fixed Assets has been added successfully!')  ;
	  }	
	  
	  setTimeout(
  function() 
  {
	  location.reload(true);
    //do something special
  }, 1000);
  
	  
	}
	  

	  });
return false;
}
$(':checkbox').on('change',function(){
$(':checkbox').not(this).prop('checked',false);
});
    </script>