HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/public_html/baris.beatleanalytics.com/site/template/pmcbillinvoice.php
<!DOCTYPE html>
<?php
// Declare new object 
$objScorecardctsnew = object;
// Assing object 
$objScorecardctsnew = $objDB->objController;
// Assign all variable's value
$pg         = $objScorecardctsnew->pg;
$acn        = $objScorecardctsnew->acn;
$v             = $objScorecardctsnew->v;
$State         = $objScorecardctsnew->State;
$ReligionName  = $objScorecardctsnew->ReligionName;
$sort       = $objScorecardctsnew->sort;
$ReligionID    = $objScorecardctsnew->ReligionID;
$field         = $objScorecardctsnew->field;
$error         = $objScorecardctsnew->error;
$msg        = $objScorecardctsnew->msg;
$perpage       = $objScorecardctsnew->perpage;
$start         = $objScorecardctsnew->start;
$limit         = $objScorecardctsnew->limit;
$SearchValue   = $objScorecardctsnew->SearchValue;
$s          = $objScorecardctsnew->s;
$CustomerID    = $objScorecardctsnew->CustomerID;
$SurveyID      = $objScorecardctsnew->SurveyID;
$TokenID    = $objScorecardctsnew->TokenID;
$pType         = $objScorecardctsnew->pType;
$OrgID         = $objScorecardctsnew->OrgID;
$BranchID      = $objScorecardctsnew->BranchID;
$IndustryID    = $objScorecardctsnew->IndustryID;
$FromDate      = $objScorecardctsnew->FromDate;
$ToDate        = $objScorecardctsnew->ToDate;
$StationId  = $objScorecardctsnew->StationId;
$QuestionId = $objScorecardctsnew->QuestionId;
$AuditorId  = $objScorecardctsnew->AuditorId;
$Month        = $objScorecardctsnew->Month;
$Year        = $objScorecardctsnew->Year;
$WorkPenalty        = $objScorecardctsnew->WorkPenalty;
$ChemicalPenalty    = $objScorecardctsnew->ChemicalPenalty;
$OtherPenalty       = $objScorecardctsnew->OtherPenalty;
$NonremovalGarbagePenalty       = $objScorecardctsnew->NonremovalGarbagePenalty;
$OpenBurningWastePenalty       = $objScorecardctsnew->OpenBurningWastePenalty;
$RodentWorkPenalty       = $objScorecardctsnew->RodentWorkPenalty;
$PenaltyImposedByNGT       = $objScorecardctsnew->PenaltyImposedByNGT;
$valck[] = array();
//echo '<pre>'; print_r($userdata[0]['OrgID']);  die; 
if (!in_array('PMC', explode(',', $userdata[0]['reportType']))) {
//
ReturnPostFormData($ValidateArr = array(), "error.html", "<span class='error-msg'>Method <strong>" . $acn . "</strong> does not exist in <strong>" . $pg . "</strong> file !</span>", 2);
}
?>
<!-- jQuery 3 -->
<script src="<?php echo $curImagePath ?>/bower_components/jquery/dist/jquery.min.js">
</script>
<link rel="stylesheet" href="<?php echo $curImagePath ?>/datatable/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?php echo $curImagePath ?>/datatable/css/buttons.dataTables.min.css">
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">-->
<link rel="stylesheet" href="<?php echo $curImagePath ?>/dist/css/Custom.css">
<link rel='stylesheet' type='text/css' href='<?php echo $curImagePath ?>/datepikar2/datepicker3.css'>
<link rel='stylesheet' type='text/css' href='<?php echo $curImagePath ?>/datepikar2/daterangepicker-bs3.css'>
<script src="<?php echo $curImagePath ?>/dist/js/jQuery.print.min.js">
</script>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <!-- /.box -->
        <div class="box">
          <!-- /.box-header -->
          <div class="box-body">
            <!------------------------------------------------------------------>
            <form method="post" action="pmcbillinvoice.html" name="frmSearch" id="frmSearch" class="pe-no-print">
              <div class="box-header">
                <h3 class="box-title" style="width:100%;">
                  <div class="main-form-group">
                    <div class="table-sam">
                      <a class="btn btn-info btn-sm" href="dashboard.html"> 
                        <i class="fa fa-long-arrow-left">
                        </i> Back 
                      </a>
                    </div>
                    <?php //if ($_SESSION['UserInfo']['OrgID'] == 16) { ?>
                    <?php
                    /**<div class="col-md-2 col-xs-6 form-group">
                        <input type="text" readonly="readonly" id="FromDate" name="FromDate" placeholder="Start date.." class="form-control input-md" value="<?php echo $FromDate;?>">
                    </div>
                    <div class="col-md-2 col-xs-6 form-group">
                        <input type="text" readonly="readonly" id="ToDate" name="ToDate" placeholder="End date.." class="form-control input-md" value="<?php echo $ToDate;?>">
                    </div>
                    */?>
                    <div class=" col-xs-12 col-md-3 col-lg-2 form-group">
                        <select class="form-control input-md" id="month" name="Month">
                            <option value="01">Janaury</option>
                            <option value="02">February</option>
                            <option value="03">March</option>
                            <option value="04">April</option>
                            <option value="05">May</option>
                            <option value="06">June</option>
                            <option value="07">July</option>
                            <option value="08">August</option>
                            <option value="09">September</option>
                            <option value="10">October</option>
                            <option value="11">November</option>
                            <option value="12">December</option>
                        </select>
                    </div>
                    <div class=" col-xs-12 col-md-3 col-lg-2 form-group">
                        <select class="form-control input-md" id="year" name="Year">
                            <?php 
                                $firstYear = 2020;
                                $lastYear = (int)date('Y');
                                for($i=$firstYear;$i<=$lastYear;$i++){
                                    echo '<option value='.$i.'>'.$i.'</option>';
                                }?>                             
                        </select>
                    </div>
                    
                    <div class="input-group input-group-sm pull-right- text-right table-sam">
                      <span class="pull-right text-right form-group no-padding">
                        <?php if ($userdata[0]['db_usertype'] != 'viewer' ){ ?> 
                       <!-- <a class="btn btn-success btn-sm" href="setrate.html"> Set Rate 
                        </a> -->
                        <?php } ?> 
                        <a class="btn btn-success btn-sm" onclick="myFunction()" href="#"> Generate Invoice 
                        </a>
						 <?php if ($userdata[0]['db_usertype'] != 'viewer' ){ ?> 
						 <a class="btn btn-warning btn-sm"  href="imposepenalty.html"> Impose Penalty
                        </a>
						  <?php } ?>
                        <script>
                          function myFunction() {
                            $(".loader").show();
                            document.getElementById("frmSearch").submit();
                          }
                          $(window).bind("load", function() {
                            //$(".loader").hide();
                          }
                                        );
                        </script>
                      </span>
                    </div>
                  </div>
                </h3>
              </div>
            </form>
            <?php
                $rsBillRate = $objScorecardctsnew->fetchBillRate();
            ?>
            <div class="NEWCTS">
              <div class="printTable pe-preserve-ancestor" id="printTable">
                <style type="text/css">
				td.column6.style74.s.style74 , td.column0.style77.s.style78{
                        text-align: right !important;
                    }
 
				tr.row15 td.column1 , tr.row15 td.column10 , tr.row28 td.column1 , tr.row28 td.column10{
					font-weight:900 !important;
				}
				
				table#sheet0 {
    width: 773px;
}
.column7 , .column8 , .column10 , tr.row8 td.column0 , td.column0, tr.row8 .column7 , tr.row8 .column8 , tr.row8 .column10				{
    text-align: center !important;
}.column7 {
    width: 112px !important;
}
tr.row1 td ,tr.row2 td ,tr.row3 td ,tr.row4 td, tr.row5 td,tr.row6 td ,tr.row7 td, tr.row8 td {
    text-align: left !important;
}

                  html {
                    font-family:Calibri, Arial, Helvetica, sans-serif;
                    font-size:11pt;
                    background-color:white }
                  a.comment-indicator:hover + div.comment {
                    background:#ffd;
                    position:absolute;
                    display:block;
                    border:1px solid black;
                    padding:0.5em }
                  a.comment-indicator {
                    background:red;
                    display:inline-block;
                    border:1px solid black;
                    width:0.5em;
                    height:0.5em }
                  div.comment {
                    display:none }
                  table {
                    border-collapse:collapse;
                    page-break-after:always }
                  .gridlines td {
                    border:1px dotted black }
                  .gridlines th {
                    border:1px dotted black }
                  .b {
                    text-align:center }
                  .e {
                    text-align:center }
                  .f {
                    text-align:right }
                  .inlineStr {
                    text-align:left }
                  .n {
                    text-align:right }
                  .s {
                    text-align:left }
                  td.style0 {
                    vertical-align:bottom;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:white }
                  th.style0 {
                    vertical-align:bottom;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:white }
                  td.style1 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style1 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style2 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style2 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style3 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style3 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style4 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style4 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style5 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style5 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style6 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style6 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style7 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style7 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style8 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style8 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style9 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style9 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style10 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style10 {
                    vertical-align:middle;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style11 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style11 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style12 {
                    vertical-align:bottom;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:white }
                  th.style12 {
                    vertical-align:bottom;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:white }
                  td.style13 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style13 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style14 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style14 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style15 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style15 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style16 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style16 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style17 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style17 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style18 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style18 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style19 {
                    vertical-align:middle;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style19 {
                    vertical-align:middle;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style20 {
                    vertical-align:middle;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style20 {
                    vertical-align:middle;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style21 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style21 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style22 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style22 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style23 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style23 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style24 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style24 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style25 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style25 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style26 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style26 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style27 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style27 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style28 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style28 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style29 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style29 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style30 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style30 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style31 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style31 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style32 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style32 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style33 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style33 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style34 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style34 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style35 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style35 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style36 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style36 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style37 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style37 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style38 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style38 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style39 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style39 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style40 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style40 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style41 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style41 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style42 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style42 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style43 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style43 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style44 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style44 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style45 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style45 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style46 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style46 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style47 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style47 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style48 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style48 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style49 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style49 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style50 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style50 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style51 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style51 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style52 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style52 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style53 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style53 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style54 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style54 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style55 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style55 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style56 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style56 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style57 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style57 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style58 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style58 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style59 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style59 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style60 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style60 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style61 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style61 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style62 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style62 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style63 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style63 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style64 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style64 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style65 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style65 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style66 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style66 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style67 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style67 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:1px solid #000000 !important;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style68 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style68 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style69 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style69 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style70 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style70 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style71 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style71 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style72 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style72 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style73 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style73 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style74 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style74 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style75 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style75 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style76 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  th.style76 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:11pt;
                    background-color:#FFFFFF }
                  td.style77 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style77 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:1px solid #000000 !important;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style78 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style78 {
                    vertical-align:middle;
                    text-align:right;
                    padding-right:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style79 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style79 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:none #000000;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style80 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style80 {
                    vertical-align:middle;
                    text-align:left;
                    padding-left:0px;
                    border-bottom:1px solid #000000 !important;
                    border-top:none #000000;
                    border-left:none #000000;
                    border-right:1px solid #000000 !important;
                    font-weight:bold;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  td.style81 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  th.style81 {
                    vertical-align:middle;
                    text-align:center;
                    border-bottom:none #000000;
                    border-top:1px solid #000000 !important;
                    border-left:none #000000;
                    border-right:none #000000;
                    color:#000000;
                    font-family:'Calibri';
                    font-size:8pt;
                    background-color:#FFFFFF }
                  table.sheet0 col.col0 {
                    width:42pt }
                  table.sheet0 col.col1 {
                    width:42pt }
                  table.sheet0 col.col2 {
                    width:42pt }
                  table.sheet0 col.col3 {
                    width:42pt }
                  table.sheet0 col.col4 {
                    width:42pt }
                  table.sheet0 col.col5 {
                    width:42pt }
                  table.sheet0 col.col6 {
                    width:42pt }
                  table.sheet0 col.col7 {
                    width:42pt }
                  table.sheet0 col.col8 {
                    width:42pt }
                  table.sheet0 col.col9 {
                    width:42pt }
                  table.sheet0 col.col10 {
                    width:42pt }
                  table.sheet0 col.col11 {
                    width:42pt }
                  table.sheet0 tr {
                    height:15pt }
                  table#sheet0 tr td, table#sheet0 tr td span {
                    font-size: 11px !important;
                   
                  }
                </style>
                <table border="0" cellpadding="0" cellspacing="0" id="sheet0" class="sheet0 gridlines display-- new_print_display bor_none billinvoice" style="margin-top: 19px;">
                  <col class="col0">
                  <col class="col1">
                  <col class="col2">
                  <col class="col3">
                  <col class="col4">
                  <col class="col5">
                  <col class="col6">
                  <col class="col7">
                  <col class="col8">
                  <col class="col9">
                  <col class="col10">
                  <col class="col11">
                  <tbody>
                    <tr>
                    <?php if($userdata[0]['OrgID'] == 32){ ?>
                      <td  style=" text-align: center; padding-bottom: 15px !important;" colspan="12" height="19" align="center" valign="middle" bgcolor="">
                        <b>
                          <font color="#828282"style="font-size: 24px;text-align: center; padding-bottom: 17px !important; "> SCORE CARD CUM PMC PAYABLE AMOUNT 
                          </font>
                        </b>
                      </td>
                      <?php } else { ?>
                      <td  style=" text-align: center; padding-bottom: 15px !important;" colspan="12" height="19" align="center" valign="middle" bgcolor="">
                        <b>
                          <font color="#828282"style="font-size: 32px;text-align: center; padding-bottom: 17px !important; "> PMC BILL INVOICE 
                          </font>
                        </b>
                      </td>
                      <?php }?>
                      
                    </tr>
                    <tr class="row0">
                    <?php if($userdata[0]['OrgID'] == 32){ ?>
                      <td class="column0 style1 s style3" colspan="12" style="background: #ededed;
                                                                              border-bottom: 1px solid #000;text-align: center; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000">
                        SCORE CARD CUM PAYABLE AMOUNT OF SANITATION WORK AT <?php echo $stationName; ?> STATION
                      </td>
                      <?php } else { ?>
                      <td class="column0 style1 s style3" colspan="12" style="background: #ededed;
                                                                              border-bottom: 1px solid #000;text-align: center; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000">
                        PAYBLE AMOUNT DECRIPTION OF SANITATION WORK AT <?php echo $stationName; ?> STATION
                      </td>
                      <?php }?>
                    </tr>
                    <tr class="row1">
                      <td class="column0 style4 s style5" colspan="7">PAYBLE AMOUNT DECRIPTION OF SANITATION WORK AT <?php echo $stationName; ?> STATION
                      </td>
                      <td class="column7 style5 s style6" colspan="5">PERIOD OF CONTRACT-<?php echo empty($rsBillRate[0]['period_of_contract_from']) ? 'null' : date('d-m-Y', strtotime($rsBillRate[0]['period_of_contract_from'])) ?> TO 
                          <?php echo empty($rsBillRate[0]['period_of_contract_to']) ? 'null' : date('d-m-Y', strtotime($rsBillRate[0]['period_of_contract_to'])) ?>
                      </td>
                    </tr>
                    <tr class="row2">
                      <td class="column0 style7 null">
                      </td>
                      <td class="column1 style8 null">
                      </td>
                      <td class="column2 style9 null">
                      </td>
                      <td class="column3 style9 null">
                      </td>
                      <td class="column4 style9 null">
                      </td>
                      <td class="column5 style9 null">
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      <td class="column7 style8 null">
                      </td>
                      <td class="column8 style8 null">
                      </td>
                      <td class="column9 style8 null">
                      </td>
                      <td class="column10 style8 null">
                      </td>
                      <td class="column11 style10 null">
                      </td>
                    </tr>
                    <tr class="row3">
                      <td class="column0 style4 s style5" colspan="6">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">SACTIONED AMOUNT :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['sactioned_amount']) ? 'null' : $rsBillRate[0]['sactioned_amount'] ?>
                        </span>
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      <td class="column7 style5 s style6" colspan="5">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">Date Range :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt">
                            <?php echo date('d.m.Y',strtotime('01-'.$Month.'-'.$Year)) ?> TO <?php echo date('t.m.Y',strtotime('01-'.$Month.'-'.$Year)) ?>
                            <?php /*echo date('d.m.Y',strtotime($FromDate)) ?> TO <?php echo date('t.m.Y',strtotime($ToDate)); 
                            $Month = date('m',strtotime($ToDate));
                            $Year = date('Y',strtotime($ToDate));
                            */?>
                        </span>
                      </td>
                    </tr>
                    <tr class="row4">
                      <td class="column0 style4 s style5" colspan="6">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">NOS OF WORKERS :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt">
                            <?php
                            $nos_of_worker = array();
                            if (!empty($rsBillRate)) {
                                if (!empty($rsBillRate[0]['nos_of_worker'])) {
                                    $nos_of_worker = explode(",", $rsBillRate[0]['nos_of_worker']);
                                }
                            }
                            ?>
                            <?php echo implode('+', $nos_of_worker) ?>
                        </span>
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      
                      
                      
                      
                      <td class="column7 style5 s style6" colspan="5">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">SECURITY DEPOSIT :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['security_deposit']) ? 'TO BE PROVIDED' : $rsBillRate[0]['security_deposit'] ?>
                        </span>
                      </td>
                    </tr>
                    <tr class="row5">
                      <td class="column0 style4 s style5" colspan="6">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">M.B .NO : 
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['mb_no']) ? 'TO BE PROVIDED' : $rsBillRate[0]['mb_no'] ?>
                        </span>
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      <td class="column7 style5 s style6" colspan="5">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">PERFORMANCE GUARANTY :  
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['performance_guarant']) ? 'TO BE PROVIDED' : $rsBillRate[0]['performance_guarant'] ?>
                        </span>
                      </td>
                    </tr>
                    <tr class="row6">
                      <td class="column0 style11 s style12" colspan="6">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">AGREEMENT  LETTER NO &amp;DT :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['agreement_letter_no_dt']) ? 'TO BE PROVIDED' : $rsBillRate[0]['agreement_letter_no_dt'] ?>
                        </span>
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      <td class="column7 style13 s style14" colspan="5">
                        <?php if($userdata[0]['OrgID'] == 17){ ?>
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">COST OF WORK PER MONTH AS PER AGREEMENT : 
                        </span>
                        <?php }else{ ?>
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">COST OF WORK PER MONTH WITH GST AS PER AGREEMENT : 
                        </span>
                        <?php } ?>
                        <!--<span style="color:#000000; font-family:'Calibri'; font-size:8pt"><?php echo empty($rsBillRate[0]['acceptance_letter_no_dt']) ? 'null' : $rsBillRate[0]['acceptance_letter_no_dt'] ?>
                        </span> -->
                        <?php if($userdata[0]['OrgID'] == 17){ ?>
                        <?php $no_of_days = date('t',strtotime('01-'.$Month.'-'.$Year)); ?>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"><?php echo round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); ?>
                        </span>
                        <?php }else{ ?>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"><?php echo round($rsBillRate[0]['sactioned_amount']/48,2); ?>
                        </span>
                        <?php } ?>
                      </td>
                    </tr>
                    <tr class="row7">
                      <td class="column0 style15 s style16" colspan="6">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">ACCEPTANCE LETTER NO &amp;DT : 
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt"> <?php echo empty($rsBillRate[0]['acceptance_letter_no_dt']) ? 'TO BE PROVIDED' : $rsBillRate[0]['acceptance_letter_no_dt'] ?>
                        </span>
                      </td>
                      <td class="column6 style9 null">
                      </td>
                      <td class="column7 style17 s style17" colspan="2">
                        <span style="font-weight:bold; color:#000000; font-family:'Calibri'; font-size:8pt">Number Of Days for Billing  :
                        </span>
                        <span style="color:#000000; font-family:'Calibri'; font-size:8pt">  
                        </span>
                      </td>
                      <?php  /*
                      	$date1 = date_create($FromDate);
						$date2 = date_create($ToDate);
						$diff = date_diff($date1, $date2);
						$billing_days = $diff->format("%a");
					*/?>
                      <td class="column9 style18 n"><?php echo date('t',strtotime('01-'.$Month.'-'.$Year)); ?>
                      </td>
                      <td class="column10 style19 null">
                      </td>
                      <td class="column11 style20 null">
                      </td>
                    </tr>
                    <tr class="row8">
                      <td class="column0 style21 s">S.No
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Earnings
                      </td>
                      <td class="column7 style21 s">Weightage
                      </td>
                      <td class="column8 style22 s style24" colspan="2">Scored
                      </td>
                      <td class="column10 style22 s style24" colspan="2">Amount
                      </td>
                    </tr>
<?php 

    $startDate = date('d-m-Y',strtotime('01-'.$Month.'-'.$Year));
    $endDate = date('t-m-Y',strtotime('01-'.$Month.'-'.$Year));  
    // if($_SESSION['UserInfo']['OrgID'] == 16){
    //     $QuestionId = 19;
    //     $mQuestionId = 15;
    // }else{
    //     $QuestionId = 4;
    //     $mQuestionId = 14;
    // }

    $mQuestionId = getquestionid('PMC');
    $QuestionId = getsubquestionid('PMC','manpower_log');

    $manpower_target_earning = 0;
    $attendance_earning = 0;
    $absent_earning = 0;
    $rsParamIDS = SubQuestionGroupIDS('params',$QuestionId);//subquestion
    $rsPagesIDS = SubQuestionGroupIDS('pages',$rsParamIDS[0]);
    $totalTarget = 0;
    $managerTarget = 0;
    $supvisorTarget = 0;
    $storeKeeperTarget = 0;
    $machineOpeTarget = 0;
    $houseKeeperTarget = 0;
    $projectManagerTarget = 0;
    $driverTarget = 0;
    $pestcontrolTarget = 0;
    $headSupervisorTarget = 0;
    $ragPickingTarget = 0;
    $houseKeeper1Target = 0;
    $houseKeeper2Target = 0;
	  $houseKeeper3Target = 0;
    $computerOperatorTarget = 0;
    $plineAllRagPickingTarget = 0;
    $pestandrodentWorkerTarget = 0;

  foreach ($rsParamIDS as $key => $rsParams){
        
    $rsParamData = $objScorecardctsnew->getParamsData($rsParams);
      $desc = explode(',', $rsParamData[0]['paramChoice']);
        
		$rsTargetData = $objScorecardctsnew->getMonthlyTarget($mQuestionId,$QuestionId,$rsParams,$Month,$Year);
		$rsTargetData = explode(',', $rsTargetData[0]['value']);
		
		// $rsTargetData = $objScorecardctsnew->getTarget($mQuestionId,$QuestionId,$rsParams);
		// $rsTargetData = explode(',', $rsTargetData[0]['value']);

      foreach ($desc as $key1 => $value) {   
        $totalTarget = $totalTarget + $rsTargetData[$key1];
        if($value == "Manager") $managerTarget = $managerTarget + $rsTargetData[$key1];
        if($value == "Supervisor")$supvisorTarget = $supvisorTarget + $rsTargetData[$key1];
        if($value == "Storekeeper/Technician")$storeKeeperTarget = $storeKeeperTarget + $rsTargetData[$key1];
        if($value == "Machine Operator")$machineOpeTarget = $machineOpeTarget + $rsTargetData[$key1];
        if($value == "Housekeeper")$houseKeeperTarget = $houseKeeperTarget + $rsTargetData[$key1];
        if($value == "Project Manager")$projectManagerTarget = $projectManagerTarget + $rsTargetData[$key1];
        if($value == "Housekeeper (Line Siding And Good s Yard)")$houseKeeper1Target = $houseKeeper1Target + $rsTargetData[$key1];
        if($value == "Housekeeper (Drains)")$houseKeeper2Target = $houseKeeper2Target + $rsTargetData[$key1];
        if($value == "House Keeper (Garbage Disposable)")$houseKeeper3Target = $houseKeeper3Target + $rsTargetData[$key1];
        if($value == "Driver")$driverTarget = $driverTarget + $rsTargetData[$key1];
        if($value == "Pest Control")$pestcontrolTarget = $pestcontrolTarget + $rsTargetData[$key1];
        if($value == "Head Supervisor")$headSupervisorTarget = $headSupervisorTarget + $rsTargetData[$key1];
        if($value == "Rag Picking")$ragPickingTarget = $ragPickingTarget + $rsTargetData[$key1];
		    if($value == "Computer Operator")$computerOperatorTarget = $computerOperatorTarget + $rsTargetData[$key1];
        if($value == "P/Line(all) coaching yard Rag Picking")$plineAllRagPickingTarget = $plineAllRagPickingTarget + $rsTargetData[$key1];
        if($value == "Pest control & Rodent worker")$pestandrodentWorkerTarget = $pestandrodentWorkerTarget + $rsTargetData[$key1];
      }
      
  } 


  $totalPenalty = 0;
  $totalDays = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);
  for ($i=1; $i <= $totalDays; $i++) { 
    
    $date = $Year.'-'.$Month.'-'.$i;

    $actualAvailable = 0;
    $absent = 0;
    $foundWoDress = 0;
    $foundWoProGlass = 0;
    $managerAvailable = 0;
    $supvisorAvailable = 0;
    $storeKeeperAvailable = 0;
    $machineOpeAvailable = 0;
    $houseKeeperAvailable = 0;
    $projectManagerAvailable = 0;
    $driverAvailable = 0;
    $pestcontrolAvailable = 0;
    $houseKeeper1Available = 0;
    $houseKeeper2Available = 0;
    $houseKeeper3Available = 0;
    $ragPickingAvailable = 0;
    $headSupervisorAvailable = 0;
	  $computerOperatorAvailable = 0;
    $plineAllRagPickingAvailable = 0;
    $pestandrodentWorkerAvailable = 0;
   

      $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsDataManpower($mQuestionId,$QuestionId,$date);

      if(count($rsQuestionsInfo)>0){ 
          for ($q=0;$q< count($rsQuestionsInfo);$q++){
            foreach ($rsParamIDS as $rsParams) {
              $rsParamData = $objScorecardctsnew->getParamsData($rsParams);
            $desc = explode(',', $rsParamData[0]['paramChoice']);
              foreach ($desc as $key1 => $value) {
                $avgVal1 = 0;
                foreach ($rsPagesIDS as $key2 => $rsPages) {

                  $avgVal = $objScorecardctsnew->FetchValueScoreManpower($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$value,$rsQuestionsInfo[$q][0]['tokenid']);
                  //$avgVal1 += $avgVal;
                 // echo $rsQuestionsInfo[$q][0]['created_date'];
                  $created_date[] = $rsQuestionsInfo[$q][0]['created_date'];
                  if($value == "Manager")$avgVal1 += $avgVal;
                  if($value == "Supervisor")$avgVal1 += $avgVal;
                  if($value == "Storekeeper/Technician")$avgVal1 += $avgVal;
                  if($value == "Machine Operator")$avgVal1 += $avgVal;
                  if($value == "Housekeeper")$avgVal1 += $avgVal;
                  if($value == "Project Manager")$avgVal1 += $avgVal;
                  if($value == "Driver")$avgVal1 += $avgVal;
                  if($value == "Pest Control")$avgVal1 += $avgVal;
                  if($value == "Housekeeper (Line Siding And Good s Yard)")$avgVal1 += $avgVal;
                  if($value == "Housekeeper (Drains)")$avgVal1 += $avgVal;
                  if($value == "House Keeper (Garbage Disposable)")$avgVal1 += $avgVal;
                  if($value == "Head Supervisor")$avgVal1 += $avgVal;
                  if($value == "Rag Picking")$avgVal1 += $avgVal;
				          if($value == "Computer Operator")$avgVal1 += $avgVal;
                  if($value == "P/Line(all) coaching yard Rag Picking")$avgVal1 += $avgVal;
                  if($value == "Pest control & Rodent worker")$avgVal1 += $avgVal;

                  if($key2==1){
                    //$absent += $avgVal;

                      // $avgVal1 -= $avgVal;
                      // $actualAvailable += $avgVal1-$avgVal;
                          if($value == "Manager"){
                              $avgVal1 -= $avgVal;
                              $managerAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "Supervisor"){
                             $avgVal1 -= $avgVal;
                             $supvisorAvailable += $avgVal1-$avgVal;

                          }
                          if($value == "Storekeeper/Technician"){
                             $avgVal1 -= $avgVal;
                             $storeKeeperAvailable += $avgVal1-$avgVal;
                          }

                          if($value == "Head Supervisor"){
                             $avgVal1 -= $avgVal;
                             $headSupervisorAvailable += $avgVal1-$avgVal;
                          }

                          if($value == "Rag Picking"){
                             $avgVal1 -= $avgVal;
                             $ragPickingAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "Machine Operator"){
                             $avgVal1 -= $avgVal;
                             $machineOpeAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "Housekeeper"){
                             $avgVal1 -= $avgVal;
                             $houseKeeperAvailable += $avgVal1-$avgVal;
                          }

                          if($value == "Project Manager"){
                             $avgVal1 -= $avgVal;
                             $projectManagerAvailable += $avgVal1-$avgVal;
                          }

                          if($value == "Housekeeper (Line Siding And Good s Yard)"){
                             $avgVal1 -= $avgVal;
                             $houseKeeper1Available += $avgVal1-$avgVal;
                          }

                          if($value == "Housekeeper (Drains)"){
                             $avgVal1 -= $avgVal;
                             $houseKeeper2Available += $avgVal1-$avgVal;
                          }

                          if($value == "House Keeper (Garbage Disposable)"){
                             $avgVal1 -= $avgVal;
                             $houseKeeper3Available += $avgVal1-$avgVal;
                          }
                          if($value == "Driver"){
                             $avgVal1 -= $avgVal;
                             $driverAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "Pest Control"){
                             $avgVal1 -= $avgVal;
                             $pestcontrolAvailable += $avgVal1-$avgVal;
                          }
						              if($value == "Computer Operator"){
                             $avgVal1 -= $avgVal;
                             $computerOperatorAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "P/Line(all) coaching yard Rag Picking"){
                             $avgVal1 -= $avgVal;
                             $plineAllRagPickingAvailable += $avgVal1-$avgVal;
                          }
                          if($value == "Pest control & Rodent worker"){
                             $avgVal1 -= $avgVal;
                             $pestandrodentWorkerAvailable += $avgVal1-$avgVal;
                          }
                  }
                  if($key2==2){
                    $foundWoDress += $avgVal;
                  }
                  if($key2==3){
                    $foundWoProGlass += $avgVal;
                  }
                }
              }
            }
          }
             
      }  
      
     $totalAvailable = $managerAvailable+$supvisorAvailable+$machineOpeAvailable+$houseKeeperAvailable+$projectManagerAvailable+$houseKeeper1Available+$computerOperatorAvailable+$houseKeeper2Available+$houseKeeper3Available+$driverAvailable+$pestcontrolAvailable+$ragPickingAvailable+$headSupervisorAvailable+$plineAllRagPickingAvailable+$pestandrodentWorkerAvailable;

      $absent= $totalAvailable==0 ? 0 : ($managerTarget-$managerAvailable)+($supvisorTarget-$supvisorAvailable)+($machineOpeTarget-$machineOpeAvailable)+($houseKeeperTarget-$houseKeeperAvailable)+($projectManagerTarget-$projectManagerAvailable)+($houseKeeper1Target-$houseKeeper1Available)+($houseKeeper2Target-$houseKeeper2Available)+($houseKeeper3Target-$houseKeeper3Available)+($computerOperatorTarget-$computerOperatorAvailable)+($driverTarget-$driverAvailable)+($pestcontrolTarget-$pestcontrolAvailable)+($ragPickingTarget-$ragPickingAvailable)+($headSupervisorTarget-$headSupervisorAvailable)+($plineAllRagPickingTarget-$plineAllRagPickingAvailable)+($pestandrodentWorkerTarget-$pestandrodentWorkerAvailable);

    if (date('Y-m-d',strtotime($date)) <= date('Y-m-d',strtotime('2020-09-30'))) {
    
    	if($_SESSION['UserInfo']['OrgID'] == 16){
      		$totalPenalty += $foundWoDress*100;
        	$totalPenalty += $totalAvailable==0 ? 0 : (($managerTarget-$managerAvailable)*1233)+(($supvisorTarget-$supvisorAvailable)*1069)+(($machineOpeTarget-$machineOpeAvailable)*1003)+(($houseKeeperTarget-$houseKeeperAvailable)*1003);

		}else{
        	$totalPenalty += $totalAvailable==0 ? 0 : (($managerTarget-$managerAvailable)*1733)+(($supvisorTarget-$supvisorAvailable)*1569)+(($machineOpeTarget-$machineOpeAvailable)*1503)+(($houseKeeperTarget-$houseKeeperAvailable)*1503);
		}
    }else {

    	if($_SESSION['UserInfo']['OrgID'] == 16 || $_SESSION['UserInfo']['OrgID'] == 20){

      		$totalPenalty += $foundWoDress*100;

    	    $totalPenalty += $totalAvailable==0 ? 0 : 
    	      (($managerTarget-$managerAvailable)*1277)+
    	      (($projectManagerTarget-$projectManagerAvailable)*1277)+
    	      (($houseKeeper1Target-$houseKeeper1Available)*1034)+
    	      (($houseKeeper2Target-$houseKeeper2Available)*1034)+
    	      (($houseKeeper3Target-$houseKeeper3Available)*1034)+
    	      (($supvisorTarget-$supvisorAvailable)*1130)+(($machineOpeTarget-$machineOpeAvailable)*1034)+(($houseKeeperTarget-$houseKeeperAvailable)*1034);

          }
		  elseif ($userdata[0]['OrgID'] == 17 || $userdata[0]['OrgID'] == 18)
      {


        if ($Year =='2021' && $Month <='9') 
        {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1714)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*731)+
                    (($supvisorTarget-$supvisorAvailable)*1000)+
                    (($driverTarget-$driverAvailable)*1505)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*731)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
        }

        else if (($Year =='2021' && $Month >'9') || ($Year =='2022' && $Month <='3'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1724)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*737)+
                    (($supvisorTarget-$supvisorAvailable)*1012)+
                    (($driverTarget-$driverAvailable)*1512)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*737)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2022' && $Month <='9'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1770)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*766)+
                    (($supvisorTarget-$supvisorAvailable)*1044)+
                    (($driverTarget-$driverAvailable)*1544)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*766)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2022' && ( $Month == '10' || $Month == '11' || $Month == '12')) || ($Year =='2023' && $Month <='3'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1788)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*777)+
                    (($supvisorTarget-$supvisorAvailable)*1057)+
                    (($driverTarget-$driverAvailable)*1557)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*777)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2023' && $Month >'3' && $Month <='9'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1816)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*794)+
                    (($supvisorTarget-$supvisorAvailable)*1077)+
                    (($driverTarget-$driverAvailable)*1577)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*794)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2023' && $Month >='10'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1832)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*804)+
                    (($supvisorTarget-$supvisorAvailable)*1087)+
                    (($driverTarget-$driverAvailable)*1587)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*804)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2024' && $Month >='1' && $Month <'4'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1832)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*804)+
                    (($supvisorTarget-$supvisorAvailable)*1087)+
                    (($driverTarget-$driverAvailable)*1587)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*804)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }
          
           else if (($Year =='2024' && $Month >='4' && $Month <= '9'))          
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1862)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*822)+
                    (($supvisorTarget-$supvisorAvailable)*1110)+
                    (($driverTarget-$driverAvailable)*1610)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*822)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }
          
           else if (($Year =='2024' && $Month >='10'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1868)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*826)+
                    (($supvisorTarget-$supvisorAvailable)*1114)+
                    (($driverTarget-$driverAvailable)*1614)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*826)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }
          
           else if (($Year =='2025' && $Month <='3'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1868)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*826)+
                    (($supvisorTarget-$supvisorAvailable)*1114)+
                    (($driverTarget-$driverAvailable)*1614)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*826)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          else if (($Year =='2025' && $Month >='4'))
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1893)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*841)+
                    (($supvisorTarget-$supvisorAvailable)*1132)+
                    (($driverTarget-$driverAvailable)*1632)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*841)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
          }

          

          else {
        
        $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1734)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*743)+
                    (($supvisorTarget-$supvisorAvailable)*1090)+
                    (($driverTarget-$driverAvailable)*1519)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*743)+
                    ($foundWoDress*50)+($foundWoProGlass*100);
                }  
      }

      elseif ($userdata[0]['OrgID'] == 13)
      {


        if ($Year =='2022' && $Month >='10')
        {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1788)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
                    (($supvisorTarget-$supvisorAvailable)*1671)+
                    (($machineOpeTarget-$machineOpeAvailable)*1595)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
        }

        else if ($Year =='2023' && $Month >='1'&& $Month <'11')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1788)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
                    (($supvisorTarget-$supvisorAvailable)*1671)+
                    (($machineOpeTarget-$machineOpeAvailable)*1595)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          }

          else if ($Year =='2023' && $Month >='11')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1832)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1628)+
                    (($supvisorTarget-$supvisorAvailable)*1709)+
                    (($machineOpeTarget-$machineOpeAvailable)*1628)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          }  

          else if ($Year =='2024' && $Month >'3' && $Month <'11')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1862)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1651)+
                    (($supvisorTarget-$supvisorAvailable)*1734)+
                    (($machineOpeTarget-$machineOpeAvailable)*1651)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          }
          
          else if ($Year =='2024' && $Month >'10')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1868)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1655)+
                    (($supvisorTarget-$supvisorAvailable)*1739)+
                    (($machineOpeTarget-$machineOpeAvailable)*1655)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          }
          
          else if ($Year =='2025' && $Month <='3')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1868)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1655)+
                    (($supvisorTarget-$supvisorAvailable)*1739)+
                    (($machineOpeTarget-$machineOpeAvailable)*1655)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          }
          
          else if ($Year =='2025' && $Month >='4')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1893)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1674)+
                    (($supvisorTarget-$supvisorAvailable)*1760)+
                    (($machineOpeTarget-$machineOpeAvailable)*1674)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
          } 

          else {
        
        $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($projectManagerTarget-$projectManagerAvailable)*1714)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1539)+
                    (($supvisorTarget-$supvisorAvailable)*1609)+
                    (($machineOpeTarget-$machineOpeAvailable)*1539)+
                    ($foundWoDress*0)+($foundWoProGlass*0);
                }  
      }

	  elseif ($userdata[0]['OrgID'] == 21){

      if ($Year =='2022' && $Month >='4' && $Month <='9') {
         $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1625)+
        (($supvisorTarget-$supvisorAvailable)*1625)+
        (($houseKeeperTarget-$houseKeeperAvailable)*1553)+
        ($foundWoDress*100);
      }
      elseif ($Year =='2023' && $Month <='3') {
         $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1671)+
        (($supvisorTarget-$supvisorAvailable)*1671)+
        (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
        ($foundWoDress*100);
      }
      elseif ($Year =='2023' && $Month >='4'&& $Month <'10') {
         $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1695)+
        (($supvisorTarget-$supvisorAvailable)*1695)+
        (($houseKeeperTarget-$houseKeeperAvailable)*1616)+
        ($foundWoDress*100);
      }
      elseif ($Year =='2023' && $Month >='4') {
        $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1709)+
       (($supvisorTarget-$supvisorAvailable)*1709)+
       (($houseKeeperTarget-$houseKeeperAvailable)*1628)+
       ($foundWoDress*100);
     }
     elseif ($Year =='2024' && $Month <='3') {
      $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1709)+
     (($supvisorTarget-$supvisorAvailable)*1709)+
     (($houseKeeperTarget-$houseKeeperAvailable)*1628)+
     ($foundWoDress*100);
   }
    else if ($Year =='2024' && $Month >='4') {
      $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1734)+
    (($supvisorTarget-$supvisorAvailable)*1734)+
    (($houseKeeperTarget-$houseKeeperAvailable)*1651)+
    ($foundWoDress*100);
   }
      elseif ($Year =='2022' && $Month >='10') {
         $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1671)+
        (($supvisorTarget-$supvisorAvailable)*1671)+
        (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
        ($foundWoDress*100);
      }
      else {
         $totalPenalty += $totalAvailable==0 ? 0 : (($computerOperatorTarget-$computerOperatorAvailable)*1617)+
        (($supvisorTarget-$supvisorAvailable)*1617)+
        (($houseKeeperTarget-$houseKeeperAvailable)*1546)+
        ($foundWoDress*100);
      }
    }

   elseif ($userdata[0]['OrgID'] == 24)
   {
        if ($Year =='2022' && $Month >='10') 
        {
      $totalPenalty += $totalAvailable==0 ? 0 : (($headSupervisorTarget-$headSupervisorAvailable)*1557)+
          (($ragPickingTarget-$ragPickingAvailable)*1477)+
          (($supvisorTarget-$supvisorAvailable)*1557)+
          (($houseKeeperTarget-$houseKeeperAvailable)*1477)+
          (($pestcontrolTarget-$pestcontrolAvailable)*1557)+
          ($foundWoDress*100);
        }

        elseif ($Year =='2023' && $Month <='3') 
        {
      $totalPenalty += $totalAvailable==0 ? 0 : (($headSupervisorTarget-$headSupervisorAvailable)*1557)+
          (($ragPickingTarget-$ragPickingAvailable)*1477)+
          (($supvisorTarget-$supvisorAvailable)*1557)+
          (($houseKeeperTarget-$houseKeeperAvailable)*1477)+
          (($pestcontrolTarget-$pestcontrolAvailable)*1557)+
          ($foundWoDress*100);
        }

        elseif ($Year =='2023' && $Month >='4') 
        {
      $totalPenalty += $totalAvailable==0 ? 0 : (($headSupervisorTarget-$headSupervisorAvailable)*1577)+
          (($ragPickingTarget-$ragPickingAvailable)*1494)+
          (($supvisorTarget-$supvisorAvailable)*1577)+
          (($houseKeeperTarget-$houseKeeperAvailable)*1494)+
          (($pestcontrolTarget-$pestcontrolAvailable)*1577)+
          ($foundWoDress*100);
        }

        else if($Year =='2022' && $Month >='4' && $Month <='9')
          {
      $totalPenalty += $totalAvailable==0 ? 0 : (($headSupervisorTarget-$headSupervisorAvailable)*1519)+
            (($ragPickingTarget-$ragPickingAvailable)*1443)+
            (($houseKeeperTarget-$houseKeeperAvailable)*1443)+
            (($supvisorTarget-$supvisorAvailable)*1519)+
            (($pestcontrolTarget-$pestcontrolAvailable)*1519)+
            ($foundWoDress*100);
          }
          else {
        
        $totalPenalty += $totalAvailable==0 ? 0 : (($headSupervisorTarget-$headSupervisorAvailable)*1512)+
          (($ragPickingTarget-$ragPickingAvailable)*1437)+
          (($supvisorTarget-$supvisorAvailable)*1519)+
          (($houseKeeperTarget-$houseKeeperAvailable)*1437)+
          (($pestcontrolTarget-$pestcontrolAvailable)*1437)+
          ($foundWoDress*100);
                }  
      }

      elseif ($userdata[0]['OrgID'] == 25){

         $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($headSupervisorTarget-$headSupervisorAvailable)*1512)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1437)+
                    (($ragPickingTarget-$ragPickingAvailable)*1437)+
                    (($pestcontrolTarget-$pestcontrolAvailable)*1512)+
                    ($foundWoDress*100);
      }

      elseif ($userdata[0]['OrgID'] == 28)
      {
       
         if ($Year =='2022' && $Month >'9') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
                    (($supvisorTarget-$supvisorAvailable)*1671)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2023' && $Month <='3') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1595)+
                    (($supvisorTarget-$supvisorAvailable)*1671)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2023' && $Month >'3' && $Month <'10') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1616)+
                    (($supvisorTarget-$supvisorAvailable)*1695)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2023' && $Month >='10') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1628)+
                    (($supvisorTarget-$supvisorAvailable)*1709)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2024' && $Month <='3') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1628)+
                    (($supvisorTarget-$supvisorAvailable)*1709)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2024' && $Month >='4'&& $Month <'10') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1651)+
                    (($supvisorTarget-$supvisorAvailable)*1734)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2024' && $Month >'9') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1655)+
                    (($supvisorTarget-$supvisorAvailable)*1739)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2025' && $Month <'4') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1655)+
                    (($supvisorTarget-$supvisorAvailable)*1739)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }
           elseif ($Year =='2025' && $Month >'3') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
	        (($houseKeeperTarget-$houseKeeperAvailable)*1674)+
	        (($supvisorTarget-$supvisorAvailable)*1760)+
	        ($foundWoDress*100)+($foundWoProGlass*100);
	   }


          elseif ($Year =='2022' && $Month =='9') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1581)+
                    (($supvisorTarget-$supvisorAvailable)*1656)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }
          elseif ($Year =='2022' && $Month >'3' && $Month <'9') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*1581)+
                    (($supvisorTarget-$supvisorAvailable)*1656)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
          }
        else {
          $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($houseKeeperTarget-$houseKeeperAvailable)*743)+
                    (($supvisorTarget-$supvisorAvailable)*1090)+
                    ($foundWoDress*100)+($foundWoProGlass*100);
             }  
          }

      elseif ($userdata[0]['OrgID'] == 29){

         $totalPenalty += $totalAvailable==0 ? 0 : 
                    (($headSupervisorTarget-$headSupervisorAvailable)*1512)+
                    (($supvisorTarget-$supvisorAvailable)*1505)+
                    (($houseKeeperTarget-$houseKeeperAvailable)*1437)+
                    (($plineAllRagPickingTarget-$plineAllRagPickingAvailable)*1437)+
                    (($pestandrodentWorkerTarget-$pestandrodentWorkerAvailable)*1512)+
                    ($foundWoDress*100);
      }

      elseif ($userdata[0]['OrgID'] == 30) {
        if ($Year =='2023' && $Month >='4') {
          $totalPenalty += $totalAvailable==0 ? 0 : 
            (($managerTarget-$managerAvailable)*1397)+
            (($projectManagerTarget-$projectManagerAvailable)*1397)+
            (($houseKeeper1Target-$houseKeeper1Available)*1116)+
            (($houseKeeper2Target-$houseKeeper2Available)*1116)+
            (($houseKeeper3Target-$houseKeeper3Available)*1116)+
            (($supvisorTarget-$supvisorAvailable)*1195)+(($machineOpeTarget-$machineOpeAvailable)*1116)+(($houseKeeperTarget-$houseKeeperAvailable)*1116)+($foundWoDress*100)+($foundWoProGlass*100);
        }

          elseif ($Year =='2024' && $Month >='1'&& $Month <'10') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
              (($managerTarget-$managerAvailable)*1397)+
              (($projectManagerTarget-$projectManagerAvailable)*1397)+
              (($houseKeeper1Target-$houseKeeper1Available)*1116)+
              (($houseKeeper2Target-$houseKeeper2Available)*1116)+
              (($houseKeeper3Target-$houseKeeper3Available)*1116)+
              (($supvisorTarget-$supvisorAvailable)*1195)+(($machineOpeTarget-$machineOpeAvailable)*1116)+(($houseKeeperTarget-$houseKeeperAvailable)*1116)+($foundWoDress*100)+($foundWoProGlass*100);
          }

          elseif ($Year =='2024' && $Month >='10') {
            $totalPenalty += $totalAvailable==0 ? 0 : 
              (($managerTarget-$managerAvailable)*1454)+
              (($projectManagerTarget-$projectManagerAvailable)*1454)+
              (($houseKeeper1Target-$houseKeeper1Available)*1155)+
              (($houseKeeper2Target-$houseKeeper2Available)*1155)+
              (($houseKeeper3Target-$houseKeeper3Available)*1155)+
              (($supvisorTarget-$supvisorAvailable)*1239)+(($machineOpeTarget-$machineOpeAvailable)*1155)+(($houseKeeperTarget-$houseKeeperAvailable)*1155)+($foundWoDress*100)+($foundWoProGlass*100);
          }


        else {


         $totalPenalty += $totalAvailable==0 ? 0 : 
            (($managerTarget-$managerAvailable)*1366)+
            (($projectManagerTarget-$projectManagerAvailable)*1366)+
            (($houseKeeper1Target-$houseKeeper1Available)*1095)+
            (($houseKeeper2Target-$houseKeeper2Available)*1095)+
            (($houseKeeper3Target-$houseKeeper3Available)*1095)+
            (($supvisorTarget-$supvisorAvailable)*1171)+(($machineOpeTarget-$machineOpeAvailable)*1095)+(($houseKeeperTarget-$houseKeeperAvailable)*1095)+($foundWoDress*100)+($foundWoProGlass*100);
      }        
      }



	  else{
			$totalPenalty += $totalAvailable==0 ? 0 : 
	      (($managerTarget-$managerAvailable)*1777)+
	      (($projectManagerTarget-$projectManagerAvailable)*1777)+
	      (($houseKeeper1Target-$houseKeeper1Available)*1777)+
	      (($houseKeeper2Target-$houseKeeper2Available)*1777)+
	      (($houseKeeper3Target-$houseKeeper3Available)*1777)+
	      (($supvisorTarget-$supvisorAvailable)*1603)+(($machineOpeTarget-$machineOpeAvailable)*1534)+(($houseKeeperTarget-$houseKeeperAvailable)*1534);
      }
    }

    if($totalAvailable != 0){
        $attendance_earning = $attendance_earning + $totalAvailable;
        $manpower_target_earning = $manpower_target_earning + $totalTarget;;

    }


 
}

    /*point 2 - daily performance log*/

    $sumPer2 = 0;
    $sumPerCount2 = 0;
  // if($_SESSION['UserInfo']['OrgID'] == 16){
  //   $QuestionId = 20;
  //   $mQuestionId = 15;
  // }else{
  //   $QuestionId = 5;
  //   $mQuestionId = 14;
  // }

    $mQuestionId = getquestionid('PMC');
    $QuestionId = getsubquestionid('PMC','daily_performance');

    $rsParamIDS = SubQuestionGroupIDS('params',$QuestionId);//subquestion
    $rsPagesIDS = SubQuestionGroupIDS('pages',$rsParamIDS[0]);
    
    $totalDays = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);
    for ($i=1; $i <= $totalDays; $i++) { 
    $totalScore2 = 0;
    $requiredScore2 = 0;
    $date = $Year.'-'.$Month.'-'.$i;

    $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($mQuestionId,$QuestionId,$date);
    if(count($rsQuestionsInfo)>0){ 
        for ($q=0;$q< count($rsQuestionsInfo);$q++){
            foreach ($rsPagesIDS as $key2 => $rsPages) {
                foreach ($rsParamIDS as $rsParams) {

                    $avgVal = $objScorecardctsnew->FetchValueScore($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$rsQuestionsInfo[$q][0]['tokenid']);
                    $totalScore2 = $totalScore2+$avgVal;
                    $requiredScore2++;
                }
            }
        }
    } 

    $avgPer2 = round(($totalScore2*100)/$requiredScore2,2);
    $sumPer2 = $sumPer2 + $avgPer2;
    if($avgPer2 !=0) $sumPerCount2++;

}

/*point 3 - Consumable */
// if($_SESSION['UserInfo']['OrgID'] == 16){
//     $QuestionId = 17;
//     $mQuestionId = 15;
// }else{
//     $QuestionId = 2;
//     $mQuestionId = 14;
// }

$mQuestionId = getquestionid('PMC');
$QuestionId = getsubquestionid('PMC','daily_consumable');

$rsParamIDS = SubQuestionGroupIDS('params',$QuestionId);//subquestion

$rsPagesIDS = SubQuestionGroupIDS('pages',$rsParamIDS[0]);


$total_chemical_penalty = 0;// for deduction 

$skipids_for_17 = 0;
$totalPer3 = 0;

    foreach ($rsPagesIDS as $rsPages) {

        $rsPagesData = $objScorecardctsnew->getPagesData($rsPages);
        
        if($rsPages == 528 || $rsPages == 529){
            $skipids_for_17++;
            continue;
        }

        $rsPagesData = $objScorecardctsnew->getPagesData($rsPages);

        $rsTargetData = $objScorecardctsnew->getMonthlyTarget($mQuestionId,$QuestionId,$rsPages,$Month,$Year);
        if(!empty($rsTargetData))$targetValue = $rsTargetData[0]['value'];
        else $targetValue = 0;
        $avgValTotal=0;

        foreach ($rsParamIDS as $rsParams) { 
            $avgVal = $objScorecardctsnew->FetchValueScoreConsumable($mQuestionId,$QuestionId,$rsParams,$rsPages,$Month,$Year);
           $avgValTotal = $avgValTotal + $avgVal;
          
        }
        
      $dailychemicalperformance = round(($avgValTotal/$targetValue)*100,2);
        
        if($targetValue == 0 || $dailychemicalperformance  >= 100) $dailychemicalperformance = 100;
        
        
       $totalPer3 = $totalPer3 + $dailychemicalperformance;

        $difference = $targetValue - $avgValTotal;

        if ($difference > 0) {
          $total_chemical_penalty += $difference*$rsTargetData[0]['penalty_rate'];
        }
        
    }
  
// }
 $main_earning_3 = round($totalPer3/(count($rsPagesIDS)-$skipids_for_17),2);

$main_earning_30 = round($totalPer3/(count($rsPagesIDS)-$skipids_for_17),2); //for other use


/*point 7 machinery usage saperated from consumable*/
$totalPer7 = 0;
foreach ($rsPagesIDS as $rsPages) {

    if($rsPages == 528 || $rsPages == 529){

        $rsPagesData = $objScorecardctsnew->getPagesData($rsPages);
        
        $rsTargetData = $objScorecardctsnew->getMonthlyTarget($mQuestionId,$QuestionId,$rsPages,$Month,$Year);
        if(!empty($rsTargetData))$targetValue = $rsTargetData[0]['value']; else $targetValue = 0;
        $avgValTotal=0;

        foreach ($rsParamIDS as $rsParams) { 
            $avgVal = $objScorecardctsnew->FetchValueScoreConsumable($mQuestionId,$QuestionId,$rsParams,$rsPages,$Month,$Year);
            $avgValTotal = $avgValTotal + $avgVal;
        }
        $dailyMachinePerformance = round(($avgValTotal/$targetValue)*100,2);
        if($targetValue == 0) $dailychemicalperformance = 100;
        $totalPer7 = $totalPer7 + $dailyMachinePerformance;

        $difference = $targetValue - $avgValTotal;

        if($difference > 0){
          $totalMachineConsumablePenalty += $difference*$rsTargetData[0]['penalty_rate'];
        }
        
    }
}

$main_earning_7 = round($totalPer7/2,2);

$mQuestionId = getquestionid('PMC');
$QuestionId = getsubquestionid('PMC','daily_machine');
$rsParamIDS = SubQuestionGroupIDS('params',$QuestionId);//subquestion               
$rsPagesIDS = SubQuestionGroupIDS('pages',$rsParamIDS[0]);

$totalPenalty31 = 0;
$totalavg31 = 0;
$activeDay31 = 0;

$totalScore31=0;
$totalPages31=0;
$totalUsed31 = 0;
$agra_pages_count31=0;
$rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsDataMachine($startDate,$endDate,$mQuestionId,$QuestionId);
      
if(count($rsQuestionsInfo)>0){ 
	for ($q=0;$q< count($rsQuestionsInfo);$q++){
    $dailymachineperformance =0;
    if($_SESSION['UserInfo']['OrgID'] == 17 || $_SESSION['UserInfo']['OrgID'] == 21 || $_SESSION['UserInfo']['OrgID'] == 23 || $_SESSION['UserInfo']['OrgID'] == 24) {
      foreach ($rsPagesIDS as $rsPages) {
                 
          $rsTargetData = $objScorecardctsnew->getMonthlyTarget($mQuestionId,$QuestionId,$rsPages,date('m', strtotime($rsQuestionsInfo[$q][0]['created_date'])),date('Y', strtotime($rsQuestionsInfo[$q][0]['created_date'])));

          $targetValue = array();
          if(!empty($rsTargetData)){
              $targetValue = explode(',', $rsTargetData[0]['value']);
              
          }
                 
          foreach ($rsParamIDS as $keyp => $rsParams) {

              $avgVal = $objScorecardctsnew->FetchValueScoreMachine($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$rsQuestionsInfo[$q][0]['tokenid']);
              if($targetValue[$keyp] == '1' and $avgVal == '1') $totalScore31++;
              if($targetValue[$keyp] == '1') $totalPages31++;  
          }
          foreach($rsParamIDS as $keyp => $rsParams) {
            $avgVal = $objScorecardctsnew->FetchValueScoreMachine($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$rsQuestionsInfo[$q][0]['tokenid']);

            if($avgVal == '0' && $targetValue[$keyp] == '1'){
                  $totalPenalty31 += !empty($rsTargetData[0]['penalty_rate']) ? $rsTargetData[0]['penalty_rate'] : 0;
                  break;
              }
          }
      }
    }
    else {
      foreach ($rsPagesIDS as $rsPages) {
                 
          $rsTargetData = $objScorecardctsnew->getMonthlyTarget($mQuestionId,$QuestionId,$rsPages,date('m', strtotime($rsQuestionsInfo[$q][0]['created_date'])),date('Y', strtotime($rsQuestionsInfo[$q][0]['created_date'])));

          $targetValue = array();
          if(!empty($rsTargetData)){
              $targetValue = explode(',', $rsTargetData[0]['value']);
              
          }
                 
          foreach ($rsParamIDS as $keyp => $rsParams) {

              $avgVal = $objScorecardctsnew->FetchValueScoreMachine($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$rsQuestionsInfo[$q][0]['tokenid']);
              if($targetValue[$keyp] == '1' and $avgVal == '1') $totalScore31++;
              if($targetValue[$keyp] == '1') $totalPages31++;  
             
              if($avgVal == '0' && $targetValue[$keyp] == '1'){
                  

                  $totalPenalty31 += !empty($rsTargetData[0]['penalty_rate']) ? $rsTargetData[0]['penalty_rate'] : 0;  
              }
          }
      }
    }
    $dailymachineperformance = round($totalScore31*100/$totalPages31,2);
    $totalavg31 += $dailymachineperformance;
    if($dailymachineperformance != 0) $activeDay31++; 

  }
} 

$main_earning_31 = round($totalavg31/$activeDay31,2);
//echo $main_earning_31;die();
//avarage of consumable and machine

//if($main_earning_3 >= 100)
//$main_earning_3 = round((100+$main_earning_31)/2,2);
//else
//$main_earning_3 = round(($main_earning_3+$main_earning_31)/2,2);

/*point 4 - Daily surprise */
// if($_SESSION['UserInfo']['OrgID'] == 16){
//     $QuestionId = 16;
//     $mQuestionId = 15;
// }else{
//     $QuestionId = 1;
//     $mQuestionId = 14;
// }
$mQuestionId = getquestionid('PMC');
$QuestionId = getsubquestionid('PMC','daily_surprise');
$rsParamIDS = SubQuestionGroupIDS('params',$QuestionId);//subquestion
                        
$totalper4 = 0;
$totalcount4 = 0;
$number = cal_days_in_month(CAL_GREGORIAN, $Month, $Year);
for ($i=1; $i <= $number; $i++) { 
    $date = $Year.'-'.$Month.'-'.$i;
                           
    $totalScore = 0;
    $obtainScore = 0;
    $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($mQuestionId,$QuestionId,$date);
    if(count($rsQuestionsInfo)>0){ 
       for ($q=0;$q< count($rsQuestionsInfo);$q++){
          foreach ($rsParamIDS as $rsParams) {
            $rsPagesIDS = SubQuestionGroupIDS('pages',$rsParams);
            foreach ($rsPagesIDS as $rsPages) {

                $avgVal = $objScorecardctsnew->FetchValueScore($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$rsQuestionsInfo[$q][0]['tokenid']);                       
                $totalScore = $totalScore+10;
                $obtainScore = $obtainScore+$avgVal;
            }
          }
        }                   
    }

    $totalper4 = $totalper4 + round(($obtainScore*100)/$totalScore,2);
    if(!empty($obtainScore)) $totalcount4++;
}

$main_earning_4 = round($totalper4/$totalcount4,2);



/*point 5 feedback*/
$main_earning_5 = 0;
if($_SESSION['UserInfo']['OrgID'] == 16){

	$rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('63930');
	$rsBranches = $objScorecardctsnew->fetchBranchesData('','63930');
}elseif($_SESSION['UserInfo']['OrgID'] == 17){
    $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('75821');
    $rsBranches = $objScorecardctsnew->fetchBranchesData('','75821');
}elseif($_SESSION['UserInfo']['OrgID'] == 18){
    $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('81715');
    $rsBranches = $objScorecardctsnew->fetchBranchesData('','81715');
}elseif($_SESSION['UserInfo']['OrgID'] == 20){
    $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('91905');
    $rsBranches = $objScorecardctsnew->fetchBranchesData('','91905');
}elseif ($_SESSION['UserInfo']['OrgID'] == 21){
	$rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('92948');
	$rsBranches = $objScorecardctsnew->fetchBranchesData('','92948');
}elseif ($_SESSION['UserInfo']['OrgID'] == 23){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('100900');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','100900');
}elseif ($_SESSION['UserInfo']['OrgID'] == 24){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('107714');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','107714');
}elseif ($_SESSION['UserInfo']['OrgID'] == 25){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('107718');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','107718');
}elseif ($_SESSION['UserInfo']['OrgID'] == 28){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('119533');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','119533');
}elseif ($_SESSION['UserInfo']['OrgID'] == 29){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('119542');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','119542');
}elseif ($_SESSION['UserInfo']['OrgID'] == 32){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('175711');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','175711');
}elseif ($_SESSION['UserInfo']['OrgID'] == 33){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('178200');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','178200');
}elseif ($_SESSION['UserInfo']['OrgID'] == 34){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180025');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180025');
}elseif ($_SESSION['UserInfo']['OrgID'] == 35){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180031');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180031');
}elseif ($_SESSION['UserInfo']['OrgID'] == 36){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180034');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180034');
}elseif ($_SESSION['UserInfo']['OrgID'] == 37){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180037');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180037');
}elseif ($_SESSION['UserInfo']['OrgID'] == 38){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180040');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180040');
}elseif ($_SESSION['UserInfo']['OrgID'] == 39){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180065');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180065');
}elseif ($_SESSION['UserInfo']['OrgID'] == 40){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180070');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180070');
}elseif ($_SESSION['UserInfo']['OrgID'] == 41){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180083');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180083');
}elseif ($_SESSION['UserInfo']['OrgID'] == 42){
  $rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('180834');
  $rsBranches = $objScorecardctsnew->fetchBranchesData('','180834');  

}else{
	$rsOrgDetails = $objScorecardctsnew->FetchOrganizationName('59455');
	$rsBranches = $objScorecardctsnew->fetchBranchesData('','59455');
}
	$performance = 0;
	if(count($rsBranches) > 0)
	for($i=0; $i<count($rsBranches); $i++) {
	    $rsIndustryData = $objScorecardctsnew->fetchIndustryData($rsBranches[$i]['branchId']);

	    if(count($rsIndustryData) > 0) {
	        for($j=0; $j<count($rsIndustryData); $j++) {
	            $performanceArr = fetchRatingForCurrentIndustry($rsIndustryData[$j]['IndId'],$rsBranches[$i]['branchId'],$rsOrgDetails[0]['OrgId'],'us',$startDate,$endDate,'','');
	            $performance = $performance + $performanceArr['performance'];
	        }
	        $performance = $performance/$j;

	    }
	}

	$performance = number_format(($performance/count($rsBranches)),2);

	$main_earning_5 = round(($performance/5)*100,2);

$billing_days = date('t',strtotime('01-'.$Month.'-'.$Year));

$main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/($rsBillRate[0]['year_of_contract']*12),2);
// $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/1461,2) * $billing_days;
// $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/($rsBillRate[0]['year_of_contract']*365),2) * $billing_days;

$main_monthly_sectioned_amount = round(($main_monthly_sectioned_amount_with_gst*100)/($rsBillRate[0]['gst']+100),2);

$main_GST = $main_monthly_sectioned_amount_with_gst - $main_monthly_sectioned_amount;

// echo $main_GST; die;
?>
<script type="text/javascript">$('.survey_feedback_value').text('<?php echo $main_earning_5 ?>%')</script>
 
                <?php 
                //tirupati
                if($_SESSION['UserInfo']['OrgID'] == 17 || $_SESSION['UserInfo']['OrgID'] == 18){ 

                    if($_SESSION['UserInfo']['OrgID'] == 17){
                        $main_earning_31_weightage = 5;
                        $main_earning_4_weightage = 10;
                    }else{
                        $main_earning_31_weightage = 10;
                        $main_earning_4_weightage = 5;
                    }

                    ?>
                    <tr class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">25%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $attendance = $attendance = round($tirupati_amount*25/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*25/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $cleanliness = $tirupati_amount_1 = round($tirupati_amount*15/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php echo $main_earning_amount = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_30; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $consumables = $tirupati_amount_1 = round($tirupati_amount*10/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Machinery usage
                      </td>
                      <td class="column7 style29 n"><?php echo $main_earning_31_weightage; ?>%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_31; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      
                      
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $machinery_usage = round($tirupati_amount*5/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_31 = round($main_monthly_sectioned_amount*$main_earning_31_weightage/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n"><?php echo $main_earning_4_weightage; ?>%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $surprise = round($tirupati_amount*10/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php  
                        // if($main_earning_4 >= 95){
                        // 	$main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // 	echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        // 	echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        // 	$main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // 	echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*$main_earning_4_weightage/100,2);
                        ?>
                      </td>
                      <?php } ?>
                      
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Machine consumables
                      </td>
                      <td class="column7 style29 n">5%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_7; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $machine_consumables = round($tirupati_amount*5/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_7 = round($main_monthly_sectioned_amount*5/100,2);
                        
                        ?>
                      </td>
                      <?php } ?>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 17){
                         $tirupati_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $passenger = round($tirupati_amount*30/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php  
                        // if($main_earning_5 >= 95){
                        // 	$main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // 	echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        // 	echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        // 	$main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // 	echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
						echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                      <?php } ?>
                    </tr>
                    
                    <tr class="row14">
                      <td class="column0 style25 n">8
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Performance Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_1+$main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5+$main_earning_7)/6,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <?php /*
                    <tr class="row14">
                      <td class="column0 style25 n">9
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                      	<?php
                      	if($main_earning_6 >= 95){
                        	echo '5';
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                        	echo '0.00';
                        }else{
                        	echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                        }
                      	?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php
                      	$totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_31+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7;
                      	if($main_earning_6 >= 95){
                        	echo $main_earning_amount_6 = round($totalOfEarnings*5/100,2);
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                        	echo '0.00'; 
                        	$main_earning_amount_6 = 0;
                        }else{
                        	echo $main_earning_amount_6 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                        }
                      	?>
                      </td>
                    </tr>
                    */?>

                    <?php
                        $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7;
                        // if($main_earning_6 >= 95){
                        //     $main_earning_amount_with_bonus = round($totalOfEarnings*5/100,2);
                        // }else
                        if ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            // echo '0.00'; 
                            $main_earning_amount_with_bonus = 0;
                        }else{
                            $main_earning_amount_with_bonus = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate1($main_earning_6)/100,2);
                        }
                        ?>
                    <?php
                      if($userdata[0]['OrgID'] == 17){ 
                         echo ""; 
                       }else {
                    ?>
                    <tr class="row14">
                      <td class="column0 style25 n">9
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php echo $main_GST = round(($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_31+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_earning_amount_with_bonus)*18/100,2); ?>
                      </td>
                    </tr>
                    <?php } ?>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                      	<?php  
                      		if($userdata[0]['OrgID'] == 17){
                      		echo $earning_total = round($attendance+$cleanliness+$consumables+$machinery_usage+$surprise+$machine_consumables+$passenger,2);
                      		}else{
                      		echo $earning_total = round($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_31+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_earning_amount_with_bonus+$main_GST,2);
				}
                      	?>
                      </td>
                    </tr>

                
                <?php
                //agra cantt 
                }elseif($_SESSION['UserInfo']['OrgID'] == 16) { 

                    $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/($rsBillRate[0]['year_of_contract']*12),2);
                    // $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/1461,2) * $billing_days;

                    $main_monthly_sectioned_amount = round(($main_monthly_sectioned_amount_with_gst*100)/($rsBillRate[0]['gst']+100),2);

                    $main_GST = $main_monthly_sectioned_amount_with_gst - $main_monthly_sectioned_amount;

                    ?>

                    <tr class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">35%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*35/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_1+$main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5)/5,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($main_earning_6 >= 95){
                            echo '5';
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00';
                        }else{
                            echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                        }
                        ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                        if($main_earning_6 >= 95){
                            echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00'; 
                            $main_earning_amount_7 = 0;
                        }else{
                            echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                        }
                        ?>
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">8
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>
					
					<?php
                //moradabad 
                }elseif (($_SESSION['UserInfo']['OrgID'] == 21) || ($_SESSION['UserInfo']['OrgID'] == 30)) { 

                    $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/($rsBillRate[0]['year_of_contract']*12),2);
                    // $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/1461,2) * $billing_days;

                    $main_monthly_sectioned_amount = round(($main_monthly_sectioned_amount_with_gst*100)/($rsBillRate[0]['gst']+100),2);

                    $main_GST = $main_monthly_sectioned_amount_with_gst - $main_monthly_sectioned_amount;

                    ?>

                    <tr class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">35%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*35/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_1+$main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5)/5,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <?php if (($_SESSION['UserInfo']['OrgID'] == 21) || ($_SESSION['UserInfo']['OrgID'] == 30)) { ?>
                        <td class="column8 style30 n style24" colspan="2">Not Applicable</td>
                      <?php }else{ ?>
                        <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($main_earning_6 >= 95){
                            echo '5';
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00';
                        }else{
                            echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                        }
                        ?>%
                      </td>
                    <?php } ?>
                      <?php if(($_SESSION['UserInfo']['OrgID'] == 21) || ($_SESSION['UserInfo']['OrgID'] == 30)) { ?>
                      <td class="column10 style31 f style32" colspan="2">
                        0
                      </td>
                    <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                        if($main_earning_6 >= 95){
                            echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00'; 
                            $main_earning_amount_7 = 0;
                        }else{
                            echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                        }
                        ?>
                      </td>
                    <?php } ?>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">8
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>

                 <?php }elseif($_SESSION['UserInfo']['OrgID'] == 20) { 

                    $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/($rsBillRate[0]['year_of_contract']*12),2);
                    // $main_monthly_sectioned_amount_with_gst = empty($rsBillRate[0]['sactioned_amount']) ? 0 : round($rsBillRate[0]['sactioned_amount']/1461,2) * $billing_days;

                    $main_monthly_sectioned_amount = round(($main_monthly_sectioned_amount_with_gst*100)/($rsBillRate[0]['gst']+100),2);

                    $main_GST = $main_monthly_sectioned_amount_with_gst - $main_monthly_sectioned_amount;

                    ?>

                    <tr class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">25%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*25/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*15/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_1+$main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5)/5,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($main_earning_6 >= 95){
                            echo '5';
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00';
                        }else{
                            echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                        }
                        ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                        if($main_earning_6 >= 95){
                            echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                        }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                            echo '0.00'; 
                            $main_earning_amount_7 = 0;
                        }else{
                            echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                        }
                        ?>
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">8
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>

                    <!--- Ahmedabad --->

                  <?php }elseif($_SESSION['UserInfo']['OrgID'] == 32) { ?>

                    <tr style = "display: none" class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">35%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*35/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">50%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*50/100,2); ?>
                      </td>
                    </tr>
                    
<tr class="row11" style = "display: none" >
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 32){
                         $ahmed_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      <td class="column10 style31 f style32" colspan="2">
                      
                      <?php if($ahmed_amount >= 100) echo '100%'; else echo $consumables = $ahmed_amount_1 = round($ahmed_amount*10/100,2);   ?>
                        
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                      	<?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>

<tr class="row11" style = "display: none" >
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Machinery usage
                      </td>
                      <td class="column7 style29 n"><?php echo $main_earning_31_weightage; ?>%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_31; ?>%
                      </td>
                      
                      <?php
                      if($userdata[0]['OrgID'] == 32){
                         $ahmed_amount = round($rsBillRate[0]['sactioned_amount']/1461*$no_of_days,2); 
                      ?>
                      
                      
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $machinery_usage = round($ahmed_amount*5/100,2); ?>
                      </td>
                      <?php }else{ ?>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_31 = round($main_monthly_sectioned_amount*$main_earning_31_weightage/100,2); ?>
                      </td>
                      <?php } ?>
                    </tr>

                    
                    
                    
                    
                    
                    
                    
                    <tr class="row11">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo round(($main_earning_3 + $main_earning_31)/2,2) . '%';   ?>
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Performance Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5)/4,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus/ Penalty                      
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28){
                          if($main_earning_6 >= 95){
                              echo '0';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }else{
                          if($main_earning_6 >= 95){
                              echo '5';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }
                        ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28){
                          echo 0;
                        }else{
                            if($userdata[0]['OrgID'] == 32){
                            $totalOfEarnings = $main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                            }
                            else {
                            $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                            }
                          if($main_earning_6 >= 95){
                              echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00'; 
                              $main_earning_amount_7 = 0;
                            }else{
                              echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                            }
                          
                        }
                        ?>
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>

                    <!-- Sabarmati --->

                    <?php }elseif(($_SESSION['UserInfo']['OrgID'] == 31) || ($_SESSION['UserInfo']['OrgID'] == 33 ) || ($_SESSION['UserInfo']['OrgID'] == 34 ) || ($_SESSION['UserInfo']['OrgID'] == 35 ) || ($_SESSION['UserInfo']['OrgID'] == 36 ) || ($_SESSION['UserInfo']['OrgID'] == 37 ) || ($_SESSION['UserInfo']['OrgID'] == 38 ) || ($_SESSION['UserInfo']['OrgID'] == 39 ) || ($_SESSION['UserInfo']['OrgID'] == 40 ) || ($_SESSION['UserInfo']['OrgID'] == 41 ) || ($_SESSION['UserInfo']['OrgID'] == 42 )) { ?>

                    <tr style = "display: none" class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">35%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*35/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">50%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*50/100,2); ?>
                      </td>
                    </tr>
                    <tr style = "display: none" class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">20%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*20/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_2+$main_earning_4+$main_earning_5)/3,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28){
                          if($main_earning_6 >= 95){
                              echo '0';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }else{
                          if($main_earning_6 >= 95){
                              echo '5';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }
                        ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28 || $userdata[0]['OrgID'] == 31 ){
                          echo 0;
                        }else{
                            $totalOfEarnings = $main_earning_amount_2+$main_earning_amount_4+$main_earning_amount_5;
                          if($main_earning_6 >= 95){
                              echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00'; 
                              $main_earning_amount_7 = 0;
                            }else{
                              echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                            }
                          
                        }
                        ?>
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_2+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_2+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>
                
                

                <?php }else{ ?>

                    <tr  class="row9">
                      <td class="column0 style25 n">1
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Attendance records of the staff
                      </td>
                      <td class="column7 style29 n">35%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_1 = round($attendance_earning/$manpower_target_earning*100,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_1 = round($main_monthly_sectioned_amount*35/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row10">
                      <td class="column0 style25 n">2
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Cleanliness record
                      </td>
                      <td class="column7 style29 n">15%
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php echo $main_earning_2 = round($sumPer2/$sumPerCount2,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_2 = round($main_monthly_sectioned_amount*15/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row11">
                      <td class="column0 style25 n">3
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Use of type and quantity of consumables and machinery
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_3; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_earning_amount_3 = round($main_monthly_sectioned_amount*10/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row12">
                      <td class="column0 style25 n">4
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Surprise visits conducted by officials of Indian Railways
                      </td>
                      <td class="column7 style29 n">10%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_4; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_4 >= 95){
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 + ($main_earning_amount_4*5/100),2);
                        // }elseif ($main_earning_4 >= 85 && $main_earning_4 < 95) {
                        //  echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        // }else{
                        //  $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        //  echo $main_earning_amount_4 = round($main_earning_amount_4 - ($main_earning_amount_4*$objScorecardctsnew->getPenaltyRate($main_earning_4)/100),2);
                        // }
                        echo $main_earning_amount_4 = round($main_monthly_sectioned_amount*10/100,2);
                        ?>
                      </td>
                    </tr>
                    <tr class="row13">
                      <td class="column0 style25 n">5
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Passenger feedback and complaints
                      </td>
                      <td class="column7 style29 n">30%
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_5; ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php  
                        // if($main_earning_5 >= 95){
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 + ($main_earning_amount_5*5/100),2);
                        // }elseif ($main_earning_5 >= 85 && $main_earning_5 < 95) {
                        //  echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        // }else{
                        //  $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        //  echo $main_earning_amount_5 = round($main_earning_amount_5 - ($main_earning_amount_5*$objScorecardctsnew->getPenaltyRate($main_earning_5)/100),2);
                        // }
                        echo $main_earning_amount_5 = round($main_monthly_sectioned_amount*30/100,2);
                        
                        ?>
                      </td>
                    </tr>    
                    <tr class="row14">
                      <td class="column0 style25 n">6
                      </td>
                      <td class="column1 style26 s style28" colspan="6">Consolidated Score
                      </td>
                      <td class="column7 style29 n">
                      </td>
                      <td class="column8 style30 n style24" colspan="2"><?php echo $main_earning_6 = round(($main_earning_1+$main_earning_2+$main_earning_3+$main_earning_4+$main_earning_5)/5,2); ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">7
                      </td>
                      <td class="column1 style33 s style35" colspan="6">Performance Bonus
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style30 n style24" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28){
                          if($main_earning_6 >= 95){
                              echo '0';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }else{
                          if($main_earning_6 >= 95){
                              echo '5';
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00';
                          }else{
                              echo '-'.$objScorecardctsnew->getPenaltyRate($main_earning_6);
                          }
                        }
                        ?>%
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php
                        if($userdata[0]['OrgID'] == 28){
                          echo 0;
                        }else{
                            $totalOfEarnings = $main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5;
                          if($main_earning_6 >= 95){
                              echo $main_earning_amount_7 = round($totalOfEarnings*5/100,2);
                          }elseif ($main_earning_6 >= 85 && $main_earning_6 < 95) {
                              echo '0.00'; 
                              $main_earning_amount_7 = 0;
                            }else{
                              echo $main_earning_amount_7 = -round($totalOfEarnings*$objScorecardctsnew->getPenaltyRate($main_earning_6)/100,2);
                            }
                          
                        }
                        ?>
                      </td>
                    </tr>
                    <tr class="row14">
                      <td class="column0 style25 n">8
                      </td>
                      <td class="column1 style33 s style35" colspan="6">GST @ 18%
                      </td>
                      <td class="column7 style29 null">
                      </td>
                      <td class="column8 style36 null">
                      </td>
                      <td class="column9 style37 null">
                      </td>
                      <td class="column10 style31 f style32" colspan="2">
                        <?php echo $main_GST = round(($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7)*18/100,2); ?>
                      </td>
                    </tr>
                    <tr class="row15">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Total
                      </td>
                      <td class="column7 style38 null">
                      </td>
                      <td class="column8 style31 null style32" colspan="2">
                      </td>
                      <td class="column10 style39 f style40" colspan="2">
                        <?php  
                            echo $earning_total = round($main_earning_amount_1+$main_earning_amount_2+$main_earning_amount_3+$main_earning_amount_4+$main_earning_amount_5+$main_earning_amount_7+$main_GST,2);
                        ?>
                      </td>
                    </tr>
                <?php } ?>


                    <tr class="row16">
                      <td class="column0 style41 null">
                      </td>
                      <td class="column1 style42 null">
                      </td>
                      <td class="column2 style42 null">
                      </td>
                      <td class="column3 style42 null">
                      </td>
                      <td class="column4 style42 null">
                      </td>
                      <td class="column5 style43 null">
                      </td>
                      <td class="column6 style44 null">
                      </td>
                      <td class="column7 style45 null">
                      </td>
                      <td class="column8 style45 null">
                      </td>
                      <td class="column9 style45 null">
                      </td>
                      <td class="column10 style45 null">
                      </td>
                      <td class="column11 style45 null">
                      </td>
                    </tr>
                    <tr class="row17">
                      <td class="column0 style21 s">S.No
                      </td>
                      <td class="column1 style22 s style24" colspan="6">Deductions
                      </td>
                      <td class="column7 style22 s style24" colspan="3"><!-- Rate/ Value -->
                      </td>
                      <td class="column10 style22 s style24" colspan="2">Amount
                      </td>
                    </tr>
                    <?php $a = 0; ?>
                    <?php if ($_SESSION['UserInfo']['OrgID'] == 17) { ?>
                    <tr class="row18">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Passenger Complaint
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 500.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php  
                      		echo $passengerComplaints = fetch_ticket_for_tabbing($startDate,$endDate,'25') * 500;
                      	?>
                      </td>
                    </tr>
                <?php }elseif ($_SESSION['UserInfo']['OrgID'] == 18) { ?>
                    <tr class="row18">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Passenger Complaint
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 500.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php  
                            echo $passengerComplaints = fetch_ticket_for_tabbing($startDate,$endDate,'27') * 500;
                        ?>
                      </td>
                    </tr>
                <?php }else{ ?>
                    <tr class="row18">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Passenger Complaint
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php  
                            echo $passengerComplaints = fetch_ticket_for_tabbing($startDate,$endDate,'26') * 1000;
                        ?>
                      </td>
                    </tr>
                <?php } ?>
                    <tr class="row19">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Non Removal Of Garbage from Dustbins
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 500.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $NonremovalGarbagePenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','NonremovalGarbagePenalty'); ?>
                      </td>
                    </tr>
                    <tr class="row20">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Open Burning of Waste in Railways Premises
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 2000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $OpenBurningWastePenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','OpenBurningWastePenalty'); ?>
                      </td>
                    </tr>
                    <tr class="row21">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">
                        <?php if ($_SESSION['UserInfo']['OrgID'] == 17 || $_SESSION['UserInfo']['OrgID'] == 18) { 
                            echo "Roof of platform shelters";
                        }else{
                            echo "Rodent Work Not Satisfactory";
                        } ?>
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 2000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $RodentWorkPenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','RodentWorkPenalty'); ?>
                      </td>
                    </tr>
                    <?php  if ($_SESSION['UserInfo']['OrgID'] == 32 || $_SESSION['UserInfo']['OrgID'] == 31 || $_SESSION['UserInfo']['OrgID'] == 34 || $_SESSION['UserInfo']['OrgID'] == 35 || $_SESSION['UserInfo']['OrgID'] == 36 || $_SESSION['UserInfo']['OrgID'] == 37 || $_SESSION['UserInfo']['OrgID'] == 38 || $_SESSION['UserInfo']['OrgID'] == 39 || $_SESSION['UserInfo']['OrgID'] == 40 || $_SESSION['UserInfo']['OrgID'] == 41 || $_SESSION['UserInfo']['OrgID'] == 42)  { ?>
                    <tr  style = "display: none" class="row22">
                      <td class="column0 style25 n">
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Manpower and Uniform Penalty
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1150.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $totalPenalty; ?>
                      </td>
                    </tr>
                  <?php } else { ?>

                    <tr  class="row22">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style46 s style48" colspan="6">Manpower and Uniform Penalty
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1150.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php echo $totalPenalty; ?>
                      </td>
                    </tr>
                  <?php } ?>

                    <tr class="row23">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty Imposed by NGT
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 500.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $PenaltyImposedByNGT = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','PenaltyImposedByNGT'); ?>
                      </td>
                    </tr>
                    <tr class="row24">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">SPOT PENALTY
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $SpotPenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','SpotPenalty'); ?>
                      </td>
                    </tr>
                    <?php  if  ($_SESSION['UserInfo']['OrgID'] == 31 || $_SESSION['UserInfo']['OrgID'] == 34 || $_SESSION['UserInfo']['OrgID'] == 35 || $_SESSION['UserInfo']['OrgID'] == 36 || $_SESSION['UserInfo']['OrgID'] == 37 || $_SESSION['UserInfo']['OrgID'] == 38 || $_SESSION['UserInfo']['OrgID'] == 39 || $_SESSION['UserInfo']['OrgID'] == 40 || $_SESSION['UserInfo']['OrgID'] == 41 || $_SESSION['UserInfo']['OrgID'] == 42)  { ?>
                    <tr style = "display: none" class="row25">
                      <td class="column0 style25 n">
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty Imposed due to Machine Shortage/ Out of Order
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $totalPenalty31; ?>
                      </td>
                    </tr>
                     <?php } else { ?>
                      <tr class="row25">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty Imposed due to Machine Shortage/ Out of Order
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php echo $totalPenalty31; ?>
                      </td>
                    </tr>
                    <?php } ?>
                    <?php  if ($_SESSION['UserInfo']['OrgID'] == 32 || $_SESSION['UserInfo']['OrgID'] == 31 || $_SESSION['UserInfo']['OrgID'] == 34 || $_SESSION['UserInfo']['OrgID'] == 35 || $_SESSION['UserInfo']['OrgID'] == 36 || $_SESSION['UserInfo']['OrgID'] == 37 || $_SESSION['UserInfo']['OrgID'] == 38 || $_SESSION['UserInfo']['OrgID'] == 39 || $_SESSION['UserInfo']['OrgID'] == 40 || $_SESSION['UserInfo']['OrgID'] == 41 || $_SESSION['UserInfo']['OrgID'] == 42) { ?>
                    <tr  style = "display: none" class="row22">
                      <td class="column0 style25 n">
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty Imposed due to Shortage of Machine Consumables
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php echo $totalMachineConsumablePenalty; ?>
                      </td>
                    </tr>

                    <?php } else { ?>

                      <tr class="row22">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty Imposed due to Shortage of Machine Consumables
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 1000.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php echo $totalMachineConsumablePenalty; ?>
                      </td>
                    </tr>
                    <?php } ?>

                    <?php  if ($_SESSION['UserInfo']['OrgID'] == 31 || $_SESSION['UserInfo']['OrgID'] == 34 || $_SESSION['UserInfo']['OrgID'] == 35 || $_SESSION['UserInfo']['OrgID'] == 36 || $_SESSION['UserInfo']['OrgID'] == 37 || $_SESSION['UserInfo']['OrgID'] == 38 || $_SESSION['UserInfo']['OrgID'] == 39 || $_SESSION['UserInfo']['OrgID'] == 40 || $_SESSION['UserInfo']['OrgID'] == 41 || $_SESSION['UserInfo']['OrgID'] == 42) { ?>

                    <tr style = "display: none" class="row26">
                      <td  class="column0 style25 n">
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty due to non avalibility of Chemicals
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 530.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $total_chemical_penalty; ?>
                      </td>
                    </tr>


                  <?php }  else { ?>

                    <tr  class="row26">
                      
                      <td  class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Penalty due to non avalibility of Chemicals
                      </td>
                      <td class="column7 style49 n style51" colspan="3"><!-- 530.00 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                        <?php echo $total_chemical_penalty; ?>
                      </td>
                    </tr>

                    <?php } ?>



<?php  if ($_SESSION['UserInfo']['OrgID'] == 32) { ?>
                    
                      <tr style = "display: none" class="row26">
                      <td class="column0 style25 n">
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Monitoring Equipments Penalty
                      </td>
                      <td class="column7 style49 n style51" colspan="3">
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $OtherPenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','MonitoringEquipmentsPenalty'); ?>
                      </td>
                    </tr>

                    <?php } else { ?>

                      <tr  class="row26">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style54 s style56" colspan="6">Monitoring Equipments Penalty
                      </td>
                      <td class="column7 style49 n style51" colspan="3">
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $OtherPenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','MonitoringEquipmentsPenalty'); ?>
                      </td>
                    </tr>
                    <?php } ?>





                  
                    

                 

                    <tr class="row27">
                      <td class="column0 style25 n"><?php echo ++$a; ?>
                      </td>
                      <td class="column1 style57 s style59" colspan="6">MISCELLANEOUS
                      </td>
                      <td class="column7 style60 n style62" colspan="3"><!-- 2000 -->
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $OtherPenalty = $objScorecardctsnew->getImposePenalty($startDate,$endDate,'PMC','OtherPenalty'); ?>
                      </td>
                    </tr>
                    <tr class="row28">
                      <td class="column0 style21 null">
                      </td>
                      <td class="column1 style63 s style65" colspan="6">Total
                      </td>
                      <td class="column7 style31 null style32" colspan="3">
                      </td>
                      <td class="column10 style67 f style40" colspan="2">
                      	<?php echo $totalDeduction = $passengerComplaints + $NonremovalGarbagePenalty + $OpenBurningWastePenalty + $RodentWorkPenalty + $totalPenalty + $PenaltyImposedByNGT + $SpotPenalty + $totalPenalty31 + $total_chemical_penalty + $totalMachineConsumablePenalty +$OtherPenalty; ?>
                      </td>
                    </tr>
                    <tr class="row29">
                      <td class="column0 style68 null">
                      </td>
                      <td class="column1 style43 null">
                      </td>
                      <td class="column2 style43 null">
                      </td>
                      <td class="column3 style43 null">
                      </td>
                      <td class="column4 style43 null">
                      </td>
                      <td class="column5 style43 null">
                      </td>
                      <td class="column6 style69 null">
                      </td>
                      <td class="column7 style70 null">
                      </td>
                      <td class="column8 style70 null">
                      </td>
                      <td class="column9 style70 null">
                      </td>
                      <td class="column10 style45 null">
                      </td>
                      <td class="column11 style45 null">
                      </td>
                    </tr>
                    <tr class="row30">
                      <td class="column0 style71 null">
                      </td>
                      <td class="column1 style42 null">
                      </td>
                      <td class="column2 style42 null">
                      </td>
                      <td class="column3 style42 null">
                      </td>
                      <td class="column4 style42 null">
                      </td>
                      <td class="column5 style42 null">
                      </td>
                      <td class="column6 style2 null style2" colspan="4">
                      </td>
                      <td class="column10 style70 null">
                      </td>
                      <td class="column11 style72 null">
                      </td>
                    </tr>
                    <tr class="row31">
                      <td class="column0 style73 null">
                      </td>
                      <td class="column1 style43 null">
                      </td>
                      <td class="column2 style43 null">
                      </td>
                      <td class="column3 style43 null">
                      </td>
                      <td class="column4 style43 null">
                      </td>
                      <td class="column5 style43 null">
                      </td>
                      <td class="column6 style74 s style74" colspan="4">TOTAL PAYBLE AMOUNT :
                      </td>
                      <td class="column10 style52 f style53" colspan="2">
                      	<?php echo $totalDeduction = $earning_total - $totalDeduction; ?>
                      </td>
                    </tr>
                    <tr class="row32">
                      <td class="column0 style73 null">
                      </td>
                      <td class="column1 style43 null">
                      </td>
                      <td class="column2 style43 null">
                      </td>
                      <td class="column3 style43 null">
                      </td>
                      <td class="column4 style43 null">
                      </td>
                      <td class="column5 style43 null">
                      </td>
                      <td class="column6 style74 s style74" colspan="4">TOTAL ROUND OFF PAYBLE AMOUNT :
                      </td>
                      <td class="column10 style75 f style76" colspan="2">
                      	<?php echo round($totalDeduction); ?>
                      </td>
                    </tr>
                    <tr class="row33">
                      <td class="column0 style77 s style78" colspan="2">In Words:
                      </td>
                      <td class="column2 style79 s style80" colspan="10">
                      	<?php echo getIndianCurrency(round($totalDeduction)) ?>
                      </td>
                    </tr>
                    <tr class="row34">
                      <td class="column0 style81 s style81" colspan="12">This is a computer generated invoice and no signature is required.
                      </td>
                    </tr>
                  </tbody>
                </table>

                <!-- <?php  ?> -->
                <table id="" class="display-- new_print_display bor_none billinvoice" style="margin-top: 19px; display:none;">
                  <colgroup span="12" width="64">
                  </colgroup>
                  <tbody>
                    <tr>
                      <td style="font-size: 32px;text-align: center; padding-bottom: 17px !important;  " colspan="12" height="19" align="center" valign="middle" bgcolor="">
                        <b>
                          <font color="#828282"> PMC BILL INVOICE 
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td style="background: #ededed;
                                 border-bottom: 1px solid #000;text-align: center; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="12" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">PAYBLE AMOUNT DECRIPTION OF SANITATION WORK AT  
                            <?php echo $stationName; ?>  STATION
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="7" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">PAYBLE AMOUNT DECRIPTION OF SANITATION WORK AT  
                          <?php echo $stationName; ?>  STATION
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="5" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">PERIOD OF CONTRACT-
                          <?php echo empty($rsBillRate[0]['period_of_contract_from']) ? 'null' : date('d-m-Y', strtotime($rsBillRate[0]['period_of_contract_from'])) ?> TO 
                          <?php echo empty($rsBillRate[0]['period_of_contract_to']) ? 'null' : date('d-m-Y', strtotime($rsBillRate[0]['period_of_contract_to'])) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="6" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">SACTIONED AMOUNT : 
                          <?php echo empty($rsBillRate[0]['sactioned_amount']) ? 'null' : $rsBillRate[0]['sactioned_amount'] ?>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="5" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">Date Range : 
                          <?php echo $FromDate ?> TO 
                          <?php echo $ToDate ?>
                        </font>
                      </td>
                    </tr>
                    <?php
					$nos_of_worker = array();
					if (!empty($rsBillRate)) {
					if (!empty($rsBillRate[0]['nos_of_worker'])) {
					$nos_of_worker = explode(",", $rsBillRate[0]['nos_of_worker']);
					}
					}
					?>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="6" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">NOS OF WORKERS : 
                          <?php echo implode('+', $nos_of_worker) ?>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="5" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">SECURITY DEPOSIT : 
                          <?php echo empty($rsBillRate[0]['security_deposit']) ? 'null' : $rsBillRate[0]['security_deposit'] ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="6" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">M.B .NO : 
                          <?php echo empty($rsBillRate[0]['mb_no']) ? 'null' : $rsBillRate[0]['mb_no'] ?>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="5" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">PERFORMANCE GUARANTY : 
                          <?php echo empty($rsBillRate[0]['performance_guarant']) ? 'null' : $rsBillRate[0]['performance_guarant'] ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="6" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">AGREEMENT LETTER NO &amp;DT : 
                          <?php echo empty($rsBillRate[0]['agreement_letter_no_dt']) ? 'null' : $rsBillRate[0]['agreement_letter_no_dt'] ?>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="5" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">COST OF WORK PER DAY WITH GST AS PER AGREEMENT : 
                          <?php echo empty($rsBillRate[0]['cost_of_work_per_day']) ? 'null' : $rsBillRate[0]['cost_of_work_per_day'] ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" colspan="6" height="19" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">ACCEPTANCE LETTER NO &amp;DT : 
                          <?php echo empty($rsBillRate[0]['acceptance_letter_no_dt']) ? 'null' : $rsBillRate[0]['acceptance_letter_no_dt'] ?>
                        </font>
                      </td>
                      <td align="left" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000 */" colspan="2" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">Number Of Days for Billing : 
                        </font>
                      </td>
                      <?php
					$date1 = date_create($FromDate);
					$date2 = date_create($ToDate);
					$diff = date_diff($date1, $date2);
					$billing_days = $diff->format("%a");
					?>
                      <td style="/* border-bottom: 1px solid #000000 */" align="left" valign="middle" bgcolor="#FFFFFF" sdval="85" sdnum="1033;">
                        <font size="1" color="#000000">
                          <?php echo $billing_days ?>
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000 */" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000; */border-right: 1px solid #000000;" align="left" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">
                          <br>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">S.No
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Earnings
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; *//* border-right: 1px solid #000000; */" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Rate
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Per
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Amount
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="1" sdnum="1033;">
                        <font color="#000000">1
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000; *//* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">LABOUR COST TOTAL
                          </font>
                        </b>
                      </td>
                      <?php $labour_cost = empty($rsBillRate[0]['labour_cost']) ? 0 : $rsBillRate[0]['labour_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $labour_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $labour_cost ?>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000; */border-left: 1px solid #000000;border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="9986468.95" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $labour_cost_amount = round($labour_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="2" sdnum="1033;">
                        <font color="#000000">2
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">MACHINARY COST
                          </font>
                        </b>
                      </td>
                      <?php $machinary_cost = empty($rsBillRate[0]['machinary_cost']) ? 0 : $rsBillRate[0]['machinary_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $machinary_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $machinary_cost ?>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="145007.45" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $machinary_cost_amount = round($machinary_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="3" sdnum="1033;">
                        <font color="#000000">3
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">EQUIPMENTS &amp; CONSUMABLES COST
                          </font>
                        </b>
                      </td>
                      <?php $equipments_consumables_cost = empty($rsBillRate[0]['equipments_consumables_cost']) ? 0 : $rsBillRate[0]['equipments_consumables_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $equipments_consumables_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $equipments_consumables_cost ?>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="left" valign="middle" bgcolor="#FFFFFF" sdval="227054.55" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $equipments_consumables_cost_amount = round($equipments_consumables_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="4" sdnum="1033;">
                        <font color="#000000">4
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">PROTECTIVE GEAR COST
                          </font>
                        </b>
                      </td>
                      <?php $protective_gear_cost = empty($rsBillRate[0]['protective_gear_cost']) ? 0 : $rsBillRate[0]['protective_gear_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $protective_gear_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $protective_gear_cost ?>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="47897.5" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $protective_gear_cost_amount = round($protective_gear_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="5" sdnum="1033;">
                        <font color="#000000">5
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">MECHANICAL TRANSPORT COST
                          </font>
                        </b>
                      </td>
                      <?php $mechanical_transport_cost = empty($rsBillRate[0]['mechanical_transport_cost']) ? 0 : $rsBillRate[0]['mechanical_transport_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $mechanical_transport_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $mechanical_transport_cost ?>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="119057.8" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $mechanical_transport_cost_amount = round($mechanical_transport_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="6" sdnum="1033;">
                        <font color="#000000">6
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">CONTRACTOR PROFIT COST
                          </font>
                        </b>
                      </td>
                      <?php $contractor_profit_cost = empty($rsBillRate[0]['contractor_profit_cost']) ? 0 : $rsBillRate[0]['contractor_profit_cost'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $contractor_profit_cost ?>" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $contractor_profit_cost ?>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Day
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="13896.65" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $contractor_profit_cost_amount = round($contractor_profit_cost * $billing_days, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="7" sdnum="1033;">
                        <font color="#000000">7
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000; *//* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">GST
                          </font>
                        </b>
                      </td>
                      <?php $gst = empty($rsBillRate[0]['gst']) ? 0 : $rsBillRate[0]['gst'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $gst; ?>" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <?php echo $gst; ?>%
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="1897088.922" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php
					echo $gst_amount =  round(($labour_cost_amount + $machinary_cost_amount + $equipments_consumables_cost_amount + $protective_gear_cost_amount + $mechanical_transport_cost_amount + $contractor_profit_cost_amount) / 100 * 5, 2)
					?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Total
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="12436471.822" sdnum="1033;0;0.00">
                        <b>
                          <font color="#000000">
                            <?php
						echo $earning_total = round($gst_amount + $labour_cost_amount + $machinary_cost_amount + $equipments_consumables_cost_amount + $protective_gear_cost_amount + $mechanical_transport_cost_amount + $contractor_profit_cost_amount, 2)
						?>
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td style="/* border-top: 1px solid #000000 */" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">
                            <br>
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">S.No
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Deductions
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; *//* border-right: 1px solid #000000; */" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Rate
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Per
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Amount
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="1" sdnum="1033;">
                        <font color="#000000">1
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000; *//* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">TDS
                          </font>
                        </b>
                      </td>
                      <?php $tdsrate = empty($rsBillRate[0]['tds']) ? 0 : $rsBillRate[0]['tds'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $tdsrate ?>" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <?php echo $tdsrate ?>%
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000; */border-left: 1px solid #000000;border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="210787.658" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $tdsAmount = round(($earning_total - $gst_amount) / 100 * $tdsrate, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000;border-right: 1px solid #000000;" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="2" sdnum="1033;">
                        <font color="#000000">2
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">Incom Tax
                          </font>
                        </b>
                      </td>
                      <?php $incom_taxrate = empty($rsBillRate[0]['incom_tax']) ? 0 : $rsBillRate[0]['incom_tax'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $incom_taxrate ?>" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <?php echo $incom_taxrate ?>%
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="210787.658" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $incom_taxAmount = round(($earning_total - $gst_amount) / 100 * $incom_taxrate, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="3" sdnum="1033;">
                        <font color="#000000">3
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">SUR CHARGE
                          </font>
                        </b>
                      </td>
                      <?php $sur_chargerate = empty($rsBillRate[0]['sur_charge']) ? 0 : $rsBillRate[0]['sur_charge'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $sur_chargerate ?>" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <?php echo $sur_chargerate ?>%
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="31618.1487" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $surchargeAmount = round($tdsAmount / 100 * $sur_chargerate, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="4" sdnum="1033;">
                        <font color="#000000">4
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">E,CESS
                          </font>
                        </b>
                      </td>
                      <?php $ecessrate = empty($rsBillRate[0]['ecess']) ? 0 : $rsBillRate[0]['ecess'] ?>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdval="<?php echo $ecessrate ?>" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <?php echo $ecessrate ?>%
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="6323.62974" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $ecessAmount = round($tdsAmount / 100 * $ecessrate, 2) ?>
                        </font>
                      </td>
                    </tr>
                    <?php
					$subQuestionId = 3;
					$rsParamIDS = SubQuestionGroupIDS('params', $subQuestionId); //subquestion
					$rsPagesIDS = SubQuestionGroupIDS('pages', $rsParamIDS[0]);
					$totalScore = 0;
					$totalPages = 0;
					$totalUsed = 0;
					$rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($FromDate, $ToDate, $subQuestionId);
					if (count($rsQuestionsInfo) > 0) {
					for ($q = 0; $q < count($rsQuestionsInfo); $q++) {
					foreach ($rsPagesIDS as $rsPages) {
						
					$rsTargetData = $objScorecardctsnew->getMonthlyTarget(14, $subQuestionId, $rsPages, date('m', strtotime($rsQuestionsInfo[$q][0]['created_date'])), date('Y', strtotime($rsQuestionsInfo[$q][0]['created_date'])));
					$targetValue = array();
					if (!empty($rsTargetData)) {
					$targetValue = explode(',', $rsTargetData[0]['value']);
					}
					foreach ($rsParamIDS as $keyp => $rsParams) {
					$avgVal = $objScorecardctsnew->FetchValueScoreMachine($rsQuestionsInfo[$q][0]['db_surveyQuestionId'], $rsQuestionsInfo[$q][0]['db_surveySubQuestionId'], $rsParams, $rsPages, $rsQuestionsInfo[$q][0]['tokenid']);
					$totalScore = $totalScore + $avgVal;
					$totalPages++;
					if ($avgVal == '0' && $targetValue[$keyp] == '1') {
					$totalUsed++;
					}
					}
					}
					}
					}
					// $totalPenalty += $totalUsed * 1000;
					// $totalavg += round($totalScore * 100 / $totalPages, 2);
					// if ($totalScore != 0) $activeDay++;
					?>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="5" sdnum="1033;">
                        <font color="#000000">5
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">MACHINE PENALTY
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $machinaryPanalty = $totalUsed*1000; ?>
                        </font>
                      </td>
                    </tr>
                    <?php 
					$subQuestionId = 4;
					$rsParamIDS = SubQuestionGroupIDS('params',$subQuestionId);//subquestion
					$rsPagesIDS = SubQuestionGroupIDS('pages',$rsParamIDS[0]);
					$totalTarget = 0;
					foreach ($rsParamIDS as $key => $rsParams){
					$rsParamData = $objScorecardctsnew->getParamsData($rsParams);
					$desc = explode(',', $rsParamData[0]['paramChoice']);
					
					$rsTargetData = $objScorecardctsnew->getTarget("14","4",$rsParams);
					$rsTargetData = explode(',', $rsTargetData[0]['value']);
					foreach ($desc as $key1 => $value) {   
					$totalTarget = $totalTarget + $rsTargetData[$key1];
					}
					} 
					$totalPenalty = 0;
					$rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($FromDate, $ToDate, $subQuestionId);
					// echo "<pre>";
					// print_r($rsQuestionsInfo);
					// die();
					if(count($rsQuestionsInfo)>0){ 
					for ($q=0;$q< count($rsQuestionsInfo);$q++){
					$actualAvailable = 0;
					$absent = 0;
					$foundWoDress = 0;
					$foundWoProGlass = 0;
					foreach ($rsParamIDS as $rsParams) {
					$rsParamData = $objScorecardctsnew->getParamsData($rsParams);
					$desc = explode(',', $rsParamData[0]['paramChoice']);
					foreach ($desc as $key1 => $value) {
					$avgVal1 = 0;
					foreach ($rsPagesIDS as $key2 => $rsPages) {
					$avgVal = $objScorecardctsnew->FetchValueScoreManpower($rsQuestionsInfo[$q][0]['db_surveyQuestionId'],$rsQuestionsInfo[$q][0]['db_surveySubQuestionId'],$rsParams,$rsPages,$value,$rsQuestionsInfo[$q][0]['tokenid']);
					$avgVal1 += $avgVal;
					if($key2==1){
					//$absent += $avgVal;
					$avgVal1 -= $avgVal;
					$actualAvailable += $avgVal1-$avgVal;
					}
					if($key2==2){
					$foundWoDress += $avgVal;
					}
					if($key2==3){
					$foundWoProGlass += $avgVal;
					}
					}
					}
					}
					$absent = $actualAvailable==0 ? 0 : $totalTarget-$actualAvailable;
					$totalPenalty += ($absent*1525)+($foundWoDress*100)+($foundWoProGlass*20);
					}
					} 
					?>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="6" sdnum="1033;">
                        <font color="#000000">6
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">Labour Penalty
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $totalPenalty; ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="7" sdnum="1033;">
                        <font color="#000000">7
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">WORK PENALTY
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $WorkPenalty;?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="8" sdnum="1033;">
                        <font color="#000000">8
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000; *//* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">OTHER PENALTY
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $OtherPenalty;?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF" sdval="8" sdnum="1033;">
                        <font color="#000000">9
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000; *//* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="left" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">Chemical PENALTY
                          </font>
                        </b>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00%">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $ChemicalPenalty;?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000; */border-right: 1px solid #000000;" colspan="6" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">Total
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;/* border-left: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="459517.09444" sdnum="1033;0;0.00">
                        <b>
                          <font color="#000000">
                            <?php echo $totalDeduction = $tdsAmount + $incom_taxAmount + $surchargeAmount + $ecessAmount + $machinaryPanalty + $totalPenalty + $WorkPenalty + $ChemicalPenalty + $OtherPenalty; ?>
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">
                            <br>
                          </font>
                        </b>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="/* border-top: 1px solid #000000 */" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-top: 1px solid #000000; border-left: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000" colspan="4" align="center" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">
                            <br>
                          </font>
                        </b>
                      </td>
                      <td style="border-top: 1px solid #000000" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td style="border-top: 1px solid #000000; border-right: 1px solid #000000" align="center" valign="middle" bgcolor="#FFFFFF" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td colspan="4" align="right" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">TOTAL PAYBLE AMOUNT :
                          </font>
                        </b>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="11976954.72756" sdnum="1033;0;0.00">
                        <font color="#000000">
                          <?php echo $totalDeduction = $earning_total - $totalDeduction; ?>
                        </font>
                      </td>
                    </tr>
                    <tr>
                      <td style="border-left: 1px solid #000000" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td align="right" valign="middle" bgcolor="#FFFFFF">
                        <font color="#000000">
                          <br>
                        </font>
                      </td>
                      <td colspan="4" align="right" valign="middle" bgcolor="#FFFFFF">
                        <b>
                          <font color="#000000">TOTAL ROUND OFF PAYBLE AMOUNT :
                          </font>
                        </b>
                      </td>
                      <td style="border-right: 1px solid #000000" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" sdval="11976954.72756" sdnum="1033;0;0">
                        <b>
                          <font color="#000000">
                            <?php echo round($totalDeduction); ?>
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td style="/* border-bottom: 1px solid #000000; */border-left: 1px solid #000000;" colspan="2" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">In Words:
                        </font>
                      </td>
                      <td style="/* border-bottom: 1px solid #000000; */border-right: 1px solid #000000;" colspan="10" align="left" valign="middle" bgcolor="#FFFFFF" sdval="0" sdnum="1033;">
                        <b>
                          <font size="1" color="#000000">
                            <?php echo getIndianCurrency($totalDeduction) ?>
                          </font>
                        </b>
                      </td>
                    </tr>
                    <tr>
                      <td style="    text-align: center; border-top: 1px solid #000000" colspan="12" height="19" align="center" valign="middle" bgcolor="#FFFFFF">
                        <font size="1" color="#000000">This is a computer generated invoice and no signature is required.
                        </font>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <div class="fixed-btn--">
                <div class="table_print- pe-no-print">
                  <form name="myform" class="print_cheked" style="TEXT-ALIGN: CENTER;MARGIN-TOP: 12px;">
                    <button type="button" class="print print_btn" style="FLOAT: NONE;">Print 
                    </button>
                    <!-- onClick="breakeveryheader()" -->
                    <input type="checkbox" name="mybox" checked="" style="display: none;">
                  </form>
                </div>
              </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
        </section>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <!-- Bootstrap 3.3.7 -->
    <script src="<?php echo $curImagePath ?>/bower_components/bootstrap/dist/js/bootstrap.min.js">
    </script>
    <!-- DataTables -->
    <script src="<?php echo $curImagePath ?>/datatable/js/jquery.dataTables.min.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datatable/js/dataTables.buttons.min.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datatable/js/buttons.flash.min.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datatable/js/buttons.print.min.js">
    </script>
    <!-- SlimScroll -->
    <script src="<?php echo $curImagePath ?>/bower_components/jquery-slimscroll/jquery.slimscroll.min.js">
    </script>
    <!-- FastClick -->
    <script src="<?php echo $curImagePath ?>/bower_components/fastclick/lib/fastclick.js">
    </script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo $curImagePath ?>/dist/js/demo.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datepikar2/bootstrap-datepicker.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datepikar2/daterangepicker.js">
    </script>
    <script src="<?php echo $curImagePath ?>/datepikar2/moment.min.js">
    </script>
    <script>
      $(document).ready(function() {
        $("#FromDate").datepicker({
          format: 'dd-mm-yyyy'
        }
                                 );
        $("#ToDate").datepicker({
          format: 'dd-mm-yyyy'
        }
                               );
        //document.forms["frmSearch"].submit();
      }
                       );
      function validateDate() {
        var D1 = document.getElementById("ToDate");
        var D2 = document.getElementById("FromDate");
        if (D1.value.trim() == "") {
          D1.style.border = "1px solid red";
          return false;
        }
        if (D2.value.trim() == "") {
          D2.style.border = "1px solid red";
          return false;
        }
      }
      $('#month').val('<?php echo $Month ?>');
      $('#year').val('<?php echo $Year ?>');
    </script>
    <!---creat_new_page_print--->
    <script>
      function breakeveryheader() {
        if (!document.getElementById) {
          alert("You need IE5 or NS6 to run this example")
          return
        }
        var thestyle = (document.forms.myform.mybox.checked) ? "always" : "auto"
        for (i = 0; i < document.getElementsByClassName("creat_new_page_print").length; i++)
          document.getElementsByClassName("creat_new_page_print")[i].style.pageBreakBefore = thestyle
          }
    </script>
    <script>
      $('.print_btn').on('click', function() {
        // select print button with class "print," then on click run callback function
        breakeveryheader();
        $.print("#printTable");
        // inside callback function the section with class "content" will be printed
      }
                        );
    </script>
    <!--//creat_new_page_print -->
    <style>
      @media print {
        .new_print_display {
          page-break-after: always;
        }
		 td {
    padding: 0 7px !important;
}
      }
      @page {
        size: A4;
      }
      table.display--.new_print_display.bor_none td {
        border: 0px solid #000;
      }
      table.display--.new_print_display.bor_none.billinvoice td {
        text-align: left;
       
      }
      table.display--.new_print_display.bor_none.billinvoice {
        margin: 0 auto;
      }
      table.display--.new_print_display.bor_none.billinvoice {
        text-transform: uppercase;
      }
    </style>