


	 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>

				   
	
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		
		
		
		
			 $(document).on("click", "#managebtndelete2", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid2").val(itemid); 
		  
		  
		   
        });
		
		
		
		
		
		
		
		
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
		
			
		  $(document).on("click", "#editbtn", function()
        {
          var mychargeid = $(this).data('id');
		  $("#mychargeid").val(mychargeid); 
		   
   var status = $(this).data('status');
		   $("#status").val(status); 
		    var name = $(this).data('name');
		   $("#names").val(name); 
		   
		     var cost = $(this).data('cost');
		   $("#costs").val(cost); 
		 
		 
		  var chargeid = $(this).data('chargeid');
		   $("#chargeid").val(chargeid); 
		  
		  
		   
        });
		
		
		
		
		
		  $(document).on("click", "#editbed", function()
        {
        
   var status = $(this).data('status');
		   $("#bedstatus").val(status); 
		    var name = $(this).data('name');
		   $("#bedname").val(name); 
		   
		        var description = $(this).data('description');
		   $("#beddescription").val(description); 
		   
		 
		  var id = $(this).data('id');
		   $("#bedid").val(id); 
		  
		  
		   
        });
		
		
		
		
		
		
		
		
		
        </script>
                  



<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i> 
					Edit this Room
                    	</a></li>
						
							<li>
						<a href="#back" data-toggle="tab"><i class="entypo-menu"></i> 
									 <a href="<?php echo base_url(); ?>admin/viewplot?randomitemidentifier=<?php echo$house[0]['plotno']; ?>&category=<?php echo $house[0]['category']; ?>" class="btn-primary">Go back	</a></a>

                    	</li>
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">
				
     


		
<div class="row">

	<div class="col-md-6">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Update   House/Room Details
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				
		 echo $this->session->flashdata('deletemsg'); 
	 $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	 
	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];


		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];
	 			      $updateroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','updateroom',$userid);
	 			      $addcharges=$this->usermodel->populatuserpermissionsdataarray('accomodation','addcharges',$userid);
	 			      $updatecharges=$this->usermodel->populatuserpermissionsdataarray('accomodation','updatecharges',$userid);

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('addhouse' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
					
  <div class="form-group">

    <label for="inputhouseno" class="col-sm-2 control-label">Room Number</label>
    <div class="col-sm-7">
				  		<input type="hidden" name="id" value="<?php echo set_value('id',$house[0]['id']); ?>"id="houseno" class="form-control" required placeholder="Enter house number">
  		<input type="hidden" name="action" value="<?php echo set_value('action','update'); ?>"id="action" class="form-control" required >



		  		<input type="text" name="houseno" value="<?php echo set_value('houseno',$house[0]['houseno']); ?>"id="houseno" class="form-control" required placeholder="Enter house number">
     <span class="text-danger"><?php echo form_error('houseno'); ?></span>
   </div>
  </div>
    <div class="form-group">

    <label for="inputhouseno" class="col-sm-2 control-label">	House Number</label>
    <div class="col-sm-7">

			  		<input type="text" readonly name="plotno" value="<?php echo set_value('plotno',$house[0]['plotno']); ?>"id="plotno" class="form-control" required placeholder="Enter plot number">


     <span class="text-danger"><?php echo form_error('plotno'); ?></span>
   </div>
  </div>
   <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Room status</label>
		                    <div class="col-sm-7">
		                        <select name="status" class="form-control" id="section_selector_holder">
		                <option value="<?=$house[0]['status']  ?>"><?=$house[0]['status']  ?></option>

	<option value="">--Select status--</option>
			                    							
   <option value="vacant"  >Vacant Ready</option>
  <option value="occupied">Occupied Ready</option>

<option value="Occupied Dirty" >Occupied Dirty </option>
	<option  value="Vacant Dirty" >Vacant Dirty</option>

   <option value="Blocked" >Blocked</option>
   <option value="inactive"  >Inactive</option>



			                    </select>
								     <span class="text-danger"><?php echo form_error('status'); ?></span>
			                </div>
	</div>
					
  	
	
  
  
  
  
  <?php
if($house[0]['category']=="rental"){

?>
    <div class="form-group">
    <label for="inputcost" class="col-sm-2 control-label">Rent cost</label>
    <div class="col-sm-7">
				<input type="text" name="cost" value="<?php echo set_value('cost',$house[0]['cost']); ?>" id="cost" class="form-control" required placeholder="Enter Rent">
        <span class="text-danger"><?php echo form_error('cost'); ?></span>
	</div>
  </div>
  
  
    <?php
}else{
	?>
					<input type="hidden" name="cost" value="<?php echo set_value('cost',$house[0]['cost']); ?>" id="cost" class="form-control" required placeholder="Enter Rent">

	
	<?php
	
}
?>
    <div class="form-group">

    <label for="inputfloor" class="col-sm-2 control-label">Floor</label>
    <div class="col-sm-7">



	<select class="form-control" name="floor"  required>
			<option selected value="<?php echo $house[0]['floor'];?>"  ><?php echo $house[0]['floor']; ?></option>

		<option value=""  >---Select Floor---</option>
		<option value="Ground"   >Ground</option>
		<option value="1"  >1</option>
		<option value="2"  >2</option>
		<option value="3"  >3</option>
		<option value="4"  >4</option>
		<option value="5"  >5</option>
		<option value="6"  >6</option>
		<option value="7"  >7</option>
		<option value="8"  >8</option>
		<option value="9"  >9</option>

		<option value="10"  >10</option>
		<option value="11"  >11</option>
		<option value="12"  >12</option>
		<option value="13"  >13</option>
		<option value="14"  >14</option>
		<option value="15"  >15</option>
		<option value="16"  >16</option>
		<option value="17"  >17</option>
		<option value="18"  >18</option>
		<option value="19"  >19</option>
		<option value="20"  >20</option>
		<option value="20"  >20</option>
		<option value="21"  >21</option>
		<option value="22"  >22</option>
		<option value="23"  >23</option>
		<option value="24"  >24</option>
		<option value="25"  >25</option>
		<option value="26"  >26</option>
		<option value="27"  >27</option>
		<option value="28"  >28</option>
		<option value="29"  >29</option>
		<option value="30"  >30</option>
</select>
		


     <span class="text-danger">E.g GF, 1STF, 2NDF,3RDF etc<?php echo form_error('floor'); ?></span>
   </div>
  </div>


  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Room Type</label>
		                    <div class="col-sm-7">
		                        <select name="type" class="chzn-select" id="section_selector_holder">
		                           <option value="<?=$house[0]['type']  ?>"><?=$house[0]['type']  ?></option>

									<option value="">--Select type--</option>
			                      
			                         <option value="Double">Double</option>
									   <option value="Single">Single</option>
									   									   <option value="Bed Sitter">Bed Sitter</option>

									   	<option value="Twin">Twin</option>

									   <option value="One bedroom">One bedroom</option>
									    <option value="Two bedroom">Two bedroom</option>
										 <option value="Office">Office</option>
										  <option value="Shop">Shop</option>
										  	 <option value="Standard">Standard</option>
										 <option value="Superior">Superior</option>
										 <option value="Executive">Executive</option>
										 <option value="Junior">Junior</option>
  <option value="Budget Room">Budget Room</option>
									   <option value="Deluxe">Deluxe</option>
									   <option value="Deluxe Extra">Deluxe Extra</option>


			                    </select>
								     <span class="text-danger"><?php echo form_error('status'); ?></span>
			                </div>
	</div>
	
	
	
	       <div class="form-group">
    <label for="inputbeds" class="col-sm-2 control-label"> No of Pax/ Beds</label>
    <div class="col-sm-7">
				<input type="text" name="beds" value="<?php echo set_value('beds',$house[0]['beds']); ?>" id="cost" class="form-control" required placeholder="Enter beds">
        <span class="text-danger"><?php echo form_error('beds'); ?></span>
	</div>
  </div>
	
	
	
	
	
 
	
	
  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">category</label>
		                    <div class="col-sm-7">
		                        <select name="category" class="form-control" id="section_selector_holder">
		                <option value="<?=$house[0]['category']  ?>"><?=$house[0]['category']  ?></option>

								   <option value="">--Select status--</option>
			                         <option value="rental">rental</option>
												                         <option value="accomodation">accomodation</option>



			                    </select>
								     <span class="text-danger"><?php echo form_error('category'); ?></span>
			                </div>
	</div>
					
  
  
  
  
					  <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-7">
				<?php
			$mybranchid=	$house[0]['branchid']
				?>
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter-</option>

									
								
<?php
	     $mybranch=$this->usermodel->populateall('branch','id',$mybranchid);


if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){

   ?>
					<option selected="selected" value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>




	<?php

}} else {
    echo 'No Branch available.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
  
    
  <div class="form-group" style="display:none">

    <label for="inputpriority" class="col-sm-2 control-label">Priority Number</label>
    <div class="col-sm-7">

			  		<input type="text" name="priority" value="<?php echo set_value('priority',$house[0]['priority']); ?>"id="plotno" class="form-control"  placeholder="Enter priority number">


     <span class="text-danger"><?php echo form_error('priority'); ?></span>
   </div>
  </div>
  
  
        <div class="form-group">
    <label for="inputvat" class="col-sm-2 control-label">Tax</label>
    <div class="col-sm-7">
				<input type="text" name="vat" value="<?php echo set_value('vat',$house[0]['vat']); ?>" id="cost" class="form-control" required placeholder="Enter vat">
        <span class="text-danger"><?php echo form_error('vat'); ?></span>
	</div>
  </div>
         <div class="form-group">
    <label for="inputvat2" class="col-sm-2 control-label">Tax2(Levy)</label>
    <div class="col-sm-7">
				<input type="text" name="vat2" value="<?php echo set_value('vat2',$house[0]['vat2']); ?>" id="vat2" class="form-control" required placeholder="Enter vat for levy">
        <span class="text-danger"><?php echo form_error('vat2'); ?></span>
	</div>
  </div>
  
    <div class="form-group">
    <label for="inputcommission" class="col-sm-2 control-label">Commission</label>
    <div class="col-sm-7">
				<input type="text" name="commission" value="<?php echo set_value('commission',$house[0]['commission']); ?>" id="cost" class="form-control" required placeholder="Enter commission">
        <span class="text-danger"><?php echo form_error('commission'); ?></span>
	</div>
  </div>
  
     <div class="form-group" >
   <label for="inputmeternumber" class="col-sm-2 control-label">Meter Numbers</label>
    <div class="col-sm-7">
	<input type="text" name="meternumber" value="<?php echo set_value('meternumber',$house[0]['meternumber']); ?>"id="meternumber" class="form-control"  placeholder="Enter all the meter numbers here">
     <span class="text-danger"><?php echo form_error('meternumber'); ?></span>
   </div>
  </div>
  
  
   <div class="form-group">
    <label for="inputphone3" class="col-sm-2 control-label">Description </label>
    <div class="col-sm-7">
	<textarea name="description" id="ttt" rows="2" placeholder="add Description" class="form-control"><?php echo set_value('description',$house[0]['description']); ?></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
    <div class="form-group">
    <label for="inputpaymentdetails" class="col-sm-2 control-label">Sms Payment Details </label>
    <div class="col-sm-7">
	<textarea name="paymentdetails" id="paymentdetails" rows="2" placeholder="Enter SMS Room payment details" class="form-control"><?php echo set_value('paymentdetails',$house[0]['paymentdetails']); ?></textarea>
    <span class="text-danger"><?php echo form_error('paymentdetails'); ?></span>
   </div>
  </div>
    
  
   
  	<div class="form-group">
  	    <label for="inputwaterno" class="col-sm-1 control-label"></label>

				<div class="col-sm-2">Water Meter. No 
					<div class="form-group">

                     		  		<input type="text" name="waterno" value="<?php echo set_value('waterno',$house[0]['waterno']); ?>" class="form-control"  placeholder="Enter water Meter No">

					</div>
				</div>
				<div class="col-sm-2">Water Monthly rate
					<div class="form-group">
					

							  		<input type="text"  name="waterrate" value="<?php echo set_value('waterrate',$house[0]['waterrate']); ?>" class="form-control"  placeholder="Enter water rate ">

					</div>
				</div>
			
				<div class="col-sm-3">
					Water Standing charge
					<div class="form-group">
			

							  		<input type="text"  name="watercharge" value="<?php echo set_value('watercharge',$house[0]['watercharge']); ?>" class="form-control"  placeholder="Enter water standing charge ">

					</div>
				</div>
  
  </div>
  
  
  
  	<div class="form-group">
  	    <label for="inputwaterno" class="col-sm-1 control-label"></label>

				<div class="col-sm-2">Electricity Meter. No 
					<div class="form-group">

                     		  		<input type="text" name="electricityno" value="<?php echo set_value('electricityno',$house[0]['electricityno']); ?>" class="form-control"  placeholder="Enter Electricity Meter No">

					</div>
				</div>
				<div class="col-sm-2">Electricity rate
					<div class="form-group">
					

							  		<input type="text"  name="electricityrate" value="<?php echo set_value('electricityrate',$house[0]['electricityrate']); ?>" class="form-control"  placeholder="Enter Electricity rate ">

					</div>
				</div>
			
				<div class="col-sm-3">
					Electricity Standing charge
					<div class="form-group">
			

							  		<input type="text"  name="electricitycharge" value="<?php echo set_value('electricitycharge',$house[0]['electricitycharge']); ?>" class="form-control"  placeholder="Enter Electricity standing charge ">

					</div>
				</div>
  
  </div>
  
  
  
  	<div class="form-group">
  	    <label for="inputwaterno" class="col-sm-1 control-label"></label>

				<div class="col-sm-2">Bowhole Meter. No 
					<div class="form-group">

                     		  		<input type="text" name="bowholeno" value="<?php echo set_value('bowholeno',$house[0]['bowholeno']); ?>" class="form-control"  placeholder="Enter Bowhole Meter No">

					</div>
				</div>
				<div class="col-sm-2">Bowhole rate
					<div class="form-group">
					

							  		<input type="text"  name="bowholerate" value="<?php echo set_value('bowholerate',$house[0]['bowholerate']); ?>" class="form-control"  placeholder="Enter Bowhole rate ">

					</div>
				</div>
			
				<div class="col-sm-3">
					Bowhole Standing charge
					<div class="form-group">
			

							  		<input type="text"  name="bowholecharge" value="<?php echo set_value('bowholecharge',$house[0]['bowholecharge']); ?>" class="form-control"  placeholder="Enter Bowhole standing charge ">

					</div>
				</div>
  
  </div>
  
  
  
  
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     

		   
		   		<?php
									

									 if( $updateroom==true){
											
											?>
	       <button type="submit" name="btn_house"value="house" class="btn btn-primary">Update Room</button>

										<?php
										}else{
										
										}
										?>
		   
		   
		   
		   
		   
		   
    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
		
		
		
	
		
    </div>
	
		<div class="col-md-6">

		
			<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Add new room charges
            	</div>
            </div>
			<div class="panel-body">
				<?PHP
				echo $this->session->flashdata('roommsg'); 
		 echo $this->session->flashdata('deletemsg'); 

                 echo form_open('user/addroomcharges' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
							  		<input type="hidden" name="plotno" value="<?php echo set_value('plotno',$house[0]['plotno']); ?>"id="plotno" class="form-control" required placeholder="Enter plot number">

								  		<input type="hidden" name="roomid" value="<?php echo set_value('roomid',$house[0]['id']); ?>"id="roomid" class="form-control" required placeholder="Enter house number">

			   <div class="form-group">












    <label for="inputchargeid" class="col-sm-2 control-label">Charge Name</label>
    <div class="col-sm-7">


		                        <select required name="chargeid" class="form-control">



<option value=""  >---Select Charge Name-</option>

									
								
<?php

		$mybranch = $this->accomodationmodel->getrentplotcharges($house[0]['plotno']);

if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){
	   
	    
						   
						   $chargename = $this->usermodel->populateallarray('charges','id', $branchrow->chargeid);

	 $chargename=$chargename[0]['type'];

   ?>
					<option  value="<?=  $branchrow->chargeid;   ?>"><?=  $chargename; ?></option>




	<?php

}} else {
    echo 'No charges available.';
}
	
?>


			                    </select>
			     
				 
     <span class="text-danger"><?php echo form_error('name'); ?></span>
   </div>
  </div>
  
  
  
  
  <div class="form-group">
    <label for="inputcost" class="col-sm-2 control-label">Cost</label>
    <div class="col-sm-7">
				<input type="text" name="cost" value="<?php echo set_value('cost'); ?>" id="cost" class="form-control" required placeholder="Enter the cost">
        <span class="text-danger"><?php echo form_error('cost'); ?></span>
	</div>
  </div>
  
    <div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">Description</label>
    <div class="col-sm-7">
			  		<input type="text" name="name" value="<?php echo set_value('name'); ?>"id="name" class="form-control"  placeholder="Enter Charge description / name">
        <span class="text-danger"><?php echo form_error('cost'); ?></span>
	</div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     

		   


		   		<?php
										
								 if( $addcharges==true){

											?>
	       <button type="submit" name="btn_addroomcharges"value="charges" class="btn btn-primary">Add Charges</button>

										<?php
										}else{
										
										}
										?>
		   
		   
		   
		   
		   
		   
		   
    </div>
  </div>
  
     <?php echo form_close();?>
  
  
  
  						
									
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example2" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
       <th>Name</th>
     <th>Description</th>
	   
	  <th>Cost</th>	 
	  	  <th>Status</th>	 

  <th>More</th>	 
	

                 </tr>
             </thead><tbody>
<?php

	$roomid=$house[0]['id'];
$plotno=$house[0]['plotno'];


        		$roomcharges = $this->usermodel->populateallstatus('roomcharges','plotno', $plotno,'roomid', $roomid);

				
				
				
				
				
				
 if(!is_array($roomcharges)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='4'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($roomcharges as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;


?>

     
  <td><?php 
   $chargename = $this->usermodel->populateallarray('charges','id', $c->chargeid);

	 echo $chargename=$chargename[0]['type'];


  ?></td>         

  <td><?php echo $c->name ; ?></td>
   
     <td><?php echo $c->cost ; ?></td>
     <td><?php echo $c->status ; ?></td>

		 
		 	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									<?php
																		 if( $updatecharges==true){

											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                        
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn"      data-status='<?php echo  $c->status;?>'    data-chargeid='<?php echo  $c->chargeid;?>'    data-name='<?php echo  $c->name;?>' data-cost='<?php echo  $c->cost;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
		
		 
             </tr>

	<?php endforeach;
	
	} ?>

              
<tbody>
        </table>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
			</div>
		</div>
	
	
</div>


	<div class="col-md-6">

		
			<div class="panel panel-info" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Add new bed 
            	</div>
            </div>
			<div class="panel-body">
				<?PHP
				echo $this->session->flashdata('roommsg'); 
		 echo $this->session->flashdata('deletemsg'); 

                 echo form_open('admin/addbencharges' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
							  		<input type="hidden" name="plotno" value="<?php echo set_value('plotno',$house[0]['plotno']); ?>"id="plotno" class="form-control" required placeholder="Enter plot number">
							  		<input type="hidden" name="houseno" value="<?php echo set_value('houseno',$house[0]['houseno']); ?>"id="plotno" class="form-control" required placeholder="Enter plot number">
							  		<input type="hidden" name="beds" value="<?php echo set_value('beds',$house[0]['beds']); ?>"id="plotno" class="form-control" required placeholder="Enter plot number">

								  		<input type="hidden" name="roomid" value="<?php echo set_value('roomid',$house[0]['id']); ?>"id="roomid" class="form-control" required placeholder="Enter house number">

			 
  
  
  

  
    <div class="form-group">
    <label for="inputname" class="col-sm-3 control-label">Bed / Section Name</label>
    <div class="col-sm-3">
			  		<input type="text" name="name" value="<?php echo set_value('name'); ?>"id="name" class="form-control"  placeholder="Enter Bed Name">
        <span class="text-danger"><?php echo form_error('cost'); ?></span>
	</div>
 
  
    <div class="form-group">
    <label for="inputdescription" class="col-sm-1 control-label">Remarks</label>
    <div class="col-sm-3">
				<input type="text" name="description" value="<?php echo set_value('description'); ?>" id="cost" class="form-control"  placeholder="Enter the description">
        <span class="text-danger"><?php echo form_error('description'); ?></span>
	</div>
	  	       <button type="submit" name="btn_addbeds"value="beds" class="btn btn-primary">Add Capacity /Pax /Bed</button>

  </div>

   </div>
  
 
  
     <?php echo form_close();?>
  
  
  
  						
									
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example2" style="border-color:#CCCCCC; width:100%;"  >

             <thead>
         <tr>
       <th>Name</th>
     <th>Description</th>
	   
	  <th>House No</th>	 
	  	  <th>Status</th>	 

  <th>More</th>	 
	

                 </tr>
             </thead><tbody>
<?php

	$roomid=$house[0]['id'];
$plotno=$house[0]['plotno'];


        		$beds= $this->usermodel->populateallstatus('beds','plotno', $plotno,'roomid', $roomid);

				
				
				
				
				
				
 if(!is_array($beds)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='4'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($beds as $row): 

		 

             ?>



             <tr>
                
            <?php 
$id=$row->id;


?>

     
          

  <td><?php echo $row->name ; ?></td>
        <td><?php echo $row->description ; ?></td>

     <td><?php echo $row->houseno ; ?></td>
     <td><?php echo $row->status ; ?></td>

		 
		 	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									<?php
																		 if( $updatecharges==true){

											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete2"		 data-id='<?php echo  $row->id;?>'    data-toggle='modal' data-target='#myModal2<?php  $row->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                      
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbed"      data-status='<?php echo  $row->status;?>'       data-name='<?php echo  $row->name;?>' data-description='<?php echo  $row->description;?>'  data-id='<?php echo  $row->id;?>' data-toggle='modal' data-target='#editbedModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Update
                                                </a>
                                                        </li>
                                   
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
		
		 
             </tr>

	<?php endforeach;
	
	} ?>

              
<tbody>
        </table>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
			</div>
		</div>
	
	
</div>

















<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Room Charges</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatecharges' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
				  		<input type="hidden" name="roomid" value="<?php echo set_value('id',$house[0]['id']); ?>"id="houseno" class="form-control" required placeholder="Enter house number">

 <input type="hidden" id="hidden"name="view" class="view" placeholder="view" value="admin/editroom?randomitemidentifier=<?php echo $house[0]['id'];?>" >

	<input type="hidden" name="mycategoryid" value=""id="mychargeid" class="form-control" required placeholder="Enter mycategoryid">
			  		
	
	
	
	<div class="form-group">
<label for="inputchargeid" class="col-sm-2 control-label">Charge Name</label>
    <div class="col-sm-10">


		                        <select name="chargeid" required class="form-control" id="chargeid">

	<option value="" selected></option>


<option value=""  >---Select Charge Name-</option>
				
								
<?php

		$charges = $this->accomodationmodel->populateall('charges','companyid', $companyid);

if(is_array($charges)) {

   foreach($charges as $chargesrow){
	   
	    
						   
						
   ?>
					<option value="<?=  $chargesrow->id;   ?>"><?=  $chargesrow->type ; ?></option>




	<?php

}} else {
    echo 'No charges available.';
}
	
?>


			                    </select>
			     
				 
     <span class="text-danger"><?php echo form_error('name'); ?></span>
   </div>
  </div>
  	
	
	  
		<div class="form-group">
    <label for="inputcost" class="col-sm-2 control-label">	Cost </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="cost" value="<?php echo set_value('cost'); ?>" id="costs" class="form-control" required placeholder="Enter cost">
		 
				
		<span class="text-danger"> <?php echo form_error('cost'); ?>
		
		</span>
	</div>
  </div>


	
	
	
	
	
	
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Description </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" id="names" class="form-control"  placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>


	<div class="form-group">
<label for="inputstatus" class="col-sm-2 control-label">Charge status</label>
    <div class="col-sm-10">


		                        <select name="status" required class="form-control" id="status">

	<option value="" selected></option>


<option value=""  >---Select Charge status-</option>
			<option value="active"  >active</option>
				<option value="inactive"  >inactive</option>



			                    </select>
			     
				 
     <span class="text-danger"><?php echo form_error('status'); ?></span>
   </div>
  </div>
  	


	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="charges" name="btn_updatecharges" class="btn btn-primary"> Update Charges   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>






<div id="editbedModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Bed Details</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/updatebeds' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
				  		<input type="hidden" name="roomid" value="<?php echo set_value('id',$house[0]['id']); ?>"id="houseno" class="form-control" required placeholder="Enter house number">

 <input type="hidden" id="hidden"name="view" class="view" placeholder="view" value="admin/editroom?randomitemidentifier=<?php echo $house[0]['id'];?>" >

	<input type="hidden" name="mycategoryid" value=""id="bedid" class="form-control" required placeholder="Enter mycategoryid">
			  		
	
	
	
<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" id="bedname" class="form-control"  placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>
  	
	
	  
		

	
	
	
	
	
	
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="description" value="<?php echo set_value('description'); ?>" id="beddescription" class="form-control"  placeholder="Enter description">
		 
				
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>


	<div class="form-group">
<label for="inputstatus" class="col-sm-2 control-label">Bed status</label>
    <div class="col-sm-10">


		                        <select name="status" required class="form-control" id="bedstatus">

	<option value="" selected></option>


<option value=""  >---Select Charge status-</option>
			<option value="active"  >active</option>
				<option value="inactive"  >inactive</option>
				<option value="occupied"  >occupied</option>



			                    </select>
			     
				 
     <span class="text-danger"><?php echo form_error('status'); ?></span>
   </div>
  </div>
  	


	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="bed" name="btn_updatebed" class="btn btn-primary"> Update    </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>








				

					<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="roomcharges">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/editroom?randomitemidentifier=<?php echo $house[0]['id'];?>" >
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>

   </div>
 








				

					<div id="myModal2" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="beds">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/editroom?randomitemidentifier=<?php echo $house[0]['id'];?>" >
 <input type="hidden" id="itemid2"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>

   </div>
 



			