<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
function export_data(id)
{
      
        var url = "<?php echo site_url('userdata/export_data');?>"+'/'+'0'+'/'+id;
        console.log(url);
        window.location = url;
    
} 

function editForm(id)
  {
    $(this).hide();
    $('#txtBox'+id).show();
  }
  function test(id)
          {
            console.log($('#txtBox'+id).val())
            var val,type,data
            $('#txtBoxValue').text($('#txtBox'+id).val()).show();
            $('#txtBox'+id).hide();
            type  =   'type='+id;
            data  =   $('#txtBox'+id).val();
            if(id == 1 )  val   = 'name='+data;
            if(id == 2 )  val   = 'address='+data;
            
            updateData(val,type,id)
          }
  function updateData(val,type,id)
    {
      var FAMILY_ID = '<?php echo $FAMILY_ID; ?>';
      $.ajax({
            type: "GET",
            url: "<?php echo site_url('userdata/survey_update')?>",
            data: "FAMILY_ID="+FAMILY_ID+"&"+val+"&"+type,
            success: function(msg){
              if(msg == 1){
              var url = '<?php echo site_url('login'); ?>';
              //window.location.href = url;
            }else
            {
              var url = '<?php echo site_url(); ?>';
              //window.location.href = url;
            }
            }
          });
    }
    function getImage(image)
      {
        $('#getImage').modal('show'); 
      }
	  
	  
</script>
<style type="text/css">
  .pull-left {
  float: right!important;
  padding: 15px;
}
.col-md-6{
  border: 1px solid #DAECF0;
  margin: 10px;
  width: 48% !important
}
.imgPic{
  width: 152px;
}
.imgPic1{
  width: 139px;
}
p{
  text-transform: uppercase;
}
.input_txt{
  float: right;
    width: 50%;
}
</style>
<?php

//echo '<pre>';print_r($district);die;
$latitude = json_decode($family_details->latitude);
$longitude = json_decode($family_details->longitude);
$is_exist_member = $family_details->is_exist_member;
	if($is_exist_member == 1)
		{
			$exists = 'അതെ';
		}
	else	
		{
			$exists = 'അല്ല';
		}
  ?>

<div class="container container-fluid table widget" id="page-wrapper">
  
  <div class="row">
    <div class="col-md-12">
    <!-- <div class="pull-left" style="margin-bottom:10px;">
        <input type="button" name="export" id="export" value="Export" class="btn btn-primary" style=""  onClick="javascript:export_data(<?php echo $id;?>);"> 
        </div> -->
        
 
    </div>
  </div>  
  <div class="row">
  
    <div class="col-md-12">
   <!-- <div class="pull-right" style="margin-bottom:10px;">
        <a  class="btn btn-default btn-sm" href="<?php echo site_url('print_application/'.$FAMILY_ID)?>">
        <i class="fa fa-print " aria-hidden="true"></i> Print Application</a>
        </div> -->
    <h4 class="main_txt">ആശ്രയ പദ്ധതി </h4>
    <h5 class="sub_txt"><u>കുടുംബ അവലോകന ഫോറം</u></h5>
	<?php //echo $district . '/' . $block . '/' .$CDS ;
	if(!empty($district)){ echo '<p>District - '.$district.'</p>';}
	if(!empty($block)){ echo '<p>Block - '.$block.'</p>';}
	if(!empty($CDS)){ echo '<p>CDS - '.$CDS.'</p>';}
	
	?>
	<hr>
    <br><br>
    <?php
    	
    $place_category = $family_details->place_category;
    if($place_category == 1) {$p_cate = 'Rural';}
    else {$p_cate = 'Urban';}
    $category = $family_details->category;
    if($category == 1) {$cate = 'SC';}
    if($category == 2) {$cate = 'ST';}
    if($category == 3) {$cate = 'General ( ' . $family_details->general_specify . ' )';}
    if($category == 0) {$cate = '-NA-';}

    $ration_card = $family_details->ration_card;
    if($ration_card == 1) {$card = 'yes';}
    else {$card = 'No';}

    $ayal_type = $family_details->ayalkootam_member;
    if($ayal_type == 1) {$ayal_mem = 'yes';}
    else {$ayal_mem = 'No';}

    $old_stay = $family_details->oldage_home_stay;
    if($old_stay == 1) {$old_mem = 'yes';}
    else {$old_mem = 'No';}

    $profile_pic = $family_details->profile_pic;
    $familyIID 	= $family_details->dist_code;
	if(isset($familyIID) && !empty($familyIID))
	{
		$familyIID 	= $family_details->dist_code;
	}else{
		$familyIID 	= '';
	}
	
    ?>
    <div class="pull-right">
    <?php if(isset($profile_pic) && $profile_pic !='' && file_exists('uploads/'.$profile_pic)){?>
      <img class="imgPic" src="<?php echo base_url('uploads/'); ?><?php echo $family_details->profile_pic;?>"/>
    <?php } else {?>
    <img class="imgPic1" src="<?php echo base_url('images/dummy_img.jpeg'); ?>"/>
    <?php } ?>  
    </div>
    <p>നിലവിൽ പദ്ധതിയിൽ ഉൾപ്പെട്ട ആൾ ആണോ ?  : <b><?php echo $exists; ?></b></p>
    <p>Family ID  : <b><?php echo $familyIID; ?></b></p>
    <p>ഗ്രാമ പഞ്ചായത്ത് / നഗരസഭാ  :<u><?php echo $p_cate; ?></u></p>
    <p>വിലയിരുത്തൽ തിയതി :<u><?php echo $family_details->suvey_date; ?></u></p>
    <p>1.കുടുംബനാഥ(ൻ) യുടെ പേര്  : <u><?php echo strip_tags($family_details->name); ?></u></p>
    <p>2.മേൽവിലാസം :<u><?php echo strip_tags($family_details->address); ?></u></p>    
    <p>3.വിഭാഗം  :<u><?php echo $cate;?></u></p>
    <p>4.വില്ലജ്   :<u><?php echo $family_details->village; ?></u></p>
    <p>5.വാർഡ് നമ്പർ , വീട് നമ്പർ    :<u><?php echo $family_details->ward_no; ?></u> , <u><?php echo $family_details->house_no; ?></u></p>
    <p>6.കുടുംബത്തിലെ ആകെ ആംഗങ്ങൾ     :<u><?php echo $family_details->family_members; ?></u></p>
    <p>7.റേഷൻ കാർഡ് ഉണ്ടോ ?  :<u><?php echo $card; ?></u></p>
    <?php if($card == 'yes'){?>
    <p>എ).റേഷൻ കാർഡ് നമ്പർ  :<u><?php echo $family_details->ration_card_no; ?></u></p>
    <p>ബി).റേഷൻ ഷോപ് നമ്പർ   :<u><?php echo $family_details->ration_shop_no; ?></u></p>
    <p>സി).റേഷൻ കാർഡ് കളർ    :<u><?php echo $ration_color; ?></u></p>
    <?php }?>
    <p>8.ഭൂമി</p>
	<?php  
	if($family_details->land == 2){echo $ans='No';}else {$ans='Yes';};
	?>
    <p>എ).സ്വന്തമായി ഭൂമി ഉണ്ടോ    ?  :<u><?php echo $ans; ?></u></p>
    <p>ബി).ഉണ്ടെങ്കിൽ  എത്ര  സെന്റ്  ?  :<u><?php echo $family_details->land_cent; ?></u></p>
    <p>9.കുടുംബശ്രീ അയൽക്കൂട്ടത്തിൽ അംഗംമാനോ  ? <u><?php echo $ayal_mem; ?></u></p>
    <?php if($ayal_mem == 'yes'){?>
    <p>എ).അയൽക്കൂട്ടത്തിന്റെ  പേരു  ?  :<u><?php echo $family_details->ayalkootam_name; ?></u></p>
    <p>ബി).ഉൾപ്പെടുന്ന വാർഡ് നമ്പർ      ?  :<u><?php echo $family_details->ayalkootam_ward_no; ?></u></p>
    <?php }?>
    <p>10.അഗതിമന്ദിരത്തിൽ താമസിക്കാൻ തയാറാണോ :<u><?php echo $old_mem; ?></u></p>
    
    </div> 
<div class="modal fade" id="getImage" role="dialog">
    <div class="modal-dialog">   
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title"><?php echo $family_details->name;?></h4>
        </div>
        <div class="modal-body no_die">
          <p>  
          <?php
          $profile_pic = $family_details->profile_pic;
          if(isset($profile_pic) && $profile_pic !='' && file_exists('uploads/'.$profile_pic)){
         $temp = explode(".", $profile_pic);

           $filename1 = $temp[0]."_thumb.".$temp[1];?>
         <img class="imgPic" src="<?php echo base_url('uploads/'); ?><?php echo $profile_pic;?>"/>
         <?php }else{ ?>
          <img class="imgPic1" src="<?php echo base_url('images/dummy_img.jpeg'); ?>"/>
         <?php } ?>
</p>

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
</div>
<?php if(isset($member_details) && !empty($member_details)){ 
 
    ?>


<div class="col-md-12">
<h4>Family Member</h4>
<div class="rTable">
<div class="rTableRow">
<div class="rTableHead mem">Name</div>
<div class="rTableHead mem">Gender</div>
<div class="rTableHead mem">Age</div>
<div class="rTableHead mem">Relation</div>
<div class="rTableHead mem">Job</div>
<div class="rTableHead mem">Physical Condition</div>
<div class="rTableHead mem">Pension</div>
<div class="rTableHead mem">Monthly Income</div>
<div class="rTableHead mem">Aadhar No </div>
<div class="rTableHead mem">Remarks </div>
<div class="rTableHead mem"></div>

</div>

<?php if(isset($member_details) && !empty($member_details)){ 
  $k=1;
  foreach($member_details as $each_member){
  $male = '<i class="fa fa-mars" aria-hidden="true"></i>'; 
  $female = '<i class="fa fa-venus" aria-hidden="true"></i>'; 
  $others = '<i class="fa fa-transgender" aria-hidden="true"></i>'; 
    if($each_member['gender'] == 1){
      $gender = 'പുരുഷന്‍ '. $male;
    }
    if($each_member['gender'] == 2){
      $gender = 'സ്‌ത്രീ' . $female;
    }
    if($each_member['gender'] == 3){
      $gender = 'ഭിന്നലിംഗം' . $others;
    }
    if($each_member['physical_condition'] == 1){
      $phy_cond = 'മോശം';
    }else{
      $phy_cond = 'നല്ലത്';
    }
    if($each_member['pension'] == 1){
      $pension = 'ഉണ്ട്';
    }else{
      $pension = 'ഇല്ല';
    }
    if(!empty($each_member['monthly_income'])){
      $img = '<i class="fa fa-inr" aria-hidden="true"></i>';
      $income = $img.' '.$each_member['monthly_income'];
    }else{
      $income ='-';
    }
    ?>
<div class="rTableRow">
<div class="rTableCell mem"><?php echo ' ('. $k .') ' .  $each_member['member_name']; ?></div>
<div class="rTableCell mem"><?php echo $gender; ?></div>
<div class="rTableCell mem"><?php echo $each_member['age'] . ' Yrs'; ?></div>
<div class="rTableCell mem"><?php echo $each_member['relation']; ?></div>
<div class="rTableCell mem"><?php echo $each_member['job_title']; ?></div>
<div class="rTableCell mem"><?php echo $phy_cond; ?></div>
<div class="rTableCell mem"><?php echo $pension; ?></div>
<div class="rTableCell mem"><?php echo $income; ?></div>
<div class="rTableCell mem"><?php echo $each_member['aadhar_no']; ?></div>
<div class="rTableCell mem"><?php echo $each_member['remarks']; ?></div>
<div class="rTableCell mem">
<?php if($each_member['physical_condition'] ==1)//1-have issue
                { ?>
<button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#showDiseases_<?php echo $k;?>">
<i class="fa fa-user-md" aria-hidden="true"></i></button>
<?php } else {?>
<button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#noDiseases">
<i class="fa fa-user-md" aria-hidden="true"></i></button>
<?php } ?>
</div>

</div>

<div class="modal modal-wide fade" id="showDiseases_<?php echo $k;?>" role="dialog">
    <div class="modal-dialog">    
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title"><?php echo $each_member['member_name'];?></h4>
        </div>
        <div class="modal-body">
          <div class="rTable">
            <div class="rTableRow">
            <div class="iss_head_1"><strong>Question</strong></div>
            <div class="iss_head_2"><strong>Answer</strong></div>
            </div>
            <?php
            $j=1;
            $y = 'ഉണ്ട്';
            $n= 'ഇല്ല';
            foreach ($each_member['diseases'] as $key => $diseases) 
              { ?> 
                <div class="rTableRow">
                <div class="question"><?php echo ' ('. $j .') ' .  $diseases['questions']; ?></div>
                <div class="answer"><?php if($diseases['answer'] == 2 ) {echo $n; } else {echo $y;}?></div>
                </div>
            <?php $j++;} ?>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
</div>
<?php $k++;} } }?>

<div class="modal fade" id="noDiseases" role="dialog">
    <div class="modal-dialog">   
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title"><?php echo $each_member['member_name'];?></h4>
        </div>
        <div class="modal-body no_die">
          <p><h4>No diseases found ! </h4></p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
</div>





</div>
  
</div>
<?php if(isset($services) && !empty($services)){
	//echo '<pre>';print_r($services);
	foreach($services as $eachServe){
		//echo $eachServe['member_name'];
	?>
<div class="col-md-12">
      <label class="control-label"></label>
      <p class="help-block"><small>Services Needed</small></p><hr>
      <div class="col-md-4"><?php if(isset($eachServe['member_name']) && $eachServe['member_name'] !='' && $eachServe['member_name'] !='0'){?>
          Name : <?php echo $eachServe['member_name']; ?><br>
          <?php } ?>
		  <?php if(isset($eachServe['address']) && $eachServe['address'] !='' && $eachServe['address'] !='0'){?>
          Address : <?php echo $eachServe['address']; ?><br>
          <?php } ?></div>
      <div class="pull-right"><?php if(isset($eachServe['age']) && $eachServe['age'] !='' && $eachServe['age'] !='0'){?>
          Age : <?php echo $eachServe['age']; ?><br>
          <?php } ?>
		  <?php if(isset($eachServe['gender']) && $eachServe['gender'] !='' && $eachServe['gender'] !='0'){?>
          Gender : <?php if($eachServe['gender'] == 1) echo 'Female'; else echo 'Male'; ?><br>
          <?php } ?></div>    
      
  
<div class="rTable">
<div class="rTableRow">
<div class="rTableHead"><strong>Services Needed</strong></div>
<div class="rTableHead"><span style="font-weight: bold;">Yes / No</span></div>
<div class="rTableHead">Amount</div>
</div>
<div class="rTableRow">
<div class="rTableCell">Food</div>
<div class="rTableCell"><?php if($eachServe['food'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['food_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Medical</div>
<div class="rTableCell"><?php if($eachServe['medical'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['medical_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Dress</div>   
<div class="rTableCell"><?php if($eachServe['dress'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['dress_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">House</div>
<div class="rTableCell"><?php if($eachServe['home'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['home_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Land</div>
<div class="rTableCell"><?php if($eachServe['land'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['land_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Water</div>
<div class="rTableCell"><?php if($eachServe['water'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['water_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Job</div>
<div class="rTableCell"><?php if($eachServe['job'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['job_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Pension</div>
<div class="rTableCell"><?php if($eachServe['pension'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['pension_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Education</div>
<div class="rTableCell"><?php if($eachServe['education'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['education_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Service Needed</div>
<div class="rTableCell"><?php if($eachServe['service_needed'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['service_amt'];?></div>
</div>

<div class="rTableRow">
<div class="rTableCell">Toilet</div>
<div class="rTableCell"><?php if($eachServe['toilet'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['toilet_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">House Modification</div>
<div class="rTableCell"><?php if($eachServe['house_modification'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['house_modification_amt'];?></div>
</div>
<div class="rTableRow">
<div class="rTableCell">Electrification</div>
<div class="rTableCell"><?php if($eachServe['electrification'] == 1) { echo $yes= '<i class="fa fa-check" aria-hidden="true"></i>';}else {echo $no= '<i class="fa fa-times" aria-hidden="true"></i>';}?></div>
<div class="rTableCell"><?php echo $eachServe['electrification_amt'];?></div>
</div>

</div>

    </div> 
<?php } }?>
<?php if(isset($issues) && !empty($issues) ){?>
<div class="col-md-12">
      <label class="control-label"></label>
      <h4>Family Issues</h4>

<div class="rTable">
<div class="rTableRow">
<div class="iss_head_1"><strong>Questions</strong></div>
<div class="iss_head_2"><span style="font-weight: bold;">Answer</span></div>
</div>
<?php 
$y = 'ഉണ്ട്';
$n= 'ഇല്ല';
//if($is['answers'] == 2 ) {echo $y; } else {$n;}
$q=1;foreach ($issues as $is) { ?>
<div class="rTableRow">
<div class="question"><?php echo ' ('. $q .') ' .  $is['questions'];?></div>
<div class="answer"><?php if($is['answers'] == 2 ) {echo $n; } else {echo $y;}?></div>
</div>
<?php $q++;} ?>

</div>

          
    </div> 
<?php } ?>




<p>Route Map</p>
<div>
  <div id="dvMap" class="map-container">
</div>




  </div>   
</div>
<!-- AIzaSyC_s_-4o7wXYyAFzEE8to8dE8qydkkTBgE -->

<script type="text/javascript">

      var latitude,longitude,lat,lo;
      latitude      =   '<?php echo $family_details->latitude;?>'
      longitude     =   '<?php echo $family_details->longitude;?>'
      var res1      =   latitude.replace("[", latitude);
      var res       =   res1.replace("]", res1);
      var lat_array =   latitude.split(',');
      var log_array =   longitude.split(',');
      var markers   =   []
      var item,lt,lg

     
      for(lat = 0; lat < lat_array.length; lat++)
      {
          lt    =   lat_array[lat].replace("[", '');
          lt    =   lt.replace("]", '');
          lg    =   log_array[lat].replace("]", '');
          lg    =   lg.replace("[", '');
          if(lt!='' && lg != '')
            {
              item  =   {'lat':lt,'lng':lg} ;
              markers.push(item);
            }                
      }    

    console.log(markers)
    window.onload   = function () {
      if(markers.length >=1){
      loadGoogleMap()
    }
    }
    function loadGoogleMap()
      {

    var lat_count   = lat_array.length;
    var mapOptions  = {
            center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
            zoom: 5,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            disableDefaultUI: true
        };

        var map           = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
        var infoWindow    = new google.maps.InfoWindow();
        var lat_lng       = new Array();
        var latlngbounds  = new google.maps.LatLngBounds();
        for (i = 0; i < markers.length; i++)
        {
            var data      = markers[i]
            var myLatlng  = new google.maps.LatLng(data.lat, data.lng);
            lat_lng.push(myLatlng);
            var marker    = new google.maps.Marker({
                position: myLatlng,
               // map: map,
                //title: data.title
            });
            latlngbounds.extend(marker.position);
            (function (marker, data) 
            {
                google.maps.event.addListener(marker, "click", function (e) 
                {
                    infoWindow.setContent(data.description);
                    infoWindow.open(map, marker);
                });
            })(marker, data);
        }
        map.setCenter(latlngbounds.getCenter());
        map.fitBounds(latlngbounds);
 
        //***********ROUTING****************//
 
        //Initialize the Path Array
        var path = new google.maps.MVCArray();
 
        //Initialize the Direction Service
        var service = new google.maps.DirectionsService();
 
        //Set the Path Stroke Color
        var poly = new google.maps.Polyline({ map: map, strokeColor: '#4986E7' });
 
        //Loop and Draw Path Route between the Points on MAP
        for (var i = 0; i < lat_lng.length; i++) {
            if ((i + 1) < lat_lng.length) {
                var src = lat_lng[i];
                var des = lat_lng[i + 1];
                path.push(src);
                poly.setPath(path);
                service.route({
                    origin: src,
                    destination: des,
                    travelMode: google.maps.DirectionsTravelMode.DRIVING
                }, function (result, status) {
                    if (status == google.maps.DirectionsStatus.OK) {
                        for (var i = 0, len = result.routes[0].overview_path.length; i < len; i++) {
                            path.push(result.routes[0].overview_path[i]);
                        }
                    }
                });
            }
        }
      }
</script>

    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC_s_-4o7wXYyAFzEE8to8dE8qydkkTBgE">
    </script>









<style type="text/css">
.map-container {
    width:  300px;
    height: 300px;
    margin: .4rem;;
}
#map {
        height: 100%;
      }
.rTable {
    display: block;
    width: 100%;
}
.rTableHeading, .rTableBody, .rTableFoot, .rTableRow{
    clear: both;
}
.rTableHead, .rTableFoot{
    background-color: #DDD;
    font-weight: bold;
}
.rTableCell, .rTableHead {
    border: 1px solid #999999;
    float: left;
    height: 25px;
    overflow: hidden;
    padding: 1px 4.8%;
    width: 30%;
}
.rTable:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
}
.fa-times{
      color: #3ec33e;
}
.fa-check{
  color: #e65050;
}
.question {
  border: 1px solid #999999;
    float: left;
    height: 25px;
    overflow: hidden;
    padding: 1px 0.8%;
    width: 85%;
}
.answer{
  border: 1px solid #999999;
    float: left;
    height: 25px;
    overflow: hidden;
    padding: 1px 4.8%;
    width: 15%;
}
.iss_head_1{
  border: 1px solid #999999;
    float: left;
    height: 25px;
    overflow: hidden;
    padding: 1px 0.8%;
  width: 85% !important
}
.iss_head_2{
  border: 1px solid #999999;
    float: left;
    height: 25px;
    overflow: hidden;
    padding: 1px 4.8%;
  width: 15% !important
}
.mem{
      border: 1px solid #999999;
    float: left;
    height: 34px;
    overflow: hidden;
    padding: 1px 0.8%;
    width: 9%;
    font-size: smaller;
}
.bmem{
      border: 1px solid #999999;
    float: left;
    height: 34px;
    overflow: hidden;
    padding: 1px 0.8%;
    width: 6%;
    font-size: smaller;
}
.modal.modal-wide .modal-dialog {
  width: 100%;
}
.no_die{
  color: #048404;
    font-weight: bold;
    text-align: center;
}
.main_txt{
  color: #852771;
    font-weight: bold;
    text-align: center;
}
.sub_txt{
  color: #852771;
    text-align: center;
}
</style>