File: /home/barbeatleanalyti/public_html/barisnew.beatleanalytics.com/site/template/photoreport.php
<?php
set_time_limit(0);
?>
<!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;
$processList = $objScorecardctsnew->processList;
$valck[] = array();
// if(!in_array('WAT', 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="photoreport.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" style="display:none;">
<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="14">photoreport Of Coaches</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>
<?php $processLists = $objScorecardctsnew->getUserData(); ?>
<div class=" col-xs-12 col-md-2 col-lg-2 form-group">
<select class="form-control input-md" id="processList" name="processList">
<option value="0"> Process </option>
<?php foreach (explode(',', $processLists[0]['reportType']) as $value): ?>
<option value="<?php echo $value ?>" <?php if($value == $processList) echo "selected"; ?>><?php echo $value ?></option>
<?php endforeach ?>
</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)){
$rsUserInfo = $objScorecardctsnew->FetchUsersData();
?>
<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>
<div class="printTable pe-preserve-ancestor" id="printTable">
<br>
<div class="demo-gallery">
<br>
<ul id="lightgallery" class="list-unstyled row">
<?php for ($i=0; $i < count($rsUserInfo); $i++) { ?>
<li class="col-xs-4 col-sm-3 col-md-3" >
<a href="#" type="button" class="" data-toggle="modal" data-target="#photo_report_modal<?php echo $i ?>">
<img class="img-responsive" src="http://mbaris.beatleanalytics.com/assets/upload/<?php echo $rsUserInfo[$i]['imagename'] ?>" alt="Thumb-1">
<p>Process : <?php echo $rsUserInfo[$i]['db_process_type'] ?><br>
Date & Time:<?php echo $rsUserInfo[$i]['created_date'] ?><br>
</p>
<hr>
<p>
<?php echo $rsUserInfo[$i]['remarks'] ?>
</P>
</a>
</li>
<div class="modal photo_report" id="photo_report_modal<?php echo $i ?>">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<form name="myform" class="print_cheked text_center" >
<button type="button" class="print modal_print_btn<?php echo $i ?>" ><i class="fa fa-print" aria-hidden="true"></i>
</button>
<input type="checkbox" name="mybox" checked="" style="display: none;">
</form>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body" id="modal_printTable<?php echo $i ?>">
<img class="img-responsive photo_img" src="http://mbaris.beatleanalytics.com/assets/upload/<?php echo $rsUserInfo[$i]['imagename'] ?>" alt="Thumb-1">
<p class="text_center">Process : <?php echo $rsUserInfo[$i]['db_process_type'] ?><br>
Date & Time:<?php echo $rsUserInfo[$i]['created_date'] ?><br>
</p>
<p class="text_center">
<?php echo $rsUserInfo[$i]['remarks'] ?>
</P>
</div>
</div>
</div>
</div>
<?php } ?>
</ul>
</div>
</div>
</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 -->
</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>
<!---//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>
<script>
<?php for ($i=0; $i < count($rsUserInfo); $i++) { ?>
$('.modal_print_btn<?php echo $i; ?>').on('click', function() { // select print button with class "print," then on click run callback function
breakeveryheader();
$.print("#modal_printTable<?php echo $i; ?>"); // inside callback function the section with class "content" will be printed
});
<?php } ?>
</script>
<style>
@media print {
.new_print_display { page-break-after: always; }
}
</style>
<style>
@page {size: A4 ;margin:0;padding:0px;}
.modal {
background: rgb(0 0 0 / 83%);
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.10.0/css/lightbox.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>