| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/views/scripts/customer/ |
Upload File : |
<?php
$code = base64_decode($this->code);
$cityname = $this->cityname;
$countryId = $this->countryId;
$coderes = explode("_",$code);
$packageId = $coderes[0];
$cityId = $coderes[1];
$seq = $coderes[2];
$newtype = $coderes[3];
?>
<html>
<head>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/lib/jquery-1.11.min.js');?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/lib/jqueryui.js');?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/bootstrap.min.js');?>"></script>
<link href="<?php echo $this->baseUrl('public/assets/css/bootstrap.min.css'); ?>" rel="stylesheet">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/icheck/skins/all.css'); ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/jquery.toolbars.css'); ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/accordion.css'); ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/tab.css'); ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/summernote.css'); ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/custom_smart_wizard.css'); ?>">
<link href='https://fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/lightGallery.css'); ?>">
<!--[if gt IE 8]> <link href="assets/css/ie/ie9-gallery.css" rel="stylesheet" type="text/css"> <!--<![endif]-->
<link href="<?php echo $this->baseUrl('public/assets/css/plugins/shuffle.css');?>" rel="stylesheet">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/font.css');?>">
<!-- Plugin Css End -->
<!-- Custom styles Style -->
<link href="<?php echo $this->baseUrl('public/assets/css/style.css');?>" rel="stylesheet">
<!-- Custom styles Style End-->
<!-- Responsive Style For-->
<link href="<?php echo $this->baseUrl('public/assets/css/responsive.css');?>" rel="stylesheet">
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/jquery-ui.css');?>"/>
<script src="<?php echo GOOGLE_PLACES_API_URL?>?address=<?php echo $cityname?>&key=<?php echo GOOGLE_PLACES_APP_KEY?>&libraries=places"></script>
<style>
#map_canvas {
height: 40%;
width:100%;
}
</style>
<body>
<div id="addNewHotel">
<fieldset style="width: 75%; margin-left: 20px; margin-right: 20px">
<legend>Add New Destination</legend>
<form name="frm" id="frm" method="post">
<div class="col-md-12">
<div class="span6">
<label class="form-label span4" for="normal">Destination name<span class="required">*</span></label>
<input type="text" name="txtDestinationName" id="txtDestinationName" value="<?php echo $cityname; ?>" style="width:390px; height: 30px">
<?php //echo $this->form->hotel_name; ?>
<input type="hidden" name="seq" id="seq" value="<?php echo @$seq?>"/>
<input type="hidden" name="packageId" id="packageId" value="<?php echo @$packageId?>"/>
<input type="hidden" name="newtype" id="newtype" value="<?php echo @$newtype?>"/>
<input type="hidden" name="intCity" id="intCity" value="<?php echo @$cityId?>"/>
<input type="hidden" name="place_id" id="place_id" value=""/>
<input type="hidden" name="place_lat" id="place_lat" value=""/>
<input type="hidden" name="place_lng" id="place_lng" value=""/>
<input type="hidden" name="contId" id="contId" value="<?php echo $countryId; ?>"/>
<input type="hidden" name="weekday_text" id="weekday_text" value=""/>
<input type="hidden" name="formatted_address" id="formatted_address" value=""/>
<input type="hidden" name="city_long_name" id="city_long_name" value=""/>
<input type="hidden" name="formatted_phone_number" id="formatted_phone_number" value=""/>
<input type="hidden" name="rating" id="rating" value=""/>
<input type="hidden" name="photo_reference" id="photo_reference" value=""/>
</div>
</div>
<div class="col-md-12"> </div>
<div class="form-row row-fluid col-md-12">
<div class="span12">
<div class="row-fluid">
<div class="span6" style="float:right;">
<div class="span4"></div>
<button class="btn btn-primary" name="btnAdd" type="button" id="btnAdd" onClick="return Getlatlong()">Save</button>
<a href="javascript:void(0)" class="btn btn-danger" name="btnClose" id="btnCancel" onClick="closeWindow();">Close</a>
</div>
</div>
</div>
</div>
</form>
</fieldset>
<fieldset style="width: 75%; margin-left: 20px; margin-right: 20px">
<legend>Map</legend>
<div class="form-row row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<div id="map_canvas"></div>
</div>
<div class="row-fluid" style="margin-left:10px">
<ul id="tt"></ul>
</div>
</div>
</fieldset>
</div>
</body>
<script type="text/javascript">
function saveDestination() {
var type = $('#newtype').val();
var packageId = $('#packageId').val();
var cityId = $('#intCity').val();
// var contId = $('#country').val();
var seq = $('#seq').val();
var strDestinationName = $('#txtDestinationName').val();
var formValue = $("#frm").serialize();
var titlearr = strDestinationName.split(',');
var url = '/customer/add-new-city';
$.ajax({
url : url,
data : formValue,
type : 'POST',
dataType : 'json',
beforeSend : function() {
},
success : function(response) {
window.opener.$(".typeaheadCity").val(response.cityName);
window.opener.$("#hidden_typeahead_cityid").val(response.cityId);
//alert(response);
//Getlatlong();
window.close();
return false;
}
});
return false;
// $("#addNewHotel").css("display","none");
}
function closeWindow() {
window.close();
}
</script>
<script>
var mapOptions = {
center: new google.maps.LatLng('-33.8688', '151.2195'),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
var input = /** @type {HTMLInputElement} */
(document.getElementById('txtDestinationName'));
function initialize() {
var input = document.getElementById('txtDestinationName');
var autocomplete = new google.maps.places.Autocomplete(input);
$("#txtDestinationName").focus();
}
var autocomplete = new google.maps.places.Autocomplete(input);
google.maps.event.addDomListener(window, 'load', initialize);
autocomplete.bindTo('Bounds', map);
//autocomplete.setBounds( someOtherBounds );
var infowindow = new google.maps.InfoWindow();
var marker = new google.maps.Marker({
map: map
});
google.maps.event.addListener(autocomplete, 'place_changed', function () {
infowindow.close();
marker.setVisible(false);
input.className = '';
var place = autocomplete.getPlace();
// var data = $("#frm").serialize();
//console.log(data);
if (!place.geometry) {
// Inform the user that the place was not found and return.
input.className = 'notfound';
return;
}else{
$("#place_id").val(place.place_id);
$("#place_name").val(place.name);
$("#place_lat").val(place.geometry.location.lat());
$("#place_lng").val(place.geometry.location.lng());
//$("#weekday_text").val(place.opening_hours.weekday_text);
$("#formatted_address").val(place.formatted_address);
$("#formatted_phone_number").val(place.formatted_phone_number);
$("#rating").val(place.rating);
}
// If the place has a geometry, then present it on a map.
if (place.geometry.viewport) {
map.fitBounds(place.geometry.viewport);
} else {
map.setCenter(place.geometry.location);
map.setZoom(17); // Why 17? Because it looks good.
}
marker.setIcon( /** @type {google.maps.Icon} */ ({
url: place.icon,
size: new google.maps.Size(71, 71),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(17, 34),
scaledSize: new google.maps.Size(35, 35)
}));
marker.setPosition(place.geometry.location);
marker.setVisible(true);
console.log(place);
var address = '';
if (place.address_components) {
address = [
(place.address_components[0] && place.address_components[0].short_name || ''), (place.address_components[1] && place.address_components[1].short_name || ''), (place.address_components[2] && place.address_components[2].short_name || '')].join(' ');
}
infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address);
infowindow.open(map, marker);
});
// Sets a listener on a radio button to change the filter type on Places
// Autocomplete.
function setupClickListener(id, types) {
var radioButton = document.getElementById(id);
google.maps.event.addDomListener(radioButton, 'click', function () {
autocomplete.setTypes(types);
});
}
setupClickListener('changetype-all', []);
setupClickListener('changetype-establishment', ['establishment']);
setupClickListener('changetype-geocode', ['geocode']);
function Getlatlong(){
var showlocation = $("#txtDestinationName").val();
jQuery.ajax({
url: '/customer/getlatlong',
type: 'POST',
async: false,
dataType: 'json',
data: {showlocation: showlocation},
success: function(result){
if(result.status=='success'){
$("#place_lat").val(result.place_lat);
$("#place_lng").val(result.place_lng);
$("#city_long_name").val(result.city_long_name);
$("#formatted_address").val(result.formatted_address);
saveDestination();
}
}
});
}
</script>