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/www/baris.beatleanalytics.com/site/template/manpowerattendancerodent.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;
   $Year  		= $objScorecardctsnew->Year;
   
   $valck[] = array();
   
   if(!in_array('EQP', 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">
   <section class="content">
      <div class="row">
         <div class="col-xs-12">
            <div class="box">
               <div class="box-body">
                  <form method="post" action="pmcsurprisesummary.html" class="pe-no-print" style="display:block;">
                     <div class="box-header">
                        <h3 class="box-title" style="width:100%;">
						              <a class="btn btn-info btn-sm back_btn" href="rodant.html"> <i class="fa fa-long-arrow-left"></i> Back </a>
                        </h3>
                     </div>
                  </form>
                  <div class="NEWCTS">
                 <!---<div class="fixed-btn">
                        <div class="table_print- pe-no-print">
                           <form name="myform" class="print_cheked">
                              <button type="button" class="print print_btn" >Print All</button>
                              <input type="checkbox" name="mybox" checked="" style="display: none;">
                           </form>
                        </div>
                     </div>--->

                     <?php

                     	$rsStation = $objScorecardctsnew->fetchStation();
                     	// $rsPagesIDS = SubQuestionGroupIDS('pages',$rsStation[0]['paramId']);
                     	// echo "<pre>";
                     	// print_r($rsPagesIDS);
                     	// die;

                      ?>
                     <div class="printTable pe-preserve-ancestor" id="printTable">
					           <br>
                    <form method="post" action="rodant.html" name="frmSearch" id="frmSearch" class="pe-no-print">
                      <input type="hidden" name="acn" value="addManpowerAttendance">
                      <input type="hidden" name="paramId" value="60">
                      <input type="hidden" name="stationId" value="<?php echo $rsStation[0]['stationId']; ?>">
                      <input type="hidden" name="divisionId" value="<?php echo $rsStation[0]['DivisionId']; ?>">

                      <table cellspacing="0" border="0" style="margin:0 auto;">
                         <colgroup width="64"></colgroup>
                         <colgroup width="151"></colgroup>
                         <colgroup width="185"></colgroup>
                         <colgroup width="150"></colgroup>
                         <colgroup width="150"></colgroup>
                         <colgroup width="150"></colgroup>
                         <colgroup width="150"></colgroup>
                         <tbody>
                            <tr class="no_br report_header2">
                               <td colspan="28" align="center" valign="bottom"> NORTH EASTERN RAILWAY    </td>
                            </tr>
                            <tr class="no_br report_header2">
                               <td colspan="28" height="28" align="center" valign="bottom"><span class="report_name"> 
                                  MANPOWER - PEST AND RODENT CONTROL - ATTENDANCE 
                                  </span> 
                               </td>
                            </tr>
                            <tr class="no_br report_header2 " style="border-bottom: 1px solid #bfbfbf;">
                               <td colspan="28" align="center" valign="bottom">
                               </td>
                            </tr>
                            <tr class="no_br">
                               <td height="100" style=" height: 12px !important;"></td>
                            </tr>
                            <tr>
                               <td>S.No</td>
                               <td>Description </td>
                               <td>To be Provided as Per Norms</td>
                               <?php  
                               // $a_date = date("Y-m-t");
                               function weekOfMonth($date) {
                                  // estract date parts
                                  list($y, $m, $d) = explode('-', date('Y-m-d', strtotime($date)));

                                  // current week, min 1
                                  $w = 1;

                                  // for each day since the start of the month
                                  for ($i = 1; $i <= $d; ++$i) {
                                      // if that day was a sunday and is not the first day of month
                                      if ($i > 1 && date('w', strtotime("$y-$m-$i")) == 0) {
                                          // increment current week
                                          ++$w;
                                      }
                                  }

                                  // now return
                                  return $w;
                              }
                              $totalWeeks = weekOfMonth(date("Y-m-t"));
                               for ($i=1; $i <= $totalWeeks; $i++) { 
                                  echo "<td>Week ".$i."</td>";
                               }
                               ?>
                            </tr>
                            <tr>
                              <td sdval="1" sdnum="1033;">1</td>
                              <td>Housekeeper</td>
                              <td>Once a week</td>
                              <?php 
                               for ($i=1; $i <= $totalWeeks; $i++) { 

                                $avgVal = $objScorecardctsnew->FetchValueScore("60",$i,$rsStation[0]['stationId'],$rsStation[0]['DivisionId']);
                              ?>
                               <td>
                                  <label>
                                     <select class="form-control input-md" id="week<?php echo $i ?>" name="week<?php echo $i ?>">
                                        <option selected="" value="">--Select--</option>
                                        <option value="p" <?php if($avgVal == "p") echo "selected"; ?>>Present</option>
                                        <option value="a" <?php if($avgVal == "a") echo "selected"; ?>>Absent</option>
                                     </select>
                                  </label>
                               </td>
                              <?php }
                              ?>
                            </tr>
                         </tbody>
                      </table>

                      <input type="hidden" name="totalWeeks" value="<?php echo $totalWeeks ?>">

                     	<button class="btn btn-success btn-sm" style="float: right;margin-right: 160px;margin-top: 30px;"name="btn_submit" id="btn_submit" type="submit">Submit</button>
                     </form>
                     </div>
                     <div>

                     </div>
                  </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>
   $( "#frmSearch" ).submit(function( event ) { 
    var $this = $(this);
    $('.alert').slideUp();  
    var formDatapro = new FormData(this);
    if($('#month').val() != "" || $('#year').val() != "" )
    {
      $.ajax({
          url : 'runajax.php',
          method : "POST",
          data : formDatapro,
          beforeSend: function() {
            //$this.html(ing);
            $this.after('<div class="ldr"><i class="fa fa-circle-o-notch fa-spin"></i></div>');  
          },
          success :function(data){
            console.log(data);
            $('.ldr').hide();         
            //$this.html(prv);
   
            if(data.trim() == 'done'){
              $('.inputpageid').val('');
              //setTimeout(window.location.href = base_url+'member', 2000);
              // $.toastr.success('Success SignIn.', {position: 'top-center',size: 'lg',time: 5000});
              //setTimeout(window.location.href = base_url+'member', 2000);
              var alert = $('<div class="alert alert-success alert-dismissible" role="alert">'+
                '<div class="alert-text">Attendance submitted successfully</div>'+
                '<div class="alert-close"><i class="flaticon2-cross kt-icon-sm" data-dismiss="alert"></i></div>'+
              '</div>');
             $this.after(alert);   
              return false;
            }else{
              // $.toastr.error('SignIn failed'+'<br>'+data, {position: 'top-center',size: 'lg',time: 5000});     
              var alert = $('<div class="alert alert-danger alert-dismissible" role="alert">'+
                '<div class="alert-text">Attendance submitted failed<br> '+data+'</div>'+
                '<div class="alert-close"><i class="flaticon2-cross kt-icon-sm" data-dismiss="alert"></i></div>'+
              '</div>');
             $this.after(alert);   
              return false;          
            }
          },
          cache: false,
          contentType: false,
          processData: false
      });
    }else{
        // $.toastr.error('Empty Credential', {position: 'top-center',size: 'lg',time: 5000});       
        var alert = $('<div class="alert alert-danger alert-dismissible" role="alert">'+
                '<div class="alert-text">Oops! Something is missing.</div>'+
                '<div class="alert-close"><i class="flaticon2-cross kt-icon-sm" data-dismiss="alert"></i></div>'+
              '</div>');
      
             $this.after(alert); 
       
             
        return false; 
    }
   
   event.preventDefault(); 
   });
   $(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;
       }
   }
</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; }
   }
   @page { size: A4;  }
</style>