<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" rel="stylesheet"></link>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCDgFNMkZRmDv6tkxbKut5eIqaQbcM8zS8&sensor=true&libraries=places"></script>
<!---->
<script src="js/jquery.placepicker.js"></script>
<script>
      $(document).ready(function() {
        // Basic usage
        $(".placepicker").placepicker();
      }); // END document.ready
</script>
<style>
      .placepicker-map {
        width: 100%;
        height: 300px;
      }
      .another-map-class {
        width: 100%;
        height: 300px;
      }
      .pac-container {
        border-radius: 5px;
      }
</style>

<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title"><?php if($isEdit){ echo 'Operator Location of <span style="color:black;">'.getTechnicianName($techId).'</span>';} else { echo 'Operator Location for <span style="color:black;">'.getTechnicianName($techId).'</span>'; }?></div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.php?page=home">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="index.php?page=manage_technician">Technician</a>&nbsp;<i class="fa fa-angle-right"></i></li><li class="active">Operator Location</li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card card-box">
                                <div class="card-head">
                                    <header><?php if($isEdit){ echo 'Edit Location';} else { echo 'Add Location'; }?></header>                                    
                                </div>
                                <div class="card-body" id="bar-parent1">
                                	
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger"><?php echo $error; ?></div>
                                	<?php } else if(isset($success) && $success!=''){ ?>                                		
                                		<div class="alert alert-success"><?php echo $success; ?></div>
                                	<?php } else if(isset($_REQUEST['success'])){ ?>                                		
                                		<div class="alert alert-success"><?php echo urldecode($_REQUEST['success']); ?></div>
                                	<?php } ?>
                                	                                	
                                    <form action="" id="form_user_add" class="form-horizontal" method="post">
                                        <div class="form-body"> 
                                        	 
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Place<span class="required"> * </span></label>
                                                <div class="col-md-4">         
                                                	<input name="place" class="placepicker form-control" placeholder="Enter a location" data-required="1" value="<?php if(isset($_POST['place'])) { echo htmlentities(($_POST['place']), ENT_QUOTES); } else if(isset($resEdit['place']) && $resEdit['place']!=''){ echo $resEdit['place'];} ?>"/>                                           
                                                    
                                                </div>
                                            </div>
                                                                                                                                    
                                            
                                        </div>                                        
                                      	<div class="form-group">
                                            <div class="offset-md-3 col-md-9">
                                            	<?php if($isEdit){ ?>
                                            		<button type="submit" name="update" class="btn btn-info">Update</button>
                                            	<?php } else { ?>
                                            		<button type="submit" name="add" class="btn btn-info">Submit</button>
                                            	<?php } ?>                                                                                             
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        
                        
                        <div class="col-md-12">
                            <div class="card card-topline-red">
                                <div class="card-head">
                                    <header>Manage Location</header>
                                    <div class="tools">                                        
	                                    <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
	                                    <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
                                    </div>
                                </div>                                
                                <div class="card-body ">
                                    <?php if(isset($execDetails) && mysqli_num_rows($execDetails)>0) { ?>
                                    <table class="table table-striped table-bordered table-hover table-checkable order-column" style="width: 100%" id="example4">
                                        <thead>
                                           <tr>   
                                                <th> SL NO </th>
                                                <th> Location </th>                                                                                         
                                                <th> Actions </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<?php
                                        	if(isset($_GET['p']) && is_numeric($_GET['p']) && ($_GET['p'] > 1)) {
												$slNo = ($_GET['p']*30-29);
											} else {
												$slNo = 1;
											}
												while($resDetails = mysqli_fetch_array($execDetails)) {	?>
                                            <tr class="odd gradeX">                                                
                                                <td><?php echo $slNo; ?></td>                                              
                                                <td><?php echo $resDetails['place']; ?></td>                                                                                                                                             
                                                <td>
                                                    <div class="btn-group">                                                       
                                                        <a class="btn btn-xs deepPink-bgcolor dropdown-toggle no-margin" onclick="return confirm('Are you sure to delete this location?');" href="index.php?page=operator_location&action=delete&del_id=<?php echo $resDetails['id']; ?>&tech_id=<?php echo $techId; ?>">Delete </a>
                                                    </div>
                                                </td>
                                            </tr>
                                            <?php ++$slNo; } ?>                                            
                                        </tbody>
                                    </table>
                                    <div style="float: left; width: auto;"> <?php echo $pageNums; ?> </div>
                                    <?php } else { ?>
                                    	<div class="alert alert-danger">Sorry! No Results Found.</div>					        		
					        		<?php }	?> 
                                </div>
                            </div>
                        
                        
                    </div>
	</div>
</div>

