<?php
    include 'connection.php';
    session_start();
    $user=$_SESSION['user'];
    if (!isset($user)) {
        header('location:officer-login.php');
        die();
    }
    $current_date = date("Y-m-d")

?>
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
        <title>DGRC dashboard
		</title>
	    <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="css/bootstrap.min.css">
	    <!----css3---->
        <link rel="stylesheet" href="css/custom.css">
		<!-- SLIDER REVOLUTION 4.x CSS SETTINGS -->
	
	<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;700;900&display=swap" rel="stylesheet">

	
	
	
	<!--google material icon-->
        <link href="https://fonts.googleapis.com/css2?family=Material+Icons"
      rel="stylesheet">
      <style>
          .grievance-form input,
          .grievance-form select{
          	width: 100%;
          	height: 30px;
          }
          .grievance-form input[type="checkbox"]{
          	width: 5%;
          	height: 15px;
          }
          .grievance-form textarea{
          	width: 100%;
          	height: 140px;
          }

      </style>
  </head>
  <body>
 
<div class="wrapper">


<div class="body-overlay"></div>


        <!-- Sidebar  -->
        <nav id="sidebar">
            <div class="sidebar-header">
                <h3><span>dgrc</span></h3>
            </div>
            <ul class="list-unstyled components">
			<li  class="active">
                    <a href="index.php" class="dashboard"><i class="material-icons">dashboard</i><span>Dashboard</span></a>
                </li>
		
		      <div class="small-screen navbar-display">
                <li class="dropdown d-lg-none d-md-block d-xl-none d-sm-block">
                    <a href="#homeSubmenu0" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">
					<i class="material-icons">person</i><span>User</span></a>
                    <ul class="collapse list-unstyled menu" id="homeSubmenu0">
                        <li>
                        <a href="#">Profile</a>
                        </li>
                        <li>
                        <a href="#">Update Password</a>
                        </li>
                        <li>
                            <a href="logout.php">Logout</a>
                        </li>
                    </ul>
                </li>
				
				</div>
			
			
                <li class="dropdown">
                    <a href="#homeSubmenu1" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">
					<i class="material-icons">aspect_ratio</i><span>Grievance Registration</span></a>
                    <ul class="collapse list-unstyled menu" id="homeSubmenu1">
                        <li>
                            <a href="add-grievance.php">Add Grievance</a>
                        </li>
                        <li>
                            <a href="All Grievance">All Data</a>
                        </li>
                        
                    </ul>
                </li>
                
                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>Upload Evidence</span></a>
                </li>
                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>View Status</span></a>
                </li>
                
                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>Reminder</span></a>
                </li>
                
                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>Grievance Enquery</span></a>
                </li>

                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>Contact Rrport</span></a>
                </li>
                <li class="">
                    <a href="#"><i class="material-icons">date_range</i><span>Logout</span></a>
                </li>

               
            </ul>

           
        </nav>
		
		

        <!-- Page Content  -->
        <div id="content">
		
		<div class="top-navbar">
            <nav class="navbar navbar-expand-lg">
                <div class="container-fluid">

                    <button type="button" id="sidebarCollapse" class="d-xl-block d-lg-block d-md-mone d-none">
                        <span class="material-icons">arrow_back_ios</span>
                    </button>
					
					<a class="navbar-brand" href="#"> Dashboard </a>
					
                    <button class="d-inline-block d-lg-none ml-auto more-button" type="button" data-toggle="collapse"
					data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="material-icons">more_vert</span>
                    </button>

                    <div class="collapse navbar-collapse d-lg-block d-xl-block d-sm-none d-md-none d-none" id="navbarSupportedContent">
                        <ul class="nav navbar-nav ml-auto">   
                            <li class="dropdown nav-item active">
                                <a href="#" class="nav-link" data-toggle="dropdown">
                                   <span class="material-icons">person</span>
                               </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="#">Profile</a>
                                    </li>
                                    <li>
                                        <a href="#">Update Password</a>
                                    </li>
                                    <li>
                                        <a href="logout.php">Logout</a>
                                    </li>
                                  
                                </ul>
                            </li>
                            
                        </ul>
                    </div>
                </div>
            </nav>
	    </div>
			
			
			<div class="main-content">
			<div class="container pt-3 pb-5">
				<form method="post">
					<div class="grievance-form">
						<div class="row">
							<div class="col-md-12 col-lg-12 col-sm-12 col-12">
								<h4 class="text-center text-danger"><b>Grievance Registration Form</b></h4>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Mode of Complaint*</label>
								<select name="t20" id="t20">
									<option></option>
									<?php
										$mode_display="SELECT * FROM complaint_mode";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['mode']; ?>"><?php echo $row['mode']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="t20-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Nature of Call*</label>
								<select name="t21" id="t21">
									<option></option>
									<?php
										$mode_display="SELECT * FROM call_nature";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['nature']; ?>"><?php echo $row['nature']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="t21-error" class="text-danger"></span>
							</div>
							<div class="col-md-12 col-lg-12 col-sm-12 col-12">
								<h4 class="text-danger">Complainant Information:</h4>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Mobile Number*</label>
								<input type="text" name="t1" id="t1" >
								<span id="t1-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Alternate Mobile Number</label>
								<input type="text" name="t4" id="t4">
								<span id="t4-error" class="text-danger"></span>
							</div>
							<div class="col-md-4 col-lg-4 col-sm-12 col-12">
								<label>First Name*</label>
								<input type="text" name="ta2" id="ta2" >
								<span id="ta2-error" class="text-danger"></span>
							</div>
							<div class="col-md-4 col-lg-4 col-sm-12 col-12">
								<label>Middle Name</label>
								<input type="text" name="tb2" id="tb2" >
								<span id="tb2-error" class="text-danger"></span>
							</div>
							<div class="col-md-4 col-lg-4 col-sm-12 col-12">
								<label>Last Name*</label>
								<input type="text" name="tc2" id="tc2" >
								<span id="tc2-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Father’s/Husband/Mother’s Name</label>
								<input type="text" name="t3" id="t3">
								<span id="t3-error" class="text-danger"></span>
							</div>
							
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Email ID</label>
								<input type="email" name="t5" id="t5">
								<span id="t5-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Gender*</label>
								<select name="t6" id="t6">
									<option value="Male">Male</option>
									<option value="Female">Female</option>
									<option value="Other">Other</option>
								</select>
								<span id="t6-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Aadhar Number</label>
								<input type="text" name="t7" id="t7">
								<span id="t7-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>District*</label>
								<select name="t8" id="t8">
									<option value="Male">Ranchi</option>
								</select>
								<span id="t8-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Occupation</label>
								<input type="text" name="t9" id="t9">
								<span id="t9-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Area*</label>
								<select name="t10" id="t10">
									<option></option>
									<option value="Urban">Urban</option>
									<option value="Rural">Rural</option>
								</select>
								<span id="t10-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Municipality*</label>
								<select name="t11" id="t11">
									<option></option>
								</select>
								<span id="t11-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Block*</label>
								<select name="t12" id="t12">
									<option></option>
									<?php
										$mode_display="SELECT * FROM blocks";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="t12-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Panchayat*</label>
								<select name="t13" id="t13">
									<option></option>
									<?php
										$mode_display="SELECT * FROM panchayat";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="t13-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Village*</label>
								<select name="vill" id="vill">
									<option></option>
								</select>
								<span id="vill-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Ward*</label>
								<select name="t15" id="t15">
									<option></option>
								</select>
								<span id="t15-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Land Mark / Tolla</label>
								<input type="text" name="t16" id="t16">
								<span id="t16-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Police Station</label>
								<select name="t17" id="t17">
									<option></option>
									<option value="mithun">Mithun</option>
								</select>
								<span id="t17-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Vidhan Sabha</label>
								<select name="t18" id="t18">
									<option></option>
									<option value="mithun">Mithun</option>
								</select>
								<span id="t18-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Lok Sabha</label>
								<select name="t19" id="t19">
									<option></option>
									<option value="mithun">Mithun</option>
								</select>
								<span id="t19-error" class="text-danger"></span>
							</div>

							<!----Complanent Address-------->

							<div class="col-md-12 col-lg-12 col-sm-12 col-12">
								<h4 class="text-danger">Complaint Location:</h4>
							</div>
							<div class="col-md-12 col-lg-12 col-sm-12 col-12">
								<input type="checkbox" name="grievance-data" id="grievance-data">
								<span>If same as complainant location, click on Yes</span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Area*</label>
								<select name="c1" id="c1">
									<option></option>
									<option value="Urban">Urban</option>
									<option value="Rural">Rural</option>
								</select>
								<span id="c1-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Municipality*</label>
								<input type="text" name="c2" id="c2">
								<span id="c2-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Block*</label>
								<select name="c3" id="c3">
									<option></option>
									<?php
										$mode_display="SELECT * FROM blocks";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="c3-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Panchayat*</label>
								<select name="c4" id="c4">
									<option></option>
									<?php
										$mode_display="SELECT * FROM panchayat";
										$mode_query=mysqli_query($con,$mode_display);
										while ($row=mysqli_fetch_assoc($mode_query)) {
									?>
										<option value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></option>
									<?php
										}

									?>
								</select>
								<span id="c4-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Village*</label>
								<input type="text" name="c5" id="c5">
								<span id="c5-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Ward*</label>
								<input type="text" name="c6" id="c6">
								<span id="c6-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Land Mark / Tolla</label>
								<input type="text" name="c7" id="c7">
								<span id="c7-error" class="text-danger"></span>
							</div>
							
							<div class="col-md-12 col-lg-12 col-sm-12 col-12">
								<label>Grievance Description*</label>
								<textarea name="t22" id="t22"></textarea>
								<span style="float: right;" class="text-danger">max-1000 words</span>
								<span id="t22-error" class="text-danger"></span>
							</div>
							<div class="col-md-6 col-lg-6 col-sm-12 col-12">
								<label>Evidence/Supporting Document*</label>
								<input type="file" name="t23" id="t23">
								<span id="t23-error" class="text-danger"></span>
							</div>
							
						<div class="col-md-12 col-lg-12 col-sm-12 col-12 mt-3">
							<button type="submit" id="add-grievance" class="form-control btn-success">Submit</button>
						</div>
					</div>
					</div>
				</form>
			</div>

			</div>
        </div>
    </div>

     <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
   <script src="js/jquery-3.3.1.slim.min.js"></script>
   <script src="js/popper.min.js"></script>
   <script src="js/bootstrap.min.js"></script>
   <script src="js/jquery-3.3.1.min.js"></script>
   <script src="js/grievance-validation.js"></script>
   <script src="js/grievance-register.js"></script>
  
  
  <script type="text/javascript">
  	$('#t11').on('change',function(){
	  var services_id = this.value;
	  // console.log(services_id);
	  $.ajax({
	    url: 'load-urbanward.php',
	    type: 'post',
	    data: { s_id:services_id },
	    success: function(data){
	      $('#c6').html(data);
	      // console.log(data);
	    }
	  });

	});

	$('#c2').on('change',function(){
	  var uservices_id = this.value;
	  // console.log(services_id);
	  $.ajax({
	    url: 'load-urbanward.php',
	    type: 'post',
	    data: { u_id:uservices_id },
	    success: function(data){
	      $('#c6').html(data);
	      // console.log(data);
	    }
	  });

	});

  $(document).ready(function () {
        $('#sidebarCollapse').on('click', function () {
            $('#sidebar').toggleClass('active');
    		$('#content').toggleClass('active');
        });
    	
    	 $('.more-button,.body-overlay').on('click', function () {
            $('#sidebar,.body-overlay').toggleClass('show-nav');
        });
    	
    });

     
</script>

</body>

</html>


