		<?php 
	//	echo "ss:".$ss;
		?>
		<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 $acctrnss_id;?>" name="acctrnss_id" id="acctrnss_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-12">
                

                 <?php $ss_group_id=$this->session->userdata('ss_group_id') ?>
                 <div class="form-group" <?php if ($ss_group_id!=1) echo " style=\"display:none;\""; ?>>
                   
                      <h5>Warehouse * </h5>
                      
                      <?php 
                      $ss_warehouse_id=$this->session->userdata('ss_warehouse_id');
                      $mod_warehouse=new Common_Model();
						
						$warehouse_des=$mod_warehouse->get_warehouse_info($ss_warehouse_id);
						if($ss){
						echo $warehouse_des['name'];
						}
                      ?>
                      
                      
                      <select id="warehouse_id" class="form-control warehouse_id_multi search-select" name="warehouse_id[]" multiple <?php if($ss) echo 'style="display:none;"'; ?> >
                        
                        <!--<option value="">-- Select Warehouse --</option>-->
                        
                        <?php 

																 $ss_warehouse_id=$this->session->userdata('ss_warehouse_id'); 

                                                              foreach ($warehouse_list as $row)

                                                              {

																  $sel='';

																  if($ss_warehouse_id==$row->id)

																  {

																	  $sel=' selected="selected"';
																	  
																	  
																	  ?>
																	  <option value="<?php echo $row->id; ?>" <?php echo $sel ?> > <?php echo $row->name; ?> </option>
																	  
																	  <?php

																  }

                                                              ?>
                        
                        <?php }?>
                      </select>
                    </div>
                    </div>
                    
                    
                    <div class="col-md-5">
                        
                        
                    
                    
                    <?php //print_r($transactions_details);?>
                    <!-- <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($transactions_details['fxd_ass_serial_no']))?'value="'.$transactions_details['fxd_ass_serial_no'].'"':null;?>>
                        </div>-->
                        
                        
                        
                        
                
                       
                        <div class="form-group">
                        <h5>Transaction * </h5>
                        <?php //print_r($transactions_type);?>
                            <select class="select2-container form-control" id="fxd_ass_id" name="fxd_ass_id">
                          <option value="">-- Select Transaction--</option>
						  <?php foreach($transactions_type as $row){
							  $sel='';
					  if(isset($transactions_details['fxd_ass_id'])){
						  if($transactions_details['fxd_ass_id']==$row['fxd_ass_id']){
						  $sel='selected="selected"';
						  }
						  }else if($ss==1 && $row['fxd_ass_id']==1){
						      $sel='selected="selected"';
						  } ?>
                          <option <?php echo $sel; ?> value="<?php echo $row['fxd_ass_id'];?>"><?php echo $row['fxd_ass_name'];?></option>
                          <?php }?>
                            </select>
                        </div>
                        
                        <div class="form-group" id="to_warehouse_id_wap" style="display:none;">
                   
                      <h5>To Warehouse * </h5>
                      <select id="to_warehouse_id" class="form-control" name="to_warehouse_id">
                        
                        <option value="">-- Select --</option>
                        
                        <?php 

																 $ss_warehouse_id=$this->session->userdata('ss_warehouse_id'); 

                                                              foreach ($warehouse_list as $row)

                                                              {

																  $sel='';

																  if($ss_warehouse_id==$row->id)

																  {

																	 // $sel=' selected="selected"';

																  }

                                                              ?>
                        <option value="<?php echo $row->id; ?>" <?php echo $sel ?> > <?php echo $row->name; ?> </option>
                        <?php }?>
                      </select>
                    </div>
                       
                   <div class="form-group">
                        <h5> Amount*</h5>
                       <input type="text" class="form-control" name="acctrnss_amount" id="acctrnss_amount" <?php echo (isset($transactions_details['acctrnss_amount']))?'value="'.$transactions_details['acctrnss_amount'].'"':null;?>>
                        </div>
                      
                        </div>
                  <div class="col-md-5 pull-right">
                   <div class="form-group" <?php if ($ss_group_id!=1) echo " style=\"display:none;\""; ?>>
                               <h5> Date *</h5>
                              <?php $nowdate=date("Y-m-d H:i:s");?>
                              <input id="acctrnss_date" name="acctrnss_date" type='text' class="form-control date"  value="<?php echo date("Y/m/d");?>" readonly/> 
                    </div> 
                   <div class="form-group">
                        <h5>Details</h5>
                       <textarea type="text" class="form-control" name="acctrnss_details" id="acctrnss_details" style="height:60px"><?php if(isset($transactions_details['acctrnss_details'])){echo htmlentities($transactions_details['acctrnss_details']);}?> </textarea>
                       </div>
                
       
       
              
                
                
         
                </div>
                
                </div> <!--col-md-12-->
            </div>
            <div class="modal-footer">
            <input id="add_category" 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">

$( "#fxd_ass_id" ).change(function() {
    if(this.value==3){
        
        $("#to_warehouse_id_wap").show();
    }
    else {
        
         $("#to_warehouse_id_wap").hide();
    }
 // alert(this.value);
});

//$("#warehouse_id").select2();
$(".warehouse_id_multi").select2();

jQuery(document).ready(function() {
	
				FormValidator.init();
				
				<?php if($ss){ ?>
				$('#fxd_ass_id option:not(:selected)').prop('disabled', true);
				<?php } ?>
				//$("#fa_type_id").select2();
				
				/*
				var currentDate = new Date();
				if($('#type').val()=="E"){
				$('#acctrnss_date').datetimepicker({
				 format: 'YYYY/MM/DD',
				defaultDate:"<?php if(isset($transactions_details['acctrnss_date'])){ echo $transactions_details['acctrnss_date'];}?>"
				});
				 }
				 if($('#type').val()=="A"){
				$('#acctrnss_date').datetimepicker({
				 format: 'YYYY/MM/DD',
				defaultDate:currentDate
				});
				 }
				 */
				 
			});
			
			
			
function insertFixedAssetsData(){
	
	 $("#add_category").prop("disabled", true);

		  $("#add_category").val('Please wait...');
		  
var fields=$('#create_fixed_assets_form').serialize();
//alert(fields);
$.post( "<?php echo base_url('transactions/save_transactions'); ?>",fields)
	  .done(function( data ) {
		
	
	  var obj = jQuery.parseJSON(data);
	  //alert(obj.status);
	  var status=parseInt(obj.status);
	  if(status==0){
	     // alert(1111);
	       alert(obj.error_msg);
	       
	        $("#add_category").prop("disabled", false);

		  $("#add_category").val('Add');
	       /*
	      $('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+obj+error_msg+'</div>');
	      */
		//$('body').modalmanager('removeLoading');
	//	$('body').attr('class','');
	  }else{
	     //alert(222);
	  }
	  
	  
	 if (obj.status=='0') 
	{
	    /*
	    alert(error_msg);
	    
		$('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+obj+error_msg+'</div>');
		*/
	//	$('body').attr('class','');
		
	} else {
		
	  $('div#ajax-modal').modal('hide');
	  
	 
			 // loadGrid();// load customer data
	  if(obj.type=='E'){
		 displayNotice('page','Transactions has been updated successfully!');
		 
	  }
	  if(obj.type=='A'){
		displayNotice('page','Transactions 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>