<?php  
session_start(); 
if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
include("connect.php");	

$cmpmid=$_SESSION['linkarisecmpmid'];


date_default_timezone_set("Asia/Singapore");
	$mdate= date('Y/m/d');
	$mdate1= date('d-m-y h:i:sa');				
	$mdate2= date('d-m-Y');
	$mdate3= date('d-m-Y');
if (isset($_POST['daterange'])) {
    // Retrieve the date range string submitted via POST
    $p1 = $_POST['daterange'];

    // Extract the individual components of the start date
    $dd1 = substr($p1, 0, 2);
    $mm1 = substr($p1, 3, 2);
    $yy1 = substr($p1, 6, 4);

    // Extract the individual components of the end date
    $dd2 = substr($p1, 14, 2);
    $mm2 = substr($p1, 17, 2);
    $yy2 = substr($p1, 20, 4);

    // Convert the start and end date components into "YYYY-MM-DD" format
    $lower = "$yy1-$mm1-$dd1";
    $upper = "$yy2-$mm2-$dd2";

    // Store the original date range and the converted lower and upper dates in session variables
    $_SESSION['daterange'] = $_POST['daterange'];
    $_SESSION['lowerdate'] = $lower;
    $_SESSION['upperdate'] = $upper;
}


	
	else
	{
		$lower =  date('Y-m-d', strtotime('-1 months'));
		$upper =  date('Y-m-d',strtotime(date('Y-m-d')));
		$startdate =  date('d-m-Y', strtotime('-1 months'));
		$enddate =  date('d-m-Y',strtotime(date('Y-m-d')));
		//$lower =  $_SESSION['lowerdate'];
		//$upper =  $_SESSION['upperdate'];
		
		//$_SESSION['cstatus']="All";
		// $status='Pending';
		// $_SESSION['cstatus']="All";
	  $_SESSION['lowerdate']=$lower;
	  $_SESSION['upperdate']=$upper; 
	 
	}
	

if(isset($_POST['spotmid']))
	{
		$_SESSION['spotmid']=$_POST['spotmid'];
	}else
	{
		$_SESSION['spotmid']='All';
	}
	
	if(isset($_POST['jobworkstatus']))
	{
		$_SESSION['jobworkstatus']=$_POST['jobworkstatus'];
	}else
	{
		$_SESSION['jobworkstatus']='All';
	}
	?>
<!DOCTYPE html>
<!--
Author: Keenthemes
Product Name: Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme
Purchase: https://1.envato.market/EA4JP
Website: http://www.keenthemes.com
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Dribbble: www.dribbble.com/keenthemes
Like: www.facebook.com/keenthemes
License: For each use you must have a valid license purchased only from above link in order to legally use the theme for your project.
-->
<html lang="en">
	<!--begin::Head-->
	<head>
		<title><?php if($_SESSION['linkarisecmptype']=='Hotel'){?>
                                   Linen Job Work
															<?php } else{?>
															 Clean Clothes Job Work
															<?php } ?> Report</title>
		<meta charset="utf-8" />
		<meta name="description" content="The most advanced Bootstrap Admin Theme on Themeforest trusted by 100,000 beginners and professionals. Multi-demo, Dark Mode, RTL support and complete React, Angular, Vue, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel versions. Grab your copy now and get life-time updates for free." />
		<meta name="keywords" content="metronic, bootstrap, bootstrap 5, angular, VueJs, React, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel starter kits, admin themes, web design, figma, web development, free templates, free admin themes, bootstrap theme, bootstrap template, bootstrap dashboard, bootstrap dak mode, bootstrap button, bootstrap datepicker, bootstrap timepicker, fullcalendar, datatables, flaticon" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta property="og:locale" content="en_US" />
		<meta property="og:type" content="article" />
		<meta property="og:title" content="Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme" />
		<meta property="og:url" content="https://keenthemes.com/metronic" />
		<meta property="og:site_name" content="Keenthemes | Metronic" />
		<link rel="canonical" href="https://preview.keenthemes.com/metronic8" />
		<link rel="shortcut icon" href="assets/media/logos/iwashlogo.jpg" />
		<!--begin::Fonts(mandatory for all pages)-->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
		<!--end::Fonts-->
		<!--begin::Vendor Stylesheets(used for this page only)-->
		<link href="assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Vendor Stylesheets-->
		<!--begin::Global Stylesheets Bundle(mandatory for all pages)-->
		<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Global Stylesheets Bundle-->
		
		
		 <style>
       .table-responsive::-webkit-scrollbar {
    width: 12px; /* You can adjust the width as needed */
    height: 10px; /* You can adjust the width as needed */
	color: darkgrey;
}
.table-responsive:hover::-webkit-scrollbar-thumb {
    background-color: darkgrey; /* Change this to your desired color (e.g., dark grey) */
}
.table-responsive::-webkit-scrollbar-thumb {
    background-color: darkgrey; /* Change this to your desired color (e.g., dark grey) */
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: black; /* Change this to your desired color on hover (e.g., black) */
}

    </style>
	<style>
.table-responsive {
 overflow-y: auto;
 height: 600px;
}
.table-responsive thead tr {
 position: sticky;
 top: 0;
  background-color: skyblue;
}
table {
 border-collapse: collapse;
 width: 100%;
}
th,
td {
 padding: 8px 15px;
 border: 2px solid #529432;
}
th {
 background: #abdd93;
}
@media print
{    
    .no-print, .no-print *
    {
        display: none !important;
    }
}
</style>
	</head>
	<!--end::Head-->
	<!--begin::Body-->
	<body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
		<!--begin::Theme mode setup on page load-->
		<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-bs-theme-mode")) { themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); } else { if ( localStorage.getItem("data-bs-theme") !== null ) { themeMode = localStorage.getItem("data-bs-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-bs-theme", themeMode); }</script>
		<!--end::Theme mode setup on page load-->
		<!--begin::Main-->
		<!--begin::Root-->
		<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
			<!--begin::Page-->
			<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
				<!--begin::Header-->
				<?php include('header2.php'); ?>
				
				<!--end::Header-->
				<!--begin::Wrapper-->
				<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
					<!--begin::Sidebar-->
				<?php include('sidebar2.php'); ?>
				<!--end::Sidebar-->
					<!--begin::Main-->
					<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
						<!--begin::Content wrapper-->
						<div class="d-flex flex-column flex-column-fluid">
							<!--begin::Toolbar-->
							<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
								<!--begin::Toolbar container-->
								<div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
									<!--begin::Page title-->
									<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
										<!--begin::Title-->
										<h1 class="text-dark fw-bold my-1 fs-3 lh-1"><?php if($_SESSION['linkarisecmptype']=='Hotel'){?>
                                   Linen Job Work
															<?php } else{?>
															 Clean Clothes Job Work 
															<?php } ?>Report</h1>
										<!--end::Title-->
										<!--begin::Breadcrumb-->
										<!--begin::Breadcrumb-->
									<ul class="breadcrumb fw-semibold fs-8 my-1">
										<li class="breadcrumb-item text-muted">
											<a href="dashboard.php" class="text-muted">Home</a>
										</li>
										<li class="breadcrumb-item text-muted">Reports</li>
										
										<li class="breadcrumb-item text-muted"><?php if($_SESSION['linkarisecmptype']=='Hotel'){?>
                                   Linen Job Work
															<?php } else{?>
															 Clean Clothes Job Work 
															<?php } ?> Report</li>
									</ul>
										<!--end::Breadcrumb-->
									</div>
									<!--end::Page title-->
									<!--begin::Actions-->
									
									<!--end::Actions-->
								</div>
								<!--end::Toolbar container-->
							</div>
							<!--end::Toolbar-->
							<!--begin::Content-->
							<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
						<!--begin::Container-->
						<div class="container-xxl" id="kt_content_container">
							<!--begin::Card-->
							<div class="card">
								<!--begin::Card header-->
								<div class="card-header border-0 pt-6 no-print" >
									<!--begin::Card title-->
									<div class="card-title">
										<!--begin::Search-->
									
										<!--end::Search-->
									</div>
									<!--begin::Card title-->
									<!--begin::Card toolbar-->
									<div class="card-toolbar flex-row-fluid justify-content-end gap-5">
										<!--begin::Toolbar-->
										<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
											<!--begin::Export-->
											
										<a href="javascript:;" onClick="javascript:window.print();" class="btn btn-light-danger me-3">
    <i class="fa fa-print"></i> Print
</a>

											<!--end::Export-->
											<!--begin::Add user-->
											
									
											<!--end::Add user-->
										</div>
								
										<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
    <!--begin::Export-->
    <div class="dropdown">
        <button class="btn btn-light-primary dropdown-toggle me-3" type="button" id="exportDropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Export
        </button>
        <div class="dropdown-menu" aria-labelledby="exportDropdown">
            <a href="javascript:;" onClick ="$('#sample_5').tableExport({type:'excel',escape:'false'}); " class="dropdown-item">
                <i class="fa fa-file-excel"></i> Export to Excel
            </a>
            
        </div>
    </div>
    <!--end::Export-->
    <!--begin::Add user-->

    <!--end::Add user-->
</div>

										<!--end::Toolbar-->
										<!--begin::Group actions-->
									
										<!--end::Group actions-->
										<!--begin::Modal - Adjust Balance-->
								
									<!--end::Card toolbar-->
									
								</div>
								
								</div>
								<div class="card-header align-items-center py-5 gap-2 gap-md-5 no-print">
									<!--begin::Card title-->
									<div class="card-title">
										<!--begin::Search-->
										<div class="d-flex align-items-center position-relative my-1">
											<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
									
											<!--end::Svg Icon-->
										
										</div>
										<!--end::Search-->
									</div>
									<!--end::Card title-->
									<form method="post" class="form-control" style="border: none;">
									<!--begin::Card toolbar-->
									<div class="card-toolbar flex-row-fluid justify-content-end gap-5 ">
										<!--begin::Flatpickr-->
										 <label class="control-label col-md-0">Date Range</label>
										<div class="input-group w-250px">
										
											<input class="form-control form-control rounded rounded-end"  name="daterange" placeholder="Pick date range" id="kt_ecommerce_sales_flatpickr" value="<?php if( isset($_POST['daterange']) ){ echo $_POST['daterange'];}else{ echo $startdate." to ".$enddate;}	?>"/>
										
										</div>
										<!--end::Flatpickr-->
										<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
											 <label class="control-label col-md-0">Hotel</label>
										<div class="w-100 mw-200px">
											<!--begin::Select2-->
											<select class="form-select form-select" data-control="select2" data-hide-search="true" name="spotmid">
												<option value="All">All</option>
												<?php
														$eve_main = "select * from res_company_master where companytype='Hotel'";
														$re_main = mysqli_query($conn, $eve_main);
														while($rt_main = mysqli_fetch_assoc($re_main))
														{
															
															$spotmid1=$rt_main['companymid'];
															$spotname1=$rt_main['companyname'];
															if($_POST['spotmid']==$spotmid1)
															{
																echo "<option value='$spotmid1' selected>$spotname1</option>";
															}
															else
															{
																echo "<option value='$spotmid1'>$spotname1</option>";
															}

														}
													?>
											</select>
											<!--end::Select2-->
										</div>
										<?php } ?>
										<label class="control-label col-md-0">Status</label>
										<div class="w-100 mw-150px">
											<!--begin::Select2-->
											<select class="form-select form-select" data-control="select2" data-hide-search="true" name="jobworkstatus">
												<option value="All" >All</option>
												<option value="Dispatched"  <?php if ($_SESSION['jobworkstatus']=='Dispatched'){echo 'selected';}?>>Dispatched</option>
												<option value="Received"  <?php if ($_SESSION['jobworkstatus']=='Received'){echo 'selected';}?>>Received</option>
												
											</select>
											<!--end::Select2-->
										</div>
										<!--begin::Add product-->
									   <div class="col-md-0">
                                                    <button type="submit" name="btnsubmit" class="btn btn-light-danger me-3">
                                                        <i class="fa fa-check"></i> Submit</button>
                                                   
                                                </div>
										<!--end::Add product-->
									</div>
									<!--end::Card toolbar-->
									</form>
								</div>
								<!--end::Card header-->
								<style> 
 .table-responsive{
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}
#sample_5 {
    border: 0.5px solid lightgrey; /* You can adjust the border width and color as needed */
  }
   #sample_5, #sample_5 th, #sample_5 td {
    border: 0.5px solid lightgrey; /* You can adjust the border width and color as needed */
  }
</style>
								<!--begin::Card body-->
								<div class="card-body py-4">
								<div class="table-responsive">
									<!--begin::Table-->
									<table class="table align-middle table-row-dashed fs-6 gy-5" id="sample_5">
									<thead>
											<tr>
												<th class="sorting" style="display:none;"> </th>
                                                <th>Sr. No.</th>
													<th>Trolley S.No</th>
												<th>Trolley No</th>
												<th>Job Work Status</th>
												<th>Gross Weight</th>
												<th>Tare Weight</th>
												<th>Net Weight</th>
												<th>No. of Items in Trolley</th>
												<th>Job Work No</th>
												<th>Job Work Date</th>
												<th>Send Out Time</th>
												
												<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
												<th>I-Wash (Net Weight) (kg)</th>
												<?php } else { ?>
												<th>Hotel (Net Weight) (kg)</th>
												<?php } ?>
												<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
												<th>Hotel (Verified Weight) (kg)</th>
												<?php } else{ ?>
												<th>I-Wash (Verified Weight) (kg)</th>
												<?php } ?>
												<th>Difference (kg)</th>
												
												
												<th>Sent Out By</th>
												
												<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
												<th>Hotel Name</th>
												<?php } ?>
												<th>Received Date</th>
												<th>Received Time</th>
												<th>Received By</th>
											
												
											
                                        </tr>
                                    </thead>
									 <tbody>
									
									<?php
										 if(isset($_SESSION['spotmid']))
	 {
		 $spotmid = $_SESSION['spotmid'];
		if($spotmid == 'All')
		{
			$bb = "";
		}else{
			$bb = "and tocompanymid='$spotmid'";
		}			
	 }else
	 {
		$bb = ""; 
	 }
	  if(isset($_SESSION['jobworkstatus']))
	 {
		 $jobworkstatus = $_SESSION['jobworkstatus'];
		if($jobworkstatus == 'All')
		{
			$cc = "";
		}else{
			$cc = "and jobworkstatus='$jobworkstatus'";
		}			
	 }else
	 {
		$cc = ""; 
	 }
					
										$i=1;
										$totalexpenseamount=0;
										$totalverfiedweight=0;
										$totaldifference=0;
										$eve = "select * from res_jobwork_master where jobworkdate between '$lower' and '$upper' and fromcompanymid=$cmpmid $bb $cc";
										$re = mysqli_query($conn, $eve);
										while($rt = mysqli_fetch_assoc($re))
										{
											$jobworkmid=$rt['jobworkmid'];
			 	$jobworknumber=$rt['jobworknumber'];
			 	$dispatchedby=$rt['dispatchedby'];
			 	$jobworkdate=date("d-m-Y",strtotime($rt['jobworkdate']));
			 	$jobworktime=date("H:i",strtotime($rt['dispatchedon']));
				if($rt['receivedon']=='0000-00-00 00:00:00'){
					$receiveddate="";
			 	$receivedtime="";
			 	$receivedby=0;
				}
				else{
					 	$receiveddate=date("d-m-Y",strtotime($rt['receivedon']));
			 	$receivedtime=date("H:i",strtotime($rt['receivedon']));
			 	$receivedby=$rt['receivedby'];
				}
			
											
										
											$tocompanymid=$rt['tocompanymid'];
				$jobworktype=$rt['jobworktype'];
				$jobworkstatus=$rt['jobworkstatus'];
				$jobworknofordisplay=$rt['jobworknofordisplay'];
				
$companyname="";
$cpname="";
$cpmobile="";
				$eve71="select * from res_company_master where companymid=$tocompanymid";
					$re71 = mysqli_query($conn, $eve71);
					while($rt71 = mysqli_fetch_assoc($re71))
					{
						$companyname=$rt71['companyname'];
						$cpname=$rt71['companycontactperson'];
						
						
					}

				$totalweight="";
				$eve72="select SUM(trolleynetweight) as cc from res_jobwork_detail where jobworkmid=$jobworkmid";
					$re72 = mysqli_query($conn, $eve72);
					while($rt72 = mysqli_fetch_assoc($re72))
					{
					    
					     $totalweight11 = $rt72['cc'];
					    if($totalweight11 == ""){
					        $totalweight = 0;
					    }else{
						$totalweight=number_format($totalweight11,2,'.','');
					        
					    }
					    
						
							$totalexpenseamount=$totalexpenseamount+$totalweight;
					}
					$correctionweight="";
				$eve721="select SUM(trolleyreceivedgrossweight) as cc from res_jobwork_detail where jobworkmid=$jobworkmid and trolleyreceived=1";
					$re721 = mysqli_query($conn, $eve721);
					while($rt721 = mysqli_fetch_assoc($re721))
					{
					    $correctionweight11 = $rt721['cc'];
					    if($correctionweight11 == ""){
					        $correctionweight = 0;
					    }else{
						$correctionweight=number_format($correctionweight11,2,'.','');
					        
					    }
						
					}
				$totaltareweight="";
				$eve722="select SUM(trolleytareweight) as cc from res_jobwork_detail where jobworkmid=$jobworkmid and trolleyreceived=1";
					$re722 = mysqli_query($conn, $eve722);
					while($rt722 = mysqli_fetch_assoc($re722))
					{
						$totaltareweight11=$rt722['cc'];
						if($totaltareweight11 == ""){
					        $totaltareweight = 0;
					    }else{
						$totaltareweight=number_format($totaltareweight11,2,'.','');
					    }
					}
					
					$verifiedweight=$correctionweight-$totaltareweight;
					$verifiedweight=number_format($verifiedweight,2,'.','');
					$totalverfiedweight=$totalverfiedweight+$verifiedweight;
					$difference=$totalweight-$verifiedweight;
					$difference=number_format($difference,2,'.','');
					$totaldifference=$totaldifference+$difference;
				if($_SESSION['linkarisecmptype']=='Hotel'){
				if($jobworkstatus=="Dispatched")
				{
					
					$jobworkstatus1="<div class='badge badge-light-primary fw-bold'>Dispatched From Hotel</div>";
				}
				else if($jobworkstatus=="Received")
				{
					
					$jobworkstatus1="<div class='badge badge-light-primary fw-bold'>Received By I-Wash</div>";
				}
					}
					else{
						if($jobworkstatus=="Dispatched")
				{
					
					$jobworkstatus1="<div class='badge badge-light-primary fw-bold'>Dispatched From I-Wash</div>";
				}
				else if($jobworkstatus=="Received")
				{
					
					$jobworkstatus1="<div class='badge badge-light-primary fw-bold'>Received By Hotel</div>";
				}
					}
				$eve75="select * from res_company_master where companymid=$cmpmid";
					$re75 = mysqli_query($conn, $eve75);
					while($rt75 = mysqli_fetch_assoc($re75))
					{
					
						$cmpprefix=$rt75['companyprefix'];
						
						
					}
				$dispatchedbyname="";
				$eve72="select * from res_user_master where usermid=$dispatchedby";
					$re72 = mysqli_query($conn, $eve72);
					while($rt72 = mysqli_fetch_assoc($re72))
					{
						$dispatchedbyname=$cmpprefix."-".$rt72['username'];
						$cpmobile=$rt72['usermobile'];
						
					}
					$eve751="select * from res_company_master where companymid=$tocompanymid";
					$re751 = mysqli_query($conn, $eve751);
					while($rt751 = mysqli_fetch_assoc($re751))
					{
					
						$cmpprefix1=$rt751['companyprefix'];
						
						
					}
					$receivedbyname="";
				$eve74="select * from res_user_master where usermid=$receivedby";
					$re74 = mysqli_query($conn, $eve74);
					while($rt74 = mysqli_fetch_assoc($re74))
					{
						$receivedbyname=$cmpprefix1."-".$rt74['username'];
						
						
					}
					$flag=1;
				$eve73="select * from res_jobwork_detail where jobworkmid=$jobworkmid";
					$re73 = mysqli_query($conn, $eve73);
					$n=1;
					while($rt73 = mysqli_fetch_assoc($re73))
					{
						$jobworkdid=$rt73['jobworkdid'];
		$query11 = "select count(jobworkdid) as cc from res_jobworkitem_detail where jobworkdid=$rt73[jobworkdid]";
															$stmt11=mysqli_query($conn,$query11);
															
															$totalitem="";
															
															if(mysqli_num_rows($stmt11) > 0)
															{
																while($rt11 = mysqli_fetch_assoc($stmt11))
																{
																	$totalitem=$rt11['cc'];
																	
																}
															}
															$eve22 = "select itemname,itemqty from res_jobworkitem_detail where jobworkdid=$jobworkdid";
				$re22= mysqli_query($conn, $eve22);
				$itemname="";
				$itemqty="";
				if(mysqli_num_rows($re) > 0)
				{
					$t1=1;
					while($rt22 = mysqli_fetch_assoc($re22))
					{
						/* $ufullname=$rt22['ufullname']; */
						
						if($t1==1)
						{
							$itemname = $itemname.$rt22['itemname']."-".$rt22['itemqty'];
							$t1=0;
						}
						else
						{
							$itemname = $itemname.", ".$rt22['itemname']."-".$rt22['itemqty'];
						}
					}
				}
									if($flag==1)
					{
										?>
									
									 <tr class="odd gradeX">
										<td style="display:none;">  </td>
										<td> <?php echo $i++; ?> </td>
										<td> <?php echo $n++; ?></td>
										<td> <?php echo $rt73['trolleyqrcode']; ?></td>
										<td> <?php echo $jobworkstatus1; ?></td>
										
										<td> <?php echo $rt73['trolleygrossweight']; ?></td>
											<td> <?php echo $rt73['trolleytareweight']; ?></td>
											<td> <?php echo $rt73['trolleynetweight']; ?></td>
										<td> <?php echo $totalitem." (".$itemname.")"; ?></td>
										<td> <?php echo $jobworknofordisplay; ?></td>
										<td> <?php echo $jobworkdate; ?></td>
										<td> <?php echo $jobworktime; ?></td>
										
										<td> <?php echo $totalweight; ?></td>
										<td> <?php echo $verifiedweight; ?></td>
										<td> <?php echo $difference; ?></td>
										
									
										<td> <?php echo $dispatchedbyname; ?></td>
											
										<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
										<td> <?php echo $companyname; ?></td>
											<?php } ?>
											<td> <?php echo $receiveddate; ?></td>
											<td> <?php echo $receivedtime; ?></td>
											<td> <?php echo $receivedbyname; ?></td>
											
											
											
												
		
				
									</tr>
									<?php
										$flag=0; }
										else {
									?>
									 <tr class="odd gradeX">
										<td style="display:none;">  </td>
										<td>  </td>
										<td> <?php echo $n++; ?></td>
										<td> <?php echo $rt73['trolleyqrcode']; ?></td>
										<td> </td>
										<td> <?php echo $rt73['trolleygrossweight']; ?></td>
											<td> <?php echo $rt73['trolleytareweight']; ?></td>
											<td> <?php echo $rt73['trolleynetweight']; ?></td>
											<td> <?php echo $totalitem." (".$itemname.")"; ?></td>
										
										<td> </td>
										<td> </td>
										<td></td>
										<td> </td>
										<td></td>
										<td> </td>
										
									
										<td> </td>
											
										
										
										
											<td> </td>
											<td></td>
											<td></td>
											<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
											<td> </td>
											<?php } ?>
											
											
											
										
		
				
									</tr>
										<?php }}} ?>
                                    </tbody>
									 <tr>
										<td style="display:none;">  </td>
										<td></td>
										<td></td>
										<td></td>
										
										
										<td><b>Total</b></td>
										<td> <?php echo number_format($totalexpenseamount,2,'.','');; ?></td>
										<td> <?php echo number_format($totalverfiedweight,2,'.','');; ?></td>
										<td> <?php echo number_format($totaldifference,2,'.','');; ?></td>
										<td> </td>
										<td></td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<td> </td>
										<?php if($_SESSION['linkarisecmptype']=='I-Wash'){?>
											<td> </td>
											<?php } ?>
									</tr>
								</table>
									<!--end::Table-->
									</div>
								</div>
								<!--end::Card body-->
							</div>
							<!--end::Card-->
						</div>
						<!--end::Container-->
					</div>
					<!--end::Content-->
						</div>
						<!--end::Content wrapper-->
						<!--begin::Footer-->
						<?php include('footer.php'); ?>
						
						<!--end::Footer-->
					</div>
					<!--end:::Main-->
				</div>
				<!--end::Wrapper-->
			</div>
			<!--end::Page-->
		</div>
		<!--end::Root-->
		<!--end::Modals-->
		<!--begin::Javascript-->
		<script>var hostUrl = "assets/";</script>
		<!--begin::Global Javascript Bundle(mandatory for all pages)-->
		<script src="assets/plugins/global/plugins.bundle.js"></script>
		<script src="assets/js/scripts.bundle.js"></script>
		<!--end::Global Javascript Bundle-->
		<!--begin::Vendors Javascript(used for this page only)-->
		<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
		<!--end::Vendors Javascript-->
		<!--begin::Custom Javascript(used for this page only)-->
		<script src="assets/js/custom/apps/user-management/users/list/table.js"></script>
		<script src="assets/js/custom/apps/user-management/users/list/export-users.js"></script>
		<script src="assets/js/custom/apps/user-management/users/list/add.js"></script>
		<script src="assets/js/widgets.bundle.js"></script>
		<script src="assets/js/custom/widgets.js"></script>
		<script src="assets/js/custom/apps/chat/chat.js"></script>
		<script src="assets/js/custom/utilities/modals/upgrade-plan.js"></script>
		<script src="assets/js/custom/utilities/modals/users-search.js"></script>
		<script type="text/javascript" src="myjs/64/jquery.base64.js"/></script>
		<script type="text/javascript" src="myjs/tableexport.js"/></script>
		<script type="text/javascript" src="js/notification.js"/></script>

<?php

if(isset($_SESSION['msg']))
{
	$tt = $_SESSION['msg'];
	echo "<input type=\"hidden\" id=\"mymsg\" value=\"$tt\"/>";
	unset($_SESSION['msg']);
	
	
?>	
								
		<script lang="javascript">

var a = [
    function () {
	

		var mymsg = document.getElementById("mymsg").value;
		toastr.success(mymsg, "Operation Completed")
		
    },
    function () {
        $('span').show();
    },
    function () {
        $('p').fadeIn(100);
    }
];		
					

a[0]();
</script>


		
	
<?php
}

if(isset($_SESSION['msg1']))
{
	$tt1 = $_SESSION['msg1'];
	echo "<input type=\"hidden\" id=\"mymsg1\" value=\"$tt1\"/>";
	unset($_SESSION['msg1']);
	
	
	?>	
								
		<script lang="javascript">

var a = [
    function () {
	

		var mymsg = document.getElementById("mymsg1").value;
		toastr.warning(mymsg, "Error")
		
    },
    function () {
        $('span').show();
    },
    function () {
        $('p').fadeIn(100);
    }
];		
					

a[0]();
</script>
	
<?php

}
?>								
		<!--end::Custom Javascript-->
		<!--end::Javascript-->
		
		

<!-- Initialize Flatpickr date range picker -->
  <script>
        document.addEventListener('DOMContentLoaded', function () {
            // Get the current date
     

            // Set the default date range for the date picker
            flatpickr('#kt_ecommerce_sales_flatpickr', {
                mode: 'range', // Set the mode to 'range' for a date range picker
                dateFormat: 'd-m-Y', // Set the desired date format: "day-month-year"
               // defaultDate: [lowerDate, upperDate], // Set the default date range
            });
        });
    </script>
		
	</body>
	<!--end::Body-->
</html>