This commit is contained in:
parent
4848d4d04d
commit
412a998a9a
2 changed files with 13 additions and 7 deletions
|
@ -19,7 +19,15 @@
|
||||||
if(array_key_exists('assurance',$_REQUEST) && $_REQUEST['assurance'] > 0)
|
if(array_key_exists('assurance',$_REQUEST) && $_REQUEST['assurance'] > 0)
|
||||||
{
|
{
|
||||||
$assurance = mysql_escape_string(intval($_REQUEST['assurance']));
|
$assurance = mysql_escape_string(intval($_REQUEST['assurance']));
|
||||||
mysql_query("delete from `notary` where `id`='$assurance'");
|
$row = 0;
|
||||||
|
$res = mysql_query("select `to` from `notary` where `id`='$assurance'");
|
||||||
|
if ($res) {
|
||||||
|
$row = mysql_fetch_assoc($res);
|
||||||
|
}
|
||||||
|
mysql_query("delete from `notary` where `id`='$assurance'");
|
||||||
|
if ($row) {
|
||||||
|
fix_assurer_flag($row['to']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(intval(array_key_exists('userid',$_REQUEST)?$_REQUEST['userid']:0) <= 0)
|
if(intval(array_key_exists('userid',$_REQUEST)?$_REQUEST['userid']:0) <= 0)
|
||||||
|
|
|
@ -98,16 +98,14 @@ document.f.location.focus();
|
||||||
$query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + (COS(PI() * $loc[lat] / 180 ) *
|
$query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + (COS(PI() * $loc[lat] / 180 ) *
|
||||||
COS(PI() * `locations`.`lat` / 180) * COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`,
|
COS(PI() * `locations`.`lat` / 180) * COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`,
|
||||||
`locations`.`name` AS `location`, concat(`users`.`fname`, ' ', LEFT(`users`.`lname`, 1)) AS `name`, `long`, `lat`,
|
`locations`.`name` AS `location`, concat(`users`.`fname`, ' ', LEFT(`users`.`lname`, 1)) AS `name`, `long`, `lat`,
|
||||||
`users`.`id` as `uid`, `contactinfo` FROM `locations`, `users`, `notary` WHERE `users`.`locid` = `locations`.`id` AND
|
`users`.`id` as `uid`, `contactinfo` FROM `locations`, `users` WHERE `users`.`locid` = `locations`.`id` AND
|
||||||
`users`.`id` = `notary`.`to` AND `users`.`listme` = 1 GROUP BY `notary`.`to`
|
`users`.`assurer` = 1 AND `users`.`listme` = 1 HAVING `distance` <= '$maxdist' ORDER BY `distance`";
|
||||||
HAVING SUM(`notary`.`points`) >= 100 AND `distance` <= '$maxdist' ORDER BY `distance`";
|
|
||||||
} else {
|
} else {
|
||||||
$query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + (COS(PI() * $loc[lat] / 180 ) *
|
$query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + (COS(PI() * $loc[lat] / 180 ) *
|
||||||
COS(PI() * `locations`.`lat` / 180) * COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`,
|
COS(PI() * `locations`.`lat` / 180) * COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`,
|
||||||
`locations`.`name` AS `location`, concat(`users`.`fname`, ' ', LEFT(`users`.`lname`, 1)) AS `name`, `long`, `lat`,
|
`locations`.`name` AS `location`, concat(`users`.`fname`, ' ', LEFT(`users`.`lname`, 1)) AS `name`, `long`, `lat`,
|
||||||
`users`.`id` as `uid`, `contactinfo` FROM `locations`, `users`, `notary` WHERE `users`.`locid` = `locations`.`id` AND
|
`users`.`id` as `uid`, `contactinfo` FROM `locations`, `users` WHERE `users`.`locid` = `locations`.`id` AND
|
||||||
`users`.`id` = `notary`.`to` AND `users`.`listme` = 1 GROUP BY `notary`.`to`
|
`users`.`assurer` = 1 AND `users`.`listme` = 1 HAVING `distance` <= '$maxdist' ORDER BY `distance` LIMIT 50";
|
||||||
HAVING SUM(`notary`.`points`) >= 100 AND `distance` <= '$maxdist' ORDER BY `distance` LIMIT 50";
|
|
||||||
//echo $query;
|
//echo $query;
|
||||||
}
|
}
|
||||||
$res = mysql_query($query);
|
$res = mysql_query($query);
|
||||||
|
|
Loading…
Reference in a new issue