<?php

session_start();


include "../config.php";


if (isset($_POST['action'])) {
   $action = $_POST['action'];
}

if (isset($_POST['save'])) {
   $save = 1;
} else $save = 0;

if ($memtype=="PRO") {
            $savesolos = $prosavesolos;
        }
        elseif ($memtype=="JV Member"){
           $savesolos = $jvsavesolos;
        }
		elseif ($memtype=="SUPER JV"){
            $savesolos = $superjvsavesolos;
        }

if( isset($_SESSION["ulogin"]) ) {

    if ($action=="send") {
		if (empty($subject)){
			include "../header.php";
	include "../style.php";
    include("navigation.php");
    include("../banners.php");
    echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";
       		?><p>No subject entered. Click <a href=addsolos.php>here</a> to go back<p> <?
       		include "../footer.php";
       		exit;
    	}
		if (empty($adbody)){
			include "../header.php";
	include "../style.php";
    include("navigation.php");
    include("../banners.php");
    echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";
       		?><p>No adbody entered. Click <a href=addsolos.php>here</a> to go back<p> <?
       		include "../footer.php";
       		exit;
    	}
		if (empty($url)){
			include "../header.php";
	include "../style.php";
    include("navigation.php");
    include("../banners.php");
    echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";
       		?><p>No url entered. Click <a href=addsolos.php>here</a> to go back<p> <?
       		include "../footer.php";
       		exit;
    	}
		
    	$subject = dbput($subject);
    	$adbody = dbput($adbody);
    	$url = dbput($url);

    	$query = "update solos set subject='$subject', adbody='$adbody', sent=0, url='$url', date='".time()."' where id=".$id;
    	$result = mysql_query ($query)
	     	or die ("Query failed");
			
			
		if($save AND $savedcount < $savesolos) {
			mysql_query("insert into saved_solos (subject,adbody,userid,url) values('$subject','$adbody','$userid','$url')");
		}		
			

    	?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Frame Breaker Test</title>
<META HTTP-EQUIV="Refresh" Content="10; URL=addsolos_checked.php?id=<? echo $id; ?>">
</head>

  <frameset ROWS="60,*" BORDER=0 FRAMEBORDER=1 FRAMESPACING=0>
  <frame name="header" scrolling="no" noresize marginheight="1" marginwidth="1" target="main" src="addsolos_check.php?id=<? echo $id; ?>">
  <frame name="main" src="<? echo dbget($url); ?>">
  </frameset>
  
</html>		
		
    	<?
    }
    else {

	include "../header.php";
	include "../style.php";
    include("navigation.php");
    include("../banners.php");
    echo "<font size=2 face='$fonttype' color='$fontcolour'><p><center>";
	
	$savedsql = mysql_query("SELECT * FROM saved_solos WHERE userid = '$userid'");
	$savedcount = @mysql_num_rows($savedsql);
	

    if($action == "Delete") {
			mysql_query("DELETE FROM saved_solos WHERE id='".$_POST['id']."' AND userid = '".$userid."'");
			echo "<center><p><b>The saved ad has been deleted successfully.</b></p></center><br><br>";
	} else {
	
	
	

	
	//Solo available
	$query = "SELECT * FROM solos where added=0 and userid='".$_SESSION[uname]."' limit 1";
	$result = mysql_query ($query)
		or die ("Query failed");
	while ($line = @mysql_fetch_array($result)) {
	
			
        $id = $line["id"];
		

		if($savedcount) {
			echo "<font size=3><b>Your Saved Solos</b></font><br><br>You can save up to $savesolos ads.";
			
			echo "<table border=1 cellpadding=5><tr align=\"center\"><td><b>Subject</b><td><b>Action</b></td></tr>";
			
			while($each = mysql_fetch_array($savedsql)) {
				
				echo "<tr><td>".$each['subject']."</td><td>";
				
					?>
						  <form method="POST" action="addsolos.php">
						  <input type="hidden" name="id" value="<? echo $id; ?>">
						  <input type="hidden" name="subject" value="<? echo dbget($each['subject']); ?>">
						  <input type="hidden" name="adbody" value="<? echo dbget($each['adbody']); ?>">
						  <input type="hidden" name="url" value="<? echo dbget($each['url']); ?>">
						  <input type="hidden" name="action" value="send">
						  <input type="submit" value="Post Solo"></p>
						  </form>
				
					<?
				
				
				echo "<form method=\"post\"><input type=\"hidden\" name=\"id\" value=\"".$each['id']."\"><input type=\"submit\" name=\"action\" value=\"Delete\"></form></td></tr>";
			}
			
			echo "</table><br><br>";
		}
		
		

            $subject = $line["subject"];
            $adbody = $line["adbody"];
            ?>
              <center><H2>ADD YOUR SOLO ADS</H2>
<p><B>PLEASE LIMIT YOUR SOLO AD POSTING TO ONLY 1 A DAY AT MOST.  </B>No adult, offensive or illegal ads (including pyramid schemes and chainletters).  <BR><b><font size=3></font></p><p align="center"><font color="#000000" face="tahoma" size="2"><b>
<font size="2"><span style="background-color: #FFFF00">PLEASE DO NOT INCLUDE 
URLS IN THE BODY OF YOUR SOLO AD - FAR TOO MANY OF THE WEBSITES BEING PROMOTED 
ARE ALREADY &quot;BLACKLISTED&quot; BY THE TOP ISPS AND IT IS CAUSING SOLO ADS TO BOUNCE ALOT - MEANING LESS PEOPLE ARE READING YOUR ADS! ONLY PLACE THE URL IN 
THE CREDIT LINK BOX AT THE BOTTOM</span></font></b></font></p>
<BR><BR>Use the tags ~fname~ for the FIRST name and ~userid~ for the user ID in the body and in the subject of the solo ad.<br><br>

		<!-- tinyMCE -->
		<script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
		<script language="javascript" type="text/javascript">
		tinyMCE.init({
			mode : "textareas",
			theme : "advanced",
			extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"
		});
		</script>
		<!-- /tinyMCE -->


              <form method="POST" action="addsolos.php">
              Subject:<br>
              <input type="text" name="subject" maxsize="70"><br>
              Ad body:<br>
              <textarea  name="adbody" cols="65" rows="30">
<font size="+1">In Accordance with the New FTC Law changes:

 <br><br>

<strong>No more $$$ amounts allowed in subject lines.</strong>

 <br><br>

Make sure your claims in your ads can be backed up with solid proof. (No outlandish claims of any type)

 <br><br>

No subject lines that are deceptive in nature. (e.g Join business X and make $XXX,XXX a month!)

 
<br><br>
<font color="#FF0000">No adult, offensive or illegal ads</font> (including pyramid schemes and chainletters).
<br><br>
 

PLEASE DO NOT INCLUDE URLS IN THE BODY OF YOUR SOLO AD IN ANY FORM (IMAGES OR DISGUISED IN HTML FORMAT). FAR TOO MANY OF THE WEBSITES BEING PROMOTED ARE ALREADY BLACKLISTED BY THE TOP ISPS AND IT IS CAUSING SOLO ADS TO BOUNCE ALOT. MEANING LESS PEOPLE ARE READING YOUR ADS! ONLY PLACE THE URL IN THE CREDIT LINK BOX AT THE BOTTOM <strong>PLEASE DELETE THIS TEXT BEFORE POSTING YOUR SOLO AD</strong>
<br><br>

PLEASE KEEP YOUR ADS SHORT TO MAKE THEM EFFECTIVE . UP TO 1500 CHARACTERS MAX. ADS WITH MORE THAN 1500 CHARACTERS WILL SLOW DOWN THE SERVER WHEN SEND THE AD OUT.
<br><br>
 

<strong>If any of your ads violate any of these rules I will delete your ad and a blank Solo ad will be sent back to you!!</strong></font></textarea>
              <br>



			  Ad URL:<br>
              <input type="text" name="url" maxsize="1250"><br>
              <input type="hidden" name="id" value="<? echo $id; ?>">
              <input type="hidden" name="action" value="send">
              <p>Enter the website address you want traffic to go to above, include 
				<span style="background-color: #FFFF00">http://</span> <br>  Double check your Solo ad, as it cannot be edited once submitted.</p>
				<? if($savedcount < $savesolos) echo "<input type=\"checkbox\" name=\"save\" value=\"1\"> Save ad <br>"; ?>
              <input type="submit" value="Send">
              </form></center>
<br>
 <center><h3><font color=#000080>Check Your URLS for Frame Breaking Before
You Send Them Out!</font></h3></center>

<center><h3><font color=#000080>Protect Your Membership By Using the Tool
Below! <br>

(Opens in New Window)</font></h3></center>

<center>
<FORM NAME='urtotest' target="_blank" ACTION='<? echo $domain; ?>/members/sitecheck.php'
METHOD='GET' >

<input type='text' value="http://" size="50" name='url' />

<input type='submit' value='Check URL' />
</FORM>

            <?
    	}
    }
    echo "</td></tr></table>";
	
	}
	
  }
else
  { 
  
			include "../header.php";
	include "../style.php";  
  
  ?>

  <p>You must be logged in to access this site. Please <a href="../index.php">click here</a> to login.</p>

  <? }

include "../footer.php";
mysql_close($dblink);
?>