<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 class="profile-info-row">
													<div class="profile-info-name"> Gender </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['gender'])){ foreach(getGender() as $key=>$val){if($key==$customerById['gender']){echo $val;}}}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Religion </div>

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['religion'])){ foreach(getReligion() as $key=>$val){if($key==$customerById['religion']){echo $val;}}}?></span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Present Address </div>

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

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

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

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

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


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

<!-- ___________________                         Nomeeni Info      __________________________  -->
<div class="alert alert-block alert-info">
 <h4 class="lighter arial red" style="text-align:center;"><b>Nominee's Information </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['nominee_photo'])){?>
													<img id="avatar" class="editable img-responsive" alt="Alex's Avatar" src="<?php if(file_exists($customerById['nominee_photo'])){ echo base_url().$customerById['nominee_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['nomineeName'])){ echo $customerById['nomineeName'];}?></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"> Nominee's Name  </div>

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

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

													<div class="profile-info-value">
														<span class="editable" id="signup"><?php if(!empty($customerById['nominee_phone'])){ echo $customerById['nominee_phone'];}?></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['nominee_mobile'])){ echo $customerById['nominee_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['nominee_email'])){ echo $customerById['nominee_email'];}?></span>
													</div>
												</div>

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

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

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

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

													<div class="profile-info-value">
														<span class="editable" id="about"><?php if(!empty($customerById['part'])){ echo $customerById['part'];}?>&nbsp;&nbsp;(will get)</span>
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name"> Permanent Address </div>

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


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



<!-- ___________________                      End    Nomeeni Info      __________________________  -->

<!--  ___________________________________________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">
                    <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;">Search By DateRange</h3>
                            </div>
                            <div>


            <div class="widget-body">
                <div class="widget-main no-padding">
                    <form action="<?php echo admin_url()?>/extraincomesetup/searchBydaterangeofCust" 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>
                                    <input type="hidden" name="data[customerId]" value="<?php if(!empty($customerById['customerId'])){ echo $customerById['customerId'];}?>">
                                    <input type="hidden" name="data[total_cost]" value="<?php if(!empty($customerById['total_cost'])){ echo $customerById['total_cost'];}?>">
                                </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">
                            <div class="col-xs-4 col-sm-4"><label>Customer id</label></div>
                            <?php echo form_error('data[customerId]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                             <select name="data[customerId]"  class="col-xs-8 col-sm-8" id="form-field-select-3" data-placeholder="Choose a State...">
                                 <option value=""> Select Customer Id......  </option>
                                 <?php if(!empty($allCustomerId)){
                                        foreach($allCustomerId as $value){
                                    ?>
                                    <option value="<?php echo $value['customerId'];?>" <?php echo set_select('data[customerId]',$value['customerId'],FALSE);?>>
                                        <?php 
                                            echo $value['customerId']; $app_name=getlandCustomerNameById($value['customerId']); echo "(".$app_name['applicant_name'].")";

                                        ?>
                                    </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="btnSdateRangeCust" class="btn btn-sm btn-success">
                                 <i class="ace-icon fa fa-undo bigger-110"></i>
                                Search By DateRange 
                                
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    </div>
<!--=======================================================-->
<!-- 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 

?>
            <?php if(!empty($allincome)){?>
                <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:60px;">
                                <h3 style="text-align:center;">Customer 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;">Serial</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>Payment Process</th>




                                        <th>
                                            Payment Description
                                        </th>
                                        <th style="color:red;">
                                            Receiver Id & Name
                                        </th>

                                    </tr>
                                    </thead>

                                    <tbody>

                                    <?php
                                    $i=0;
                                    $countAmount=0;
                                    foreach($allincome 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 style="color:red;"><?php echo ++$i;?></td>

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

                                            <td style="text-align:center;">
                                                <?php  echo $value['amount'];
                                                $countAmount=$countAmount + $value['amount'];
                                                ?>
                                            </td>
                                            <td>
                                                <?php
                                                if(!empty($value['payment_type']))
                                                {
                                                    foreach(getPaymentType() as $key=>$val)
                                                    {
                                                        if($value['payment_type']==$key){echo $val;}
                                                    }
                                                }
                                                ?>
                                            </td>
                                            <td >
                                                <?php
                                                if(!empty($value['paymentProcess']))
                                                {
                                                    foreach(getPaymentProcess() as $key=>$val)
                                                    {
                                                        if($value['paymentProcess']==$key){echo $val;}
                                                    }
                                                }
                                                ?>
                                            </td>


                                            <td><?php  echo $value['payment_description'];?></td>
                                            <td style="color:red;">
                                                Id:<?php  echo $value['receiver_id'].'</br>';?>
                                                Name :<?php $usrnm=getEmployeeById($value['receiver_id']);  echo $usrnm['userName']?>
                                            </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_cost-$countAmount);?></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 }?>
        </div><!-- /.col -->
    </div><!-- /.row -->

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




								<?php }?>
								</div>
