<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>
        Survey Report
    </title>
        <!-- <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.6.0/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
   <link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
   <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script> -->

   <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

   
   <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
   <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
   <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

   <style>
    body{
        font-family: 'Times New Roman';
    }
    @media  print {
        @page  {
            size: A3 landscape;
        }

        /*.head_class{
                    position: fixed;
                    }*/
        .print_action {
            display: none ;
        }
        .page-break {
            page-break-after: always !important;
        }
    }
    .btn-primary,
    .btn-primary:hover {
        background-color: #008cba;
        border-color: #008cba;
    }

    /*button#dashboard {
                background-color: #008CBA;;
                padding:10px 24px;
                border:none;
                font-weight: bold;
                margin-top : 10px;
            }
            

            button#print {
                margin-top:-53px;
                margin-left: 180px;
                background-color: #008CBA;;
                padding:10px 24px;
                border:none;
                text-decoration:none;
                color:white;
                cursor:pointer;
                font-weight: bold;
                }*/

    .vertical-text {
        writing-mode: vertical-lr;
        /*transform: rotate(-180deg);*/
    }

    table {
        height: 300px;
        border-collapse: collapse;
        text-align: center;
    }

    .text-uppercase {
        text-transform: uppercase;
    }
    .heading {
        font-size: 20px;
        color: #000;
        font-weight: bold;
    }
    .sub-heading {
        font-size: 18px;
        color: #000;
        font-weight: bold;
    }
    .table td,
    .table th {
        padding: 4px;
    }
    .table td {
        vertical-align: middle;
         font-family: 'Times New Roman';
    }
    .table td,
    .table th {
        border-top: 1px solid #000;
         font-family: 'Times New Roman';
    }
    .table-bordered thead td,
    .table-bordered thead th {
        border-bottom-width: 1px;
    }
    .table-bordered td,
    .table-bordered th {
        border: 1px solid #000000;
    }
    .table thead th {
        border-bottom: 1px solid #000 !important;
    }
    *,
    ::after,
    ::before {
        box-sizing: content-box !important;
    }
    .row.px-3.pt-4.model *, .modal-dialog.modal-lg *{
      box-sizing: border-box !important;
    }
    .row.px-3.pt-4.model::before, .modal-dialog.modal-lg::before{
      box-sizing: border-box !important;
    }
    .row.px-3.pt-4.model::after, .modal-dialog.modal-lg::after{
      box-sizing: border-box !important;
    }

    .table tbody+tbody {
        border-top: 1px solid #000000;
    }
    .table td:last-child { 
        border-right: 1px solid #000 !important; 
    }
/*    .row px-3 pt-4 .model::after, .row px-3 pt-4 .model::before{
        box-sizing: border-box !important;
    }*/
</style>

<script type="text/javascript">
    $(document).ready(function(){
// Activate tooltip
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</head>
<body>
           <?php if($rejectedreport): ?>
           <?php if($rejectedreport->approve_status=='2'): ?>
             <b>Current Status</b> :<?php echo e("Rejected"); ?>

             <?php endif; ?>
              <?php endif; ?>
            

    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-2 my-auto">
                <div>
                   <a href="<?php echo e(url('/survey_info')); ?>" id="dashboard" class="print_action btn btn-primary text-decoration-none">Back To Dashboard</a>

               </div>
           </div>

           <div class="col-8 my-auto mx-auto px-0">
            <form action="<?php echo e(url('displayallsearch')); ?>" method="get">
                <?php echo csrf_field(); ?>
                <input type="hidden" name="jillase" value="<?php echo e($jilla); ?>">
                <input type="hidden" name="talukase" value="<?php echo e($taluka); ?>">
                <input type="hidden" name="gramse" value="<?php echo e($gram); ?>">
                <div class="form-inline print_action mt-3">
                  <div class="form-group my-auto">
                    <label>Filter By Date :</label>
                </div>
                <div class="form-group mx-sm-3 my-auto">
                    <input type="text" class="datepicker form-control" name="from_date"  value="<?php echo e($request['from_date']); ?>">
                </div>
                <?php if(isset($_GET['pedding']) && $_GET['pedding']!=" "){}else{?>
                    <div class="form-group ml-sm-0 mr-sm-3 my-auto">
             <select class="form-control" name="phase_no" style="height: 24px;">
                        <option value="">All Phases</option>
                        <?php $__currentLoopData = $phase; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ph): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($ph->phase_no); ?>" <?php if($request['phase_no']==$ph->phase_no): ?> Selected <?php endif; ?>>Phase-<?php echo e($ph->phase_no); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
				<?php } ?>
                <div class="form-group my-auto">
                  <button type="submit" class="btn btn-primary" class="print_action">Search</button>

              </div>
          </div>
          <!--  <h5>To Date : <input type="text" name="to_date" class="datepicker" value="<?php echo e($request['to_date']); ?>" required></h5> -->

      </form>
  </div>
        <!-- <div class="col-lg-2 my-auto">
            <div class="text-right">
                <button onclick="window.print();return false;" class="btn btn-info print_action" id="print">Print</button>
            </div>
        </div> -->
    </div>
    <div class="row">
      <div class="col-12 pb-3">
            
        <div>

           <span class="">
            <?php if(!$survey_i->isEmpty()): ?>
             <b>Current Status</b> : <?php if($survey_i[0]->approve_status=='1'): ?>
             <?php echo e("Approved"); ?>

             <?php elseif($survey_i[0]->approve_status=='2'): ?>
             <?php echo e("Rejected"); ?>

             <?php else: ?>
             <?php echo e('Pending'); ?>

             <?php endif; ?>
             </span>
             </div>
 <?php if(!Session::has('dashboardurl')): ?>
         <div>
             <span> 
               
             <?php if($survey_i[0]->approve_status !=1): ?>
            <a href="<?php echo e(url('update_survey_status')); ?>?selecteddate=<?php echo e($request['from_date']); ?>&&jilla=<?php echo e($jilla); ?>&&taluka=<?php echo e($taluka); ?>&&gram=<?php echo e($gram); ?>&&status=1&&type=1&&phase_no=<?php echo e($survey_i[0]->phase_no); ?>" class="print_action btn btn-primary ">Approve</a>
            <a href="<?php echo e(url('update_survey_status')); ?>?selecteddate=<?php echo e($request['from_date']); ?>&&jilla=<?php echo e($jilla); ?>&&taluka=<?php echo e($taluka); ?>&&gram=<?php echo e($gram); ?>&&status=2&&type=1&&phase_no=<?php echo e($survey_i[0]->phase_no); ?>" class="print_action btn btn-danger">Reject</a>
            <?php endif; ?>

            <?php endif; ?>
           
            <a target="_blank" href="<?php echo e(url('survey_map')); ?>?&gramse=<?php echo e($gram); ?>" class="print_action btn btn-warning ">View On Map</a>
            <button onclick="window.print();return false;" class="print_action btn btn-info " id="print">Print</button>
			<button type="button" class="btn btn-warning my-1 btn_upload print_action" id="btn_upload" data-target="#ex" data-toggle="modal">Upload&nbsp;file</button>
              <a  href="<?php echo e(url('survey_exceldownload')); ?>?selecteddate=<?php echo e($request['from_date']); ?>&&jilla=<?php echo e($jilla); ?>&&taluka=<?php echo e($taluka); ?>&&gram=<?php echo e($gram); ?>&&status=1&&type=1&&phase_no=<?php echo e($request['phase_no']); ?>" class="print_action btn btn-success ">Download</a>
            <!-- <a target="_blank" href="<?php echo e(url('phase_survey_report')); ?>?&gramse=<?php echo e($gram); ?>" class="print_action btn btn-warning ">Report</a> -->

        </span>
       
    </div>
    <?php endif; ?>
    
</div>
<div class="col-12">
    <div>
        <table class="table" border="1">
            <thead>
                <!-- Row 1 -->
                <tr class="table-primary">
                    <td class="text-center heading head_class" colspan="25">Survey Report</td>
                </tr>

                <!-- Row 2 -->
                <tr class="table-success text-left">
                    <?php

                    $jillaname=$jillanamesss[0];
                    $talukaname=$areanamesss[0];
                    $gramname=$gramnamesss[0];
                    ?>

                    <th class="heading" colspan="7">Gram Panchayat Name : &nbsp;&nbsp;&nbsp;<?php echo e($gramname); ?></th>
                    <th class="heading" colspan="8">Mandal Name : &nbsp;&nbsp;&nbsp;<?php echo e($talukaname); ?></th>
                    <th class="heading" colspan="10">District Name: &nbsp;&nbsp;&nbsp;<?php echo e($jillaname); ?></th>
                </tr>

                <!-- Row 3 -->
                <tr class="table-warning">

                    <td colspan="5"></td>
                    <th class="heading" colspan="10" align="center">Existing</th>

                    <td class="heading" colspan="10">Suggested</td>


                </tr>
                <tr class="table-danger">
                    <th rowspan="3" class="vertical-text sub-heading">Sr.No</th>
                    <!-- <th rowspan="3" class="vertical-text sub-heading">Gram Panchayat Name</th> -->
                    <th rowspan="3" class="vertical-text sub-heading">Created Date</th>
                    <th rowspan="3" class="sub-heading">Location/Area<br>(with landmark)</th>
                    <th colspan="2" rowspan="2"  class="sub-heading">GPS LOCATION</th>
                    <th rowspan="3" class="sub-heading">Pole No</th>
                    <th rowspan="3" class="sub-heading">Road Width in feets</th>
                    <th rowspan="3" class="sub-heading">Road configuration as per NLC</th>
                    <th rowspan="3" class="sub-heading">Switch point No/ Type of switch point  (3-Ph/1-Ph)</th>
                    <th colspan="3" class="sub-heading">Mounting arrangement of Poles</th>
                    <th rowspan="3" class="sub-heading">Height of the pole (mtrs.)</th>
                    <th rowspan="3" class="sub-heading">Pole spacing (mtrs.)</th>
                    <th rowspan="3" class="sub-heading">Types of fixtures</th>
                    <th rowspan="3" class="sub-heading">Fixture Wattage (W)</th>
                    <th rowspan="3" class="sub-heading">Warranty  for Existing LED Fixtures if any</th>
                    <th rowspan="3" class="sub-heading">Condition of underground Cable (Working/ Damaged), if applicable</th>
                    <td rowspan="3" class="vertical-text sub-heading">Earth Condition</td>
                    <td rowspan="3" class="vertical-text sub-heading"> Arms & Clamps Required (Yes/ No) <br></td>
                    <td rowspan="3" class="vertical-text sub-heading">Dedicated Streetline Available (Yes/ No)</td>
                    <th colspan="2" rowspan="2" class="sub-heading">Network Issues</th>
                    <th rowspan="3" class="sub-heading">Suggested LED Wattage (18/ 35/70/110/190 W)</th>
                    <th rowspan="3" class="sub-heading">Remarks, if any</th>
                    <th rowspan="3" class="print_action sub-heading">Action</th>

                </tr>
                <tr class="table-danger">
                    <th colspan="2" class="sub-heading">Type of Pole</th>
                    <th class="sub-heading">Pole arrangement</th>
                </tr>
                <tr class="table-danger">
                    <th class="sub-heading">Lattitude</th>
                    <th class="sub-heading">Longitude</th>
                    <th class="sub-heading">Concrete/ Iron</th>
                    <th class="sub-heading">Others(Wall mount, Wooden, etc)</th>
                    <th class="sub-heading">One Sided/ Central</th>
                    <th class="sub-heading">Is the safe distance maintained between HT Lines - LED Lights</th>
                    <th class="sub-heading">Is there any tree Obstructions</th>
                </tr>
            </thead>
            <?php
            echo "<tr> \n";
            for ($row=1; $row <= 26; $row++) { 
                echo "<td>$row</td> \n";
            }
            echo "</tr>";
            ?>
            <?php
            $count = 0;

            ?>
            
           
            <tbody>
              
                <?php if(sizeof($survey_i) == ""): ?>
                <tr>

                    <td colspan="25"><b>No Data Found</b></td>

                </tr>
                <?php else: ?>
                <?php $tw1=0;$tw2=0;$tw3=0;$tw4=0;$tw5=0; $sum=0; $i=0;?>
                <?php $__currentLoopData = $survey_i; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                
                 
                <?php

                $r=$sur->types_of_arms;
                $str=explode(',',$r);
                $location_explode=explode(",",$sur->location);
                $fixture_wattage = explode('||',$sur->fixture_wattage);
                if(empty($sur->maker_name)){
                    $maker_name=[$sur->maker_name];
                }else{
                    $maker_name = explode('||',$sur->maker_name);
                }
                $type_of_fixture = explode('||',$sur->type_of_fixture);
                $warranty_existing = explode('||',$sur->warranty_existing);
                $LED_wattage = explode('||',$sur->LED_wattage);
                $types_of_arms = explode('||',$sur->types_of_arms);



           
                    if($sur->pole_led_wattage != "N/A" && !is_null($sur->pole_led_wattage) && $sur->pole_led_wattage != "-NA-"){
                        $count++;

             if($sur->pole_led_wattage=="18 W") {$tw1=$tw1+1; }
              if($sur->pole_led_wattage=="35 W") {$tw2=$tw2+1; }
               if($sur->pole_led_wattage=="70 W") {$tw3=$tw3+1; }
                if($sur->pole_led_wattage=="110 W") {$tw4=$tw4+1; }
                 if($sur->pole_led_wattage=="190 W") {$tw5=$tw5+1; }
                        ?>

                       
       
                        <tr>
                            <!--<td><?php echo e($sur->s_no); ?></td>-->
                            <td><?php echo e($count); ?></td>
                             <?php if($sur->approve_status=='0'): ?>
                           <td><?php echo e(Carbon\Carbon::parse($sur->screated_at)); ?></td>
                           <?php else: ?>
                            <td><?php echo e(Carbon\Carbon::parse($sur->screated_at)->format('d/m/Y')); ?></td> <?php endif; ?> 

                            <td><?php echo e($sur->landmark??$gramname); ?></td>
                            <td><?php echo e(round((float)$location_explode[0],6)); ?></td>
                            <td><?php if(isset($location_explode[1])): ?> <?php echo e(round((float)$location_explode[1],6)); ?><?php endif; ?></td>
                            <td><?php echo e($sur->pole_num); ?></td>
                            <td><?php echo e($sur->road_width); ?></td>
                            <td class="text-uppercase"><?php echo e($sur->road_confi); ?></td>
                            <td><?php echo e(preg_replace('/: /i', '/', $sur->switch_point)); ?></td>
                            <td><?php echo e($sur->pole_type); ?></td>
                            <td><?php echo e($sur->pole_other); ?></td>
                            <td><?php echo e($sur->pole_side); ?></td>
                            <td><?php echo e($sur->pole_height); ?></td>
                            <td><?php echo e($sur->pole_spacing); ?></td>
                            <td><?php if(isset($sur->pole_type_of_fixture)): ?><?php echo e($sur->pole_type_of_fixture); ?> <?php endif; ?></td>
                            <td><?php if(isset($sur->pole_fixture_wattage)): ?><?php echo e($sur->pole_fixture_wattage); ?> <?php endif; ?></td>
                            <td><?php echo e($sur->pole_warranty_existing??'0'); ?></td>
                            <td><?php echo e($sur->Condition_existing); ?></td>
                            <td class="text-uppercase"><?php echo e($sur->earth_condition); ?></td>
                            <td><span class="text-uppercase"><?php echo e($sur->arms_clamps_required); ?></span>,<?php if(isset($sur->pole_type_of_arms)): ?><?php echo e($sur->pole_type_of_arms); ?> <?php endif; ?> </td>
                            <td class="text-uppercase"><?php echo e($sur->dedicated_available); ?></td>
                            <td class="text-uppercase"><?php echo e($sur->netword_issue_1); ?></td>
                            <td class="text-uppercase"><?php echo e($sur->netword_issue_2); ?></td>

                            <td><?php if(isset($sur->pole_led_wattage)): ?><?php echo e($sur->pole_led_wattage); ?> <?php endif; ?></td>
                            <td><?php echo e($sur->remark); ?></td>

                            <td class="print_action">
                                    <?php if($sur->approve_status !=1): ?>
                                <button type="button" class="btn btn-primary survey_instal_edit" data-target="#exampleModalLong" data-toggle="modal" data-id="<?php echo e($sur->sid); ?>">
                              Edit
                          </button>
                       
                          <a href="<?php echo e(url('delete_survey')); ?>?id=<?php echo e($sur->sid); ?>" class="btn btn-danger mt-2" onclick="return confirm('Are you sure?')">Delete</a>
                             <?php endif; ?>
                      </td>
                      </tr>
                   
               
     

                 
                  <?php  } ?>
                


                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  
                  <?php endif; ?>
                    <tr class="print_action">
                            <td><b></b></td>
                            <td><b>Total</b></td>
                            <td><b>18w</b></td>
                        <td><?php echo e($tw1??''); ?></td>
                        <td><b>35w</b></td>
                        <td><?php echo e($tw2??''); ?></td>
                        <td><b>70w</b></td>
                        <td><?php echo e($tw3??''); ?></td>
                        <td><b>110w</b></td>
                        <td><?php echo e($tw4??''); ?></td>
                        <td><b>190w</b></td>
                        <td><?php echo e($tw5??''); ?></td>
                   </tr>

              </tbody>
                
             

              <tfoot>
                <tr class="page-break">
                    <td colspan=6 height="21" align="left" valign=middle bgcolor="#FFFFFF"><b><font size=3 color="#000000"><br></font></b></td>
                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000"><br></font></td>
                    <td colspan=7 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000"><br></font></td>

                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000"><br></font></td>
                </tr>
                <tr>
                    <td colspan=6 height="21" align="left" valign=middle bgcolor="#FFFFFF"><b><font size=3 color="#000000">Vendor&rsquo;s representative</font></b></td>
                    <td align="left" colspan=6  valign=middle bgcolor="#FFFFFF"><b><font size=3 color="#000000">TSREDCO representative</font></b></td>
                    <td align="left" colspan=7  valign=middle bgcolor="#FFFFFF"><b><font size=3 color="#000000">EESL&rsquo;s representative</font></b></td>   
                    <td colspan=6 align="left"   valign=middle bgcolor="#FFFFFF"><b><font size=3 color="#000000">TS PR & RD representative</font></b></td>
                </tr>
                <tr>
                    <td colspan=6 height="27" align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Name:</font></td>

                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Name:</font></td>

                    <td colspan=7 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Name:</font></td>

                    <td colspan=6 align="left"  valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Name:</font></td>
                </tr>
                <tr>
                    <td colspan=6 height="27" align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Designation:</font></td>     
                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Designation:</font></td>        
                    <td  colspan=7 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Designation:</font></td>               
                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Designation:</font></td>
                </tr>
                <tr>
                    <td colspan=6 height="27" align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Signature:</font></td>

                    <td  colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Signature:</font></td>

                    <td colspan=7 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Signature:</font></td>

                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000">Signature:</font></td>
                </tr>
                <tr>
                    <td colspan=6 height="20" align="left" valign=top bgcolor="#FFFFFF"><font color="#000000"><br></font></td>
                    <td colspan=6 align="left" valign=middle bgcolor="#FFFFFF"><font size=3 color="#000000"><br></font></td>
                    <td colspan=7 align="left" valign=top bgcolor="#FFFFFF"><font color="#000000"><br></font></td>

                    <td colspan=6 align="left" valign=top bgcolor="#FFFFFF"><font color="#000000"><br></font></td>
                </tr>
            </tfoot>

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








</body>

<div class="modal fade" id="ex" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
			  <div class="modal-header">
					<h5 class="modal-title" id="exampleModalLongTitle">Upload file</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
			  </div>
			  <div class="modal-body">
					<form action="<?php echo e(url('uploadfilegram1')); ?>" method="post"  enctype="multipart/form-data" onsubmit="return confirm('Do you really want to submit the form?');">
						<?php echo csrf_field(); ?>
						<input type="hidden" name="district_id" value="<?php echo e(Request::get('jillase')); ?>">
						<input type="hidden" name="mandal_id" value="<?php echo e(Request::get('talukase')); ?>">
						<input type="hidden" name="gram_id" id="gram_id" value="<?php echo e(Request ::get('gramse')); ?>">
						<div class="form-group">
							<label for="files">File upload</label>
							<input type="file" class="form-control" name="files" id="files" accept=".xlsx, .xls, .csv" required=""  />
						</div>
						<div class="modal-footer px-0 border-top-0">
							<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
							<button type="submit" class="btn btn-primary">Submit</button>
						</div>
					</form>
			  </div>
		</div>
	</div>
</div>

<div class="modal fade" id="ex" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
			  <div class="modal-header">
					<h5 class="modal-title" id="exampleModalLongTitle">Upload file</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
			  </div>
			  <div class="modal-body">
					<form action="<?php echo e(url('uploadfilegram1')); ?>" method="post"  enctype="multipart/form-data" onsubmit="return confirm('Do you really want to submit the form?');">
						<?php echo csrf_field(); ?>
						<input type="hidden" name="district_id" value="<?php echo e(Request::get('jillase')); ?>">
						<input type="hidden" name="mandal_id" value="<?php echo e(Request::get('talukase')); ?>">
						<input type="hidden" name="gram_id" id="gram_id" value="<?php echo e(Request ::get('gramse')); ?>">
						<div class="form-group">
							<label for="files">File upload</label>
							<input type="file" class="form-control" name="files" id="files" accept=".xlsx, .xls, .csv" required=""  />
						</div>
						<div class="modal-footer px-0 border-top-0">
							<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
							<button type="submit" class="btn btn-primary">Submit</button>
						</div>
					</form>
			  </div>
		</div>
	</div>
</div>

<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true" data-backdrop="static">

    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
          <div class="modal-header">

            <h5 class="modal-title" id="exampleModalLongTitle">Survey Installation Edit</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
          </button>
      </div>
      <div class="modal-body">
        <form action="<?php echo e(url('survey_install_update')); ?>" method="post" onsubmit="return confirm('Do you really want to submit the form?');">
            <?php echo csrf_field(); ?>



            <div class="form-group">
                <label for="ticket">Switching Point No :</label>
                <input type="text" class="form-control" name="switch_point" id="switch_point" value="" required=""  />
            </div>

            <div class="form-group">
                <label for="value">Pole Series No: </label>
                <input type="hidden" class="form-control" name="pole_serial_number" id="pole_serial_number" value=""   />
                <input type="text" class="form-control" id="old_pole" value="" readonly =""  />
            </div>
            <div class="form-group">
                <label for="value">Pole No: </label>

               <!--  <input type="text" class="form-control" name="pole_num"  value="" required=""  /> -->

                <input type="number" class="form-control your_class" id="pole_num" name="pole_num"  value="" required="" min="0" />
            </div>
            <div class="form-group">

                <label for="stock_name">Landmark</label>
                <input type="text" class="form-control" name="landmark" id="landmark" value="" required="" />
            </div>
            <div class="form-group">

                <label for="stock_name">Location/Area:</label>
                <input type="text" class="form-control" name="location" id="location" value="" required="" />
            </div>

            <div class="form-group">

                <label for="stock_name">Road Width in mtrs:</label>
                <input type="text" class="form-control" name="road_width" id="road_width" value="" required="" />
            </div>

            <div class="form-group">

                <label for="stock_name">Road configuration as per NLC:</label>
                <input type="text" class="form-control" name="road_confi" id="road_confi" value="" required="" />
            </div>
            <div class="form-group">

                <label for="stock_name">Concrete/ Iron</label>
                <input type="text" class="form-control" name="pole_type" id="pole_type" value="" required="" />
            </div>

            <div class="form-group">

                <label for="stock_name">Others(Wall mount, Wooden, etc)</label>
                <input type="text" class="form-control" name="pole_other" id="pole_other" value="" required="" />
            </div>
            <div class="form-group">

                <label for="stock_name">One Sided/ Central:</label>
                <input type="text" class="form-control" name="pole_side" id="pole_side" value="" required="" />
            </div>

            <div class="form-group">

                <label for="stock_name">Height of the pole (mtrs.):</label>
                <input type="text" class="form-control" name="pole_height" id="pole_height" value="" required="" />
            </div>
            <div class="form-group">

                <label for="stock_name">Pole spacing (mtrs.):</label>
                <input type="text" class="form-control" name="pole_spacing" id="pole_spacing" value="" required="" />
            </div>

            

            <div class="form-group">
                <label for="value">Arms and clamps used:</label>
                <input type="text" class="form-control" name="arms" id="arms" value="" required="" />
            </div>
            <div class="form-group">
                <label for="cable_user">No Of lights:</label>
                <input type="text" class="form-control" name="no_of_lights" id="led_light_num" value="" readonly="" required="" />
            </div>
            <div id="lights_list">

            </div>
            <button id="add_light" type="button" class="btn btn-primary">Add Lights</button>

            <div class="form-group">

                <label for="stock_name">Network issue1:</label>
                <input type="text" class="form-control" name="led_lights" id="led_lights" value="" required="" />
            </div>
            <div class="form-group">

                <label for="stock_name">Network issue2:</label>
                <input type="text" class="form-control" name="tree_obstruction" id="tree_obstruction" value="" required="" />
            </div>

            <div class="form-group">
                <label for="remark_data"> Remarks:</label>
                <input type="text" class="form-control" name="remark_data" id="remark_data" value="" required="" />
            </div>

            <input type="hidden" name="id" id="dic_id">


            <div class="modal-footer px-0 border-top-0">
                <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Save changes</button>
            </div>

        </form>
    </div>
</div>
</div>
</div>
<!-- <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.6.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>

<script type="text/javascript">
   $(document).ready(function(){


    var enableDays = JSON.parse('<?php echo json_encode($edates); ?>');
//alert(enableDays);

$('.datePicker').datepicker({
    beforeShowDay: function(dt) {
       var datestring = $.datepicker.formatDate('dd-mm-yy', dt);
       if($.inArray(datestring, enableDays) != -1) {
         return [true];
     }
     else{
         return false;
     }


 }});

$('body').on('click','#add_light',function(){
    
    var count = $('body').find('.lights').length;
    var j= parseInt(count)+parseInt('1');

    if(count > 5){
        alert('Reached maximum bulb limit');
    }else{

         $('#led_light_num').val(j);

   

    var light = '<div class="lights"><div class="row px-2 pt-4 model"> <div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Old Fixture '+j+':</label><select class="form-control fixt_type" name="type_of_fixtures[]" id="type_of_fixtures"><option value="LED" >LED</option><option value="LED 9W" >LED 9W</option><option value="LED 24W" >LED 24W</option><option value="LED 12W" >LED 12W</option><option value="LED 36W" >LED 36W</option><option value="LED 70W" >LED 70W</option><option value="LED 110W" >LED 110W</option><option value="LED 180W" >LED 180W</option><option value="HPSV/MH LAMPS-70W" >HPSV/MH LAMPS-70W</option><option value="HPSV/MH-150W" >HPSV/MH-150W</option><option value="HPSV/MH-250W" >HPSV/MH-250W</option><option value="HPSV/MH-400W" >HPSV/MH-400W</option><option value="FTL" >FTL</option><option value="CFL (Bulb)" >CFL (BULb)</option></select></div><div class="form-group col-lg-3 px-2 mb-3"><label for="stock_name">Fixture Wattage '+j+':</label><input type="text" class="form-control fixt_watt" name="fixture_wattage[]" id="fixture_wattage" value="" required="" /></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Warranty Existing '+j+':</label><input type="text" class="form-control" name="warranty_existing[]" id="warranty_existing" value="" required="" /></div> <div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Type '+j+':</label><select class="form-control" name="type[]" id="type"><option value="N/A" >N/A</option><option value="25mm Dia 1.2mt"  >25mm Dia 1.2mt</option><option value="32mm Dia 1.2mt" >32mm Dia 1.2mt</option><option value="40mm Dia 1.2mt" >40mm Dia 1.2mt</option></select></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">LED Wattage '+j+':</label><select class="form-control" name="LED_wattage[]" id="ledwattage"><option value="18 W"  >18 W</option><option value="35 W" >35 W</option><option value="70 W" >70 W</option><option value="110 W" >110 W</option><option value="190 W" >190 W</option></select></div>  <div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Maker '+j+':</label><select class="form-control" name="maker_name[]" id="maker_name"><option value="flux lite"  >Flux lite</option><option value="Bajaj" >Bajaj</option><option value="HQ Lamps" >HQ Lamps</option><option value="shubha" >shubha</option><option value="surya" >Surya</option><option value="florida" >florida</option><option value="crompton" >Crompton</option><option value="orient" >Orient</option></select></div><button class="remove_light btn btn-danger" type="button">Remove</button></div>';

    

    $('#lights_list').append(light);
    }

});
        $('body').on('click','.remove_light',function(){ //alert();
            // $(this).parents('.lights').remove();
             var count = $('body').find('.lights').length;var count = $('body').find('.lights').length;
              if(count == 1){
        alert('Minimum One Bulb Should Be Alloted For Pole.Bulb Cannot be Deleted');
    }else{
          $(this).parents('.lights').remove();var count = $('body').find('.lights').length;
    }
              
             $('#led_light_num').val(count);

        });

        $(".survey_instal_edit").on("click",function()
        { 
            var id=$(this).data('id');
            //alert(id);              
            $.ajax({
                url:'<?php echo e(url("survey_instal_edit")); ?>/'+id,
                method:'get',
                dataType:'json',
                success:function(data)
                {
                    //console.log(data);
               // data=JSON.parse(data);
               //alert(data.id);
               $('#exampleModalLong').modal('show');
               var pole_num = data.pole_num.replace(/[0-9]/g, '');
               var splitpole =  data.pole_num.split(pole_num);

               $('#pole_serial_number').val(splitpole[0]);
               $('#old_pole').val(data.pole_num);
               $('#pole_num').val(splitpole[1]);
               $('#dic_id').val(data.id);
               //$('#dic_id').val(data.id);
               $('#location').val(data.location);
               $('#landmark').val(data.landmark);
               $('#switch_point').val(data.switch_point);
               $('#type_of_fixtures').val(data.type_of_fixture);
               $('#fixture_wattage').val(data.fixture_wattage);
               $('#cable_user').val(data.cable_user);
               $('#reducer_used').val(data.reducer_used);
               $('#minimast_clamp_used').val(data.minimast_clamp_used);
               $('#remark_data').val(data.remark);
               $('#road_confi').val(data.road_confi);
               $('#road_width').val(data.road_width);
               $('#pole_type').val(data.pole_type);
               $('#pole_other').val(data.pole_other);
               $('#pole_side').val(data.pole_side);
               $('#pole_height').val(data.pole_height);
               $('#maker_name').val(data.maker_name);
               $('#pole_spacing').val(data.pole_spacing);
               $('#warranty_existing').val(data.warranty_existing);
               $('#arms').val(data.arms_clamps_required);

               $('#led_lights').val(data.netword_issue_1);
               $('#tree_obstruction').val(data.netword_issue_2);
             //$('.led_wattage').val(data.LED_wattage);
             $(".led_wattage").each(function(){
                //alert($(this).val(),data.LED_wattage);
                if($(this).val() == data.LED_wattage)
                {
                    $(this).prop("checked",true);
                }
                else{
                    $(this).prop("checked",false);
                }
            });  

             
             var total_num=data.led_light_num;
             if(data.led_light_num == "" || data.led_light_num == null || data.led_light_num == false){
               
                total_num=1;
              }


                        

  //              var input1 = document.getElementById('type_of_fixtures');
  // var input2 = document.getElementById('fixture_wattage');

  // input1.addEventListener('change', function() {
  //   input1.value = input2.value;
  // });
             
           $('#led_light_num').val(total_num);


             var fixture_wattage = data.fixture_wattage?data.fixture_wattage.split('||'):{0:data.fixture_wattage};
             var maker_name = data.maker_name?data.maker_name.split('||'):{0:data.maker_name};
             var type_of_fixture = data.type_of_fixture?data.type_of_fixture.split('||'):{0:data.type_of_fixture};
             var warranty_existing = data.warranty_existing?data.warranty_existing.split('||'):{0:data.warranty_existing};
             var ledwattages = data.LED_wattage?data.LED_wattage.split('||'):{0:data.LED_wattage};
             var types_of_arms = data.types_of_arms?data.types_of_arms.split('||'):{0:data.types_of_arms};
             


             var light='';
             //console.log(data.pole_details.length);
             for(var i = 0; i < data.pole_details.length; i++)
             {

             if(ledwattages[i] != "N/A" && ledwattages[i] != "-NA-" && typeof(ledwattages[i]) != "undefined" && ledwattages[i] !== null && ledwattages[i] != "undefined"){

                var type_of_fixtures="N/A";var maker_names="N/A";var warranty_existings="N/A";var fixture_wattages="N/A";var ledwattage="N/A";var types_of_arm="N/A";
                var led18select="";var led35select="";var led70select="";var led110select="";var led190select="";
                var  CFLBulbselect="";var LEDselect="";var FTLselect="";var Otherselect="";
                    MH150Wselect="";var MH250Wselect="";var MHLAMPS70Wselect="";var MH400Wselect="";var LED9Wselect="";var LED12Wselect="";var LED24Wselect="";var LED36Wselect="";
                    var LED70Wselect="";var LED110Wselect="";var LED180Wselect="";

                var  arm25mmselect="";var arm32mmselect="";var arm40mmselect="";var NAselect="";
                 var fluxliteselect="";var Bajajselect="";var HQLampsselect="";var subhahselect="";var suryaselect="";var floridaselect="";var cromptonselect="";var orientselect="";


               
                    type_of_fixtures=data.pole_details[i].pole_type_of_fixture;
                    maker_names=data.pole_details[i].pole_maker_name;
                    warranty_existings=data.pole_details[i].pole_warranty_exsting;
                    fixture_wattages=data.pole_details[i].pole_fixture_wattage;
                    ledwattage=data.pole_details[i].pole_led_wattage;
                    types_of_arm=data.pole_details[i].pole_type_of_arms;
                
                var j = parseInt(1)+parseInt(i);
                if(ledwattage=="18 W"){ led18select=" Selected"; }
                if(ledwattage=="35 W"){ led35select=" Selected"; }
                if(ledwattage=="70 W"){ led70select=" Selected"; }
                if(ledwattage=="110 W"){ led110select=" Selected"; }
                if(ledwattage=="190 W"){ led190select=" Selected"; }

                 if(type_of_fixtures=="CFL (Bulb)"){ CFLBulbselect=" Selected"; }
                 if(type_of_fixtures=="HPSV/MH-400W"){ MH400Wselect=" Selected"; }
                  if(type_of_fixtures=="HPSV/MH-150W"){ MH150Wselect=" Selected"; }
                   if(type_of_fixtures=="HPSV/MH-250W"){ MH250Wselect=" Selected"; }
                    if(type_of_fixtures=="HPSV/MH LAMPS-70W"){ MHLAMPS70Wselect=" Selected"; }


                 if(type_of_fixtures=="LED"){ LEDselect=" Selected"; }
                 if(type_of_fixtures=="LED 9W"){ LED9Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 12W"){ LED12Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 24W"){ LED24Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 36W"){ LED36Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 70W"){ LED70Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 110W"){ LED110Wselect=" Selected"; }
                 if(type_of_fixtures=="LED 180W"){ LED180Wselect=" Selected"; }
                 if(type_of_fixtures=="FTL"){ FTLselect=" Selected"; }
                if(type_of_fixtures=="Other"){ Otherselect=" Selected"; }

                if(types_of_arm=="25mm Dia 1.2mt"){ arm25mmselect=" Selected"; }
                 if(types_of_arm=="32mm Dia 1.2mt"){ arm32mmselect=" Selected"; }
                 if(types_of_arm=="40mm Dia 1.2mt"){ arm40mmselect=" Selected"; }
                 if(types_of_arm=="N/A"){ NAselect=" Selected"; }


                    //alert(maker_names);
                  if(maker_names=="flux lite"){ fluxliteselect="Selected"; }
                 if(maker_names=="Bajaj"){ Bajajselect="Selected"; }
                 if(maker_names=="HQ Lamps"){ HQLampsselect="Selected"; }
                  if(maker_names=="subhah"){ subhahselect="Selected"; }
                 if(maker_names=="Surya"){ suryaselect="Selected"; }
                 if(maker_names=="Florida"){ floridaselect="Selected"; }
                   if(maker_names=="Crompton"){ cromptonselect="Selected"; }
                   if(maker_names=="Orient"){ orientselect="Selected"; }


                light+= '<div class="lights"><div class="row px-2 pt-4 model"><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Old Fixture '+j+':</label><select class="form-control fixt_type" name="type_of_fixtures[]" id="type_of_fixtures"><option value="LED" '+LEDselect+' >LED</option><option value="LED 9W" '+LED9Wselect+'>LED 9W</option><option value="LED 12W" '+LED12Wselect+'>LED 12W</option><option value="LED 24W" '+LED24Wselect+'>LED 24W</option><option value="LED 36W" '+LED36Wselect+'>LED 36W</option><option value="LED 70W" '+LED70Wselect+'>LED 70W</option><option value="LED 110W" '+LED110Wselect+'>LED 110W</option><option value="LED 180W" '+LED180Wselect+'>LED 180W</option><option value="HPSV/MH LAMPS-70W" '+MHLAMPS70Wselect+' >HPSV/MH LAMPS-70W</option><option value="HPSV/MH-150W" '+MH150Wselect+' >HPSV/MH-150W</option><option value="HPSV/MH-250W" '+MH250Wselect+' >HPSV/MH-250W</option><option value="HPSV/MH-400W" '+MH400Wselect+' >HPSV/MH-400W</option><option value="FTL" '+FTLselect+'>FTL</option><option value="CFL (Bulb)" '+CFLBulbselect+'>CFL (BULb)</option></select></div><div class="form-group col-lg-3 px-2 mb-3"><label for="stock_name">Fixture Wattage '+j+':</label><input type="text" class="form-control fixt_watt" name="fixture_wattage[]" id="fixture_wattage" value="'+fixture_wattages+'" required="" /></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Warranty Existing '+j+':</label><input type="text" class="form-control" name="warranty_existing[]" id="warranty_existing" value="'+warranty_existings+'" required="" /></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Type  '+j+':</label><select class="form-control" name="type[]" id="type"><option value="N/A" '+NAselect+' >N/A</option><option value="25mm Dia 1.2mt" '+arm25mmselect+' >25mm Dia 1.2mt</option><option value="32mm Dia 1.2mt" '+arm32mmselect+'>32mm Dia 1.2mt</option><option value="40mm Dia 1.2mt" '+arm40mmselect+'>40mm Dia 1.2mt</option></select></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">LED Wattage '+j+':</label><select class="form-control" name="LED_wattage[]" id="ledwattage"><option value="18 W" '+led18select+' >18 W</option><option value="35 W" '+led35select+'>35 W</option><option value="70 W" '+led70select+'>70 W</option><option value="110 W" '+led110select+'>110 W</option><option value="190 W" '+led190select+'>190 W</option></select></div><div class="form-group col-lg-3 px-2 mb-2"><label for="stock_name">Maker '+j+':</label><select class="form-control" name="maker_name[]" id="maker_name"><option value="flux lite" '+fluxliteselect+' >Flux lite</option><option value="Bajaj" '+Bajajselect+'>Bajaj</option><option value="HQ Lamps" '+HQLampsselect+'>HQ Lamps</option><option value="subhah" '+subhahselect+'>Subhah</option><option value="Surya" '+suryaselect+'>Surya</option><option value="Florida" '+floridaselect+'>florida</option><option value="Crompton" '+cromptonselect+'>Crompton</option><option value="Orient" '+orientselect+'>Orient</option></select></div><button type="button" class="float-left remove_light btn btn-danger" >Remove</button></div>';
  
                  if(i != 0){
                   // light+='<button type="button" class=" remove_light btn btn-danger" >Remove</button>';
                    light+='';
                    }
                  light+='</div>';
                
              }
              }
              $('#lights_list').html(light);

              $(".armscondition").each(function(){
                if($(this).val() == data.types_of_arms) 
                {
                    $(this).prop("checked",true);
                }
            });

          },
          error:function(data)
          {
            alert(data);
        }
    });
});
});


$('body').on('change','.fixt_type',function(){ 

    var fixt_type = $(this).val();
    var fixt_types = "";

               if(fixt_type=="LED"){ fixt_types="9W"; }
               if(fixt_type=="LED 9W"){ fixt_types="9W"; }
               if(fixt_type=="LED 12W"){ fixt_types="12W"; }
               if(fixt_type=="LED 24W"){ fixt_types="24W"; }
               if(fixt_type=="LED 36W"){ fixt_types="36W"; }
                if(fixt_type=="LED 70W"){ fixt_types="70W"; }
                if(fixt_type=="LED 110W"){ fixt_types="110W"; }
                if(fixt_type=="LED 180W"){ fixt_types="180W"; }
               if(fixt_type=="HPSV/MH-150W"){ fixt_types="150W"; }
               if(fixt_type=="HPSV/MH-250W"){ fixt_types="250W"; }
               if(fixt_type=="HPSV/MH-400W"){ fixt_types="400W"; }
               if(fixt_type=="HPSV/MH LAMPS-70W"){ fixt_types="70W"; }
               if(fixt_type=="FTL"){ fixt_types="40W"; }
               if(fixt_type=="CFL (Bulb)"){ fixt_types="100W"; }

        $(this).parent('div').next("div").find(".fixt_watt").val(fixt_types);

            
               
   });

document.querySelector(".your_class").addEventListener("keypress", function (evt) {
    if (evt.which != 8 && evt.which != 0 && evt.which < 48 || evt.which > 57)
    {
        evt.preventDefault();
    }
});
</script>
</html>

<?php /**PATH /home/neefc25/public_html/tgredco.fovea.in/resources/views/backend/display_info.blade.php ENDPATH**/ ?>