<?php $__env->startSection('content'); ?> 
	
	<script>
	 function getAppDetailsById()
	  {
	  	  var AppUserID=$('#AndroidAppUser').val();
	  	  $.ajax({
	            type: "GET",
	            url: "getAppDetailsById",
	            data:"AppUserID="+AppUserID,
	            dataType: "json",
	            success: function(result){
	                $.each(result, function(id, value) {
	                	$("#AndroidAppName").val(value.Name);
	                	$("#MobileNumber").val(value.MobileNumber);
                     $("#Address").val(value.Address);
                    $("#DOB").val(value.DateOfBirth);
                    $("#WhatsappNumber").val(value.WhatsAppNumber);
                    $("#Email").val(value.Email);
                    $("#BloodGroup").val(value.BloodGroup);
                    $("#Cast").select2('val',value.CastId);
                    // Get Booth Name By Id
	              });
	            }
	       });
	  }
	</script>
 <div class="qv rc sm sp" style="margin-top:3%;">
        <div class="qw">
            <?php if(Session::has('Name')): ?> 
              <span style="margin-left:70px;"> <strong> कार्यकर्ता अनब्लॉक करा</strong> </span>
              <span style="margin-top:-7px;margin-left:55%;">Welcome, <?php echo e(Session::get('Name')); ?>

              <a href='dashboard' class='cg ts fx green' style="margin-left:80px;"> Go To Dashboard </a>
          <?php endif; ?>
        </div>
  </div>

 <div class="by amt" style="margin-top:-30px;">
    <div class="gc">
      <div class="gz"> 
        <div class="ca qo anx">
          <div class="qf b aml" style="width:170%;margin-left:20%;">
               <form id="EnableAndroidAppForm" action="EnableApp" role="form" style="margin-top:20px;">
                   <div class="row">
                      <div class="col-lg-3"></div>
                          <div class="col-lg-6">
                            <!-- Errors And Success Messages -->
                             <?php if(count($errors)>0): ?>
                              <div class="alert alert-danger">
                                <ul>
                                  <?php foreach($errors->all() as $error): ?>
                                    <li> <strong><font color="red" > <?php echo e($error); ?> </font> </strong></li>
                                    <p/>
                                  <?php endforeach; ?>
                                </ul>
                              </div>
                            <?php endif; ?>
                        </p>
                        	<?php if(Session::has('success')): ?>
                              <font color="green" > <?php echo e(Session::get('success')); ?> </font>
                              <p/>
                            <?php endif; ?>

                            <?php if(Session::has('error')): ?>
                              <font color="red" > <?php echo e(Session::get('error')); ?> </font>
                              <p/>
                            <?php endif; ?>
                          </div>
                          <div class="col-lg-3"></div>
                   </div>
              <div class="row">
    					  <div class="col-lg-12">
			             		<div class="col-lg-8">
			             			<select id="AndroidAppUser" name="AndroidAppUser" onchange="getAppDetailsById()" class="form-control">
			             				<option value=""> कार्यकर्ता निवडा  </option>
										            <?php foreach($AppUsers as $AppUser): ?>
			                          	<option value="<?php echo e($AppUser->AppUserID); ?>"> <?php echo e($AppUser->Name); ?>  </option>
			                          <?php endforeach; ?>
			                  </select>
			             		</div>
			             	</div>
                   </div>
			             	<div class="row" style="margin-top:15px;">
                          <div class="col-lg-12">                        
      			             		<div class="col-lg-4">
      			             			<input type="text" name="AndroidAppName" id="AndroidAppName" class="form-control" placeholder="नाव"readonly>
      			             		</div>
      			             		<div class="col-lg-4">
      			             			<input type="text" name="MobileNumber" id="MobileNumber" class="form-control" placeholder=" मोबाईल नंबर " readonly>
      			             		</div>
                             <div class="col-lg-4">
                                <input type="text" name="Email" id="Email" class="form-control" placeholder=" ईमेल" readonly>
                              </div>
                          </div>
			             	</div>
                    <div class="row" style="margin-top:20px;" >
                            <div class="col-lg-12">
                              <div class="col-lg-4">
                                <input type="text" name="WhatsappNumber" id="WhatsappNumber" class="form-control" placeholder=" व्हॉट्सअप नंबर" readonly>               
                              </div>                              
                              <div class="col-lg-4">
                                <div class="date">
                                  <div class="input-group input-append date" id="datePicker1">
                                    <input type="text" class="form-control" name="DOB" id="DOB" placeholder="जन्म तारीख" readonly/>
                                    <span class="input-group-addon add-on"><span class="glyphicon glyphicon-calendar"></span></span>
                                  </div>
                                </div>
                              </div>
                              <div class="col-lg-4">
                                 <textarea  name="Address" id="Address" class="form-control" placeholder=" पत्ता " readonly></textarea>
                              </div>
                            </div>
                       </div>
                     <div class="row" style="margin-top:15px;">
                          <div class="col-lg-12">
                              <div class="col-lg-3">
                                <select id="BloodGroup" name="BloodGroup" class="form-control">
                                  <option value=""> रक्तगट निवडा  </option>
                                  <option value="O+"> O+ </option>
                                  <option value="A+"> A+ </option>
                                  <option value="B+"> B+ </option>
                                  <option value="AB+"> AB+ </option>
                                  <option value="O-"> O- </option>
                                  <option value="A-"> A- </option>
                                  <option value="B-"> B- </option>
                                  <option value="AB-"> AB- </option>
                                </select>
                              </div>
                              <div class="col-lg-3">
                                <select id="Cast" name="Cast" class="form-control">
                                  <option value=""> जात निवडा </option>
                                  <?php foreach($Casts as $Cast): ?>
                                    <option value="<?php echo e($Cast->CastId); ?>"> <?php echo e($Cast->CastName); ?>  </option>
                                  <?php endforeach; ?>
                                </select>
                              </div>
                              <div class="col-lg-3"></div>
                            </div>
                          </div>
			             	    <div class="row" style="margin-top:15px;">
		                       <div class="col-lg-6">                      
		                          <input type="submit" value="अनब्लॉक करा" class="cg fp"> &nbsp;&nbsp;&nbsp;
		                          <input type="reset" value="रद्द करा" class="fy cg">
		                        </div>
		                       <div class="col-lg-3"></div>
		                    </div>
    		             </div>
    		         </div>
                </form>
            </div>
         </div>
      </div>

<script>
   $(document).ready(function() {
        $("#AndroidAppUser").select2();
        $("#Cast").select2();
     });

    $('#EnableAndroidAppForm')
        .formValidation({
            framework: 'bootstrap',
            icon: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            // This option will not ignore invisible fields which belong to inactive panels
            excluded: ':disabled',
            fields: {
                Districts: {
                    validators: {
                        notEmpty: {
                            message: 'The District is required'
                        }
                    }
                },
                Tehsils: {
                    validators: {
                        notEmpty: {
                            message: 'The Tehsil is required'
                        }
                    }
                },
                 CityOrVillage: {
                    validators: {
                        notEmpty: {
                            message: 'The City Or Village is required'
                        }
                    }
                },
                Booths: {
                    validators: {
                        notEmpty: {
                            message: 'The Booth is required'
                        }
                    }
                },
                AndroidAppName: {
                    validators: {
                        notEmpty: {
                            message: 'The Android App Name is required'
                        }
                    }
                },
                MobileNumber: {
                    validators: {
                        notEmpty: {
                            message: 'The Mobile Number is required'
                        }
                    }
                }
              }
        }).find('[name="MobileNumber"]').mask('9999999999');

      function validateTab(index) {

           var fv   = $('#EnableAndroidAppForm').data('formValidation'), // FormValidation instance
           // The current tab
           $tab = $('#EnableAndroidAppForm');

          // Validate the container
          fv.validateContainer($tab);

          var isValidStep = fv.isValidContainer($tab);
          if (isValidStep === false || isValidStep === null) {
              // Do not jump to the target tab
              return false;
          }
          return true;
      }

</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.votermainview', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>