<?php
session_start();
include("../../registration/sql_connect.php");
mysql_query("SET NAMES 'utf8'");
include("../head.php");
$offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0; // Hvis ikke $offset er sat, sættes den til 0
$pr_side = 10; // Antal resultater pr. side
if (isset($_SESSION['username'])) {
//Laver en query der cheker om han har et billede selv i databasen
$query = mysql_query("SELECT * FROM picture WHERE user ='". $_SESSION['username'] ."' AND godkendt like 'yes' ") or die(mysql_error());
$row = mysql_fetch_assoc($query);
echo "Hi: ". $_SESSION['username']. " ......Here some of the GUIDE from the database.";
if (!isset($row['user'])){
echo " If u like to see ppl <b>picture</b>, " . $_SESSION['username']. " then you have to upload you <b>picture </b>to.";
echo '<meta http-equiv="refresh" content="6; URL=/upload.php" />';
exit;
}
else{
// Henter poster fra picture databasen
$query = mysql_query("SELECT * FROM picture WHERE type1 BETWEEN '26' and '34' AND type LIKE 'Women' AND godkendt like 'yes' LIMIT $offset,$pr_side") or die (mysql_error());
// Henter poster fra new_picture databasen
$flerepic = mysql_query("SELECT * FROM new_picture WHERE godkendt like 'yes'") or die (mysql_error());
while($row = mysql_fetch_array($flerepic)) {
$flerepic = $row['user'];
//echo $picuser;
}
echo"<table border='0' width='60' height='100' align='top'>";
$i=0;
$antal = 1;//Det antal billeder som skal vises i hver række
while($row = mysql_fetch_array($query)) {
if($i%$antal == 0){
echo "<tr>";
echo "<td>";
}
if($row['user']==$flerepic){
$picuser = $row['user'];
}else{
$picuser = "no_pic";
}
//echo $picuser;
$navn = $row['navn'];
$billede = $row['filnavn'];
//echo $billede;
$sti = "../../upload/pic/new";
//$test = "<a href='java script:popwin('$sti/$billede\','pop_118967460','700','500','yes','yes')' show('</a>";
//echo "<img src=\"$sti/$billede\"/>";
extract($row);
//echo $test;
echo "<td><a href=\"java script:PopWin('
http://www.c2chat.com/upload/$picuser/test.php', 'popup', 'yes','yes')\"><img src=\"$sti/$billede\"/ . width='100' height='100' border='1'></a>";
echo "<td>$overskrift<br>";
echo "Hi I'am: ";
echo "$navn. ";
echo "My ChatName in voodoo chat is : $chat.<br>";
echo "I Like to Guide ". $_SESSION['username']. " : $type2. ";
echo "Looking for a Guide: $type3. ";
echo "AND Looking for a : $type4.<br> ";
echo "Country: <u> $country</u>. ";
echo "City: <u>$city</u>.<br>";
echo "Age: $type1. years old. ";
echo "$besk ";
$i++;
echo "<hr width='540' align='left'>";
}
echo "</td>";
echo "</tr>";
echo "</table>";
// Tæller antal poster i databasen
$tael = mysql_query("SELECT COUNT(*) AS antal FROM picture") or die (mysql_error());
$antal = mysql_result($tael,0);
if ($offset >= $pr_side) {
$forrige = $offset-$pr_side;
echo "<a href='?offset=$forrige'>Forrige</a> ";
}
$page = 1;
for($start=0; $antal > $start; $start=$start+$pr_side){
if ($start != $offset) {
echo "<a href='?offset=$start'>$page</a> ";
} else {
echo "$page ";
}
$page++;
}
if ($antal > $offset+$pr_side) {
$naeste = $offset+$pr_side;
echo "<a href='?offset=$naeste'>Next</a>";
}
}}
?>
<script language=JavaScript>
<!-- Gem koden for gamle browsere
function PopWin(url,h,w) {
popupWin = window.open(url, 'popup', 'height=390', 'width=140', 'top=50', 'left=50');
}
// -->
</script>
<script language=Javascript>
if (self==parent) location.replace("../../c2chat.htm");
</script>