GIF89a;
| Direktori : /home/serb/public_html/ |
| Current File : /home/serb/public_html/change-location.php |
<? session_start();
include("lib/globals.php");
include("lib/common.php");
include("lib/functions.php");
$page="change_pass";
?>
<? include "includes/header_top.php";?>
<script type="text/javascript">
function selectCity(country_id){
if(country_id!="-1"){
loadData('state',country_id);
$("#city_dropdown").html("<option value='-1'>Select city</option>");
}else{
$("#state_dropdown").html("<option value='-1'>Select state</option>");
$("#city_dropdown").html("<option value='-1'>Select city</option>");
}
}
function selectState(state_id){
if(state_id!="-1"){
loadData('city',state_id);
}else{
$("#city_dropdown").html("<option value='-1'>Select city</option>");
}
}
function loadData(loadType,loadId){
var dataString = 'loadType='+ loadType +'&loadId='+ loadId;
$("#"+loadType+"_loader").show();
$("#"+loadType+"_loader").fadeIn(400).html('Please wait...');
$.ajax({
type: "POST",
url: "loadData.php",
data: dataString,
cache: false,
success: function(result){
$("#"+loadType+"_loader").hide();
$("#"+loadType+"_dropdown").html("<option value='-1'>Select "+loadType+"</option>");
$("#"+loadType+"_dropdown").append(result);
}
});
}
</script>
<script language="javascript">
function validate()
{
if(document.chngpwd.newPassword.value=="")
{
alert("Enter your password");
document.chngpwd.newPassword.focus();
return false;
}
if(document.chngpwd.newPassword.value!=document.chngpwd.cnfPassword.value)
{
alert("Password not match");
document.chngpwd.cnfPassword.focus();
return false;
}
}
</script>
<?
if($_POST)
{
$stateid=$_POST['prlState'];
$cityid=$_POST['prlCities'];
$upd="UPDATE user_info SET state='$stateid',city='$cityid' WHERE userid='".$_SESSION['userid']."'";
execute_query($upd);
$update_escortloc="UPDATE escort_details SET escort_state='$stateid',escort_city='$cityid' WHERE user_id='".$_SESSION['userid']."'";
execute_query($update_escortloc)
?>
<script language="javascript">
location.href="change-location.php?msg=1";
</script>
<?
} ?>
<body>
<? include "includes/header.php";?>
<div class="hdr_foo">
<div class="hrd_ftmenu">
</div>
</div>
<div class="main_bg">
<div style="height:32px;"></div>
<div style="width:1000px; margin:0 auto;">
<div class="menuleft_contain">
<? include "includes/acount_leftcontent.php";?>
</div>
<div class="acountright_contain">
<?
$sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'";
$res=execute_query($sql);
$row=mysql_fetch_array($res);
$num=mysql_num_rows($res);
?>
<div class="acccmid1_header">Change Location</div>
<div class="accountrightct_mid">
<div class="small_space"></div>
<div class="profile_data">
<?php /*?><?
$sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'";
$res=execute_query($sql);
$row=mysql_fetch_array($res);
$num=mysql_num_rows($res);
?><?php */?>
<? if($_GET['msg']==1){ ?>
<p style="color:#ff9131; font-family:'Open Sans',sans-serif; text-align:center;">Your Location Has Changed.</p>
<? } ?>
<form action="<?=$_SERVER['PHP_SELF'] ?>" method="post" name="chngloc">
<table border="0" cellpadding="0" cellspacing="7" align="center" style="margin:0 auto;">
<tr height="5"></tr>
<tr>
<td class="logintext">Location :</td>
<td>
<select name="prlState" id="state_dropdown" class="drp_img3" onChange="selectState(this.options[this.selectedIndex].value)">
<option value="-1">Select</option>
<?
$sql_state="SELECT * FROM states ORDER BY name";
$res_state=execute_query($sql_state);
while($row_state=mysql_fetch_array($res_state))
{
?>
<option value="<?=$row_state['id'] ?>"><?=$row_state['name'] ?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td class="logintext">Sub Location :</td>
<td>
<select name="prlCities" id="city_dropdown" class="drp_img3">
<option value="-1" name="cityname"></option>
</select>
</td>
</tr>
<tr height="15"></tr>
<tr>
<td></td>
<td><input type="image" src="images/submit.png" /></td>
</tr>
<tr height="10"></tr>
</table>
</form>
<br class="spacer" />
</div>
<br class="spacer" />
</div>
</div>
<br class="spacer" />
</div>
<br/>
</div>
<? include "includes/footer.php";?>