<div class="page-content" >
    
    
<div class="row">

    <div class="col-xs-12 col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:70px;">
                <h4  style="text-align:center; color:green;"><b> Send SMS to Customer</b> </h4>
            </div>
            
            <div class="widget-body "> 
            
                 <?php
                                $message = $this->session->userdata('message');
                                if (!empty($message)) {
                                    ?>
                                    <div class="alert alert-block alert-success">
                                        <h6 class="lighter arial green" style="text-align:center;"><b>
                                                <?php echo $message;
                                                $this->session->unset_userdata('message');
                                                ?>
                                            </b></h6>
                                    </div>  
                                    <?php
                                }
                                $errormessage = $this->session->userdata('errormessage');
                                if (!empty($errormessage)) {
                                    ?>
                                    <div class="alert alert-block alert-danger">
                                        <h6 class="lighter arial red" style="text-align:center;"><b>
                                                <?php echo $errormessage;
                                                $this->session->unset_userdata('errormessage');
                                                ?>
                                            </b></h6>
                                    </div> 
                                    <?php
                                }
                                ?>
                <div class="widget-main no-padding ">
                    <form action="<?php echo admin_url()?>/sendsms/send " method="post" enctype="multipart/form-data">
                        <div class="row">
                            <div class="col-md-7 col-sm-12">
                                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                    
                                <!--<table class="table table-striped table-bordered table-hover">-->
                                                <div class="dataTables_length" id="dynamic-table_length">
                                                <select name="dynamic-table_length" aria-controls="dynamic-table" class="form-control input-sm">
                                                    <option value="250">250</option>
                                                    <option value="500">500</option>
                                                    <option value="1000">1000</option>
                                                    <option value="5000">5000</option>
                                                    </select> </div>
                                                
                                                    <tr style="color:red;">
                                                        <th style="color:red;">ID</th>
                                                        <th>Customer Name</th>
                                                        <th>Mobile</th>
                                                        <th><input type="checkbox" id="ckbCheckAll" /> Select All</th>
                                                        <th></th>
                                                        <th></th>
                                                        <th></th>
                                                        <!--<th>Nominee Name</th>-->
                                                        <!--<th>Nominee Mobile</th>-->
                                                        <!--<th>Select</th>-->
                                                    </tr>
                                                </thead>

                                                <tbody>

                                                <?php $i=0;  foreach($allLandcustomer as $value){?>
                                
                                                                                    <tr>
                                
                                
                                                                                        <td>
                                                                                            <?php if(!empty($value['customerId'])) {echo $value['customerId'];}?>
                                                                                        </td>
                                                                        <td style="color:red;">
                                                                            
                                                                                <a href="<?php echo admin_url()?>/landcustomerRegistration/viewProfile/<?php echo $value['id'];?>">
                                                                                    <?php echo $value['applicant_name'];?></a><br/> 
                                                                                    
                                                                                        </td>
                                                                                <td>
                                                                                    <?php if(!empty($value['mobile'])) {echo $value['mobile']."";}?>
                                                                                </td>
                                                                                <td><p id="checkBoxes">
                                                                                    <input class="checkBoxClass" type="checkbox" name="data[<?php if(!empty($value['customerId'])) {echo $value['customerId'];}?>]" value="<?php if(!empty($value['mobile'])) {echo $value['mobile']."";}?>"> 
                                                                                    </p>
                                                                                    </td>
                                                                                
                                                                            
                                                         <!--<td><?php //  echo $value['nomineeName'];?> </td>-->
                                                         <!--<td><?php //  echo "" .$value['nominee_mobile'];?></td>-->
                                                         <!--<td><input type="checkbox" name="ndata[a1b2<?php// if(!empty($value['customerId'])) {echo $value['customerId'];}?>]" value="<?php// if(!empty($value['nominee_mobile'])) {echo $value['nominee_mobile']."";}?>"> </td>-->
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                                                        
                                                                                    </tr>
                                
                                                   <?php }?>


                                                </tbody>
                                            </table>

                            </div>
                            <div class="col-md-5 col-sm-12">
                                <br><br>
                                <!--character counter-->
                                 <script>
                    $(document).ready(function() {
                        var text_max = 160;
                        $('#textarea_feedback').html(text_max + ' characters remaining');
                    
                        $('#textarea').keyup(function() {
                            var text_length = $('#textarea').val().length;
                            var text_remaining = text_max - text_length;
                    
                            $('#textarea_feedback').html(text_remaining + ' characters remaining');
                        });
                    });
                    </script>
                    

                    
<script>
    $(document).ready(function () {
    $("#ckbCheckAll").click(function () {
        $(".checkBoxClass").prop('checked', $(this).prop('checked'));
    });
    
    $(".checkBoxClass").change(function(){
        if (!$(this).prop("checked")){
            $("#ckbCheckAll").prop("checked",false);
        }
    });
});
</script>



                        <fieldset class="col-md-12 col-sm-12">
                            <label class="col-xs-4 col-sm-4"> Write SMS </label>
                            <?php echo form_error('data[sms]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            
                           <textarea rows='8' cols="3"  name="sdata[sms]" class="col-xs-8 col-sm-8" id="textarea" maxlength="160"><?php echo set_value('data[parmanentAddress]',false); ?></textarea> 
                                
                        </fieldset>
                        <fieldset class="col-md-12 col-sm-12">
                            <span class="col-xs-4 col-sm-4"> .</span>
                            <div style="font-size: 18px; color:red; " id="textarea_feedback"></div>
                        </fieldset>
                        <div class="clearfix"></div>

                        <div class="form-actions center">
                            <button type="submit" name="btnSend" class="btn btn-sm btn-success">
                                 <i class="ace-icon fa fa-check bigger-110"></i>
                                Send SMS
                                
                            </button>
                        </div>
                            </div>
                        </div>
                        
                   
                    </form>
                </div>
            </div>
        </div>
    </div></div></div>

