<?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="page-content" >  
<div class="row">
    <!--<div class="col-sm-5">
        <div class="widget-box">
            <div class="widget-header" style="height:40px;">
                <h5  style="text-align:center; color:red;"><b> Search By Date And Anyone Selector ( Category Or Payment Type )</b> </h5>
            </div>

            <div class="widget-body">
                <div class="widget-main no-padding"> 
                    <form action="<?php //echo admin_url()?>/extraincomesetup/searchSingleBydate " method="post">

                        <fieldset class="col-xs-12 col-sm-12">
                                <div class="col-xs-3 col-sm-3"><label>Date</label></div>
                                <?php //echo form_error('data[date]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-6 col-sm-6">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[date]" value="<?php //echo set_value('data[date]',false); ?>" placeholder="dd-mm-yyyy" data-date-format="dd-mm-yyyy" />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                        </fieldset>
                        <?php //if(!empty(getCategoryInfo())){?>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-3 col-sm-3">Category</label>
                            <?php //echo form_error('data[incomeCategory]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[incomeCategory]" class="col-xs-6 col-sm-6">
                                    <option value=""> Select Income Category.....</option>
                                <?php //foreach(getCategoryInfo() as $value){?>
                                    <option value="<?php //if(!empty($value['category_id'])){echo $value['category_id'];}?>" <?php //echo set_select('data[incomeCategory]',$value['category_id'],FALSE);?>>
                                    <?php //if(!empty($value['category_name'])){echo $value['category_name'];}?>
                                    </option>
                                <?php //}?>
                            </select>
                           
                        </fieldset>
                        <?php //}?>
                        
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-3 col-sm-3">Payment Type </label>
                            <?php //echo form_error('data[payment_type]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[payment_type]" class="col-xs-6 col-sm-6">
                                    <option value="0"> Select Payment Type.....</option>>
                                <?php //foreach(getPaymentType() as $key=>$value){?>
                                    <option value="<?php //echo $key?>" <?php //echo set_select('data[payment_type]',$key,FALSE);?>>
                                        <?php //echo $value;?>
                                    </option>
                                <?php //}?>
                            </select>
                           
                        </fieldset>

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

                        <div class="form-actions center">
                            <button type="submit" name="btnSdate" class="btn btn-sm btn-success">
                                 <i class="ace-icon fa fa-undo bigger-110"></i>
                                Search 
                                
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>-->
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:40px;">
                <h5  style="text-align:center; color:red;"><b> Search By Employee</b> </h5>
            </div>

            <div class="widget-body">
                <div class="widget-main no-padding">
                    <form action="<?php echo admin_url()?>/extraincomesetup/searchBydaterangeandemp " method="post">
                    
                        <!-- <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label>Date From</label></div>
                                <?php echo form_error('data[fromdate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-8 col-sm-8">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[fromdate]" value="<?php echo set_value('data[fromdate]',false); ?>" placeholder="dd-mm-yyyy" data-date-format="dd-mm-yyyy" />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                        </fieldset>

                        <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label>Date To</label></div>
                                <?php echo form_error('data[todate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-8 col-sm-8">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[todate]" value="<?php echo set_value('data[todate]',false); ?>" placeholder="dd-mm-yyyy" data-date-format="dd-mm-yyyy" />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                        </fieldset> -->
                        
                        <!-- <?php //if(!empty(getCategoryInfo())){?>
                        <fieldset class="col-xs-6 col-sm-6">
                            <label class="col-xs-4 col-sm-4">Category</label>
                            <?php echo form_error('data[incomeCategory]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[incomeCategory]" class="col-xs-8 col-sm-8" id="category" onchange="checkedSellection()">
                                    <option value=""> Select Income Category.....</option>
                                <?php foreach(getCategoryInfo() as $value){?>
                                    <option value="<?php if(!empty($value['category_id'])){echo $value['category_id'];}?>" <?php echo set_select('data[incomeCategory]',$value['category_id'],FALSE);?>>
                                    <?php if(!empty($value['category_name'])){echo $value['category_name'];}?>
                                    </option>
                                <?php }?>
                            </select>
                           
                        </fieldset>
                        <?php //}?> -->

                        <fieldset class="col-xs-6 col-sm-6">
                            <label class="col-xs-4 col-sm-4">Select Employee</label>
                            <?php echo form_error('data[employee_id]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                             
                             <select name="data[employee_id]" class="col-xs-8 col-sm-8" id="form-field-select-3" data-placeholder="Choose a State...">
                                 <option value=""> Select Employee Id......  </option>
                                 <?php if(!empty($allEmployeeId)){
                                        foreach($allEmployeeId as $value){
                                    ?>
                                    <option value="<?php echo $value['userId'];?>" <?php echo set_select('data[employee_id]',$value['userId'],FALSE);?>>
                                        <?php 
                                            echo $value['userId']; $emp_usrname=getEmployeeById($value['userId']); echo "(".$emp_usrname['userName']." ) ";
                                           
                                        ?>
                                    </option>
                                    <?php }
                                        }
                                    ?>
                            </select>
                            
                         </fieldset>


                        <!-- <fieldset class="col-xs-6 col-sm-6">
                            <label class="col-xs-4 col-sm-4">Payment Type </label>
                            <?php echo form_error('data[payment_type]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[payment_type]" class="col-xs-8 col-sm-8" id="paymentType" >
                                    <option value="0"> Select Payment Type.....</option>>
                                <?php foreach(getPaymentType() as $key=>$value){?>
                                    <option value="<?php echo $key?>" <?php echo set_select('data[payment_type]',$key,FALSE);?>>
                                        <?php echo $value;?>
                                    </option>
                                <?php }?>
                            </select>
                           
                        </fieldset> -->

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

                        <div class="form-actions center">
                            <button type="submit" name="btnSdateRangeEmp" class="btn btn-sm btn-success">
                                 <i class="ace-icon fa fa-undo bigger-110"></i>
                                Search By Employee
                                
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    </div>
<!--Calculation Amount  -->
     <?php 
     //if(!empty($extraincome)){
    //         $count=count($extraincome);
    //         //echo $extraincome[0]['extraincomeAmount'];
    //         $count1=0;
    //         for ($i=0;$i<$count;$i++) {
    //             $count1=$count1 + $extraincome[0]['extraincomeAmount'];
    //         }
    //         echo $count1;
    //}
        ?>

 
<!--     <?php if(!empty($extraincome) || !empty($income)){?> 
    <div class="row">
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:40px;">
                <h4  style="text-align:center; color:green;"><b> Total Income</b> </h4>
            </div>

            <div class="widget-body">
                <div class="widget-main no-padding">
                    <form >
                    <fieldset class="col-xs-4 col-sm-4"></fieldset>
                        <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label style="color:green;"><b>By Category</b></label></div>
                                
                                <div class="input-group col-xs-8 col-sm-8">
                                    <span style="color:red;">
                                        <?php if(!empty($extraincome))
                                            {
                                                $count=0;
                                                foreach ($extraincome as $total) 
                                                {
                                                    $count=$count + $total['amount'];
                                                }
                                                echo $count;
                                            }else{echo $count=0;}
                                        ?>
                                    </span>
                                </div>
                        </fieldset>
                        <fieldset class="col-xs-4 col-sm-4"></fieldset>
                        <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label style="color:green;"><b>Income From Customer</b></label></div>

                                
                                <div class="input-group col-xs-8 col-sm-8">
                                    
                                    <span style="color:red;">
                                         <?php if(!empty($income))
                                            {
                                                $countsalary=0;
                                                foreach ($income as $total) 
                                                {
                                                    $countsalary=$countsalary + $total['amount'];
                                                }
                                                echo $countsalary;
                                            }else{echo $countsalary=0;}
                                        ?>
                                    </span>
                                </div>
                        </fieldset>
                        <fieldset class="col-xs-4 col-sm-4"></fieldset>
                        <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label style="color:green;"><b>Total Income</b></label></div>

                                
                                <div class="input-group col-xs-8 col-sm-8">
                                   
                                    <span style="color:red;">
                                    <?php if(!empty($count) || !empty($countsalary)) {echo $count + $countsalary ; }else{echo 0;}?>
                                    </span>
                                </div>
                        </fieldset>
                        <div class="clearfix"></div>
                        <div class="form-actions center">
                           
                        </div>
                        
                    </form>
                </div>
            </div>
        </div>
    </div>
    </div>
     <?php }?> -->
 
    <?php 
        // $data['customerId']='2019-01-342';
        // $data['customertotaland'] =$this->extraincomesetupmodel->incomebycusttotal($data['customerId']);
        // foreach ($data['customertotaland'] as $key => $custvalue) {
        //         echo "".$custvalue['amount']."<br>";
        // }
    ?>
<!-- End Calculation Amount  -->
  <?php 
        // foreach ($customertotal as $key => $csamtvalue) {
        //         echo "".$csamtvalue['customerId']." ".$csamtvalue['amount']."<br>";
        //     }
    ?>

    <?php 
    // if (!empty($customertotal) && $customertotal['customerId'] ='016') {
    //         echo "customerId: ".$customertotal['customerId']."amount: ".$customertotal['amount']."<br>";
    //         echo "".$csamtvalue['customerId']." ".$csamtvalue['amount']."<br>";
    //     }
    ?>


 <!--    Start table   -->

 <div class="clearfix"></div> 
  
  <?php if(!empty($custbyemployee)){?>




 <div id="printDIV" > 
  
<div class="row col-xs-12 col-sm-12">
<div class="col-xs-12 col-sm-12 widget-container-col">
                                        <div class="widget-box widget-color-blue">
                                            <div class="widget-header">
                                                <h5 class="widget-title bigger lighter">
                                                    
                                                    Customer Details by Employee                                                     
                                                </h5>
                                                <!-- <button style='margin:0px 0px 0px 400px;' onclick="javascript:printDiv('printDIV')" type="button" class="btn"> PRINT </button> -->
                                                 <i class="red ace-icon glyphicon glyphicon-print  bigger-130" style='margin:0px 0px 0px 1100px;' onclick="javascript:printDivmulti('cinfo','printDIV')"></i> 
                                                <!-- <i class="red ace-icon glyphicon glyphicon-print  bigger-130" style='margin:0px 0px 0px 1100px;' id="iconprint1" onclick="javascript:printDiv('printDIV')"></i> -->  
                                            </div>

                                            <div class="widget-body">
                                                <div class="widget-main no-padding">
                                                    <table id="mytable" class="table table-striped table-bordered table-hover">
                                                            <tr>
                                                                <th>
                                                                    <i ></i>
                                                                    Serial
                                                                </th>

                                                                <th >
                                                                  
                                                                    Customer Id & Name
                                                                </th>
                                                                <th class="hidden-480">Booking Date</th>
                                                                <th class="hidden-480">Total Cost</th>
                                                                <th class="hidden-480">Down Payment</th>
                                                                <th class="hidden-480">Total Paid</th>
                                                                <th class="hidden-480">Total Dues</th>
                                                            </tr>
                                                            
                                                <?php $i=0; foreach($custbyemployee as $value){ ?>
                                                            <tr>
                                                                <td ><?php echo ++$i ?></td>

                                                                <td style="color:red;"><?php echo ++$i.'  .';?>
                                                                    Id :&nbsp;&nbsp;<?php echo $value['customerId'];?><br/>
                                                                    Name:&nbsp;&nbsp;

                                                                    <?php  $sl_id = getlandCustomerslIdById($value['customerId']);?>
                                                                    <a href="<?php  echo base_url('admin/landcustomerRegistration/viewProfile').'/'.$sl_id[0]['id'];?>">
                                                                        <?php
                                                                            $app_name=getlandCustomerNameById($value['customerId']);
                                                                            echo $app_name['applicant_name'];
                                                                        ?>
                                                                        <?php
                                                                            // $refname=getlandCustomerNameById($value['customerId']);
                                                                            // echo $refname['ref_id'];
                                                                        ?>
                                                                    </a>
                                                                    
                                                                </td>
                                                                <td class="hidden-480">
                                                                    <?php echo $value['date'];?>                        
                                                                </td>
                                                                <td><?php echo $value['total_cost'];?></td>
                                                                <td><?php echo $value['down_payment']; ?></td>
                                                                <td>
                                                <?php 
                                                    // if (!empty($customertotal) && $customertotal['customerId'] =$value['customerId']) {
                                                    // if (!empty($customertotal) && $customertotal['customerId'] =$value['customerId']) {
                                                    //         echo "customerId: ".$customertotal['customerId']." amount: ".$customertotal['amount']."<br>";
                                                    // echo "".$csamtvalue['customerId']." ".$csamtvalue['amount']."<br>";
                                                        // }
                                                    ?>
                                                  <?php 
                                                    $data['customerId']= $value['customerId'];
                                                    $data['customertotaland'] =$this->extraincomesetupmodel->incomebycusttotal($data['customerId']);
                                                    foreach ($data['customertotaland'] as $key => $custvalue) {
                                                        if (!empty($custvalue['amount'])) {
                                                            echo "".$custvalue['amount']."<br>";
                                                            $total_paids= "".$custvalue['amount']."";
                                                        } else{ echo //$value['down_payment']
                                                        "0";
                                                            
                                                        }
                                                            
                                                        }
                                                        

                                                        
                                                ?>
                                                                            
                                                        </td>
                                                        <td>
                                                            <?php 
                                                            $totalpaid= $custvalue['amount']+$value['down_payment'];
                                                            $duestotal= $value['total_cost']-$totalpaid;
                                                                echo $duestotal; 
                                                                ?></td>
                                                        </tr>
                                                <?php }?>
                                                             
                                                    </table>
                                                    <table class="table table-striped table-bordered table-hover">
                                                        <tr>
                                                            <td colspan="7" style="text-align: center; font-size: 20px;"><span style="color: green;">Total Paids:</span> 
                                                                <span id="showtotalpaids"></span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                </div><!-- /.span -->
    </div><!-- /.row -->
    </div>
    <?php } ?>



<!-- <table id="table" border="1" style="visibility: visible;">
 <tr>                                             
     <th>value</th>
 </tr>
    <?php $i=0; foreach($custbyemployee as $value){ ?>
       <?php echo "<tr><td>" . $value["total_cost"]. "</td></tr>"; ?>
    <?php }?>    
</table> -->


    <script>
    
    var table = document.getElementById("mytable"), sumVal = 0;
    
    for(var i = 1; i < table.rows.length; i++)
    {
        sumVal = sumVal + parseInt(table.rows[i].cells[5].innerHTML);
    }
    
    document.getElementById("showtotalpaids").innerHTML = "" + sumVal;
    //console.log(sumVal);
    
</script>
    <!--   -----------------------company info----------------------------------- -->
<div class="col-sm-2"></div>
    <div class="col-sm-10 hidden " id="cinfo" >
                                                            <div class="row">
                                                                <div class="col-xs-11 label label-lg label-info arrowed-in arrowed-right">
                                                                    <b>Company Info</b>
                                                                </div>
                                                            </div>

                                                            <div>
                                                                <ul class="list-unstyled spaced">

                                                                    <li>
                                                                    <i class="ace-icon fa fa-caret-right blue"></i>
                                                                    <span >Company Name:</span>
                                                                        
                                                                        Hasan Homes and Developers Limited
                                                                    </li>

                                                                    <li>
                                                                    <i class="ace-icon fa fa-caret-right blue"></i>
                                                                        <span >Address:</span>
                                                                        <?php echo "A.R Khan,Treade Center(4th Flore),40/1 , Nyapolton ,Motijil ,Dhaka-1000"?>
                                                                    </li>

                                                                    <li>

                                                                        <i class="ace-icon fa fa-caret-right blue"></i><span >Branch :</span>
                                                                        Dorigaw Stand ,Dokkkhin keranigong , Dhaka-1310
                                                                    </li>

                                                                    <li>
                                                                        <i class="ace-icon fa fa-caret-right blue"></i>
                                                                        Phone:
                                                                        02-9355530,
                                                                        Mobile:
                                                                        01977-672672, 01711-437255, 01726-235544</b>
                                                                    </li>

                                                                    <li>
                                                                        <i class="ace-icon fa fa-caret-right blue"></i>
                                                                        Email: info@hasanhomesltd.com
                                                                    </li>
                                                                    <li >
                                                                        <i class="ace-icon fa fa-caret-right blue"></i>
                                                                        Web: www.hasanhomesltd.com
                                                                    </li>

                                                                    <li>
                                                                        <i class="ace-icon fa fa-caret-right blue"></i>
                                                                        Paymant Info
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div><!-- /.col -->




    <!--   ---------------------------End company info---------------------------------- --> 

<?php if(!empty($income)){?> 
 <div id="printDIV1" > 
    
<div class="row col-xs-12 col-sm-12">
<div class="col-xs-12 col-sm-12 widget-container-col">
                                        <div class="widget-box widget-color-blue">
                                            <div class="widget-header">
                                                <h5 class="widget-title bigger lighter">
                                                    
                                                    Income From Customer
                                                    
                                                </h5>
                                                <!--<button style='margin:0px 0px 0px 300px;' onclick="javascript:printDivmulti('cinfo','printDIV1')" type="button" class="btn"> PRINT </button>-->
                                               <i class="red ace-icon glyphicon glyphicon-print  bigger-130" style='margin:0px 0px 0px 1100px;' onclick="javascript:printDivmulti('cinfo','printDIV1')"></i> 
                                               <!--<i class="red ace-icon glyphicon glyphicon-print  bigger-130" id="printicon" style='margin:0px 0px 0px 1100px;' onclick="javascript:printDiv('printDIV1')"></i>--> 
                                            </div>

                                            <!-- <div class="widget-body">
                                                <div class="widget-main no-padding">
                                                    <table class="table table-striped table-bordered table-hover">
                                                        <thead class="thin-border-bottom">
                                                            <tr>
                                                                <th>
                                                                   
                                                                   Serial
                                                                </th>

                                                                <th >
                                                                   Customer 
                                                                </th>
                                                                <th>Payment Type </th>
                                                                <th class="hidden-480">Amount</th>

                                                                <th class="hidden-480">
                                                                   date
                                                                </th>
                                                            </tr>
                                                        </thead>

                                                       <tbody>
                                               <?php $i=0;foreach($income as $value){ ?>             

                                                            <tr>
                                                                <td ><?php echo ++$i ?></td>

                                                                <td>
                                                                     <a href="#">
                                                                     	<?php
                                                                     		$app_name=getlandCustomerNameById($value['customerId']); 
                                                                     		echo "Id:".$value['customerId']."</br> Name: ".$app_name['applicant_name'];?>
                                                                    </a>
                                                                </td>
                                                                <td>
                                                                    <a href="#"><?php if(!empty($value['payment_type'])){ echo element($value['payment_type'],getPaymentType() ,null);}?></a>
                                                                </td>
                                                                <td class="hidden-480">
                                                                    <span class="label label-warning"><?php echo $value['amount']?></span>
                                                                </td>
                                                                
                                                                <td>
                                                                    <a href="#"><?php echo $value['date']?></a>
                                                                </td>
                                                            </tr>
                                                <?php }?>

                                                            <tr>
                                                                <td></td>
                                                                <td></td>
                                                                <td></td>
                                                                <td style="color:red;">

                                                                        <?php if(!empty($income))
                                                                        {
                                                                            $countsalary=0;
                                                                            foreach ($income as $total) 
                                                                            {
                                                                                $countsalary=$countsalary + $total['amount'];
                                                                            }
                                                                            echo "Total Amount  =<b><i>".$countsalary."</i></b>  Taka";
                                                                        }else{echo $countsalary=0;}
                                                                    ?>
                                                                    
                                                                </td>
                                                                <td></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div> -->
                </div><!-- /.span -->
    </div><!-- /.row -->
    </div>
    
<?php }?>
<!--<button style='margin:0px 0px 0px 300px;' onclick="javascript:printDivmulti('cinfo','printDIV1')" type="button" class="btn"> PRINT </button>-->
<!--   end table   -->
    </div>


 <script type="text/javascript"> 
    // function checkedSellection(){
    //    var category=document.getElementById('category').value;
    //    var paymentType=document.getElementById('paymentType').value;
    //    if(category !=""){
    //       document.getElementById("category").disabled = false;
    //         document.getElementById("paymentType").disabled = true;
    //    }
    //    else{
    //         document.getElementById("category").disabled = true;
    //         document.getElementById("paymentType").disabled = false;
    //          // document.getElementById("category").disabled = true;
    //          // document.getElementById("paymentType").disabled = false;
    //    }
    
    
    
    
   // function myPrint() {
        //var myPrintContent = document.getElementById('printDIV1');
        //var myPrintWindow = window.open(windowUrl, windowName, 'left=300,top=100,width=400,height=400');
        //myPrintWindow.document.write(myPrintContent.innerHTML);
        //myPrintWindow.document.getElementById('hidden_div').style.display='block'
        //myPrintWindow.document.close();
        //myPrintWindow.focus();
        //myPrintWindow.print();
       // myPrintWindow.close();    
        //return false;
    //}

    $(document).ready(function(){
       
        //$('#cinfo').hide();
       // $('#printicon').click(function(){
       // alert('lo');
             // $('#cinfo').show();
            // var cinfo=$('#cinfo').html();
            // var divContents = $("#printDIV").html();
            // var printWindow = window.open('', '', 'height=400,width=900');
            // printWindow.document.write('<html><head><title>DIV Contents</title>');
            // printWindow.document.write('</head><body >');
            // printWindow.document.write(cinfo+'<br/>'+divContents);
            // printWindow.document.write('</body></html>');
            // printWindow.document.close();
            // printWindow.print();
        });
    });
   

</script>