
	 <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).ready(function() { 

                
                $("#plotno").change(function(){
                 	var plotnoid = $("#plotno").val();
                     /*dropdown post *///
                      $.ajax({
			 		url:"<?php echo base_url();?>admin/populatehouseid",
			 		
					 data: {plotno: $(this).val()},

                    type: "POST",
                    success:function(data){
                        
                        $("#houseid").html(data);
                    }
                
                    });

               
                });

            });
               $(function () {
        $("#plotno").change(function () {
            if ($(this).val() == "") {
                $("#house").hide();
            } 
            else {
                $("#house").show();
            }
        });
    });
          
        </script>
	
        <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>	
	
	
	
	
	
	<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i> 
					All SMS sent
                    	</a></li>
			<li>
            	<a href="#add" data-toggle="tab"><i class="entypo-plus-circled"></i>
					Send General SMS 
                    	</a></li>
						<li>
						<a href="#house" data-toggle="tab"><i class="entypo-plus-circled"></i>
					Send SMS Per House 
                    	</a></li>
						<li>
						<a href="#plot" data-toggle="tab"><i class="entypo-plus-circled"></i>
					Send SMS Per Plot 
                    	</a></li>
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">
				
     


 <div class="panel panel-primary" data-collapsed="0">
 
<table id="example"  cellspacing="1" class="table  table" width="100%">
             <thead>
		
         <tr>
    
    <th>Receiver Name </th>
    
    <th>Receiver Number</th>
           
	<th>message</th> 
	<th>Date created</th> 
	<th>User</th> 
	<th>Update</th> 




                 </tr>
             </thead>
<?php
echo $this->session->flashdata('msg'); 
 if(!is_array($sms)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='1'>";
    
       echo '<div class="alert alert-warning text-center">There is no payment name found by now from system..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($sms as $c): 

		 

             ?>



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


?>
   <td><?php echo $c->name ; ?></td> 
             <td><?php echo $c->number ; ?></td> 
				<td><?php echo $c->message ; ?></td> 

				
                     <td><?php echo $c->createdat; ?></td>  
					<td><?php echo $c->user; ?></td> 			 
                     <td>
                     <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/editsms?randomitemidentifier=<?php   {echo  $id;}  ?>">Update </a>
         </td>
		        
             </tr>

             <?php endforeach; ?>

              <?php }?>

        </table>

</div>

</div>



















<div class="tab-pane box" id="add" style="padding: 5px">




		
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Add new SMS
            	</div>
            </div>
			<div class="panel-body">





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

     $data['email'] = $session_data['email'];
 	 $data['id'] = $session_data['id'];
	$userid=$data['id'];
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/addsms' , 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="inpunumber" class="col-sm-2 control-label">Receiver Number</label>
    <div class="col-sm-7">
		  		<input type="text" name="number" value="<?php echo set_value('number'); ?>"id="number" class="form-control" required placeholder="Enter  number">
     <span class="text-danger"><?php echo form_error('number'); ?></span>
   </div>
  </div>	
    		<input type="hidden" name="userid" value="<?php echo set_value('userid',$userid); ?>"id="userid" class="form-control" required placeholder="Enter userid">

  		<input type="hidden" name="action" value="<?php echo set_value('action','insert'); ?>"id="action" class="form-control" required placeholder="Enter action">

  
   <div class="form-group">
    <label for="inputmessage" class="col-sm-2 control-label">Message </label>
    <div class="col-sm-7">
	<textarea name="message" id="ttt" rows="5" placeholder="add Message" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('message'); ?></span>
   </div>
  </div>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_sms"value="sms" class="btn btn-primary">Click to ADD SMS</button>

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


    </div>
	
	
	
	
	 <div   class="tab-pane box" id="house">
				
    
		<div class="panel panel-primary" data-collapsed="0">


		
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
			Advance Search for specific house per plot
            	</div>
            </div>
			<div class="panel-body">





				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();
				$date= Date('Y-m-d');
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/searchallhouse' , 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="field-2" class="col-sm-2 control-label">Plot Name</label>
		                    <div class="col-sm-7" >
		                        <select name="plotno" class="form-control"  id="plotno"  style="width: 100px;"  required>
		                            <option selected value="">--Select Plot--</option>
									   <?php
									$plot = $this->adminusermodel->populateallplots();


if(is_array($plot)) {

   foreach($plot as $plotrow){

    ?>
	    <option  value="<?php echo set_value('plotno',$plotrow->id); ?> "><?=$plotrow->name;?></option>

   
    <?php

}} else {
    echo 'There is no plot in the system.... Please add plot first.';
}

?>
			                        
			                    </select>
								     <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">House number</label>
		                    <div class="col-sm-7" id="house"  >
		                        <select name="houseno" class="form-control"  id="houseid"   >
		                            <option selected value="none">--All houses--</option>
									  
			                        
			                    </select>
								
								     <span class="text-danger"><?php echo form_error('houseno'); ?></span>
			                </div>
	</div>
	

	

    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Send SMS</button>

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




