File size: 7.54Kb
<?php
include("head.php");
echo "<div><br/>Wapirate Dating!<br/></div>";
echo "<p align=\"center\">";
addonline(getuid_sid($sid),"Viewing Dating System","");
////////////////////////////////////////MAIN PAGE
if($action=="main")
{
$result=mysql_query("select * from ibwf_dating where cat='m4f'");
$mf = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='f4m'");
$fm = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='m4m'");
$mm = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='f4f'");
$ff = mysql_num_rows($result);
echo "<img src=\"/images/dating.gif\" alt=\"\"/></p>";
echo "<p><img src=\"images$folder/normal.gif\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=m4f\">Guys for Girls</a>($mf)<br/>";
echo "<img src=\"images$folder/normal.gif\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=f4m\">Girls for Guys</a>($fm)<br/>";
echo "<img src=\"images$folder/normal.gif\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=m4m\">Guys for Guys</a>($mm)<br/>";
echo "<img src=\"images$folder/normal.gif\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=f4f\">Girls for Girls</a>($ff)<br/>";
echo "</p>";
echo "<p align=\"center\">";
echo "<br/><a title=\"Enter\" href=\"dating.php?action=add\">Add Card</a>";
echo getfoot($sid,$folder);
exit();
}
/////////////////////////////////////////////
else if($action=="datingview")
{
$cat=$_GET["cat"];
$page=$_GET["page"];
if($page=="")
{
$page=1;
}
$max_results = 7;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dating WHERE cat='$cat'"));
if($total_results[0]<1)
{
echo "No Profiles To Show Yet<br/>";
}else{
$total_pages = ceil($total_results[0] / $max_results);
echo "$page Of $total_pages<br/><br/>";
echo "</p>";
echo "<p>";
$sql = mysql_query("SELECT * FROM ibwf_dating WHERE cat='$cat' ORDER BY id desc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$name = $row['uid'];
$key = $row['id'];
$sqlthing = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_users WHERE id='$name'"));
$age=getage($sqlthing["birthday"]);
$uname=$sqlthing["name"];
echo "<a href=\"dating.php?action=card&cat=$cat&key=$key\">~$uname(Age: $age)~</a><br/>" ;
}
echo "</p>";
echo "<p align=\"center\">";
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"dating.php?action=datingview&page=$next&cat=$cat\">Next</a><br />";
}
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"dating.php?action=datingview&page=$prev&cat=$cat\">Prev</a><br/>";
}
$i = 1; $i <= $total_pages; $i++ ;
}
echo "<br/><a href=\"dating.php?action=main\">Dating Index</a>";
echo getfoot($sid,$folder);
exit();
}
////////////////////////////////////////////////////////////////////////////
else if($action=="card")
{
$key=$_GET["key"];
$cat=$_GET["cat"];
$sql = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_dating WHERE id='$key'"));
$usid=$sql["uid"];
$who=$usid;
$name=getnick_uid($usid);
$about=$sql["aboutme"];
$looking=$sql["lookingfor"];
$avlink = getavatar($usid);
echo "<br/><img src=\"$avlink\" alt=\"avatar\" width=\"100\" hieght=\"100\"/>";
echo "</p>";
echo "<p>";
echo "<b>*Username*</b><br/> <a href=\"index.php?action=viewuser&who=$usid\">$name</a><br/><br/>";
$about = parsepm($about, $sid,left,$usid);
echo "<b>*About*</b><br/> $about<br/><br/>";
$looking = parsepm($looking, $sid,left,$usid);
echo "<b>*Looking For*</b><br/> $looking<br/>";
echo "<br/>";
echo "<a href=\"inbox.php?action=sendpm&who=$usid\">Send $name A PM</a><br/><br/>";
$uid = getuid_sid($sid);
if(budres($uid, $who)==0)
{
echo "<a href=\"genproc.php?action=bud&who=$who&todo=add\">Add to buddy List</a><br/>";
}else if(budres($uid, $who)==1)
{
echo "Queued Buddy Requests<br/>";
}else if(budres($uid, $who)==2)
{
echo "<a href=\"genproc.php?action=bud&who=$who&todo=del\">Remove From Buddy List</a><br/>";
}
$ires = ignoreres($uid, $who);
if(es==2)
{
echo "<a href=\"genproc.php?action=ign&who=$who&todo=del\">Remove From Ignore List</a><br/>";
}else if($ires==1)
{
echo "<a href=\"genproc.php?action=ign&who=$who&todo=add\">Add to Ignore List</a><br/>";
}
echo "</p>";
echo "<p align=\"center\">";
if($usid==$uid||isstatus5(getuid_sid($sid))){
echo "<a href=\"dating.php?action=delad&cid=$key\">Delete Card</a><br/><br/>";
}
echo "<a href=\"dating.php?action=datingview&cat=$cat\">Back</a>";
echo "<br/><a href=\"dating.php?action=main\">Dating Index</a>";
echo getfoot($sid,$folder);
exit();
}
///////////////////////////////////////////////////////
else if($action=="add")
{
echo "Here you can Place Your Own Advert In Our Dating System, Simply Enter The Details Below To Add Your Card</p>";
echo "<form action=\"dating.php?action=add2\" method=\"post\">";
echo "<p>";
echo "About Me:<br/>";
echo "Hobbies Intrests etc<br/>";
echo "<input name=\"aboutme\"/><br/>";
echo "Looking For:<br/>";
echo "<input name=\"lookingfor\"/><br/>";
echo "Your Gender:";
echo "<br/><select name=\"first\">";
echo "<option value=\"m\">Male</option>";
echo "<option value=\"f\">Female</option>";
echo "</select>";
echo "<br/>Gender wanted:";
echo "<br/><select name=\"second\">";
echo "<option value=\"f\">Female</option>";
echo "<option value=\"m\">Male</option>";
echo "</select>";
echo "<br/><input name=\"submit\" value=\"Add Card\" type=\"submit\"/></p></form>";
echo "<p align=\"center\">";
echo getfoot($sid,$folder);
exit();
}
/////////////////////////////////////////////
else if($action=="add2")
{
$about=$_POST["aboutme"];
$looking=$_POST["lookingfor"];
$cat1=$_POST["first"];
$cat2=$_POST["second"];
$cat=$cat1."4".$cat2;
$ui=getuid_sid($sid);
$result=mysql_query("select * from ibwf_dating where uid='$ui' and cat='$cat'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0){
echo "You Already Have A Card In This Category!<br/>";
}else{
//echo "<img src=\"images/dating.gif\" alt=\"\"/>$sitename-Dating<img src=\"images/dating.gif\" alt=\"\"/><br/>";
$sql = "INSERT INTO ibwf_dating (uid, cat, aboutme, lookingfor) VALUES ('$ui','$cat','$about','$looking')";
$result = mysql_query($sql);
echo "Cupids Arrow Has Been Fired, But Where Will It Land?<br/>";
}
echo "<br/><a href=\"dating.php?action=main\">Dating Index</a><br/>";
echo getfoot($sid,$folder);
exit();
}
/////////////////////////////////////////////
else if($action=="delad")
{
$cid=$_GET["cid"];
$test = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_dating WHERE id='".$cid."'"));
if($test[0]==$uid||isstatus5(getuid_sid($sid))){
$res = mysql_query("DELETE FROM ibwf_dating WHERE id='".$cid."'");
if($res)
{
echo "<img src=\"../images$folder/ok.gif\" alt=\"O\"/>Card Deleted Successfully<br/>";
}else{
echo "<img src=\"../images$folder/notok.gif\" alt=\"X\"/>Error Deleting Card<br/>";
}
}else{
echo "<img src=\"../images$folder/notok.gif\" alt=\"X\"/>You Can Not Delete This Card<br/>";
}
echo "<br/><a href=\"dating.php?action=main\">Dating Index</a><br/>";
echo getfoot($sid,$folder);
exit();
}
?>