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/barisnew.beatleanalytics.com/site/template/scorecardctsnew.php
<?php 
set_time_limit(0);   
// ini_set('mysql.connect_timeout','0');   
// ini_set('max_execution_time', '0');
 ?>
<div id="preloader">
  <div id="status" style="background-image: url(http://baris.beatleanalytics.com/theme/black/dist/img/status.gif);"> </div>  
</div>
<?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;

   $valck[] = array();


if(!in_array('CTS', 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);
}

   ?>  
   <!-- Preloader -->

   
	
    <!-- 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="scorecardctsnew.html" name="frmSearch" id="frmSearch" class="pe-no-print">  
                                <div class="box-header">
                                    <h3 class="box-title" style="width:100%;">
                           <div class="form-group" >
                              <?php $rsStation = $objScorecardctsnew->fetchStation(); ?>
                              <!-- <label class=" control-label station_select"> Select Station</label>-->
                              <div class=" col-md-2 station_select_opction ">
                                 <select class="form-control input-md" id="org_list" name="Station">
                                    <option value="0">Select Station </option>
                                    <?php if(count($rsStation) > 0) { 
                                       for($s=0; $s<count($rsStation); $s++) { ?>
                                    <option <?php if($StationId === $rsStation[$s]['stationId']) echo 'selected="selected"'; ?> value="<?php echo $rsStation[$s]['stationId']?>"><?php echo $rsStation[$s]['stationName']?></option>
                                    <?php }
                                       }else{ ?>
                                    <option value="0">No any station found</option>
                                    <?php } ?>
                                 </select>
                              </div>
                              <div class=" col-xs-12 col-md-3 col-lg-2 form-group">
                                 <select class="form-control input-md" id="org_list" name="Question">
                                    <?php //$rsQuestion = $objScorecardctsnew->FetchQuestion(); ?>
                                    <option value="0">Select Question </option>
                                    <option selected="selected" value="6">Score Card CTS</option>
                                 </select>
                              </div>
                              <div class=" col-xs-12 col-md-3 col-lg-2 form-group">
                                 <select class="form-control input-md" id="org_list" name="Auditor">
                                    <?php $rsAuditor = $objScorecardctsnew->FetchAuditor(); ?>
                                    <option value="0">Select Auditor </option>
                                    <?php if(count($rsAuditor) > 0) { 
                                       for($a=0; $a<count($rsAuditor); $a++) { ?>
                                    <option <?php if($AuditorId === $rsAuditor[$a]['userId']) echo 'selected="selected"'; ?> value="<?php echo $rsAuditor[$a]['userId']?>"><?php echo $rsAuditor[$a]['db_username']?></option>
                                    <?php }
                                       }else{ ?>
                                    <option value="0">No any auditor found</option>
                                    <?php } ?>
                                 </select>
                              </div>
                              <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="input-group input-group-sm pull-right- text-right">
                                 <span class="pull-right text-right form-group no-padding">
                                    <a class="btn btn-success btn-sm" onclick="myFunction()" href="#"> <i class="fa fa-search"></i> GO  </a>
                                    <script>
                                       function myFunction() {
                                          $(".loader").show();
                                          document.getElementById("frmSearch").submit(); 
                                       }
                                       $(window).bind("load", function() {
                                       //$(".loader").hide();
                                       });
                                    </script>
                                 </span>
                              </div>
                           </div>
                        </h3>
                                </div>
                            </form>
                            <?php 
                     if(!empty($QuestionId) && !empty($StationId)){
                      // $rsPagesIDS = QuestionGroupIDS('pages',$QuestionId);

                      // $rsParamIDS = QuestionGroupIDS('params',$QuestionId);
                      
                      $rsUserInfo = $objScorecardctsnew->FetchUsersData(); 
                      
                      // echo("<pre>");
                      // print_r($rsUserInfo);

                      ?>
                  <div class="NEWCTS">

			<div class="fixed-btn">				  
				   <a href="ctsscorecardsummary.html"  class="btn summary-btn" target="_blank">CTS - Summary </a>  
                    <div class="table_print- pe-no-print">
					
					

					
                      <form name="myform" class="print_cheked">
							 <button type="button" class="print print_btn" >Print All</button>
                          <!-- onClick="breakeveryheader()" -->
                          <input type="checkbox" name="mybox" checked="" style="display: none;">
                      </form>
                    </div>
					</div>

<div class="printTable- pe-preserve-ancestor" id="printTable"> 
				 
				 

<?php
//$no = 1;
$totalAvgVer = 0;
$zeroTotalAvgVer = 0;
// $reportArray = array();
// $mReportArray = array();
//   if(count($rsUserInfo)>0){ 

//     for ($u=0;$u< count($rsUserInfo);$u++)
//       { 

//         // $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($rsUserInfo[$u]['db_surveyUserid']);
//         $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($rsUserInfo[$u]);
//          if(count($rsQuestionsInfo)>0){ 
                            
//           $idArr = array();
                            
//           for ($i=0;$i< count($rsQuestionsInfo);$i++)
//           { 
//             //echo "<pre>";
//             //print_r($rsQuestionsInfo[$i]);
//             for ($j=0;$j< count($rsQuestionsInfo[$i]);$j++)
//             { 
//               $reportArray[$u][$i][$j] = $rsQuestionsInfo[$i][$j];
//             }
//           }
//         }
        
//       }
//     }

// $mReportArray = array_merge_recursive($reportArray[0],$reportArray[1]);
// // echo "<pre>";
// // print_r($mReportArray);
// for ($i=0; $i <count($mReportArray) ; $i++) { 
  
// }


$pageno = 1;
if(count($rsUserInfo)>0){ 

    for ($u=0;$u< count($rsUserInfo);$u++)
      { 

        // $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($rsUserInfo[$u]['db_surveyUserid']);
        $rsQuestionsInfo = $objScorecardctsnew->FetchQuestionsData($rsUserInfo[$u]);
         if(count($rsQuestionsInfo)>0){ 
            // echo "<pre>";
            // print_r($rsQuestionsInfo);
            // die(); 
          $idArr = array();
                            
          for ($i=0;$i< count($rsQuestionsInfo);$i++)
          { 
            // echo "<pre>";
            // print_r($rsQuestionsInfo[$i]);
            ?>
			
			<div class="creat_new_page_print"></div>
<table id="" class="display-- new_print_display" style="width:100%;     margin-bottom: 87px; ">

   
   <tr class="no_br report_header2">
      <td colspan="28" height="28" align="center" valign="bottom"> NORTH EASTERN RAILWAY <span class="pull-right">Page <?php echo $pageno++; ?></span>  </td>
	   
   </tr>
    <tr class="no_br report_header2">
      <td colspan="28" height="28" align="center" valign="bottom"><span class="report_name">"CLEAN TRAIN STATION"</span></td>
   </tr>
     <tr class="no_br report_header2 " style="border-bottom: 1px solid #bfbfbf;">
      <td colspan="28" height="28" align="center" valign="bottom">SCORE CARD (TO BE FILLED BY THE TXR/HOUSE KEEPING INSPECTOR)  </td>
   </tr>
   
  <tr class="no_br"><td height="100" style=" height: 12px !important;"></td></tr>
   
   <tr class="no_br report_header2">
      <td colspan="28" height="28" align="center" valign="bottom">
	  Date of Inspection :<span class="t_nas" id="dateofinspection<?php echo $u.$i;?>">02/01/2020</span>     
	  Auditor  :<span class="t_nas" id="auditorname<?php echo $u.$i;?>">gautam prajapati</span>     
	  Train No :<span class="t_nas" id="trainno<?php echo $u.$i;?>">54820 </span>     
	  Arr.Time :<span class="t_nas" id="#">   </span>   
	  Dep.Time :<span class="t_nas" id="deptime<?php echo $u.$i;?>">5:50</span>    </td>
   </tr>
   <tr class="no_br report_header2">
      <td colspan="28" height="28" align="center" valign="bottom">  
	
	  No.of Coaches Attended by contractor :<span class="t_nas" id="noofcoach_attended<?php echo $u.$i;?>">224</span>    Total No. of Coaches in the train :<span class="t_nas" id="noofcoach_intrain<?php echo $u.$i;?>">24</span>   Total Scores obtained :<span class="t_nas" id="totalscore_obtained<?php echo $u.$i;?>">80%</span>     Inaccessible :<span class="t_nas" id="score_inaccessible<?php echo $u.$i;?>"> 10%</span>

      </td> 
   </tr>
   
   
   
     <tr class="no_br report_header2">
      <td colspan="28" height="28" align="center" valign="bottom">  
	   Division :<span class="t_nas" id=""><?php echo $rsQuestionsInfo[$i][0]['DivisionName'] ?></span> 
	  Station :<span class="t_nas" id=""><?php echo $rsQuestionsInfo[$i][0]['stationName'] ?></span> 
	  Contractor :<span class="t_nas" id=""><?php echo $rsQuestionsInfo[$i][0]['db_Orgname'] ?></span> 
  
      </td>
   </tr>
   
  <tr class="no_br"><td height="100" style=" height: 12px !important;"></td></tr>
   <tr>
      <td height="20"> S.N. </td>
      <td class="qua_list"> Itemized Description of work </td>
      <td> T&rsquo;let </td>

      <?php  
          $rsCoachList = $objScorecardctsnew->FetchCoachList($rsQuestionsInfo[$i][0]['tokenid']);
          /*for ($c=0;$c< count($rsCoachList);$c++)
          { ?>
            <th id="tbl-<?php echo $val;?>"><?php echo $rsCoachList[$c][0];?></th>
          } */

          for ($c=0;$c < 24;$c++){?>

          <td> C<?php echo $c+1; ?>
          <span class="c_num"><br>
            <?php //echo wordwrap(str_replace($rsCoachList[$c][0]." ","",$rsCoachList[$c][1]),6,"<br>\n",TRUE);?>
            <?php echo str_replace(" ","<br>\n",$rsCoachList[$c][1]);?>
          </span>
        </td>
        <?php } ?>
     
      
      <td>T.S.</td> 
   </tr>
   <?php 
      $no = 1;
      $tokenid = ""; 
      $totalCountOfOne = 0;
      $totalCount = 0;
      $totalRatingBox = 0;
      $inaccessibleCount = 0;
      for ($j=0;$j< count($rsQuestionsInfo[$i]);$j++)
      { 
        $tokenid = $rsQuestionsInfo[$i][$j]['tokenid'];
        $fixPageID_T = array("22", "23", "24", "25");
        $fixPageID_BD = array("27", "28", "29", "30");
        //for toilet column
        $fixPageID2 = array("31", "32", "33","34");?>
        <tr>
        <?php if($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 22){ ?>
        <td rowspan=4 height="80" sdval="1" sdnum="1033;">1 </td>
        <?php } ?>
        <?php if($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 27){ ?>
        <td rowspan=4 height="80" sdval="1" sdnum="1033;">2</td>
        <?php } ?>
        <?php if($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 31){ ?>
        <td height="80" sdval="1" sdnum="1033;">3</td>
        <?php } ?>
        <?php if($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 32){ ?>
        <td height="80" sdval="1" sdnum="1033;">4</td>
        <?php } ?>
        <?php if($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 33){ ?>
        <td rowspan=2 height="80" sdval="1" sdnum="1033;">5</td>
        <?php } ?>
        
        <?php if ($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 22){?> 
          <td class="qua_list" rowspan=4>Toilet cleaning complete including pan  with High Pressure Jet machine &drying, cleaning wiping & drying of wash basin, mirror & shelves,  Spraying of Air Freshener  & Mosquito Repellant</td>
          <?php }elseif ($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 27) {?>
            <td class="qua_list" rowspan=4>Vestibule area, Doorway area, area between two toilets and footsteps</td>
          <?php }elseif($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 31){?>
            <td class="qua_list">Coach aisle area cleaning</td>
          <?php }elseif($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 32){?>
          <td class="qua_list">AC Coaches Window Glass Cleaning From Platform Side</td>
          <?php }elseif($rsQuestionsInfo[$i][$j]['db_surveyPageId'] == 33){?>
            <td class="qua_list" rowspan=2>Disposal Of Collected Waste from Coaches & Ac Bins underneath the wash basin</td>
          <?php }?>
        
        <td>
          <?php echo $objScorecardctsnew->SelectBarisPageName($rsQuestionsInfo[$i][$j]['db_surveyPageId']);?>
        </td>
        <?php
          $totalScore = 0;

          //$rsCoachList = $objScorecardctsnew->FetchCoachList($rsQuestionsInfo[$i][0]['tokenid']);
          // echo "<pre>";
          // print_r($rsCoachList);
          //die;
          // for ($c=0;$c< count($rsCoachList);$c++)
          for ($c=0;$c < 24;$c++)
          {
          /*}
          foreach($rsParamIDS as $val) {*/
          	if(count($rsCoachList) > $c){

	          	$avgVal = $objScorecardctsnew->FetchValueScore($rsQuestionsInfo[$i][$j]['db_surveyQuestionId'],'',$rsQuestionsInfo[$i][$j]['db_surveyPageId'],$rsQuestionsInfo[$i][$j]['tokenid'],$rsCoachList[$c][0]);
	        	
	          	$totalRatingBox++;
	          
              if($avgVal == "1" || $avgVal == "0"){
                $totalCount++;
              }
	          	if($avgVal == "X"){
	          		$inaccessibleCount++;
	          	}elseif($avgVal == "1"){
	            	$totalCountOfOne++;
	            	$totalScore++;
	          	} 
          	}else{
          		$avgVal ="-";
        	  }

        	if($rsQuestionsInfo[$i][$j]['db_totalCoachCount'] <= $c)
          		$avgVal ="";

        	?>
          <td sdval="<?php echo $avgVal;?>" sdnum="1033;"><?php echo $avgVal;?></td>
      <?php }  ?>
      <td sdval="<?php echo $totalScore; ?>" sdnum="1033;"> <?php echo $totalScore; ?> </td>
    </tr>
          <script>
            $("#dateofinspection<?php echo $u.$i;?>").html('<?php echo date("Y-m-d",strtotime($rsQuestionsInfo[$i][$j]['created_date']));?>');
            $("#auditorname<?php echo $u.$i;?>").html('<?php echo $rsQuestionsInfo[$i][$j]['db_username'];?>');
            $("#trainno<?php echo $u.$i;?>").html('<?php echo $rsQuestionsInfo[$i][$j]['db_trainno'];?>');
            $("#deptime<?php echo $u.$i;?>").html('<?php echo $rsQuestionsInfo[$i][$j]['db_depart_time'];?>');
            $("#noofcoach_intrain<?php echo $u.$i;?>").html('<?php echo $rsQuestionsInfo[$i][$j]['db_totalCoachCount'];?>');
            $("#totalscore_obtained<?php echo $u.$i;?>").html('<?php echo round(($totalCountOfOne/$totalCount)*100,2); ?>%');
            $("#score_inaccessible<?php echo $u.$i;?>").html('<?php echo $inaccessibleCount ?>');
          </script>
        <?php } ?>


      <?php
      $vertiScoreZero1 = 0;
      $vertiScoreX1 = 0;
      $vertiScoreDash1 = 0;
      for ($c=0;$c < 24;$c++){ 
          
      $vertiScoreZero = 0;
      $vertiScoreX = 0;
      $vertiScoreDash = 0;
      if(!empty($rsCoachList[$c][0])){
        for ($j=0;$j< count($rsQuestionsInfo[$i]);$j++)
        {
            $avgVal = $objScorecardctsnew->FetchValueScore($rsQuestionsInfo[$i][$j]['db_surveyQuestionId'],'',$rsQuestionsInfo[$i][$j]['db_surveyPageId'],$rsQuestionsInfo[$i][$j]['tokenid'],$rsCoachList[$c][0]);
            if($avgVal == "0"){
              $vertiScoreZero++;
            } 
            if($avgVal == "X"){
              $vertiScoreX++;
            }
            if($avgVal == "-"){
              $vertiScoreDash++;
            } 
        }
        if($vertiScoreZero==12){
          $vertiScoreZero1++;
        }
        if($vertiScoreX==12){
          $vertiScoreX1++;
        }
        if($vertiScoreDash==12){
          $vertiScoreDash1++;
        }
      }
    }

    //echo "zeros".$vertiScoreZero1;
    //echo "xs".$vertiScoreX1;

    ?>
   <script type="text/javascript">
            $("#noofcoach_attended<?php echo $u.$i;?>").html('<?php echo count($rsCoachList)-($vertiScoreZero1+$vertiScoreX1+$vertiScoreDash1);?>');
   </script>
   
   
   
   <tr class="no_br bt_sig">
      <td colspan="28" height="28" align="center" valign="bottom" style=" text-align: left;  padding-left: 0px !important; padding-top: 4px !important;">
	  Note : Please give marks for each item as either 0 or 1 or X "-". All items as above which are inaccessible should be marked "X" and shall not be counted in total score.<br><br>
	  Item not available should be marked "-". No column should be left blank
	  </td>
   </tr>
   
   <!--------------------------------------------------------------------------------------------------------------------------
   --------------------------------->
   <?php 

   //echo $rsQuestionsInfo[$i][0]['tokenid'];
   $remarks = $objScorecardctsnew->fetchContentRemark('',$rsQuestionsInfo[$i][0]['tokenid']);
   //echo "<pre>";
   //print_r($remarks);
   //die();
    ?>
<tr class="reason-attending-coach">
		<td class="text-center bold f13" style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="5" rowspan="2" height="40" align="center" valign="middle"><font color="#000000"><b> &nbsp;&nbsp; Reason for not attending Coach </b></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="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Coach 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="5" align="left" valign="middle"><font color="#000000"><?php if(!empty($remarks)) echo explode(':', $remarks[0])[0]; ?></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="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Coach 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="5" align="left" valign="middle"><font color="#000000"><?php if(!empty($remarks)) echo explode(':', $remarks[1])[0]; ?></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="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Coach 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="7" align="left" valign="middle"><font color="#000000"><?php if(!empty($remarks)) echo explode(':', $remarks[2])[0]; ?></font></td>
		</tr>
		
		
		<tr class="reason-attending-coach">
		<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" colspan="7" align="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Reason: <?php if(!empty($remarks)) echo explode(':', $remarks[0])[1]; ?></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="7" align="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Reason: <?php if(!empty($remarks)) echo explode(':', $remarks[1])[1]; ?></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="9" align="left" valign="middle"><font color="#000000">&nbsp;&nbsp; Reason: <?php if(!empty($remarks)) echo explode(':', $remarks[2])[1]; ?></font></td>
		</tr>  
   <!--------------------------------------------------------------------------------------------------------------------------
   --------------------------------->
   
   <tr class="no_br report_header2" style="">
      <td colspan="28" height="28" align="center" valign="bottom" style=" padding-top: 28px !important;">
		  <span class="t_nas" id="" style=" padding: 13px 32px; margin-right: 20%;">Sig. Rly Contractor </span>
		  <span class="t_nas" id="" style="padding: 13px 32px; margin-left: 20%;">Sig. Rly Authority</span> 
	  </td> 
</tr>
   
    
  
 
</table>
  
<?php }
        }
          }       
           }?> 

						 
                       
				   <!-----end copy------> 


				</div> 
				    </div> 
					
					
                <?php }else{ ?>

                  <!----NEWCTS-start---->
				  
                  <center>
					         <img class="report_sch_img" src="http://baris.beatleanalytics.com/theme/black/dist/img/searchfeedback4.jpg" style="width:100%;"> 
                  </center>
					
								<!----NEWCTS-End----> 

                        <?php } ?>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </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>
	
	
    <!-- page script -->
    <script>
        $(document).ready(function() {
            /**   $('#question_report').append('<caption style="caption-side: bottom">A fictional company\'s staff table.</caption>');
              $('#question_report').append('<caption style="caption-side: top">A fictional company\'s staff table.</caption>');****/

            $('#question_report').DataTable({
                scrollY: "900px",
                scrollX: true,
                footer: true,
                scrollCollapse: true,
                paging: true,
                dom: 'Bfrtip',
                lengthMenu: [
                    [10, 20, 30, -1],
                    ['10 rows', '20 rows', '30 rows', 'Show all']
                ],
				
                buttons: [{
                        extend: 'pageLength',
                        footer: true
                    },
                    

                    {
                        extend: 'print',
                        footer: true,
                        messageTop: '<center class="print_title" style="font-size: 20px;"><p><span style=" margin-right: 30px;">Date of Inspection : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">02/01/2020</b></span><span style=" margin-right: 30px;">Auditor : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">gautam prajapati</b></span><span style=" margin-right: 30px;">Train No. : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">54820</b></span> <span style=" margin-right: 30px;">Dep.Time : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">5:50</b></span> </p><p><span style=" margin-right: 30px;">No.of Coaches Attended by contractor  : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">224</b></span> <span style=" margin-right: 30px;">Total No. of Coaches in the train : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">24</b></span>  </p> <p><span style=" margin-right: 30px;">Total Scores obtained : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">80%</b></span><span style=" margin-right: 30px;">Inaccessible : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">10%</b></span></p></center>',
                        messageBottom: '<BR><BR><P style="width:80%; margin:0 auto; font-size: 20px;"><span class="pull-left"  style="    border-bottom: 1px solid #656565dd;  height: 49px;  padding: 0 84px 0 84px;  float: left !IMPORTANT;">Sig. Rly Authority----</span><span class="pull-right" style="    border-bottom: 1px solid #656565dd;  height: 49px;  padding: 0 84px 0 84px;  float: right !IMPORTANT;">Sig. Rly Contractor---</span></P> '
                    },

                ]

            });
        });
    </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;
            }
        }
    </script>

   

 

    <!---16-3-2020--->
	
   
    <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>
    <!--//creat_new_page_print -->

	

    <script>
        $(document).ready(function() {
            /**   $('#question_report').append('<caption style="caption-side: bottom">A fictional company\'s staff table.</caption>');
              $('#question_report').append('<caption style="caption-side: top">A fictional company\'s staff table.</caption>');****/

            $('.display').DataTable({
                scrollY: "900px",
                scrollX: true,
                footer: true,
                scrollCollapse: true,
                paging: false,
                dom: 'Bfrtip',
               

                buttons: [{
                        extend: false,
                        footer: true
                    },
                  

                    {
                        extend: 'print',
                        footer: true,
                        messageTop: '<center class="print_title" style="font-size: 20px;"><p><span style=" margin-right: 30px;">Date of Inspection : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">02/01/2020</b></span><span style=" margin-right: 30px;">Auditor : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">1</b></span><span style=" margin-right: 30px;">Train No. : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">54820</b></span> <span style=" margin-right: 30px;">Dep.Time : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">5:50</b></span> </p><p><span style=" margin-right: 30px;">No.of Coaches Attended by contractor  : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">224</b></span> <span style=" margin-right: 30px;">Total No. of Coaches in the train : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">24</b></span>  </p> <p><span style=" margin-right: 30px;">Total Scores obtained : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">80%</b></span><span style=" margin-right: 30px;">Inaccessible : <b style="    border-bottom: 1px solid;padding: 0 33px 0 4px;">10%</b></span></p></center>',
                        messageBottom: '<p><b>Note : </b> Please give marks for each item as either 0 or 1 or X "_". All items as above which are inaccessible should be marked "X" and shall not be counted in total score </p><br><p> <b>Item not available should be marked "_". No column should be left blank</b> </p> <p class="reason_w100" style=" width: 100%;     display: inline-block"><div class="cn_reason" style="float: left; width:23%;padding: 0px;margin: 0 16px 0 0;border: 1px solid #ddd;height: 70px;text-align: left;"><div class="c_num" style="border: none; float: left; text-align: left; width: 85px; MARGIN: 0PZ; margin: 0px; padding: 5px 3px 4px 5px; height: 23px;">Coach No : </div ><div class="c_reason" style="float: left; width: 76px; padding: 0px; margin: 0px; height: 20px;border-bottom: 1px solid #656565dd;"></div> </div><div class="cn_reason" style="float: left; width:23%;padding: 0px;margin: 0 16px 0 0;border: 1px solid #ddd;height: 70px;text-align: left;"><div class="c_num" style="border: none; float: left; text-align: left; width: 85px; MARGIN: 0PZ; margin: 0px; padding: 5px 3px 4px 5px; height: 23px;">Coach No : </div ><div class="c_reason" style="float: left; width: 76px; padding: 0px; margin: 0px; height: 20px;border-bottom: 1px solid #656565dd;"></div> </div><div class="cn_reason" style="float: left; width:23%;padding: 0px;margin: 0 16px 0 0;border: 1px solid #ddd;height: 70px;text-align: left;"><div class="c_num" style="border: none; float: left; text-align: left; width: 85px; MARGIN: 0PZ; margin: 0px; padding: 5px 3px 4px 5px; height: 23px;">Coach No : </div ><div class="c_reason" style="float: left; width: 76px; padding: 0px; margin: 0px; height: 20px;border-bottom: 1px solid #656565dd;"></div> </div><div class="cn_reason" style="float: left; width:23%;padding: 0px;margin: 0 16px 0 0;border: 1px solid #ddd;height: 70px;text-align: left;"><div class="c_num" style="border: none; float: left; text-align: left; width: 85px; MARGIN: 0PZ; margin: 0px; padding: 5px 3px 4px 5px; height: 23px;">Coach No : </div ><div class="c_reason" style="float: left; width: 76px; padding: 0px; margin: 0px; height: 20px;border-bottom: 1px solid #656565dd;"></div> </div></p> <BR><BR><P style="padding-top: 50px; width:80%; margin:0 auto; font-size: 20px;"><span class="pull-left"  style="    border-bottom: 1px solid #656565dd;  height: 49px;  padding: 0 84px 0 84px;  float: left !IMPORTANT;">Sig. Rly Authority</span><span class="pull-right" style="    border-bottom: 1px solid #656565dd;  height: 49px;  padding: 0 84px 0 84px;  float: right !IMPORTANT;">Sig. Rly Contractor<span></P> '
                    },

                ]

            });
        });
    </script>

   <style>
        table.dataTable thead .sorting_asc {
            background-image: url(<?php echo $curImagePath?>/dist/img/sort_asc.png) !IMPORTANT;
        }
		 table.dataTable thead .sorting_desc {
            background-image: url(<?php echo $curImagePath?>/dist/img/sort_desc.png) !IMPORTANT;
        }
        
        table.dataTable thead .sorting {
            background-image: url(<?php echo $curImagePath?>/dist/img/sort_both.png) !IMPORTANT;
        }
		.dt-buttons button:first-child {display: none;}
   </style>
    <!---//16-3-2020--->
	
	
	
	<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>
 
	<style>
	@page {size: A4 landscape;}
	</style>