<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Language" content="en">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />
    <title>HYUNDAI | Dashboard</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
    <meta name="description" content="This is an example dashboard created using build-in elements and components.">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
    <link href="assets/css/main.css" rel="stylesheet">
    <link href="assets/css/dataTables.bootstrap4.min.css" rel="stylesheet">
    <link href="assets/css/buttons.dataTables.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
    <link rel="stylesheet" href="assets/js/select2.min.css">
    <script src="https://cdn.jsdelivr.net/npm/pptxgenjs@3.3.1/dist/pptxgen.bundle.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<style>
	a.nav-link.ash.show.active {
    background-color: #003e80 !important;
    color: #FFFFFF !important;
	}

	a.nav-link .active {
		background-color: #003e80 !important;
		color: #FFFFFF !important;
	}
	.div-head{
		margin:5px;
	}
	.div-hea{
		margin:20px;
	}
	</style>
</head>
<body>
<h5 class="div-hea" style="font-size:18px;text-align:center;"><b style="font-weight:700">Action plan upload</b></h5>
<div class="container" style="">
    <div class="col-lg-12 col-md-12">
        <div class="card card-shadow-danger" >
			<div class="tab-pane" id="tab-eg7-17" role="tabpanel" style="margin-left:-15px">
				<div class="card-header prh1" style="">
					<ul class="nav nav-justified ml-2" id="subtabs21">
						<li class="nav-item nav-mob1"><a data-toggle="tab" href="#tab-eg98-1" class="active nav-link ash " style="border-radius:20px">Overall</a></li>
						<li class="nav-item nav-mob1"><a data-toggle="tab" href="#tab-eg98-2" class="nav-link ash " style="border-radius:20px">Key Action Areas</a></li>
					</ul>
                </div>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab-eg98-1" role="tabpanel">
                        <div class="row mt-1" style="">
							<div class="col-lg-12 col-md-12">
								<div class="card card-shadow-danger" >
									<h5 class="div-head" style="">
										<button type="button" class="btn-transition btn btn-outline-primary btn-sm vocnot" onclick="exportExcel14();" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Export Excel" style="margin-right:10px;float:right;background-color:#002a5c;color:white !important;border-color:002a5c">
											EXPORT
										</button>
									</h5>
									<table id="Aupload_table" class="table table-striped table-bordered no-footer text-center display" style="font-size:12px">
    									<thead style="background-color:#002a5c;color:#fff;width:100%">
    											<tr data-height="40">
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Name</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">All India Score</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Filtered Score</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Comments</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Zone</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Region</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">State</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">City</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Main Dealer</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Dealer</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Quarter</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">s_no</th>
    											</tr>
    										</thead>
    									<tbody>
    										<?php
    										include("config.php");
    										
    										 $DC=trim($_REQUEST['dcode']);
    										 $user_type=trim($_REQUEST['utype']);
    										 
    										 
    										 
    											 $tbl='action';
    										 
    										
    										
    										if($user_type==1){
    										
    										}
    										else if($user_type>1 && $user_type<=6){						
    										$qL="select * from $tbl where Zone='".$DC."' order by s_no asc";	
    										}
    										else if($user_type>=7 && $user_type<=24){						
    										$qL="select * from $tbl where Region='".$DC."' order by s_no asc";	
    										}
    										else if($user_type==999){						
    										$qL="select * from $tbl where Main_dealer_name LIKE  '%$DC%' order by s_no asc";
    										}
    				
    										
    										$qL=mysqli_query($conn,$qL);
    										if(mysqli_num_rows($qL)>0)
    										{
    											while($rl=mysqli_fetch_assoc($qL))
    											{
    												$q=$rl['Quarter'];
    												$q1=array_search($q, $time);
    												echo"<tr>";
    												echo"<td>".$rl['Name']."</td><td>".$rl['All India Score']."</td><td>".$rl['Filtered Score']."</td><td>".$rl['Comments']."</td><td>".$rl['Zone']."</td><td>".$rl['Region']."</td><td>".$rl['State']."</td><td>".$rl['City']."</td><td>".$rl['Main_dealer_name']."</td><td>".$rl['Dealer_name']."</td><td>".$rl['Quarter']."</td><td>".$rl['s_no']."</td>";
    												echo'<tr>';
    												
    											}
    										}
    										else{
    											
    											echo'<tr><td colspan="12"><p style="text-align:center;">No Record Found</p></td></tr>';
    										}
    										
    										
    										?>
    									</tbody>
    								</table>
								</div>
							</div>
						</div>
					</div>
					<div class="tab-pane" id="tab-eg98-2" role="tabpanel">
                       <div class="row mt-1" style="">
							<div class="col-lg-12 col-md-12">
								<div class="card card-shadow-danger" >
									<h5 class="div-head" style="">
										<button type="button" class="btn-transition btn btn-outline-primary btn-sm vocnot" onclick="exportExcel15();" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Export Excel" style="margin-right:10px;float:right;background-color:#002a5c;color:white !important;border-color:002a5c">
											EXPORT
										</button>
									</h5>
									<table id="Kupload_table" class="table table-striped table-bordered no-footer text-center display" style="font-size:12px">
										<thead style="background-color:#002a5c;color:#fff;width:100%">
												<tr data-height="40">
													<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Name</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">All India Score</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Filtered Score</th>
    												<th data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Comments</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Zone</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Region</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">State</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">City</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Main Dealer</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Dealer</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">Quarter</th>
    												<th  data-fill-color="002a5c"  data-f-color="ffffff" data-a-v="middle" data-b-a-s="thin" data-b-a-c="ffffff" data-f-bold="true" data-a-h="center">s_no</th>
												</tr>
											</thead>
										<tbody>
										    <?php
												// include("config.php");
												//  $DC=trim($_REQUEST['dcode']);
												//  $user_type=trim($_REQUEST['utype']);
												$tbl='action2';
												
												if($user_type==1){
												
												}
												else if($user_type>1 && $user_type<=6){						
												$qL="select * from $tbl where Zone='".$DC."' order by s_no asc";	
												}
												else if($user_type>=7 && $user_type<=24){						
												$qL="select * from $tbl where Region='".$DC."' order by s_no asc";	
												}
												else if($user_type==999){						
												$qL="select * from $tbl where Main_dealer_name LIKE  '%$DC%' order by s_no asc";
												}
												else{
												
												}
												$qL=mysqli_query($conn,$qL);
												if(mysqli_num_rows($qL)>0)
												{
													while($rl=mysqli_fetch_assoc($qL))
													{
														$q=$rl['Quarter'];
														//echo $q;
														$q1=array_search($q, $time);
														
														echo"<tr>";
														echo"<td>".$rl['Name']."</td><td>".$rl['All India Score']."</td><td>".$rl['Filtered Score']."</td><td>".$rl['Comments']."</td><td>".$rl['Zone']."</td><td>".$rl['Region']."</td><td>".$rl['State']."</td><td>".$rl['City']."</td><td>".$rl['Main_dealer_name']."</td><td>".$rl['Dealer_name']."</td><td>".$rl['Quarter']."</td><td>".$rl['s_no']."</td>";
														echo'<tr>';
														
													}
												}
												else{
													
													echo'<tr><td colspan="12"><p style="text-align:center;">No Record Found</p></td></tr>';
												}
												
												
												?>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
			</div>
        </div>
    </div>
</div>


<script type="text/javascript" src="assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="assets/scripts/main.js"></script>
    <script type="text/javascript" src="assets/js/select2.min.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/modules/variable-pie.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts-more.js"></script>
	<script type="text/javascript" src="https://code.highcharts.com/modules/exporting.js"></script>
	<script type="text/javascript" src="https://code.highcharts.com/modules/offline-exporting.js"></script>
    <script type="text/javascript" src="assets/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="assets/js/dataTables.bootstrap4.min.js"></script>
    <script type="text/javascript" src="assets/js/dataTables.buttons.min.js"></script>
    <script type="text/javascript" src="assets/js/buttons.html5.min.js"></script>
    <script type="text/javascript" src="assets/js/jszip.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.min.js.map"></script>
    <script type="text/javascript" src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/linways/table-to-excel@v1.0.4/dist/tableToExcel.js"></script>
<script>
function exportExcel14()
    {
        /////////////debugger;
        
            let table1 = document.getElementById("Aupload_table");
            
            let book = TableToExcel.tableToBook(table1, {sheet:{name:"OverallAction_upload"}});
            
            
            TableToExcel.save(book, "ActionOverall.xlsx");
        
    }
	function exportExcel15()
    {
        /////////////debugger;
        
            let table1 = document.getElementById("Kupload_table");
            
            let book = TableToExcel.tableToBook(table1, {sheet:{name:"KeyAction_upload"}});
            
            
            TableToExcel.save(book, "ActionKey.xlsx");
        
    }
</script>

</body>
</html>