<div class="widget-box ">
<?php if(!empty($customerById)){?>
<div class="clearfix"></div>

<div class="hr dotted"></div>

<div>
<div class="alert alert-block alert-info">
 <h4 class="lighter arial red" style="text-align:center;"><b>Customer Profile</b></h4>
 </div>
									<div id="user-profile-1" class="user-profile row">
										<div class="col-xs-12 col-sm-3 center">
											<div>
												<span class="profile-picture">
												<?php if(!empty($customerById['photo'])){?>
													<img id="avatar" class="editable img-responsive" alt="Alex's Avatar" src="<?php if(file_exists($customerById['photo'])){ echo base_url().$customerById['photo'];}else{ echo base_url()."uploadimage/customerImage/logo1.png"; }?> " />
													<?php }?>
												</span>

												<div class="space-4"></div>


												<div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
													<div class="inline position-relative">
														<a href="#" class="user-title-label dropdown-toggle" data-toggle="dropdown">
															<i class="ace-icon fa fa-circle light-green"></i>
															&nbsp;
															<span class="white"><?php if(!empty($customerById['applicant_name'])){ echo $customerById['applicant_name'];}?></span>
														</a>
													</div>
												</div>
											</div>



										</div>

										<div class="col-xs-12 col-sm-9">


											<div class="space-12"></div>

											<div class="profile-user-info profile-user-info-striped">

											

												<div class="profile-info-row">
													<div class="profile-info-name"> Customer Name  </div>

													<div class="profile-info-value">
														<span class="editable" id="pay-history"><?php if(!empty($customerById['applicant_name'])){ echo $customerById['applicant_name'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Id </div>

													<div class="profile-info-value">
														<span class="editable" id="pay-history-id"><?php if(!empty($customerById['customerId'])){ echo $customerById['customerId'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> National Id </div>

													<div class="profile-info-value">
														<span class="editable" id="login"><?php if(!empty($customerById['nationalid'])){ echo $customerById['nationalid'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Mobile </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['mobile'])){ echo $customerById['mobile'];}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Email </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['email'])){ echo $customerById['email'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Booking Date </div>

													<div class="profile-info-value">
														<span class="editable" id="book-date"><?php if(!empty($customerById['date'])){ echo $customerById['date'];}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Father's Name </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['fatherName'])){ echo $customerById['fatherName'];}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Mother's Name </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['motherName'])){ echo $customerById['motherName'];}?></span>
													</div>
												</div>
												


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


<!--  ___________________________________________Project Details ___________________________________-->

<div class="alert alert-block alert-info">
 <h4 class="lighter arial red" style="text-align:center;"><b>Plot Information </b></h4>
 </div>
									<div id="user-profile-1" class="user-profile row">
										<div class="col-xs-12 col-sm-3 center">
											<div>


												<div class="space-4"></div>


												<div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
												:: Notice Board ::
												</div>
											</div>


										</div>

										<div class="col-xs-12 col-sm-9">


											<div class="space-12"></div>
											<div class="profile-user-info profile-user-info-striped">
											<div class="profile-info-row">
													<div class="profile-info-name"> Project Name  </div>

													<div class="profile-info-value">
														<span class="editable" id="ref-id"><?php if(!empty($customerById['project_name'])){ echo $customerById['project_name'];}?></span>
													</div>
												</div>
											
												<div class="profile-info-row">
													<div class="profile-info-name"> Block No  </div>

													<div class="profile-info-value">
														<span class="editable" id="customer-block"><?php if(!empty($customerById['projectBlockNo'])){ echo $customerById['projectBlockNo'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Road No </div>

													<div class="profile-info-value">
														<span class="editable" id="customer-road"><?php if(!empty($customerById['roadNo'])){ echo $customerById['roadNo'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Plot No  </div>

													<div class="profile-info-value">
														<span class="editable" id="customer-plot-no"><?php if(!empty($customerById['plotNo'])){ echo $customerById['plotNo'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Plot Size </div>

													<div class="profile-info-value">
														<span class="editable" id="customer-plot-size"><?php if(!empty($customerById['plote_size'])){ echo $customerById['plote_size'];}?></span>
													</div>
												</div>



												<div class="profile-info-row">
													<div class="profile-info-name"> Plot Face </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['plote_face'])){ echo element($customerById['plote_face'],getPlotface(),null);}?></span>
													</div>
												</div>


												<div class="profile-info-row">
													<div class="profile-info-name"> Plot Total Cost </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['total_cost'])){ echo $customerById['total_cost'];}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Payment Type </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['payment_type'])){ echo element($customerById['payment_type'],getPaymentType() ,null);}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Down Payment </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['down_payment'])){ echo $customerById['down_payment'];}?></span>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name"> Dues / Instal Installment per month   </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['dues'])){ echo $customerById['dues'];}?></span>
													</div>
												</div>
												

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




<!--  ___________________________________________End Project Details ___________________________________-->
								</div>



<!--=======================================================-->
<!-- search box -->
<div class="col-xs-12">
                    
<!--=======================================================-->
<!-- end search box -->
<!--=======================================================-->
    <div class="page-content" style="margin-bottom: 50px;">
        <div class="row">
            <?php
            $message = $this->session->userdata('message');
            if (!empty($message)) {
                ?>
                <div class="alert alert-block alert-success">
                    <h6 class="lighter arial green"><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"><b>
                            <?php echo $errormessage;
                            $this->session->unset_userdata('errormessage');
                            ?>
                        </b></h6>
                </div>
                <?php
            }

            ?>

            <?php if(!empty($allcommission)){?>
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">


                            <div class="clearfix">
                                <div class="pull-right tableTools-container"></div>
                            </div>
                            <div class="table-header" style="height:30px;">
                                <h3 style="text-align:center;">Customer Commission Payment History</h3>
                            </div>
                            <div>
                                <div id="print-content">
                                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr style="color:red;">

                                        <th style="color:red;">Token No</th>
                                        <!-- <th style="color:red;">CustomerId </th>
                                        <th  style="color:red;">Customer Name</th>-->
                                        <th >Date</th>
                                        <th style="text-align:center;">
                                            Amount
                                        </th>
                                        <th>Payment Type</th>
                                        <th>
                                            Description
                                        </th>
                                        <th style="color:red;">
                                            Receiver Id Receiver Name
                                        </th><th style="color:red;">
                                            Action
                                        </th>

                                    </tr>
                                    </thead>

                                    <tbody>

                                    <?php
                                    $i=0;
                                    $countAmount=0;
                                    foreach($allcommission as $value){?>

                                        <tr>

                                            <!-- <td style="color:red;"><?php //echo ++$i.'  .';?>
                                                        Id :<?php //echo $value['customerId'];?></td>
                                                        <td >Name:
                                                                <?php
                                            //echo getlandCustomerNameById($value['customerId'])['applicant_name'];

                                            ?>
                                                        </td> -->
                                            

                                            <td><?php  echo $value['expenseId'];?></td>
                                            <td><?php  echo $value['date'];?></td>

                                            <td style="text-align:center;">
                                                <?php  echo $value['salaryAmount'];
                                                $countAmount=$countAmount + $value['salaryAmount'];
                                                ?>
                                            </td>
                                            <td>
                                                <?php if(!empty($value['salary_type'])){echo element($value['salary_type'],getsalaryType(),null);}?>
                                            </td>
                                            


                                            <td><?php  echo $value['description'];?></td>
                                            <td style="color:red;">
                                                <?php  echo $value['employee_id'].'</br>';?> , 
                                                <?php $usrnm=getEmployeeById($value['employee_id']);  echo $usrnm['userName']?>
                                            </td>
                                            <td style="color:red;">
                                                <!--<a class="green" href="<?php //echo admin_url()?>/landincomesetup/edit_landincome/<?php //echo $value['expenseId'];?>">-->
                                                <!--       <i class="ace-icon fa fa-pencil bigger-130"></i>-->
                                                <!--   </a>-->

                                                   <a class="red" href="<?php echo admin_url()?>/landincomesetup/delete_expenseemp/<?php echo $value['expenseId'];?>" onclick="return ConfirmDelete()">
                                                       <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                                   </a>
                                            </td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <td ></td>
                                        <td ></td>
                                        <td style="color:green; font-size: 16px;"><h6>Total Paid = <?php echo $countAmount;?></h6></td>
                                        <td ></td>
                                        <td style="color:red; font-size: 16px;">
                                            <h6>Total Due =  <?php if(!empty($customerById['com_emp'])){ echo $customerById['com_emp'];}?> </h6>
                                        </td>
                                        <td ></td>
                                        <td ></td>

                                    </tr>

                                    </tbody>
                                </table>
                                </div> <!--Print Area End-->
                            </div>
                        </div>
                    </div>
                    <br>
                    <button type="button" onclick="printDivFromAdmin('print-content')" class="btn btn-success pull-right">Print Payment List</button>
                </div><!-- PAGE CONTENT ENDS -->
            <?php }?>
            <br><br>
            
            <?php if(!empty($allincentive)){?>
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">


                            <div class="clearfix">
                                <div class="pull-right tableTools-container"></div>
                            </div>
                            <div class="table-header" style="height:30px;">
                                <h3 style="text-align:center;">Customer Incentive Payment History</h3>
                            </div>
                            <div>
                                <div id="print-incentive">
                                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr style="color:red;">

                                        <th style="color:red;">Token No</th>
                                        <!-- <th style="color:red;">CustomerId </th>
                                        <th  style="color:red;">Customer Name</th>-->
                                        <th >Date</th>
                                        <th style="text-align:center;">
                                            Amount
                                        </th>
                                        <th>Payment Type</th>
                                        <th>
                                            Description
                                        </th>
                                        <th style="color:red;">
                                            Receiver Id, Receiver Name
                                        </th><th style="color:red;">
                                            
                                        </th>

                                    </tr>
                                    </thead>

                                    <tbody>

                                    <?php
                                    $i=0;
                                    $countAmount=0;
                                    foreach($allincentive as $value){?>

                                        <tr>

                                            <!-- <td style="color:red;"><?php //echo ++$i.'  .';?>
                                                        Id :<?php //echo $value['customerId'];?></td>
                                                        <td >Name:
                                                                <?php
                                            //echo getlandCustomerNameById($value['customerId'])['applicant_name'];

                                            ?>
                                                        </td> -->
                                            

                                            <td><?php  echo $value['expenseId'];?></td>
                                            <td><?php  echo $value['date'];?></td>

                                            <td style="text-align:center;">
                                                <?php  echo $value['salaryAmount'];
                                                $countAmount=$countAmount + $value['salaryAmount'];
                                                ?>
                                            </td>
                                            <td>
                                                <?php if(!empty($value['salary_type'])){echo element($value['salary_type'],getsalaryType(),null);}?>
                                            </td>
                                            


                                            <td><?php  echo $value['description'];?></td>
                                            <td style="color:red;">
                                                <?php  echo $value['employee_id'].'</br>';?> , <?php $usrnm=getEmployeeById($value['employee_id']);  echo $usrnm['userName']?>
                                                
                                            </td>
                                            <td style="color:red;">
                                               <a class="red" href="<?php echo admin_url()?>/landincomesetup/delete_expenseemp/<?php echo $value['expenseId'];?>" onclick="return ConfirmDelete()">
                                                       <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                                   </a>
                                            </td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <td ></td>
                                        <td ></td>
                                        <td style="color:green; font-size: 16px;"><h6>Total Paid = <?php echo $countAmount;?></h6></td>
                                        <td ></td>
                                        <td style="color:red; font-size: 16px;">
                                            <h6>Total Due =  <?php echo ($total_incentive);?></h6>
                                        </td>
                                        <td ></td>
                                        <td ></td>

                                    </tr>

                                    </tbody>
                                </table>
                                </div> <!--Print Area End-->
                            </div>
                        </div>
                    </div>
                    <br>
                    <button type="button" onclick="printDivFromAdmin('print-incentive')" class="btn btn-success pull-right">Print Payment List</button>
                </div><!-- PAGE CONTENT ENDS -->
            <?php }?>
            <br><br>
            
            
            <?php if(!empty($allpercents)){?>
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">


                            <div class="clearfix">
                                <div class="pull-right tableTools-container"></div>
                            </div>
                            <div class="table-header" style="height:30px;">
                                <h3 style="text-align:center;">Customer 2% Payment History</h3>
                            </div>
                            <div>
                                <div id="print-percent">
                                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr style="color:red;">

                                        <th style="color:red;">Token No</th>
                                        <!-- <th style="color:red;">CustomerId </th>
                                        <th  style="color:red;">Customer Name</th>-->
                                        <th >Date</th>
                                        <th style="text-align:center;">
                                            Amount
                                        </th>
                                        <th>Payment Type</th>
                                        <th>
                                            Description
                                        </th>
                                        <th style="color:red;">
                                            Receiver Id, Receiver Name
                                        </th><th style="color:red;">
                                            
                                        </th>

                                    </tr>
                                    </thead>

                                    <tbody>

                                    <?php
                                    $i=0;
                                    $countAmount=0;
                                    foreach($allpercents as $value){?>

                                        <tr>

                                            <!-- <td style="color:red;"><?php //echo ++$i.'  .';?>
                                                        Id :<?php //echo $value['customerId'];?></td>
                                                        <td >Name:
                                                                <?php
                                            //echo getlandCustomerNameById($value['customerId'])['applicant_name'];

                                            ?>
                                                        </td> -->
                                            <td><?php  echo $value['expenseId'];?></td>

                                            <td><?php  echo $value['date'];?></td>

                                            <td style="text-align:center;">
                                                <?php  echo $value['salaryAmount'];
                                                $countAmount=$countAmount + $value['salaryAmount'];
                                                ?>
                                            </td>
                                            <td>
                                                2%
                                            </td>
                                            


                                            <td><?php  echo $value['description'];?></td>
                                            <td style="color:red;">
                                                <?php  echo $value['employee_id'].'</br>';?> , <?php $usrnm=getEmployeeById($value['employee_id']);  echo $usrnm['userName']?>
                                                
                                            </td>
                                            <td style="color:red;">
                                                <a class="red" href="<?php echo admin_url()?>/landincomesetup/delete_expenseemp/<?php echo $value['expenseId'];?>" onclick="return ConfirmDelete()">
                                                       <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                                   </a>
                                            </td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <td ></td>
                                        <td ></td>
                                        <td style="color:green; font-size: 16px;"><h6>Total Paid = <?php echo $countAmount;?></h6></td>
                                        <td ></td>
                                        <td style="color:red; font-size: 16px;">
                                            
                                        </td>
                                        <td ></td>
                                        <td ></td>

                                    </tr>

                                    </tbody>
                                </table>
                                </div> <!--Print Area End-->
                            </div>
                        </div>
                    </div>
                    <br>
                    <button type="button" onclick="printDivFromAdmin('print-percent')" class="btn btn-success pull-right">Print Payment List</button>
                </div><!-- PAGE CONTENT ENDS -->
            <?php }?>
        </div><!-- /.col -->
    </div><!-- /.row -->

    <!--=======================================================-->




								<?php }?>
								</div>
