Files
Testing/grabzips2.php

70 lines
3.0 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
/* $Id: profile.php 42 2009-01-29 04:55:14Z john $ */
$page = "nooutputgeneralmobile";
include "header.php";
include "include/class_database_mysqli.php";
header("Expires: Sat, 1 Jan 2005 00:00:00 GMT");
header("Last-Modified: ".gmdate( "D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$database1 = new SEmysqliDatabase($database_host, $database_username, $database_password, $database_name);
//$database->database_select("bateworldcom_zips");
$coslat=cos(deg2rad($_GET["lat"]));
$sinlat=sin( deg2rad($_GET["lat"]) );
$radlon=deg2rad($_GET["long"]);
$query=$database->database_query("SELECT country_code, place_name, admin_name1, admin_code1, postal_code, ( 3959 * acos( ".$coslat."
* cos( radianslat ) * cos( radianslon - ".$radlon." )
+ ".$sinlat." * sin( radianslat ) ) )
AS distance FROM bateworldcom_zips.zipcodes1 HAVING distance < 25
ORDER BY distance ASC LIMIT 0 , 10000");
$database->database_select("bateworld");
while($row=$database->database_fetch_array($query))
{//
if($row["country_code"]=="US")
{
$query1=$database->database_query("SELECT * FROM se_users, se_profilevalues WHERE se_users.user_id=se_profilevalues.profilevalue_user_id AND se_profilevalues.profilevalue_27='".$row["postal_code"]."'");
while($row1=$database->database_fetch_array($query1))
{
$owner1 = new SEUser(Array($row1["user_id"]));
?>
<div class="browse_result" style="float: left; padding: 5px; width: 90px; height: 100px; text-align: center;">
<a href="http://bateworld.com/profile.php?user=<?=$row1["user_username"]?>"><img src="<?=$owner1->user_photo('./images/nophoto.png', TRUE)?>" class="photo" style="display: block; margin-left: auto; margin-right: auto;" width="60" height="60" border="0" alt="<?=$row1["user_username"]?>'s Profile"><?=substr($row1["user_username"],0,10)?></a>
</div>
<?
//<div style="margin-top: 3px;"><!--<img src='./images/icons/online16.gif' border='0' class='icon2'>-->Online</div>
}
}
else
{
$query1=$database->database_query("SELECT * FROM se_users, se_profilevalues WHERE se_users.user_id=se_profilevalues.profilevalue_user_id AND se_profilevalues.profilevalue_27='".$row["postal_code"]."'");
while($row1=$database->database_fetch_array($query1))
{
$owner1 = new SEUser(Array($row1["user_id"]));
?>
<div class="browse_result" style="float: left; padding: 5px; width: 90px; height: 100px; text-align: center;">
<a href="http://bateworld.com/profile.php?user=<?=$row1["user_username"]?>"><img src="<?=$owner1->user_photo('./images/nophoto.png', TRUE)?>" class="photo" style="display: block; margin-left: auto; margin-right: auto;" width="60" height="60" border="0" alt="<?=$row1["user_username"]?>'s Profile"><?=substr($row1["user_username"],0,10)?></a>
</div>
<?
//<div style="margin-top: 3px;"><!--<img src='./images/icons/online16.gif' border='0' class='icon2'>-->Online</div>
}
}
}
?><div class="clear"></div><?
include("footer.php");
?>