<div class="page-content" >   
<div class="row">
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:30px;">
                <h4  style="text-align:center; color:green;"><b> Customer Call Entry</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
                                }
                                ?>
                               


    <br><br>
<!--<fieldset class="col-xs-12 col-sm-12">       -->
<!--<div class="col-xs-2 col-sm-2"><label for="option">Select Refs.</label></div>-->
<!--<div class="col-xs-6 col-sm-6">-->
<!--<select class="form-control" name="select" id="select">                          -->
<?php
    // foreach($allemployee as $row)
    // {
    //     echo '<option value="option'.$row->userId.'">'.$row->userName.'</option>';
    // }
    ?>
<!--</select>-->
<!--</div>-->
<!--</fieldset>-->
<!--<br><br>-->



                    <div class="widget-main no-padding">
                    <form action="<?php echo admin_url()?>/customerCalls/insert_call " method="post">
                            <fieldset class="col-xs-12 col-sm-12">       
                            <div class="col-xs-2 col-sm-2"><label for="option">Select Customer</label></div>
                                
                            <div class="col-xs-6 col-sm-6">
                                <?php
                                        echo "<div class='option00' style='display:block'>
                                            <select name='data[customerId]' class='form-control'>";
                                                if(!empty($allCustomers)){
                                                    foreach($allCustomers as $acdata){
                                                        echo " <option value='".$acdata['customerId']."'>".$acdata['customerId']." , ".$acdata['applicant_name']." CM: ".$acdata['mobile']." NM: ".$acdata['nominee_mobile']."</option>";
                                                      }
                                                }
                                                    
                                          echo"</select></div>";
                                        
                                        // echo "
                                        //     <select name='data[customerId]' class='form-control'>
                                        //     <div class='option00' style='display:block'>";
                                        //         if(!empty($allCustomers)){
                                        //             foreach($allCustomers as $acdata){
                                        //                 echo " <option value='".$acdata['customerId']."'>".$acdata['customerId']." , ".$acdata['applicant_name']." CM: ".$acdata['mobile']." NM: ".$acdata['nominee_mobile']."</option>";
                                        //               }
                                        //         }
                                                    
                                        //   echo"</div></select>";
                                        
                             ?>     
                             
                             
                            <?php
                            
                            // foreach($allemployee as $row)
                            //     {
                            //         $user_id=$row->userId;
                            //         $getcustbyr=$this->CREGModel->getRef($user_id); 
                            //             echo "<div class='option".$user_id."' style='display:none'>
                            //                 <select name='data[customerId]' class='form-control'>";
                            //                     if(!empty($getcustbyr)){
                            //                         foreach($getcustbyr as $cdata){
                            //                             echo " <option value='".$cdata['customerId']."'>".$cdata['customerId']." , ".$cdata['applicant_name']." CM: ".$cdata['mobile']." NM: ".$cdata['nominee_mobile']."</option>";
                            //                           }
                            //                     }
                                                    
                            //               echo"</select></div>";
                            //     }
                            
                            
                            // foreach($allemployee as $row)
                            //     {
                            //         $user_id=$row->userId;
                            //         $getcustbyr=$this->CREGModel->getRef($user_id); 
                            //             echo "
                            //                 <div class='option".$user_id."' style='display:none'>";
                            //                     if(!empty($getcustbyr)){
                            //                         foreach($getcustbyr as $cdata){
                            //                             echo " <option value='".$cdata['customerId']."'>".$cdata['customerId']." , ".$cdata['applicant_name']." CM: ".$cdata['mobile']." NM: ".$cdata['nominee_mobile']."</option>";
                            //                           }
                            //                     }
                                                    
                            //               echo"</div>";
                            //     }
                             ?>
                             
                             
                             
                             </div>
                            </fieldset>
                        <?php 
                        $dt = new DateTime();
                        $tz = new DateTimeZone('Asia/Dhaka'); // or whatever zone you're after
                        $dt->setTimezone($tz);
                        $time_now= $dt->format('Y-m-d H:i:s');
                        ?>
                        <input class="form-control" type="hidden" name="data[date]" value="<?php echo $time_now; ?>"/>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Call Details </label>
                            <?php echo form_error('data[description]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <textarea name="data[description]" autocomplete="off" class="col-xs-6 col-sm-6" placeholder="Description...."><?php echo set_value('data[description]',false); ?></textarea>
                                        
                        </fieldset>

                        
                        <div class="clearfix"></div>

                        <div class="form-actions center">
                            <button type="submit" class="btn btn-sm btn-success"><i class="ace-icon fa fa-check bigger-110"></i>Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div></div></div>
    
    
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>                      
<script>
    var hideAll = function() {
  $('div[class^=option]').hide();
}

$('#select').on('change', function() {
  hideAll();
  var category = $(this).val();

  $('.' + category).show();
});
</script>




    