<!doctype html>
<html class="fixed">
	<head>

		<!-- Basic -->
		<meta charset="UTF-8">

		<title>Survey</title>
		<meta name="keywords" content="HTML5 Admin Template" />
		<meta name="description" content="Porto Admin - Responsive HTML5 Template">
		<meta name="author" content="okler.net">
		<meta name="csrf-token" content="{{ csrf_token() }}">
		<!-- Mobile Metas -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

		<!-- Web Fonts  -->
		<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">

		<!-- Vendor CSS -->
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/bootstrap/css/bootstrap.css')}}" />
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/font-awesome/css/font-awesome.css')}}" />
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/magnific-popup/magnific-popup.css')}}" />
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/bootstrap-datepicker/css/datepicker3.css')}}" />

		<!-- Specific Page Vendor CSS -->
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/select2/select2.css')}}" />
		<link rel="stylesheet" href="{{asset('backend/assets/vendor/jquery-datatables-bs3/assets/css/datatables.css')}}" />

		<!-- Theme CSS -->
		<link rel="stylesheet" href="{{asset('backend/assets/stylesheets/theme.css')}}" />

		<!-- Skin CSS -->
		<link rel="stylesheet" href="{{asset('backend/assets/stylesheets/skins/default.css')}}" />

		<!-- Theme Custom CSS -->
		<link rel="stylesheet" href="{{asset('backend/assets/stylesheets/theme-custom.css')}}">

		<!-- Head Libs -->
		<script src="{{asset('backend/assets/vendor/modernizr/modernizr.js')}}"></script>
		
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
		
		<style>


table {
  width: 100%;
  margin: 20px auto;
  table-layout: auto;
}

.fixed {
  table-layout: fixed;
}

table,
td,
th {
  border-collapse: collapse;
  color:black;
}

th,
td {
  padding: 10px;
  border: solid 1px;
  text-align: center;
}

.w {
  width: 400px;
}
table,
td
{
	color:black;
}
</style>
		
	</head>
	<body>
		<section class="body">

			<!-- start: header -->
			<header class="header">
				<div class="logo-container">
					<a href="{{url('index')}}" class="logo" style="text-decoration:none;color:black;">
						<h2 style="margin-top:-5px;"><b>SURVEY</b></h2>
					</a>
					<div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
						<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
					</div>
				</div>
			
				<!-- start: search & user box -->
				<div class="header-right">
			
					<span class="separator"></span>
					<button class="btn btn-danger" style="margin-right:50px;"><a href="{{url('logout')}}" style="text-decoration:none;color:white;">Logout</a></button>
					
				</div>
				<!-- end: search & user box -->
			</header>
			<!-- end: header -->

			<div class="inner-wrapper">
				<!-- start: sidebar -->
				<aside id="sidebar-left" class="sidebar-left">
				
					<div class="sidebar-header">
						
						<div class="sidebar-toggle hidden-xs" data-toggle-class="sidebar-left-collapsed" data-target="html" data-fire-event="sidebar-left-toggle">
							<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
						</div>
					</div>
				
					<div class="nano">
						<div class="nano-content">
							<nav id="menu" class="nav-main" role="navigation">
							@if(session()->get('uname'))
								<ul class="nav nav-main">
									<li>
										<a href="/index">
											<i class="fa fa-home" aria-hidden="true"></i>
											<span>Dashboard</span>
										</a>
									</li>
									
									<li class="nav-parent">
                                        <a href="{{url('dashboard')}}">
                                            <i class="fa fa-list-alt" aria-hidden="true"></i>
                                            <span>Dashboard 1</span>
                                        </a>
                                    </li>
									<!-- <li class="nav-parent">
										<a href="/jilla/create">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>District </span>
										</a>
										
									</li> 
									<li class="nav-parent">
										<a href="/taluka/create">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>Mandal</span>
										</a>
										<!--<ul class="nav nav-children">
											<li>
												<a href="/taluka/create">
													 Add New
												</a>
											</li>
											<li>
												<a href="/taluka">
													 View All
												</a>
											</li>
											
										</ul>
									</li>
									<li class="nav-parent">
										<a href="/gram/create">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>Gram Panchayat</span>
										</a>
										<!--<ul class="nav nav-children">
											<li>
												<a >
													 Add New
												</a>
											</li>
											<li>
												<a href="/gram">
													 View All
												</a>
											</li>
											
										</ul>
									</li> -->
									<li class="nav-parent">
										<a>
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>Masters</span>
										</a>
										<ul class="nav nav-children">
											<li>
												<a href="{{url('/jilla/create')}}">
												
													<span style="padding:20px;">District</span>
												</a>
											</li>
											<li>
												<a href="{{url('/taluka/create')}}">
												<span style="padding:20px;">Mandal</span>
												</a>
											</li>
											<li>
												<a href="{{url('/gram/create')}}">
												<span style="padding:20px;">Gram Panchayat</span>
												</a>
											</li>
											
										</ul>
									</li>
									<li class="nav-parent">
										<a>
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>Survey</span>
										</a>
										<ul class="nav nav-children">
											<li>
												<a href="{{url('survey_info')}}">
												<span style="padding:20px;">Survey Installation</span>
												</a>
											</li>
											<li>
												<a href="{{url('dic_view')}}">
												<span style="padding:20px;">DIC Installation</span>
												</a>
											</li>
											<li>
												<a href="{{url('abstract_survey')}}">
												<span style="padding:20px;">Abstract Of Survey</span>
												</a>
											</li>
											<li>
												<a href="{{url('/survey_material_handing')}}">
												<span style="padding:20px;">Material Handing</span>
												</a>
											</li>
										<li>
												<a href="{{url('/inwards_view')}}">
												<span style="padding:20px;">In Wards</span>
												</a>
											</li> 

											<!-- <li>
												<a href="{{url('/make_view')}}">
												<span style="padding:20px;">Make</span>
												</a>
											</li> -->
										</ul>
									</li>
									<!-- <!-- <li class="nav-parent">
										<a href="/varnan/create">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>मिळकतीचे वर्णन </span>
										</a>
										<!--<ul class="nav nav-children">
											<li>
												<a href="/varnan/create">
													 Add New
												</a>
											</li>
											<li>
												<a href="/varnan">
													 View All
												</a>
											</li>
											
										</ul>
									</li>-->
									
									<!-- <li class="nav-parent">
										<a href="/user/create">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>वापरकर्ता</span>
										</a> -->
										<!--<ul class="nav nav-children">
											<li>
												<a href="/user/create">
													 Add New
												</a>
											</li>
											<li>
												<a href="/user">
													 View All
												</a>
											</li>
											
										</ul>-->
									<!-- </li>
									<li class="nav-parent">
										<a href="/details">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>कॅल्क्युलेटर</span>
										</a>
										
									</li> -->
									<li class="nav-parent">
										<a href="{{url('/gramuser/create')}}">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>Gram User</span>
										</a> 
										<!-- <ul class="nav nav-children">
											<li>
												<a href="/user/create">
													 Add New
												</a>
											</li>
											<li>
												<a href="/user">
													 View All
												</a>
											</li>
											
										</ul> -->
									</li>

									<li>
										<a href="{{url('/make_view')}}">
											<i class="fa fa-list-alt" aria-hidden="true"></i>
												<span >Make</span>
												</a>
									</li>
									
								</ul>
								
								<!-- <ul class="nav nav-main">
									<li>
										<a href="/gramuserindex">
											<i class="fa fa-home" aria-hidden="true"></i>
											<span>Dashboard</span>
										</a>
									</li>
									
									<li class="nav-parent">
										<a>
											<i class="fa fa-list-alt" aria-hidden="true"></i>
											<span>सर्वेक्षण</span>
										</a>
										<ul class="nav nav-children"> -->
											<!--<li>-->
											<!--	<a href="/survey_info_form">-->
											<!--		 Add New-->
											<!--	</a>-->
											<!--</li>-->
											<!-- <li>
												<a href="/survey_gram_info">
													 View All
												</a>
											</li>
											
										</ul>
									</li>
									
									
								</ul> --> 
								 @endif
        
							</nav>
				
							
							
				
						</div>
				
					</div>
				
				</aside>
				<!-- end: sidebar -->
				@yield('index-content')
				
				
			</div>

			
		</section>

		<!-- Vendor -->
		<script src="{{asset('backend/assets/vendor/jquery/jquery.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/bootstrap/js/bootstrap.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/nanoscroller/nanoscroller.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/magnific-popup/magnific-popup.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/jquery-placeholder/jquery.placeholder.js')}}"></script>
		
		<!-- Specific Page Vendor -->
		<script src="{{asset('backend/assets/vendor/select2/select2.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/jquery-datatables/media/js/jquery.dataTables.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js')}}"></script>
		<script src="{{asset('backend/assets/vendor/jquery-datatables-bs3/assets/js/datatables.js')}}"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="{{asset('backend/assets/javascripts/theme.js')}}"></script>
		
		<!-- Theme Custom -->
		<script src="{{asset('backend/assets/javascripts/theme.custom.js')}}"></script>
		
		<!-- Theme Initialization Files -->
		<script src="{{asset('backend/assets/javascripts/theme.init.js')}}"></script>


		<!-- Examples -->
		<script src="{{asset('backend/assets/javascripts/tables/examples.datatables.default.js')}}"></script>
		<script src="{{asset('backend/assets/javascripts/tables/examples.datatables.row.with.details.js')}}"></script>
		<script src="{{asset('backend/assets/javascripts/tables/examples.datatables.tabletools.js')}}"></script>
		<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
		<script>
		$(document).ready(function(){
		$("#jilla_id").on("change",function()
		{
			var id=$(this).val();
			$.ajax({
				url:'{{url("/jillaid")}}/'+id,
				method:'get',
				success:function(data)
				{
					//var test=data.split("::");
					$("#taluka").html(data);
				},	
				error:function(data)
				{
					$("#taluka").html("");
				}
			});
		});
		$("#user_id").on("change",function()
		{
			var id=$(this).val();
			//alert(id);
			$.ajax({
				url:'{{url("/userid")}}/'+id,
				method:'get',
				success:function(data)
				{
					//var test=data.split("::");
					$("#usersid").val(id);
					$("#grams").html(data);
				},	
				error:function(data)
				{
					$("#grams").html("");
				}
			});
		});
		$("#taluka").change(function(){
		       var name=$(this).val();
		       $.ajax({
		           url:'{{url("/getgram")}}/'+name,
		           method:'get',
		           success:function(data){
		               var dt="<option value=''>Please Select Gram</option>";
							var res=data.split("-");
							for(var i=0;i<res.length-1;i++)
							{
								var tdt = res[i].split("_");
								dt +="<option value='"+tdt[0]+"'>"+tdt[1]+"</option>";
							}
							$('#gram_id').html(dt);	
		           },
		           error:function(data){
		               alert(data);
		           }
		           
		       });
		   });
		$("#jilla_id_gram").on("change",function()
		{
			var id=$(this).val();
			var loginid=$(".loginid").val();
			var data={
		               id:id,
		               loginid:loginid
		           };
			console.log(data);
			
			$.ajax({
				
				url:'{{url("/jillaidgram")}}',
				method:'get',
				data:data,
				success:function(data)
				{
					console.log(data);
					//alert(data);
					//var test=data.split("::");
					$("#taluka_id_gram").html(data);
				},	
				error:function(data)
				{
					$("#taluka_id_gram").html("");
				}
			});
		});
		
		   $("#taluka_id_gram").change(function(){
		       var name=$(this).val();
			   var loginid=$(".loginid").val();
				var data={
		               name:name,
		               loginid:loginid
		           };
				console.log(data);
		       $.ajax({
		           url:'{{url("/getgram_id")}}',
		           method:'get',
				   data:data,
		           success:function(data){
		               var dt="<option value=''>Please Select Gram</option>";
							var res=data.split("-");
							for(var i=0;i<res.length-1;i++)
							{
								var tdt = res[i].split("_");
								dt +="<option value='"+tdt[0]+"'>"+tdt[1]+"</option>";
							}
							$('#gram_id_gramform').html(dt);	
		           },
		           error:function(data){
		               alert(data);
		           }
		           
		       });
		   });
		   
		   
		   $("#jillasearch").on("change",function()
		    {
		    var id=$(this).val();
			$.ajax({
				url:'{{url("/jillaid")}}/'+id,
				method:'get',
				success:function(data)
				{
				    $("#talukas").html(data);
				},	
				error:function(data)
				{
					$("#taluka").html("");
				}
			});
		    });
		    
		    $("#talukasearch").change(function(){
		       var name=$(this).val();
		       //alert(name);
		       $.ajax({
		           url:'{{url("/getgramsearch")}}/'+name,
		           method:'get',
		           success:function(data){
		               var dt="";
							var res=data.split("-");
							for(var i=0;i<res.length-1;i++)
							{
								var tdt = res[i].split("_");
								dt +="<option value='"+tdt[1]+"'>";
							}
							//alert(dt);
							$('#grams').html(dt);	
		           },
		           error:function(data){
		               alert(data);
		           }
		           
		       });
		   });
		   
		  // $(".allotuser").on("click",function(){
		  //      var id=$(this).val();
		  //      //alert(id);
		  //      var test=id.split('::');
		  //     $(".userid").val(test[0]);
	
		  //     var unm=test[1];
		  //     //$("usernameid").val(unm);
		  //      document.getElementById("usernameid").innerHTML =unm;
		  //      document.getElementById("useraddform").style.cssText="display:none";
		  //      document.getElementById("userallotform").style.cssText="display:block";
		  // });
		  var rowval=parseInt($("#rowcount").val());
		  
		  var i=rowval + 1;
		   
		   $("#addallot").on("click",function(){
		       var jilla=$("#jilla_id").val();
		       var taluka=$("#taluka").val();
		       var gram=$("#gram_id").val();
		       if(jilla=="" || taluka=="" || gram=="")
		       {
		           alert('please select value');
		       }
		       else{
		           var data={
		               jilla:jilla,
		               taluka:taluka,
		               gram:gram
		           };
		           $.ajax({
                        type:'get',
                        url:'{{url("/getareanames")}}',
                        data:data,
                        success:function(data)
                        {
                            var test=data.split('::');
                             var markup="<tr><td class='jilla"+i+"'>"+test[0]+"<input type='hidden' name='jilla"+i+"' value='"+jilla+"'></td><td class='taluka"+i+"'>"+test[1]+"<input type='hidden' name='taluka"+i+"' value='"+taluka+"'></td><td class='gram"+i+"'>"+test[2]+"<input type='hidden' name='gram"+i+"' value='"+gram+"'></td> <td><button type='button' class='btn btn-danger btnDelete'>x</button></td></tr>";
    		                        $("#rowallot").append(markup);
                    		       i++;
                    		       
                    		     $('#jillasearch').val("");
                    		     $("#talukasearch").val("");
                    		     $("#gramsearch").val("");
                    		    var rowCount = $("#rowallot tr").length;
                                $("#rowcount").val(rowCount);
                            
                        },
                        error:function(data)
                        {
                            alert(data);
                        }
                });
		       }
		        
		   });
		   $("#rowallot").on('click','.btnDelete',function(){
         $(this).closest('tr').remove();
         var rt=$("#rowcount").val();
         var mins=rt-1;
         $("#rowcount").val(mins);
         
        
      });
       $(".allotdelete").on("click",function(){
            var id=$(this).val();
            
            $.ajax({
               type:'get',
               url:'{{url("/alloted")}}/'+id,
               success:function(data)
               {
                   //alert(data);
                   location.reload(true);
               },
               error:function(data)
               {
                   alert(data);
               }
            });
         });
		$(".gramallotdelete").on("click",function(){
            var id=$(this).val();
            
            $.ajax({
               type:'get',
               url:'{{url("/allotedgram")}}/'+id,
               success:function(data)
               {
                   //alert(data);
                   location.reload(true);
               },
               error:function(data)
               {
                   alert(data);
               }
            });
         });
		});
		</script>
	</body>
</html>