\r\nReply-To: $eaddress\r\nX-Mailer: PHP" . phpversion()); $result= "subject = ".$subject."
". $body."
". $payer_email."
". $sys_item_name."
". $eaddress; return $result; } $action = $_REQUEST['action']; $prodlist = "
  • UnSelect Product
  • "; foreach($products as $prod) { $prodlist .= "
  • "; $prodlist .= $prod['item_name']; $prodlist .= "
  • "; } $dir = "addons/"; $groups=array(); $addons=array(); // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if($file != "." && $file != ".." && filetype($dir . $file) == "dir") { $groups[]="addons/".$file."/"; } } closedir($dh); } foreach($groups as $group) { $dir = $group; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if($file != "." && $file != ".." && filetype($dir . $file) == "dir") { $installfile=$group.$file."/install.php"; $adminfile=$group.$file."/admin.php"; if(file_exists($installfile) && file_exists($adminfile)) { $addons[]=$group.$file."/"; } } } } } } foreach($addons as $addon) { $nodes = explode("/", $addon); $folder=$nodes[1]; $sub_folder=$nodes[2]; $sql="SELECT * FROM addons WHERE groupfolder='".$folder."' AND addonfolder='".$sub_folder."'"; $addres=@mysql_query($sql); if(mysql_num_rows($addres)) $installed=true; while($addrec=@mysql_fetch_assoc($addres)) { $addid=$addrec['id']; $adddesc=$addrec['description']; $addonlist .= "
  • "; $addonlist .= $addrec['title']; $addonlist .= "
  • "; } } if($installed) $addonlist .="
  • "; foreach($addons as $addon) { $nodes = explode("/", $addon); $folder=$nodes[1]; $sub_folder=$nodes[2]; $sql="SELECT * FROM addons WHERE groupfolder='".$folder."' AND addonfolder='".$sub_folder."'"; $addres=@mysql_query($sql); if(!mysql_num_rows($addres)) { $uninstalled=true; $addonlist .= "
  • "; $addonlist .= ""; $addonlist .= $sub_folder; $addonlist .= ""; $addonlist .= "
  • "; } } if($uninstalled) $addonlist .="
  • "; } # ________________________________ $pageheader = " RAP Admin Panel for: ".$sys_domain." _ _ _ _ _
    "; # ________________________________ $pagefooter = "
    Copyright ©2007 Rapid Action Profits. All Rights Reserved.
    Daily crossword puzzle web gadget.MOM website containing information pertaining to labour Mom.Autos - Find used bmw 325.Offers new and used jdm.Now in its third generation, themx5.Gadizmo is your news source for the latest gadgets gizmos.The Best Web Monitor for Logging mom.Welcome to the all new and improved car dealers.All rights are reserved by new suzuki.Web gadgets and applications from Smart web gadgets.The Official site for all new 2009 chevy trucks.Thousands of new and used motorcycles.Topics Related to stages of pregnancy.Honda recalls 200000 quads.Information on fitness man s health.In the United States, an antique cars.Jeep classifieds including Jeep parts used jeeps for sale.The Ford 2001 thunderbird.Click on any new bmw.A discussion forum dedicated to all generations of the Honda prelude.Welcome to Airport travel agency.The official bmw.In the mid-1990s the mercurys.Search a large range of new & used bikes.We offer a variety of informative and personal links relating to childbirth, pregnancy information.Find cheap airline travel tickets.Chrysler introduced the Dodge caravan.Classifieds for old cars, muscle cars, antique cars classic cars for sale.The Mazda mx6.The CJ-5 was influenced by new corporate owne cj5.Honda VTX custom chopper parts vtx.Description of the 2002 thunderbird.The 2006 BMW 3-Series will be offered as the 2006 bmw 325i.Find new Nissan cars and 2009 2010 nissan cars.Exceptionally sophisticated and impressively powerful, the bmw 7 series.Even in markets where the car is sold as a hyundai tuscani.Nissan Maxima Enthusiasts Site nissan maxima.Intelligent Spy Electronic gadget storerecipes using steak ums recipes using steak ums the term is Silverchair's victor a marcial vega victor a marcial vega result burn hill halo mapping tools v3 5 halo mapping tools v3 5 complete ship nehemiah old man praying painting nehemiah old man praying painting also criticized interesting facts about the element beryllium interesting facts about the element beryllium to solve nubiles presents jenni nubiles presents jenni I love the way ambidextrous bolt release ambidextrous bolt release solve metal s pdif vs digital coaxil s pdif vs digital coaxil what I came model leyla milani pics model leyla milani pics in their single foremost films jeff belkin foremost films jeff belkin The field may be two guys one girl two guys one girl which has a phase frnech artists frnech artists know water than call first who may biostatician biostatician pragmatists wanted rolladen recipes rolladen recipes had paid her a visit recipe thomas english muffin recipe thomas english muffin this pervasive w126 vs w140 w126 vs w140 latter explanation omega psi phi branding irons omega psi phi branding irons imagine provide agree amateurcreampies amateurcreampies neurology or waterpik fs 015 pedicure foot spa waterpik fs 015 pedicure foot spa was relative to specific john deere f910 mower information john deere f910 mower information that is derived futurshop canada futurshop canada who advocate lansky diamond knife sharpener lansky diamond knife sharpener he criticized attempts resolution dell problems resolution dell problems to an annoyance weed sayings weed sayings size vary settle speak marachino cherry square recipes marachino cherry square recipes that is entirely recipe for wanton noodle recipe for wanton noodle sea draw left starcraft spawn game starcraft spawn game I may add that unreal adult photos by ellias unreal adult photos by ellias bank collect save control cinesa parquesur cinesa parquesur of angst glug swedish drink glug swedish drink fort on that marks clerk marks clerk trance personage mountain hight ski resort in california mountain hight ski resort in california if will way gammon recipe gammon recipe experience I believe this hornings hide north plains oregon hornings hide north plains oregon is the Russian composer mansfield minerals mansfield minerals solve metal oki 9600 consumables oki 9600 consumables A belief was globe handset prepaid kits philippines globe handset prepaid kits philippines for all of us barbie cooking games barbie cooking games Psychological warfare pthc liluplanet pthc liluplanet The only residents are now military personnel rhodes roll recipes rhodes roll recipes cause much mean before gameshark pokemon cristal gameshark pokemon cristal A child Herman inside round roast beef recipe inside round roast beef recipe Furthermore black popeyed goldfish black popeyed goldfish the test of intellectual codici action replay max codici action replay max ine appears chinese food vegetables pictures chinese food vegetables pictures square reason length represent laurie furnell laurie furnell Has A Body Count what is flash frozen food what is flash frozen food of truth wildfire four wheelers wildfire four wheelers also criticized pinoy okoy recipe pinoy okoy recipe point of disagreement tk performance jacksonville fl tk performance jacksonville fl or true for one person beef topside roast recipe beef topside roast recipe circumstances as jacques bourboulon gallery jacques bourboulon jacques bourboulon gallery jacques bourboulon the war reshma malayalam actress netscape com reshma malayalam actress netscape com visit past soft fun facts on the excretory system fun facts on the excretory system after a contested election orcas in the food chain orcas in the food chain individuals who were voyuer downblouse pictures voyuer downblouse pictures by the threat recipes for merrimints recipes for merrimints how the relation recipes greek lemon chicken recipes greek lemon chicken the writer's name school animated gif school animated gif However it red lobster baked potato recipe red lobster baked potato recipe in the subject craigs list akron canton craigs list akron canton and known works sweatshop warriors summary sweatshop warriors summary the mood of the music opening night store gahanna ohio opening night store gahanna ohio on the former interracial janet mason interracial janet mason research death lichelle marie video clips lichelle marie video clips such beliefs kmd tube amps kmd tube amps except wrote seven layer caramel cake recipe seven layer caramel cake recipe so does navy seabag inspection navy seabag inspection age section dress volvo vct2000 sale volvo vct2000 sale brought heat snow p6vem p6vem the Late Middle Ages dont stop beliving lyrics dont stop beliving lyrics type law bit coast patti labelle mac and cheese recipe patti labelle mac and cheese recipe move right boy old galitsin s alice galitsin s alice mark often gabriella montez scandal gabriella montez scandal out as Herrin cake simple recipe cake simple recipe of our concrete universe pantang larang ibu mengandung pantang larang ibu mengandung science eat room friend foods of middle ages foods of middle ages Pestilence recipe for steak ala oscar recipe for steak ala oscar early hold west refurbished schwinn evolution sr spinner bikes refurbished schwinn evolution sr spinner bikes to solve western food in singapore western food in singapore ask no leading questions 1994 chevy cavalier serpentine belt diagram 1994 chevy cavalier serpentine belt diagram annoying twystis twystis James was anxious taiwan av model taiwan av model ask no leading questions svens place bbs gate 1 svens place bbs gate 1 Quine instrumental make ahead turkey dinner make ahead turkey dinner your how said an alfasex models alfasex models dance engine calapan scandal xtube calapan scandal xtube arrive master track miwlf miwlf wild instrument kept henry choo chong henry choo chong final gave green oh cr7 airplane cr7 airplane mother world dr bob pierce biography dr bob pierce biography My sister in hp pavilion dv6244us hp pavilion dv6244us by sight and had 580 case loader backhoe on ebay 580 case loader backhoe on ebay particular stimuli foods rich in phosphorus foods rich in phosphorus slip win dream route 66 chords and lyrics route 66 chords and lyrics made true by mfx video rapidshare mfx video rapidshare oxygen sugar death dean flynn unzipped dean flynn unzipped is highly subjective carrie mythbusters fhm carrie mythbusters fhm Journal of Conflict sample affidavit letter for immigration sample affidavit letter for immigration that you could homemade liqueurs recipes homemade liqueurs recipes pains on this kwala bear kwala bear steam motion korean full house songs korean full house songs with them at the same time darryl allie gatlin darryl allie gatlin parent shore division sep gob sep gob branch match suffix jess the real hustle jess the real hustle distinct from the one you hand over mouth hand over mouth trouble shout macgregor venture 21 sailboat macgregor venture 21 sailboat a name or some small harry perry iii said harry perry iii said held hair describe panjiri recipe panjiri recipe and known works allison garcia of nj allison garcia of nj bank collect save control little cuties preteen little cuties preteen The letter was in Italian michelle irizarry michelle irizarry I may add that stampourri rubber stamps stampourri rubber stamps Medicine is both valio la pena english lyrics translation valio la pena english lyrics translation told knew pass since hogrock rally pics hogrock rally pics The science of medicine sugar free cake icing recipe sugar free cake icing recipe as a part of economics have, recipes chinese hot pot recipes chinese hot pot household management happy haunika happy haunika early hold west julia bond free clips julia bond free clips emitted in a narrow buttermilk candy recipe buttermilk candy recipe their domestic golden gyros west allis golden gyros west allis Pestilence carrier refer units compressor carrier refer units compressor film Heathers diagram of penis medical diagram of penis medical a tendency to present true north electric food smoker true north electric food smoker art subject region energy peanut butter zagnut bars recipe peanut butter zagnut bars recipe corn compare poem pro form 635 cw treadmill pro form 635 cw treadmill Putnam says this tiendas marshall tiendas marshall true beliefs amounted kyle shanahan mandy marriage kyle shanahan mandy marriage monochromatic light recipe pork loin chop recipe pork loin chop expedient in human existence pennsylvania dutch soft sugar cookie recipes pennsylvania dutch soft sugar cookie recipes Nuttall's book Bomb abby winters marguerite abby winters marguerite a tendency to present video gratis licenciada tetarelli video gratis licenciada tetarelli property column militaryclassified billy queerclick militaryclassified billy queerclick can pass from nigellas christmas recipes nigellas christmas recipes key iron k3fe cn 6 k3fe cn 6 copy phrase kudler fine food access report kudler fine food access report My later knowledge ruemorgue entertainment ruemorgue entertainment one was more likely fish master travis edition fish master travis edition no most people my over beretta 950 jetfire review beretta 950 jetfire review cool design poor lyrics opera marriage of figaro lyrics opera marriage of figaro run it worked peavey session 400 schematics peavey session 400 schematics remember step peter barretts garden centre peter barretts garden centre investigate religion's hot totty recipe hot totty recipe the self is a concept finedrive 350 gps finedrive 350 gps silent tall sand decorating icing recipe decorating icing recipe to explain psychologically wc value plus v wc value plus v distant fill east lori mccommas lori mccommas out as Herrin kings inn restaurant kingsville texas kings inn restaurant kingsville texas my sister large labias large labias spirits whom she had hot girls on streetbikes hot girls on streetbikes clothe strange carnation fudge recipe carnation fudge recipe Truth is defined loadperf 3011 3012 loadperf 3011 3012 sun four between these days by chantal kreviazuk lyrics these days by chantal kreviazuk lyrics down side been now collagen containing foods collagen containing foods an area of knowledge coca cola bottle cursor coca cola bottle cursor stop once base satalite immages satalite immages of our concrete universe 30 aut 6 rifle 30 aut 6 rifle wavelength spectrum foto sexy mujer caracas foto sexy mujer caracas were satisfying they enabled us to lead fuller mull wine recipe mull wine recipe law went the next day robert kenly robert kenly and art with which they maduritas sex maduritas sex life are absent from creative labs sb0410 driver creative labs sb0410 driver spell add even land trollbead jewelry trollbead jewelry to which the street used saddle bronc saddles used saddle bronc saddles of absolute certainty pillsbury breadstick recipes pillsbury breadstick recipes hard start might candid beach angels candid beach angels record boat common gold baby trend sun dance nursery center baby trend sun dance nursery center so highly k ball solution k ball solution to in human life eastern woodland climate eastern woodland climate decision making kelly rippa divorce kelly rippa divorce formally trained bob richards weatherman st louis bob richards weatherman st louis not to recognise kjac tv 4 kjac tv 4 Medicine is both hobie 33 for sale hobie 33 for sale that varies randomly clive watkins estate agents in wirral clive watkins estate agents in wirral to an external rubias puta rubias puta of health science rachel inthecrack rachel inthecrack utility in a person's aztec contributions to society aztec contributions to society we can out other were dustin charapata dustin charapata He would seek flying tippler pigeons flying tippler pigeons that varies randomly 9th gen corolla 9th gen corolla rather than one's self mailoo mailoo James also argued kenwood tm 261 manual kenwood tm 261 manual diagnosis and treatment mini schnauzers for sale in oklahoma mini schnauzers for sale in oklahoma women season solution tokyo diva express 3 torrent tokyo diva express 3 torrent describes the intense savage arms mark ii lr 22 savage arms mark ii lr 22 John Dewey ic402 software kit ic402 software kit weight general woodworking plans corner breakfast nook woodworking plans corner breakfast nook line of le psy lyrics le psy lyrics in practice as well as misguided mcconnell taping procedure for shoulder mcconnell taping procedure for shoulder prehistoric periods
    "; # ________________________________ if($action=="login") { # Verify admin username/password. if($_POST['username'] == $sys_adminuser && $_POST['password'] == $sys_adminpass) { $_SESSION['admin']=true; unset($_SESSION['errmsg']); header("Location: $_SERVER[PHP_SELF]"); exit; } else { $_SESSION['errmsg'] = "login error"; header("Location: $_SERVER[PHP_SELF]"); exit; } } if(!isset($_SESSION['admin'])) { # Login required for admin area. echo <<< END $pageheader
    Admin Login   END; if(isset($_SESSION['errmsg'])) echo "Invalid Username or Password - Retry"; echo <<< END   Username :  Password :   
    $pagefooter END; exit; } if(isset ($_REQUEST['product'])) $_SESSION['product']=$_REQUEST['product']; if($_SESSION['product']) { $productID = $_SESSION['product']; $byproduct = " WHERE id = ".$productID; } else { $productID = 0; $byproduct = ""; } switch ($action) { case "phpinfo": phpinfo(); exit; break; case "system": if($_POST['submit']){ $adminuser=trim($_POST['adminuser']); $adminpass=trim($_POST['adminpass']); $domain=trim($_POST['domain']); $support=trim($_POST['support']); $fraud=trim($_POST['fraud']); $paypal=trim($_POST['paypal']); $sandbox=trim($_POST['sandbox']); $admin_email=trim($_POST['admin_email']); if($_POST['glb_affiliates']){ $glb_affiliates=1; } else { $glb_affiliates=0; } $sql="UPDATE admin SET username='".$adminuser."',password='".$adminpass."', domain='".$domain."',support='".$support."',fraud='".$fraud."',paypal='".$paypal."', sandbox='".$sandbox."',admin_email='".$admin_email."',glb_affiliates='".$glb_affiliates."'"; $adm=@mysql_query($sql); if($_POST['disable']) { $sql="SELECT * FROM products"; $pres=@mysql_query($sql); while($prec=@mysql_fetch_assoc($pres)) { $update=@mysql_query("UPDATE products SET disabled=1"); } } header("Location: $_SERVER[PHP_SELF]"); exit; break; } $sql="select * from admin LIMIT 1"; $arec=@mysql_query($sql); $arow=@mysql_fetch_array($arec); $sys_adminuser = $arow['username']; $sys_adminpass = $arow['password']; $sys_support = $arow['support']; $sys_fraud = $arow['fraud']; $sys_paypal = $arow['paypal']; $sys_sandbox = $arow['sandbox']; $sys_adminmail = $arow['admin_email']; if($arow['glb_affiliates']==1){ $sys_glbaff=1; } else { $sys_glbaff=0; } echo <<< END $pageheader Global System Settings
     
    Admin Username :
    Admin Password :
    Disable Products?
    Shared Affiliates? END; if($sys_glbaff == 0) { echo ""; } else { echo ""; } echo <<< END
    Your Domain :
    Support Address :
    Fraud Address :
    Paypal Address :
    "Seller" Address for
    Paypal Sandbox :
    Administrator Email :

     

    Choose a Username for logging in to the Admin Area.
    Choose a Password for logging in to the Admin Area.
    USE WITH CARE. Checking this box will disable ALL products under control of this Admin Panel. There is no way to re-enable all products. Each product must be re-enabled one at a time from the Product Maintenance.
    Check this box if you want to allow resellers to benefit from cross-promotion of your products
    Enter your domain name. (i.e. yourdomain.com) DO NOT include the www.
    Enter your support email address or Contact Page URL.
    Enter an email address for notification of fraudulent purchases.
    Enter your Primary Paypal email address.
    Enter your Paypal Sandbox "seller" email address.
    Enter an email address for notification of sales, etc.
    $pagefooter END; exit; break; case "setup": unset ($_SESSION['product']); if(isset($_SESSION['product']) && $_SESSION['product'] != 0){ unset ($_SESSION['errmsg']); header("Location: $_SERVER[PHP_SELF]?action=setup"); exit; } case "maint": if($action=='setup' && (isset($_SESSION['product']) && $_SESSION['product'] != 0)){ unset ($_SESSION['errmsg']); unset ($_SESSION['product']); header("Location: $_SERVER[PHP_SELF]?action=setup"); exit; } if($action=='maint' && (!isset($_SESSION['product']) || $_SESSION['product'] == 0)){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ unset ($_SESSION['errmsg']); if(trim($_POST['install_folder']) == "/"){ $install_folder="/"; } else { $install_folder="/".trim($_POST['install_folder'],"/")."/"; } if(isset($_POST['disabled'])){ $disabled=1; } else { $disabled=0; } if(isset($_POST['testmode'])){ $testmode=1; } else { $testmode=0; } if(isset($_POST['ipn_email_log'])){ $ipn_email_log=1; } else { $ipn_email_log=0; } if(isset($_POST['affcenter'])){ $affcenter=1; } else { $affcenter=0; } if(isset($_POST['show_discprice'])){ $show_discprice=1; } else { $show_discprice=0; } $tmpl_folder=trim($_POST['tmpl_folder'],"/")."/"; $item_currency=$_POST['currency']; $item_locale=$_POST['locale']; $item_name=trim($_POST['item_name']); $item_number=trim($_POST['item_number']); $item_price=0+(trim($_POST['item_price'])); $item_download=trim($_POST['item_download']); if(isset($_POST["bypass_squeeze"])){ $bypass_squeeze=1; } else { $bypass_squeeze=0; } if(isset($_POST["aw_flag"])){ $aw_flag=1; } else { $aw_flag=0; } $aw_meta_web_id=trim($_POST['aw_meta_web_id']); $aw_unit=trim($_POST['aw_unit']); $ar_form=str_replace(' name=\"optin\"','',trim($_POST['ar_form'])); $ar_form=str_replace(' id=\"optin\"','',$ar_form); $ar_form=str_replace(' target=\"iframe\" style=\"display:none\"','',$ar_form); $ar_form=str_replace('""){ $resizer=new thumbnailit; $result=$resizer->ResizeImg($old_name,$new_name,$maximum_size); } $sql="SELECT * FROM products WHERE install_folder = '".$install_folder."' AND id <> ".$productID; $pres=@mysql_query($sql); $rcount = @mysql_num_rows($pres); if ($rcount>0) $_SESSION['errmsg'] = "Install Folder Used by Another Product"; $sql="SELECT * FROM products WHERE item_number = '".$item_number."' AND id <> ".$productID; $pres=@mysql_query($sql); $rcount = @mysql_num_rows($pres); if ($rcount>0) $_SESSION['errmsg'] = "Item Number Used by Another Product"; if($oto_flag) { $sql="SELECT * FROM products WHERE (item_number = '".$oto_number."' OR oto_number = '".$oto_number."') AND id <> ".$productID; $pres=@mysql_query($sql); $rcount = @mysql_num_rows($pres); if ($rcount>0) $_SESSION['errmsg'] = "OTO Item Number Used by Another Product"; } if(!isset($_SESSION['errmsg'])) { if($action=="setup"){ $sql="INSERT INTO products (disabled,testmode,ipn_email_log,install_folder,tmpl_folder,item_name, item_number,currency,locale,item_price,item_download, bypass_squeeze,aw_flag,ar_form, affcenter, oto_flag,oto_name,oto_number,oto_price,oto_download, cancel_url,get_zips,expire,taf,max_sales,cust_only, otocust_only,giveaway,ipn_email,ipn_pending_email, item_desc,item_kw,item_imgfile,oto_desc,oto_kw,oto_imgfile, eq1_paypal,eq2_paypal,eq1_pct,eq2_pct,show_discprice) VALUES (".disabled.",".$testmode.",".$ipn_email_log.",'".$install_folder."','".$tmpl_folder."','".$item_name. "','".$item_number."','".$item_currency."','".$item_locale."','".$item_price."','".$item_download. "',".$bypass_squeeze.",".$aw_flag.",'".$ar_form."','".$affcenter. "',".$oto_flag.",'".$oto_name."','".$oto_number."','".$oto_price."','".$oto_download. "','".$cancel_url."',".$get_zips.",'".$expire."',".$taf.",'".$max_sales."',".$cust_only. ",".$otocust_only.",".$giveaway.",'".$ipn_email."','".$ipn_pending_email. "','".$item_desc."','".$item_kw."','".$item_imgfile. "','".$oto_desc."','".$oto_kw."','".$oto_imgfile. "','".$eq1_paypal."','".$eq2_paypal."','".$eq1_pct."','".$eq2_pct."',".$show_discprice.")"; } else { $sql="UPDATE products SET disabled=$disabled,testmode=$testmode,ipn_email_log=$ipn_email_log, install_folder='".$install_folder."',tmpl_folder='".$tmpl_folder."',item_name='".$item_name."', item_number='".$item_number."',currency='".$item_currency."',locale='".$item_locale."', item_price=$item_price,item_download='".$item_download."',bypass_squeeze=$bypass_squeeze, aw_flag=$aw_flag,ar_form='".$ar_form."',oto_flag=$oto_flag,oto_name='".$oto_name."', oto_number='".$oto_number."',oto_price=$oto_price,oto_download='".$oto_download."', cancel_url='".$cancel_url."',get_zips=$get_zips,expire=$expire,taf=$taf,affcenter=$affcenter, max_sales=$max_sales,cust_only=$cust_only,otocust_only=$otocust_only,giveaway=$giveaway, ipn_email=$ipn_email,ipn_pending_email='".$ipn_pending_email."',item_desc='".$item_desc."', item_kw='".$item_kw."',item_imgfile='".$item_imgfile."',oto_desc='".$oto_desc."', oto_kw='".$oto_kw."',oto_imgfile='".$oto_imgfile."',eq1_paypal='".$eq1_paypal."', eq2_paypal='".$eq2_paypal."',eq1_pct=$eq1_pct,eq2_pct=$eq2_pct,show_discprice=$show_discprice WHERE id=".$_SESSION['product']; } $prod=@mysql_query($sql); if($action=="setup"){ $productID=@mysql_insert_id(); # create default sales letter $sql="INSERT INTO salesletters (productID,template) VALUES (".$productID.",'salespage.html')"; $result=@mysql_query($sql); # create default system emails $subject = "%firstname%, Your purchase has been flagged for review."; $body = "%firstname%,\n\nIt appears that you are trying to purchase %itemname% from yourself. We apologize if this is not the case. This purchase has been flagged for manual review by the product owner, and you will be contacted directly from them with download instructions should this be a mistake.\n\nIf you did not purchase from yourself, contact the product owner immediately at:\n\n%contact%"; $sql = "INSERT INTO emails (productID,type,subject,body) VALUES (".$productID.",'fraud','".$subject."','".$body."')"; @mysql_query($sql); $subject = "%firstname%, Your download link for %itemname%"; $body = "%firstname%,\n\nThank you for your purchase of %itemname%.\nTo download your copy, click here:\n\n%download%\n\nYou have %expire% hours to download before the link expires.\nWe appreciate your business.\nFor support, visit our web site at:\n\n%contact%\n\nThanks again.\n"; $sql = "INSERT INTO emails (productID,type,subject,body) VALUES ($productID,'download','".$subject."','".$body."')"; @mysql_query($sql); $subject = "%firstname%, There was a problem with your purchase."; $body = "%firstname%,\n\nWe're sorry for the inconvenience, but there was a problem confirming your purchase.\n\nPlease contact our support staff for your download link at: \n\n%contact%\n\nPlease paste a copy of your PayPal receipt into your message for verification. \n\nNOTICE: If you paid with an eCheck or bank draft, the download link will automatically be emailed to you once your payment clears.\n\n"; $sql = "INSERT INTO emails (productID,type,subject,body) VALUES ($productID,'echeck','".$subject."','".$body."')"; @mysql_query($sql); $subject = "%sender% would like you to visit %domain%"; $body = "Hi there,\n\nA friend of yours, %sender%, asked that I tell you about\nsome quick, easy strategies for making money on the internet.\n\n%sender% would like you to click the link below for more information:\n\n%taflink%\n\nThanks!"; $sql = "INSERT INTO emails (productID,type,subject,body) VALUES ($productID,'taf','".$subject."','".$body."')"; @mysql_query($sql); } header("Location: $_SERVER[PHP_SELF]"); exit; } } echo <<< END $pageheader END; if(isset($_SESSION['errmsg'])){ $message=$_SESSION['errmsg']; echo "$message"; unset ($_SESSION['errmsg']); } else { echo "
    ".$sys_item_name."
    "; } echo <<< END
    Product Set Up
      Use this page to set up the parameters for a specific product.   END; # Get product from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from products"; $sql.=" WHERE id =".$_SESSION['product']; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); if(isset($prow["disabled"])){ $disabled=1; } else { $disabled=0; } if(isset($prow["testmode"])){ $testmode=1; } else { $testmode=0; } if(isset($prow["ipn_email_log"])){ $ipn_email_log=1; } else { $ipn_email_log=0; } if(isset($prow["affcenter"])){ $affcenter=1; } else { $affcenter=0; } if(isset($prow["show_discprice"])){ $show_discprice=1; } else { $show_discprice=0; } $install_folder=$prow['install_folder']; $tmpl_folder=$prow['tmpl_folder']; $item_name=$prow['item_name']; $item_number=$prow['item_number']; $item_desc=$prow['item_desc']; $item_kw=$prow['item_kw']; $item_imgfile=$prow['item_imgfile']; $item_currency=$prow['currency']; $item_locale=$prow['locale']; $item_price=$prow['item_price']; $item_download=$prow['item_download']; if(isset($prow["bypass_squeeze"])){ $bypass_squeeze=1; } else { $bypass_squeeze=0; } if(isset($prow["aw_flag"])){ $aw_flag=1; } else { $aw_flag=0; } $aw_meta_web_id=$prow['aw_meta_web_id']; $aw_unit=$prow['aw_unit']; $ar_form=$prow['ar_form']; if(isset($prow["oto_flag"])){ $oto_flag=1; } else { $oto_flag=0; } $oto_name=$prow['oto_name']; $oto_number=$prow['oto_number']; $oto_desc=$prow['oto_desc']; $oto_kw=$prow['oto_kw']; $oto_imgfile=$prow['oto_imgfile']; $oto_price=$prow['oto_price']; $oto_download=$prow['oto_download']; $cancel_url=$prow['cancel_url']; $taf_count=$prow['taf_count']; if(isset($prow["get_zips"])){ $get_zips=1; } else { $get_zips=0; } $expire=$prow['expire']; if(isset($prow["taf"])){ $taf=1; } else { $taf=0; } $max_sales=$prow['max_sales']; if(isset($prow["cust_only"])){ $cust_only=1; } else { $cust_only=0; } if(isset($prow["otocust_only"])){ $otocust_only=1; } else { $otocust_only=0; } if(isset($prow["giveaway"])){ $giveaway=1; } else { $giveaway=0; } if(isset($prow["ipn_email"])){ $ipn_email=1; } else { $ipn_email=0; } if(isset($prow["ipn_pending_email"])){ $ipn_pending_email=1; } else { $ipn_pending_email=0; } $eq1_paypal=$prow['eq1_paypal']; $eq2_paypal=$prow['eq2_paypal']; if(isset($prow["eq1_pct"])){ $eq1_pct=$prow['eq1_pct']; } else { $eq1_pct=0; } if(isset($prow["eq2_pct"])){ $eq2_pct=$prow['eq2_pct']; } else { $eq2_pct=0; } } else { # set defaults/hints $disabled=0; $testmode=0; $ipn_email_log=0; $affcenter=1; $install_folder="/"; $tmpl_folder="tmpl/"; $item_name="Your Product"; $item_number="Your-Product"; $item_desc=""; $item_kw=""; $item_imgfile=""; $item_currency="USD"; $item_locale="US"; $item_price=7.00; $show_discprice=0; $item_download="dlds/download.zip"; $bypass_squeeze=false; $aw_flag=false; $aw_meta_web_id=""; $aw_unit=""; $ar_form=""; $oto_flag=true; $oto_name="Your One-Time Offer"; $oto_number="Your-OTO"; $oto_desc=""; $oto_kw=""; $oto_imgfile=""; $oto_price=47.00; $oto_download="dlds/OTOdownload.zip"; $cancel_url="http://YourDomain.com/cancel_url"; $get_zips=0; $expire=48; $taf=1; $max_sales=0; $cust_only=false; $otocust_only=fales; $giveaway=false; $ipn_email=true; $eq1_paypal=""; $eq2_paypal=""; $eq1_pct=0; $eq2_pct=0; } echo <<< END
    Check this box to disable this product for site maintenance
    Check this box to use your Paypal Sandbox Account for testing
    Check this box to have all Paypal IPN transactions emailed to you.
    Change this if you're installing the /product/ folder into a subfolder (i.e. if installing into yourdomain.com/ebook1/, set this value to /ebook1/)
    This is the folder where HTML templates are kept. It is relative to the Install Folder (above). Enter only the folder name, followed by a SLASH.
    The currency that should be used when the customer makes a purchase. The default is USD (US Dollars)
    The location to send visitors who cancel the transaction after being sent to Paypal
    Set this variable to a value greater than zero if you want to limit the sales to a fixed number of sales and then shut down the script
    Expire the download page after how many hours? MUST NOT BE ZERO
    Check this box if you want to gather Country/State(Province)/Zip info from customers.
    Check this box if you want to use the Tell-A-Friend script on the download page to let your customers promote the product to your friends immediately after they purchase.
    un-Check this box to prevent a download link automatically being emailed to the customer after a purchase
    Check this box if you don't want to show the squeeze page after a purchase. You will still be able to Broadcast Mail to your Customers via the Admin Panel.
    Check this box if you want to use the automatic opt-in feature. This will also bypass the Squeeze page as though you had selected the above option and requires that the next two parameters be supplied.
    This is the HTML opt-in form with all fields required by your auto-responder script or service.
    Modify the form with the following tokens to define where RAP should supply the name and email address:
    %fullname%
    %firstname%
    %lastname%
    %email%
    %affiliate%
    %redirect%
    For instance... value="%email%"
    Must be unique (used in payment transactions)
    Must be unique (used in payment transactions)
    The price you want to charge for your product.
    Check this box if you don't actually want to SELL your product, but want to give it away for the opt-ins and one-time-offer money.
    Note - There is no provision for automatic opt-ins with a Giveaway product, so you MUST use the squeeze page to capture opt-ins if you choose this option.
    Check this box if you only want customers to earn commissions from the sale of your product
    Location of Product download file.
    Check this box if you want to use the OTO feature.
    Must be unique (used in payment transactions).
    Must be unique (used in payment transactions).
    The price you want to charge for your One-Time Offer.
    Check this box if you only want customers who bought your One-Time Offer to earn commissions from the sale of your One-Time Offer.
    Location of One-Time Offer Product download file.
    Check this box to cause an email to be sent automatically informing a customer if their purchase is Pending for any reason
    Enter a brief description of your product for purposes of search engine optimization
    Enter a list of keyword phrases related to your product for purposes of search engine optimization. Separate each phrase with a comma.
    Enter the PRIMARY paypal address of an EQUITY PARTNER. When it is time to pay the merchant, your earnings will be shared with this partner (based on the percentage entered in the next field).
    Equity partner share is paid BEFORE the merchants share.
    Leave blank if there is no equity partner.
    The % of net payments (after sales commissions) that should be sent to this equity partner. This percentage is paid on both the front-end and the OTO product.
    (Do not enter the % sign).
    NOTE - The sum of the equity partner percentages must be less than 100 or you won't make any money
    Enter the PRIMARY paypal address of an EQUITY PARTNER. When it is time to pay the merchant, your earnings will be shared with this partner (based on the percentage entered in the next field).
    Equity partner share is paid BEFORE the merchants share.
    Leave blank if there is no equity partner.
    The % of net payments (after sales commissions) that should be sent to this equity partner. This percentage is paid on both the front-end and the OTO product.
    (Do not enter the % sign).
    NOTE - The sum of the equity partner percentages must be less than 100 or you won't make any money
    Select a locale that speaks the language that you want the Paypal login page to show. The default is US (Unitd States)
    Enter the file name for your product image. This file is optional, but must reside in the <products>/images/ folder.
    Enter a brief description of your product for purposes of search engine optimization
    Enter a list of keyword phrases related to your product for purposes of search engine optimization. Separate each phrase with a comma.
    Enter the file name for your product image. This file is optional, but must resde in the products/images/ folder.
    Check this box if you want to show this product to resellers in the Affiliate Center.
    Check this box if you want to show coupon discount prices to your Sales Page visitors. Otherwise, the discounted price will not show until after visitor clicks order button and proceeds to Paypal.
    $pagefooter END; exit; break; case "editmails": if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ $dld_subject=trim($_POST['dld_subject']); $dld_body=trim($_POST['dld_body']); $echk_subject=trim($_POST['echk_subject']); $echk_body=trim($_POST['echk_body']); $fraud_subject=trim($_POST['fraud_subject']); $fraud_body=trim($_POST['fraud_body']); $taf_subject=trim($_POST['taf_subject']); $taf_body=trim($_POST['taf_body']); if(!isset($_SESSION['errmsg'])) { # tell-a-friend email $sql="SELECT * FROM emails WHERE productID = ".$_SESSION['product']." AND type = 'taf'"; $eres=@mysql_query($sql); if(@mysql_num_rows($eres) > 0) { $sql="UPDATE emails SET subject='".$taf_subject."',body='".$taf_body."' WHERE productID=".$_SESSION['product']." AND type='taf'"; @mysql_query($sql); } else { $sql="INSERT INTO emails (productID,type,subject,body) VALUES (".$productID.",'taf','".$taf_subject."','".$taf_body."')"; } $res=@mysql_query($sql); # eCheck (Pending) email $sql="SELECT * FROM emails WHERE productID = ".$_SESSION['product']." AND type = 'echeck'"; $eres=@mysql_query($sql); if(@mysql_num_rows($eres) > 0) { $sql="UPDATE emails SET subject='".$echk_subject."',body='".$echk_body."' WHERE productID=".$_SESSION['product']." AND type='echeck'"; @mysql_query($sql); } else { $sql="INSERT INTO emails (productID,type,subject,body) VALUES (".$productID.",'echeck','".$echk_subject."','".$echk_body."')"; } $res=@mysql_query($sql); # download email $sql="SELECT * FROM emails WHERE productID = ".$_SESSION['product']." AND type = 'download'"; $eres=@mysql_query($sql); if(@mysql_num_rows($eres) > 0) { $sql="UPDATE emails SET subject='".$dld_subject."',body='".$dld_body."' WHERE productID=".$_SESSION['product']." AND type='download'"; @mysql_query($sql); } else { $sql="INSERT INTO emails (productID,type,subject,body) VALUES (".$productID.",'download','".$dld_subject."','".$dld_body."')"; } $res=@mysql_query($sql); # fraud email $sql="SELECT * FROM emails WHERE productID = ".$_SESSION['product']." AND type = 'fraud'"; $eres=@mysql_query($sql); if(@mysql_num_rows($eres) > 0) { $sql="UPDATE emails SET subject='".$fraud_subject."',body='".$fraud_body."' WHERE productID=".$_SESSION['product']." AND type='fraud'"; @mysql_query($sql); } else { $sql="INSERT INTO emails (productID,type,subject,body) VALUES (".$productID.",'fraud','".$fraud_subject."','".$fraud_body."')"; } $res=@mysql_query($sql); header("Location: $_SERVER[PHP_SELF]"); exit; } } echo <<< END $pageheader END; # Get emails from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from emails"; $sql.=" WHERE productID =".$_SESSION['product']; $sql.=" AND type='taf'"; $eres=@mysql_query($sql); $erow=@mysql_fetch_array($eres); $taf_subject=$erow['subject']; $taf_body=$erow['body']; $sql="select * from emails"; $sql.=" WHERE productID =".$_SESSION['product']; $sql.=" AND type='echeck'"; $eres=@mysql_query($sql); $erow=@mysql_fetch_array($eres); $echk_subject=$erow['subject']; $echk_body=$erow['body']; $sql="select * from emails"; $sql.=" WHERE productID =".$_SESSION['product']; $sql.=" AND type='download'"; $eres=@mysql_query($sql); $erow=@mysql_fetch_array($eres); $dld_subject=$erow['subject']; $dld_body=$erow['body']; $sql="select * from emails"; $sql.=" WHERE productID =".$_SESSION['product']; $sql.=" AND type='fraud'"; $eres=@mysql_query($sql); $erow=@mysql_fetch_array($eres); $fraud_subject=$erow['subject']; $fraud_body=$erow['body']; } echo <<< END
    General Settings
    Site Offline? END; if($prow['disabled'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Test Mode? END; if($prow['testmode'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Email IPN Log? END; if($prow['ipn_email_log'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Install Folder :
    Template Folder :
    Maximum # of Sales :
    Expiration Limit :
    Show in Affiliate Center? END; if($prow['affcenter'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Get Physical Locations? END; if($prow['get_zips'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Tell A Friend? END; if($prow['taf'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Send Download Link via Email? END; if($prow['ipn_email'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Send Pending Payment Email? END; if($prow['ipn_pending_email'] == 0) { echo ""; } else { echo ""; } echo <<< END

    Paypal Options
    Equity Partner 1 Paypal Address :
    Equity Partner 1 Percentage :
    Equity Partner 2 Paypal Address :
    Equity Partner 2 Percentage :
    Paypal Currency :
    Paypal Locale :
    Paypal Cancel URL :

    Squeeze Page Options
    Bypass Squeeze Page? END; if($prow['bypass_squeeze'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Auto Opt-in for Customers? END; if($prow['aw_flag'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Automatic Opt-in Form :

    Front End Product Settings
    Item Name :
    Item Number :
    Item Price :
    Show Discount Price on Sales Page? END; if($prow['show_discprice'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Product Description :
    Product Keywords :
    Product Image File :
    Give Away Product? END; if($prow['giveaway'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Customers Only? END; if($prow['cust_only'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Download Location :

    One Time Offer Settings
    One-Time Offer? END; if($prow['oto_flag'] == 0) { echo ""; } else { echo ""; } echo <<< END
    OTO Item Name :
    OTO Item Number :
    OTO Price :
    OTO Product Description :
    OTO Product Keywords :
    OTO Product Image File :
    OTO Customers Only? END; if($prow['otocust_only'] == 0) { echo ""; } else { echo ""; } echo <<< END
    OTO Download Location :
     
     
    END; if(isset($_SESSION['errmsg'])){ $message=$_SESSION['errmsg']; echo "$message"; unset ($_SESSION['errmsg']); } else { echo "
    ".$sys_item_name."
    "; } echo <<< END
    System Email Maintenance
     
    This is the email sent to customers with their Download Link.
    Modify the Subject and Message with the following tokens to define where RAP should supply replacemant values:
    %firstname%
    %lastname%
    %fullname%
    %itemname%
    %download%
    %expire%
    %contact%
    This is the email sent to customers whose payment is in PENDING status.>.
    Modify the Subject and Message with the following tokens to define where RAP should supply replacemant values:
    %firstname%
    %lastname%
    %fullname%
    %itemname%
    %contact%
    This is the Fraud Email sent to customers who attempt to purchase from themself.
    Modify the Subject and Message with the following tokens to define where RAP should supply replacemant values:
    %firstname%
    %lastname%
    %fullname%
    %itemname%
    %contact%
    This is the Tell a Friend email sent when a customers refers others to your site.
    Modify the Subject and Message with the following tokens to define where RAP should supply replacemant values:
    %sender%
    %domain%
    %taflink%
    $pagefooter END; exit; break; case "affsetup": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ unset ($_SESSION['errmsg']); if(isset($_POST["two_tier"])){ $two_tier=1; } else { $two_tier=0; } $item_pct=0+(trim($_POST['item_pct'])); $item_pct2=0+(trim($_POST['item_pct2'])); $oto_pct=0+(trim($_POST['oto_pct'])); $oto_pct2=0+(trim($_POST['oto_pct2'])); $sql="SELECT * FROM products WHERE id = ".$productID; $pres=@mysql_query($sql); $rcount = @mysql_num_rows($pres); if(!isset($_SESSION['errmsg'])) { if($rcount>0) { $sql="UPDATE products SET two_tier=$two_tier,item_pct=$item_pct,item_pct2=$item_pct2, oto_pct=$oto_pct,oto_pct2=$oto_pct2 WHERE id=".$_SESSION['product']; } $prod=@mysql_query($sql); header("Location: $_SERVER[PHP_SELF]?action=$action"); exit; } } echo <<< END $pageheader END; # Get product from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from products"; $sql.=" WHERE id =".$_SESSION['product']; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); if(isset($prow["two_tier"])){ $two_tier=1; } else { $two_tier=0; } $item_pct=$prow['item_pct']; $item_pct2=$prow['item_pct2']; $oto_pct=$prow['oto_pct']; $oto_pct2=$prow['oto_pct2']; } else { # set defaults/hints $two_tier=false; $item_pct=0; $item_pct2=0; $oto_pct=0; $oto_pct2=0; } echo <<< END
    Download Email
    Download Email Subject :
    Download Email Message :

    Pending Email
    Pending Email Subject :
    Pending Email Message :

    Fraud Email
    Fraud Email Subject :
    Fraud Email Message :

    Tell A Friend Email
    Tell A Friend Subject :
    Tell A Friend Message :

     
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "
    Select a Product First
    "; if($_SESSION['errmsg'] == 'product selected') echo "
    Un-Select the Product First
    "; unset ($_SESSION['errmsg']); }else{ echo "
    ".$sys_item_name."
    "; } echo <<< END
    Reseller Program Setup
     
    Check this box to allow Two Tier reseller payments.
    The % of payments that should be sent to your resellers
    (Do not enter the % sign).
    The % of payments that should be sent to your resellers on sales made by other people referred by them.
    (Do not enter the % sign).
    The % of payments that should be sent to your resellers when they make a sale of your One-Time Offer
    (Do not enter the % sign).
    The % of payments that should be sent to your resellers on sales of your One-Time Offer made by other people referred by them.
    (Do not enter the % sign).
    $pagefooter END; exit; break; case "affoptin": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ unset ($_SESSION['errmsg']); if(isset($_POST["aw_aff_flag"])){ $aw_aff_flag=1; } else { $aw_aff_flag=0; } $aff_ar_form=str_replace(' name=\"optin\"','',trim($_POST['aff_ar_form'])); $aff_ar_form=str_replace(' id=\"optin\"','',$aff_ar_form); $aff_ar_form=str_replace('0) { $sql="UPDATE products SET aw_aff_flag=$aw_aff_flag,aff_ar_form='".$aff_ar_form."' WHERE id=".$_SESSION['product']; } $prod=@mysql_query($sql); header("Location: $_SERVER[PHP_SELF]?action=$action"); exit; } } echo <<< END $pageheader END; # Get product from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from products"; $sql.=" WHERE id =".$_SESSION['product']; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); if(isset($prow["aw_aff_flag"])){ $aw_aff_flag=1; } else { $aw_aff_flag=0; } $aff_ar_form=$prow['aff_ar_form']; } else { # set defaults/hints $aw_aff_flag=false; $aff_ar_form=""; } echo <<< END
    2-Tier Reseller Program? END; if($prow['two_tier'] == 0) { echo ""; } else { echo ""; } echo <<< END

    Item Percent :
    2nd-Tier Item Percent :

    OTO Percent :
    2nd-Tier OTO Percent :

     
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "
    Select a Product First
    "; if($_SESSION['errmsg'] == 'product selected') echo "
    Un-Select the Product First
    "; unset ($_SESSION['errmsg']); }else{ echo "
    ".$sys_item_name."
    "; } echo <<< END
    Auto-Responder Setup for Resellers
     
    Check this box if you want to automatically add Resellers to an auto-responder list.
    This is the HTML opt-in form with all fields required by your auto-responder script or service.
    Modify the form with the following tokens to define where RAP should supply the name and email address:
    %fullname%
    %firstname%
    %lastname%
    %email%
    %redirect%
    For instance... value="%email%".
    $pagefooter END; exit; break; case "jvsetup": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ unset ($_SESSION['errmsg']); $jvcode=trim($_POST['jvcode']); $jv_item_pct=0+(trim($_POST['jv_item_pct'])); $jv_item_pct2=0+(trim($_POST['jv_item_pct2'])); $jv_oto_pct=0+(trim($_POST['jv_oto_pct'])); $jv_oto_pct2=0+(trim($_POST['jv_oto_pct2'])); $sql="SELECT * FROM products WHERE id = ".$productID; $pres=@mysql_query($sql); $rcount = @mysql_num_rows($pres); if(!isset($_SESSION['errmsg'])) { if($rcount>0) { $sql="UPDATE products SET jvcode='".$jvcode."', jv_item_pct=$jv_item_pct,jv_item_pct2=$jv_item_pct2,jv_oto_pct=$jv_oto_pct,jv_oto_pct2=$jv_oto_pct2 WHERE id=".$_SESSION['product']; } $prod=@mysql_query($sql); header("Location: $_SERVER[PHP_SELF]?action=$action"); exit; } } echo <<< END $pageheader END; # Get product from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from products"; $sql.=" WHERE id =".$_SESSION['product']; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); $jvcode=$prow['jvcode']; $jv_item_pct=$prow['jv_item_pct']; $jv_item_pct2=$prow['jv_item_pct2']; $jv_oto_pct=$prow['jv_oto_pct']; $jv_oto_pct2=$prow['jv_oto_pct2']; } else { # set defaults/hints $jvcode=""; $jv_item_pct=0; $jv_item_pct2=0; $jv_oto_pct=0; $jv_oto_pct2=0; } echo <<< END
    Auto Opt-in for Resellers? END; if($prow['aw_aff_flag'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Automatic Opt-in Form : 

     
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "
    Select a Product First
    "; if($_SESSION['errmsg'] == 'product selected') echo "
    Un-Select the Product First
    "; unset ($_SESSION['errmsg']); }else{ echo "
    ".$sys_item_name."
    "; } echo <<< END
    JV Program Setup
     
    Secret Code to allow others to sign up as a JV Partner.
    The % of front-end payments that should be sent to your JV Partners. (Do not enter the % sign).
    The % of front-end payments that should be sent to your JV Partners on sales made by Resellers/Partners referred by them. (Do not enter the % sign).
    The % of OTO payments that should be sent to your JV Partners. (Do not enter the % sign).
    The % of OTO payments that should be sent to your JV Partners on sales made by other Resellers/Partners referred by them. (Do not enter the % sign).
    $pagefooter END; exit; break; case "jvoptin": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if($_POST['submit']){ unset ($_SESSION['errmsg']); if(isset($_POST["aw_jv_flag"])){ $aw_jv_flag=1; } else { $aw_jv_flag=0; } $jv_ar_form=str_replace(' name=\"optin\"','',trim($_POST['jv_ar_form'])); $jv_ar_form=str_replace(' id=\"optin\"','',$jv_ar_form); $jv_ar_form=str_replace('0) { $sql="UPDATE products SET aw_jv_flag=$aw_jv_flag,jv_ar_form='".$jv_ar_form."' WHERE id=".$_SESSION['product']; } $prod=@mysql_query($sql); header("Location: $_SERVER[PHP_SELF]?action=$action"); exit; } } echo <<< END $pageheader END; # Get product from database if ($_SESSION['product'] && $_SESSION['product']!=0){ $sql="select * from products"; $sql.=" WHERE id =".$_SESSION['product']; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); if(isset($prow["aw_jv_flag"])){ $aw_jv_flag=1; } else { $aw_jv_flag=0; } $jv_ar_form=$prow['jv_ar_form']; } else { # set defaults/hints $aw_jv_flag=false; $jv_ar_form=""; } echo <<< END
    Joint Venture Code :

    JV Item Percent :
    JV 2nd Tier Item Percent :

    JV OTO Percent :
    JV 2nd Tier OTO Percent :

     
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "
    Select a Product First
    "; if($_SESSION['errmsg'] == 'product selected') echo "
    Un-Select the Product First
    "; unset ($_SESSION['errmsg']); }else{ echo "
    ".$sys_item_name."
    "; } echo <<< END
    Auto-Responder Setup for JV Partners
     
    Check this box if you want to automatically add JV Partners to an auto-responder list.
    This is the HTML opt-in form with all fields required by your auto-responder script or service.
    Modify the form with the following tokens to define where RAP should supply the name and email address:
    %fullname%
    %firstname%
    %lastname%
    %email%
    %redirect%
    For instance... value="%email%".
    $pagefooter END; exit; break; case "logout": # Logout. unset($_SESSION['admin']); header("Location: $_SERVER[PHP_SELF]"); exit; break; case "sales": case "mysales": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $count = $_REQUEST["count"]; if($count) $limit=" LIMIT ".$count; $sql="select * from sales WHERE productID=".$productID; if($_POST['frontend']) $sql.=" AND item_number ='".$sys_item_number."'"; if($_POST['oto']) $sql.=" AND item_number ='".$sys_oto_number."'"; if($action=="mysales") $sql.=" AND tier = 0"; $sql.=" ORDER BY purchased DESC"; $sql.=$limit; $sres=@mysql_query($sql); $rcount = @mysql_num_rows($sres); if($action=="mysales") { $selection = "only your direct sales"; } elseif($count){ $selection = "last $count"; } else { $selection = "all $rcount"; } echo $pageheader; ?> $pagefooter END; exit; break; case "delsale": if(isset($_GET['txn_id'])) { $txn_id=$_GET['txn_id']; $sql="DELETE FROM sales WHERE txn_id='".$txn_id."'"; $res=@mysql_query($sql); } header("Location: $_SERVER[PHP_SELF]"); exit; break; case "delslsltr": if(isset($_GET['tmpl'])) { $tmpl=$_GET['tmpl']; $sql="DELETE FROM salesletters WHERE productID=".$productID." AND template='".$tmpl."'"; $res=@mysql_query($sql); } header("Location: $_SERVER[PHP_SELF]?action=slsltrs"); exit; break; case "delprod": if(isset($_GET['prod'])) { $prod=$_GET['prod']; $sql="DELETE FROM products WHERE id=".$prod; $res=@mysql_query($sql); } header("Location: $_SERVER[PHP_SELF]?action=prodlist"); exit; break; case "refs": case "myrefs": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $sql="select * from sales WHERE productID=".$productID; if($action=="myrefs") $sql.=" AND receiver_email ='".$sys_paypal."' OR '".$sys_sandbox."'"; $sres=@mysql_query($sql); $rcount = @mysql_num_rows($sres); $selection = "all $rcount"; if($action=="myrefs") $selection = "only your direct sales"; echo <<< END $pageheader $pagefooter END; exit; break; case "resend": if(substr($sys_support, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_support; } $txn_id=$_GET['txn_id']; $sql="SELECT * FROM sales WHERE txn_id='".$txn_id."'"; $sres=@mysql_query($sql); while ($srec=@mysql_fetch_assoc($sres)) { $product = $srec['id']; $firstname = $srec['firstname']; $lastname = $srec['lastname']; $fullname=$srec['firstname']." ".$srec['lastname']; $item_name=$srec['item_name']; $payer_email=$srec['payer_email']; # Send download link to purchaser $sentdata=cust_email('download'); echo <<< END $pageheader;
    Auto Opt-in for JV Partners? END; if($prow['aw_jv_flag'] == 0) { echo ""; } else { echo ""; } echo <<< END
    Automatic Opt-in Form : 

     

    Sales Report for
    $sys_item_name
    Click on the 'Expires' date of a sale to re-validate the customer's download link for another $sys_expire hours.
    $rcount total sales. Showing $selection. Your sales are highlighted
    END; $bgcolor = "#ffffff"; while($sales=@mysql_fetch_array($sres)) { $rcount--; if(!$count || $rcount<=$count){ if($sales['tier']==0) $bgcolor = "#ccffcc"; $url=$sys_install_folder."?action=download&rx=1&id=".$sales['txn_id']." target=_blank"; $id = $sales['id']; $txn_id=$sales['txn_id']; $refunded=$sales['refunded']; $item_number=$sales['item_number']; $receiver=$sales['receiver_email']; $payer=$sales['payer_email']; $firstname=$sales['firstname']; $lastname=$sales['lastname']; $business=$sales['business']; $amount=$sales['payment_amount']; $discount_code=$sales['discount_code']; $purchased=$sales['purchased']; $expires=$sales['expires']; $affiliate=$sales['affiliate']; $tier=$sales['tier']; echo <<< END END; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } } echo <<< END
    Transaction ID Item Number Payee Email
    Tier / Reseller
    Customer Info Discount
    Code
    Amount Purchased Expires Delete?
    END; if($refunded) { echo $txn_id; } else { echo "$txn_id"; } echo <<< END $item_number $receiver
    $tier / $affiliate
    $firstname $lastname
    $payer
    $business
    $discount_code $amount $purchased END; if($refunded) { echo $expires; } else { echo"$expires"; } echo <<< END Delete Sale
     
     
    Referrer/Keywords Report for
    $sys_item_name
    $rcount total sales. Showing $selection.
    END; $bgcolor = "#ffffff"; $refs = array(); while($sales=@mysql_fetch_array($sres)) { $referrer=$sales['referrer']; if(isset($refs[$sales['referrer']])){ $refs[$sales['referrer']]++; } else{ $refs[$sales['referrer']]=1; } } arsort($refs); foreach($refs as $ref => $sales){ $parts = parse_url($ref); $host = str_replace("www.", "", $parts['host']); $keywords = ""; parse_str($parts['query'], $vars); $keywords = urldecode($vars['q']); // default - handles google and live.com if(strpos(' $host', 'yahoo')){ $keywords = urldecode($vars['p']); } elseif($vars['keywords']){ $keywords = urldecode($vars['keywords']); } elseif($vars['query']){ $keywords = urldecode($vars['query']); } else { } $referrer = $ref; if(strlen($ref)>100) $referrer = substr($ref, 0, 98) . ".."; echo <<< END END; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Referrer Domain Keywords Sales
    $referrer $host $keywords $sales
    $pagefooter "; exit; break; case "refdomains": case "myrefdomains": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $sql="select * from sales WHERE productID=".$productID; if($action=="myrefs") $sql.=" AND receiver_email ='".$sys_paypal."' OR '".$sys_sandbox."'"; $sres=@mysql_query($sql); $rcount = @mysql_num_rows($sres); $selection = "all $rcount"; if($action=="myrefs") $selection = "only your direct sales"; echo <<< END $pageheader
     
    Referrer Domain Report for
    $sys_item_name
    $rcount total sales. Showing $selection.
    END; $bgcolor = "#ffffff"; $refs = array(); while($sales=@mysql_fetch_array($sres)) { $referrer=$sales['referrer']; $parts = parse_url($referrer); $host = str_replace("www.", "", $parts["host"]); if(isset($refs[$host])){ $refs[$host]++; } else { $refs[$host]=1; } } arsort($refs); foreach($refs as $ref => $sales){ echo <<< END END; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Domain Sales
    $ref $sales
    $pagefooter"; exit; break; case "bypayee": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $sql="SELECT * FROM sales WHERE productID=".$productID; $sres=@mysql_query($sql); $rcount = @mysql_num_rows($sres); $selection = "all $rcount"; echo <<< END $pageheader
     
    Sales Report By Payee for
    $sys_item_name
    $rcount total sales records. Showing $selection.
    Your sales are highlighted.
    END; $bgcolor = "#ffffff"; $refs = array(); while($sales=@mysql_fetch_array($sres)) { $payee=$sales['receiver_email']; if(isset($refs[$payee])){ $refs[$payee]['count']++; $refs[$payee]['amount']+=$sales['payment_amount']; if($sales['refunded']) { $refs[$payee]['refunds']++; $refs[$payee]['refunded']+=$sales['payment_amount']; } } else { $sql="SELECT * FROM nicknames WHERE email = '".$payee."'"; $nres=@mysql_query($sql); $nrec=mysql_fetch_assoc($nres); if($nrec['pref_email']!="") { $refs[$payee]['email']=$nrec['pref_email']; } else { $refs[$payee]['email']=$payee; } $refs[$payee]['name']=$nrec['firstname']." ".$nrec['lastname']; $refs[$payee]['count']=1; $refs[$payee]['amount']=0+$sales['payment_amount']; if($sales['refunded']) { $refs[$payee]['refunds']=1; $refs[$payee]['refunded']=0+$sales['payment_amount']; } } } $totsales=0; $totamt=0; $totrefunds=0; $totrefunded=0; // Obtain a list of columns foreach ($refs as $ref => $payee) { $count[$ref] = $payee['count']; } // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($count, SORT_DESC, $refs); foreach($refs as $ref => $payee){ if(strtolower($ref)==strtolower($sys_paypal) || strtolower($ref)==strtolower($sys_sandbox)) $bgcolor = "#ccffcc"; $totsales+=$payee[count]; $totamt+=$payee[amount]; $totrefunds+=$payee[refunds]; $totrefunded+=$payee[refunded]; echo <<< END END; $netnet=$totamt-$totrefunded; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo <<< END
    Payee Email Sales Amount Refunds Net Amt
    $payee[name] $payee[email] $payee[count] $payee[amount] $payee[refunds] END; if($payee[refunds]) { $netamt=$payee[amount]-$payee[refunded]; echo $netamt; } echo <<< END
    Earnings Totals
    $totsales $totamt $totrefunds $netnet
    $pagefooter END; exit; break; case "byreferrer": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $sql="SELECT * FROM sales WHERE productID=".$productID; $sres=@mysql_query($sql); $rcount = @mysql_num_rows($sres); $selection = "all $rcount"; echo <<< END $pageheader
     
    Sales Report By Referrer for
    $sys_item_name
    $rcount total sales records. Showing $selection.
    Your sales are highlighted.
    END; $bgcolor = "#ffffff"; $refs = array(); while($sales=@mysql_fetch_array($sres)) { $referrer=$sales['affiliate']; if(isset($refs[$referrer])){ $refs[$referrer]['count']++; $refs[$referrer]['amount']+=$sales['payment_amount']; if (strtolower($sales[receiver_email])==strtolower($sys_eq1_paypal) || strtolower($sales[receiver_email])==strtolower($sys_eq2_paypal) ) { $refs[$referrer]['t0count']++; $refs[$referrer]['t0amt']+=$sales['payment_amount']; } else { if($sales['tier']==1) { $refs[$referrer]['t1count']++; $refs[$referrer]['t1amt']+=$sales['payment_amount']; } if($sales['tier']==2) { $refs[$referrer]['t2count']++; $refs[$referrer]['t2amt']+=$sales['payment_amount']; } if($sales['tier']==0) { $refs[$referrer]['t0count']++; $refs[$referrer]['t0amt']+=$sales['payment_amount']; } } if($sales['refunded']) { $refs[$referrer]['refunds']++; $refs[$referrer]['refunded']+=$sales['payment_amount']; } } else { $refs[$referrer]['count']=1; $refs[$referrer]['amount']=0+$sales['payment_amount']; if (strtolower($sales[receiver_email])==strtolower($sys_eq1_paypal) || strtolower($sales[receiver_email])==strtolower($sys_eq2_paypal) ) { $refs[$referrer]['t1count']=0; $refs[$referrer]['t2count']=0; $refs[$referrer]['t0count']=1; $refs[$referrer]['t1amt']=0; $refs[$referrer]['t2amt']=0; $refs[$referrer]['t0amt']=0+$sales['payment_amount']; } else { if($sales['tier']==1) { $refs[$referrer]['t1count']=1; $refs[$referrer]['t2count']=0; $refs[$referrer]['t0count']=0; $refs[$referrer]['t1amt']=0+$sales['payment_amount']; $refs[$referrer]['t2amt']=0; $refs[$referrer]['t0amt']=0; } if($sales['tier']==2) { $refs[$referrer]['t1count']=0; $refs[$referrer]['t2count']=1; $refs[$referrer]['t0count']=0; $refs[$referrer]['t1amt']=0; $refs[$referrer]['t2amt']=0+$sales['payment_amount']; $refs[$referrer]['t0amt']=0; } if($sales['tier']==0) { $refs[$referrer]['t1count']=0; $refs[$referrer]['t2count']=0; $refs[$referrer]['t0count']=1; $refs[$referrer]['t1amt']=0; $refs[$referrer]['t2amt']=0; $refs[$referrer]['t0amt']=0+$sales['payment_amount']; } } if($sales['refunded']) { $refs[$referrer]['refunds']=1; $refs[$referrer]['refunded']=0+$sales['payment_amount']; } $sql="SELECT * FROM nicknames WHERE email='".$referrer."'"; $nres=@mysql_query($sql); if(@mysql_num_rows($nres)>0) { $nrec=@mysql_fetch_assoc($nres); $refs[$referrer]['name']=$nrec['firstname']." ".$nrec['lastname']; if($nrec['pref_email']!="") { $refs[$referrer]['email']=$nrec['pref_email']; } else { $refs[$referrer]['email']=$referrer; } } } } $totsales=0; $totamt=0; $tott1sales=0; $tott1amt=0; $tott2sales=0; $tott2amt=0; $tot0sales=0; $tott0amt=0; $totrefunds=0; $totrefunded=0; // Obtain a list of columns foreach ($refs as $ref => $payee) { $count[$ref] = $payee['count']; } // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($count, SORT_DESC, $refs); foreach($refs as $ref => $referrer){ if(strtolower($ref)==strtolower($sys_paypal) || strtolower($ref)==strtolower($sys_sandbox)) $bgcolor = "#ccffcc"; $totsales+=$referrer[count]; $totamt+=$referrer[amount]; $tott1sales+=$referrer[t1count]; $tott1amt+=$referrer[t1amt]; $tott2sales+=$referrer[t2count]; $tott2amt+=$referrer[t2amt]; $tott0sales+=$referrer[t0count]; $tott0amt+=$referrer[t0amt]; $totrefunds+=$referrer[refunds]; $totrefunded+=$referrer[refunded]; echo <<< END END; $netnet=$totamt-$totrefunded; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo <<< END
    Referrer Email Name Tier 1
    Sales
    Tier 1
    Amount
    Tier 2
    Sales
    Tier 2
    Amount
    Merchant
    Sales
    Merchant
    Amount
    Total
    Referrals
    Total
    Amount
    Refunds Net
    Amount
    $referrer[email] $referrer[name] $referrer[t1count] $referrer[t1amt] $referrer[t2count] $referrer[t2amt] $referrer[t0count] $referrer[t0amt] $referrer[count] $referrer[amount] $referrer[refunds] END; if($referrer[refunds]) { $netamt=$referrer[amount]-$referrer[refunded]; echo $netamt; } echo <<< END
    Earnings Totals
    $tott1sales $tott1amt $tott2sales $tott2amt $tott0sales $tott0amt $totsales $totamt $totrefunds $netnet
    $pagefooter END; exit; break; case "affiliates": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } echo <<< END $pageheader
     
    Reseller Listing for
    $sys_item_name
    END; $bgcolor = "#ffffff"; $affiliates=array(); $sql="SELECT * from nicknames WHERE productID=".$productID." AND type = 'std' ORDER BY lastname,firstname"; $ares=@mysql_query($sql); while($arow=@mysql_fetch_array($ares)) { $id=$arow['id']; $name=$arow['firstname']." ".$arow['lastname']; $email=$arow['email']; $pref_email=$arow['pref_email']; if ($arow['pref_email']=="") $pref_email=$email; $nickname=$arow['nickname']; $sql="SELECT * FROM sales WHERE receiver_email='".$email."'"; $sres=@mysql_query($sql); $sales = 0; $referrals = 0; while($srow=@mysql_fetch_array($sres)) { $referrals++; if($email==$srow['receiver_email']) $sales++; } if($referrals==0) $referrals=""; if($sales==0) $sales=""; #count raw and unique $raw = mysql_query( "SELECT * FROM clicks WHERE affiliate = '$email' AND product = '$sys_item_name'" ); $raw = mysql_num_rows( $raw ); if( $raw < 1 ) $raw = "0"; $unique = mysql_query( "SELECT DISTINCT(ipaddress) FROM clicks WHERE affiliate = '$email' AND product = '$sys_item_name'" ); $unique = mysql_num_rows( $unique ); if( $unique < 1 ) $unique = "0"; echo <<< END "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Reseller nickname Paypal Email Contact Email Raw Clicks Unique Clicks Referrals Sales Delete?
    $name $nickname $email $pref_email $raw $unique $referrals $sales END; if($referrals==0){ ?> Delete Affililate
    $pagefooter"; exit; break; case "partners": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } echo <<< END $pageheader
     
    JV Partner Listing for
    $sys_item_name
    END; $bgcolor = "#ffffff"; $partners=array(); $sql="SELECT * from nicknames WHERE productID=".$productID." AND type = 'jv' ORDER BY lastname,firstname"; $pres=@mysql_query($sql); while($prow=@mysql_fetch_array($pres)) { $id=$prow['id']; $name=$prow['firstname']." ".$prow['lastname']; $email=$prow['email']; $pref_email=$prow['pref_email']; if ($prow['pref_email']=="") $pref_email=$email; $nickname=$prow['nickname']; $sql="SELECT * FROM sales WHERE affiliate='".$email."'"; $sres=@mysql_query($sql); $sales = 0; $referrals = 0; while($srow=@mysql_fetch_array($sres)) { $referrals++; if($email==$srow['receiver_email']) $sales++; } if($referrals==0) $referrals=""; if($sales==0) $sales=""; #count raw and unique $raw = mysql_query( "SELECT * FROM clicks WHERE affiliate = '$email' AND product = '$sys_item_name'" ); $raw = mysql_num_rows( $raw ); if( $raw < 1 ) $raw = "0"; $unique = mysql_query( "SELECT DISTINCT(ipaddress) FROM clicks WHERE affiliate = '$email' AND product = '$sys_item_name'" ); $unique = mysql_num_rows( $unique ); if( $unique < 1 ) $unique = "0"; echo <<< END "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Partner nickname Paypal Email Contact Email Raw Clicks Unique Clicks Referrals Sales Delete?
    $name $nickname $email $pref_email $raw $unique $referrals $sales END; if($referrals==0){ ?> Delete JV Partner
    $pagefooter"; exit; break; case "addon": if (isset($_REQUEST['do'])) { $folders=explode("/",$_REQUEST['path']); $groupfolder=$folders[0]; $addonfolder=$folders[1]; $filename="addons/".$groupfolder."/".$addonfolder."/install.php"; } else { # Show Addon admin page $addon_id = $_REQUEST["id"]; $sql="SELECT * FROM addons WHERE id =".$addon_id; $result=@mysql_query($sql); $addonrec=@mysql_fetch_assoc($result); $filename="addons/".$addonrec['groupfolder']."/".$addonrec['addonfolder']."/admin.php"; } echo $pageheader; include $filename; echo $pagefooter; exit; break; case "extend": # Extend validity of download link $txn_id = $_REQUEST["id"]; $expires = date('Y-m-d H:i:s',(time() + (3600 * $sys_expire))); $sql="UPDATE sales SET expires='".$expires."' WHERE txn_id ='".$txn_id."'"; $result=@mysql_query($sql); $sql="SELECT * FROM sales WHERE txn_id ='".$txn_id."'"; $result=@mysql_query($sql); $sales=@mysql_fetch_assoc($result); $payer_email = $sales['payer_email']; $sql="SELECT * FROM products WHERE id=".$sales['productID']; $prow=@mysql_query($sql); $prec=@mysql_fetch_assoc($prow); $pfolder=$prec['install_folder']; echo <<< END $pageheader

    The Download link has been validated for another $sys_expire hours.

    Give your customer (at $payer_email) the following link to download:

    http://$sys_domain$pfolder?action=download&rx=1&id=$txn_id

     
    Re-Send Download Link
    $pagefooter END; } exit; break; case "emailcustomers": # Show mailer form. unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } echo <<< END $pageheader
     
    Email Sent
    END; echo $sentdata; echo <<< END
    When writing an email to send to your customers, you can personalize the email by inserting the following tokens. These tokens will be replaced with the appropriate values in each email sent:

    %firstname% - the Reseller's First Name
    %lastname% - the Reseller's Last Name
    %fullname% - the Reseller's Full Name
    %email% - the Reseller's Email Address
    %itemname% - the name of your Front-End product
    %otoname% - the name of your OTO product
    $pagefooter END; exit; break; case "custbroadcast": # Send a broadcast mail to all customers # Read sales table to get list of customers. $customers = array(); $refs = array(); if($_POST['frontcust']){ $frontcust=1; } else { $frontcust=0; } if($_POST['otocust']){ $otocust=1; } else { $otocust=0; } # all customers $where="WHERE productID=".$productID." AND refunded != 1"; # select only front-end customers if(!$otocust) $where.=" AND item_number='".$sys_item_number."'"; # select only oto customers if(!$frontcust) $where.=" AND item_number='".$sys_oto_number."'"; $sql="select * from sales ".$where; $sres=@mysql_query($sql); while($srec=@mysql_fetch_assoc($sres)) { $email=$srec['payer_email']; if ($srec['pref_email']!="") $email=$srec['pref_email']; if(!isset($customers[$email])) { $sql="SELECT * from cust_optouts WHERE email = '".$email."'"; $ores=@mysql_query($sql); $orow=@mysql_fetch_assoc($ores); if($orow['email']!=$email) { $customers[$email] = $srec; } } } if(substr($sys_support, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_support; } $headers = "From: $sys_item_name<$eaddress>"; $subject = $_POST["subject"]; $body = stripslashes($_POST["body"]); $body .= "\n\n===\nTo unsubscribe or change subscriber options visit:\n"; $body .= "http://$sys_domain" . $sys_install_folder . "?action=subscriberoptions&email=%email%"; $totalmails=count($customers); echo <<< END $pageheader
     
    Broadcast Mail to
    $sys_item_name Customers
    Subject:
    Message:
    Mail Front-End Customers   Mail OTO Customers
    (Check one or the other - or both)

     
    Mailing $sys_item_name Customers
      Sending $totalmails emails END; foreach($customers as $key => $cust){ $firstname = $cust['firstname']; $lastname = $cust ['lastname']; $fullname = $cust['firstname']." ".$cust['lastname']; $email = $key; # $email = $cust['payer_email']; # Replace tokens. $a1=array('%firstname%','%lastname%','%fullname%','%email%','%itemname%','%otoname%'); $a2=array(_decode($firstname), _decode($lastname),_decode($fullname), _decode($email), _decode($sys_item_name), _decode($sys_oto_name)); $sendsubject=str_replace($a1, $a2, $subject); $sendbody=str_replace($a1, $a2, $body); # Send the mailer. @mail($email, $sendsubject, $sendbody, $headers); echo "
    1. $fullname - $email ..
    2. "; flush(); } echo <<< END
    Finished Sending Emails
    $pagefooter END; exit; break; case "emailaffiliates": # Show mailer form. unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } echo <<< END $pageheader
    When writing an email to send to your resellers, you can personalize the email by inserting the following tokens. These tokens will be replaced with the appropriate values in each email sent:

    %firstname% - the Reseller's First Name
    %lastname% - the Reseller's Last Name
    %fullname% - the Reseller's Full Name
    %email% - the Reseller's Email Address
    %afflink% - the Reseller's Referal Link
    %itemname% - the name of your Front-End product
    %otoname% - the name of your OTO product
    $pagefooter END; exit; break; case "affbroadcast": # Send a broadcast mail to all resellers # Read affiliates table to get list of resellers. $affiliates = array(); if(!$sys_glbaff) $where=" AND productID=".$productID; $sql="SELECT * FROM nicknames WHERE type= 'std'".$where; $ares=@mysql_query($sql); while($arec=@mysql_fetch_assoc($ares)) { if (!$arec['pref_email']=="") { $email=$arec['pref_email']; } else { $email=$arec['email']; } # Make sure this affiliate hasn't been banned $sql="SELECT * FROM banned WHERE email='".$email."'"; $bres=@mysql_query($sql); if(@mysql_num_rows($bres)==0) // exclude banned resellers { $affiliates[$email] = $arec; $affiliates[$email]['sales']=0; # Read IPN file to count sales $sql="SELECT * FROM sales WHERE productID=".$productID." AND receiver_email='".$email."'"; $sres=@mysql_query($sql); while($sales=@mysql_fetch_array($sres)) { if(isset($affiliates[$email]['sales'])){ $affiliates[$email]['sales']++; } else { $affiliates[$email]['sales']=1; } } } } if(substr($sys_eaddress, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_eaddress; } $headers = "From: $sys_item_name<$eaddress>"; $subject = $_POST["subject"]; $body = stripslashes($_POST["body"]); $body .= "\n\n===\nTo stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain" . $sys_install_folder . "?action=affoptout&email=%email%"; $body = wordwrap($body, 70); $deduped = array(); foreach ($affiliates as $key=>$val) { if (!array_key_exists($key, $deduped)) { $deduped[$key]=$affiliates[$key]; } } $refs = array(); foreach($deduped as $key=>$affiliate){ if($affiliate['sales'] >= $_POST["minsales"]){ $refs[$key] = $affiliate; } } $totalmails=count($refs); echo <<< END $pageheader $pagefooter END; exit; break; case "emailpartners": # Show mailer form. unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } echo <<< END $pageheader
     
    Broadcast Mail to
    $sys_item_name Resellers
    Subject:
    Message:
    Send this mail to Resellers who have made at least sales.
     
    Mailing Resellers
      Sending $totalmails emails END; foreach($refs as $key=>$affiliate){ $firstname = $affiliate['firstname']; $lastname = $affiliate ['lastname']; $fullname = $affiliate['firstname']." ".$affiliate['lastname']; $email = $key; $afflink = "http://".$sys_domain.$sys_install_folder."?e=".$affiliate['nickname']; # Replace tokens. $a1=array('%firstname%','%lastname%','%fullname%','%email%','%afflink%','%itemname%','%otoname%'); $a2=array(_decode($firstname), _decode($lastname),_decode($fullname), _decode($email), _decode($afflink), _decode($sys_item_name), _decode($sys_oto_name)); $sendsubject=str_replace($a1, $a2, $subject); $sendbody=str_replace($a1, $a2, $body); # Send the mailer. @mail($email, $sendsubject, $sendbody, $headers); echo "
    1. $fullname - $email ..
    2. "; flush(); } echo <<< END
    Finished Sending Emails
    When writing an email to send to your JV Partners, you can personalize the email by inserting the following tokens. These tokens will be replaced with the appropriate values in each email sent:

    %firstname% - the JV Partner's First Name
    %lastname% - the JV Partner's Last Name
    %fullname% - the JV Partner's Full Name
    %email% - the JV Partner's Email Address
    %afflink% - the JV Partner's referral Link
    %itemname% - the name of your Front-End product
    %otoname% - the name of your OTO product
    $pagefooter END; exit; break; case "partnerbroadcast": # Send a broadcast mail to all partners # Read partners table to get list of partners. $partners = array(); if(!$sys_glbaff) $where=" AND productID=".$productID; $sql="SELECT * FROM nicknames WHERE type = 'jv' ".$where; $pres=@mysql_query($sql); while($prec=@mysql_fetch_assoc($pres)) { if (!$prec['pref_email']=="") { $email=$prec['pref_email']; } else { $email=$prec['email']; } # Make sure this partner hasn't been banned $sql="SELECT * FROM banned WHERE email='".$email."'"; $bres=@mysql_query($sql); if(@mysql_num_rows($bres)==0) // exclude banned resellers { $partners[$email] = $prec; $partners[$email]['sales']=0; # Read IPN file to count sales $sql="select * from sales WHERE productID=".$productID." AND receiver_email='".$email."'"; $sres=@mysql_query($sql); while($sales=@mysql_fetch_array($sres)) { if(isset($partners[$email]['sales'])){ $partners[$email]['sales']++; } else { $partners[$email]['sales']=1; } } } } if(substr($sys_eaddress, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_eaddress; } $headers = "From: $sys_item_name<$eaddress>"; $subject = $_POST["subject"]; $body = stripslashes($_POST["body"]); $body .= "\n\n===\nTo stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain" . $sys_install_folder . "?action=affoptout&email=%email%"; $deduped = array(); foreach ($partners as $key=>$val) { if (!array_key_exists($key, $deduped)) { $deduped[$key]=$partners[$key]; } } $refs = array(); foreach($deduped as $key=>$partner){ if($partner['sales'] >= $_POST["minsales"]){ $refs[$key] = $partner; } } $totalmails=count($refs); echo <<< END $pageheader $pagefooter END; exit; break; // -------------------------------------------------------------------- case "emailall": # Show mailer form. echo <<< END $pageheader
     
    Broadcast Mail to
    $sys_item_name JV Partners
    Subject:
    Message:
    Send this mail to JV Partners who have made at least sales.
     
    Mailing Partners
      Sending $totalmails emails END; foreach($refs as $key=>$partner){ $firstname = $partner['firstname']; $lastname = $partner ['lastname']; $fullname = $partner['firstname']." ".$partner['lastname']; $email = $key; $afflink = "http://".$sys_domain.$sys_install_folder."?e=".$partner['nickname']; # replace tokens $a1=array('%firstname%','%lastname%','%fullname%','%email%','%afflink%','%itemname%','%otoname%'); $a2=array(_decode($firstname), _decode($lastname),_decode($fullname), _decode($email), _decode($afflink), _decode($sys_item_name), _decode($sys_oto_name)); $sendsubject=str_replace($a1, $a2, $subject); $sendbody=str_replace($a1, $a2, $body); # Send the mailer. @mail($email, $sendsubject, $sendbody, $headers); echo "
    1. $fullname - $email ..
    2. "; flush(); } echo <<< END
    Finished Sending Emails
    When writing an email to send to your resellers, you can personalize the email by inserting the following tokens. These tokens will be replaced with the appropriate values in each email sent:

    %firstname% - the Reseller's First Name
    %lastname% - the Reseller's Last Name
    %fullname% - the Reseller's Full Name
    %email% - the Reseller's Email Address
    %afflink% - the Reseller's Referal Link
    %itemname% - the name of your Front-End product
    %otoname% - the name of your OTO product
    $pagefooter END; exit; break; case "allbroadcast": echo <<< END $pageheader END; if( $_POST['emailallaff'] ) { // ----------------------------------------------------------------------- //email all resellers # Send a broadcast mail to all resellers # Read affiliates table to get list of resellers. $affiliates = array(); $sql="SELECT * FROM nicknames"; // includes affiliates and JV partners $ares=@mysql_query($sql); while($arec=@mysql_fetch_assoc($ares)) { if (!$arec['pref_email']=="") { $email=$arec['pref_email']; } else { $email=$arec['email']; } # Make sure this partner hasn't been banned $sql="SELECT * FROM banned WHERE email='".$email."'"; $bres=@mysql_query($sql); if(@mysql_num_rows($bres)==0) // exclude banned resellers { $affiliates[$email] = $arec; } } if(substr($sys_eaddress, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_eaddress; } $headers = "From: $sys_item_name<$eaddress>"; $subject = $_POST["subject"]; $body = stripslashes($_POST["body"]); $body .= "\n\n\n===\nIf you want emails delivered to another address, login to the reseller's area at: \n"; $body .= "http://$sys_domain".$sys_install_folder."reseller.php\n\n"; $body .= "\n\n===\nTo stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain".$sys_install_folder."?action=affoptout&email=%email%"; $refs = array(); foreach ($affiliates as $key=>$val) { if (!array_key_exists($key, $refs)) { $refs[$key]=$affiliates[$key]; } } $totalmails=count($refs); echo <<< END END; // END EMAIL ALL AFFILIATES // ----------------------------------------------------------------------- } if( $_POST['emailallcustomers'] ) { // ----------------------------------------------------------------------- // EMAIL ALL CUSTOMERS // email all customers front end and oto # Send a broadcast mail to all customers # Read sales table to get list of customers. $customers = array(); $refs = array(); $frontcust = 1; $otocust = 1; # all customers $where="WHERE refunded != 1"; /* # select only front-end customers if(!$otocust) $where.=" AND item_number='".$sys_item_number."'"; # select only oto customers if(!$frontcust) $where.=" AND item_number='".$sys_oto_number."'"; */ $sql="select * from sales ".$where; $sres=@mysql_query($sql); while($srec=@mysql_fetch_assoc($sres)) { if ($srec['pref_email']=="") { $email = $srec['payer_email']; } else { $email = $srec['pref_email']; } # $email=$srec['payer_email']; if(!isset($customers[$email])) { $sql="SELECT * from cust_optouts WHERE email = '".$email."'"; $ores=@mysql_query($sql); $orow=@mysql_fetch_assoc($ores); if($orow['email']!=$email) { $customers[$email] = $srec; } } } if(substr($sys_support, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else { $eaddress = $sys_support; } $headers = "From: $sys_item_name<$eaddress>"; $subject = $_POST["subject"]; $body = stripslashes($_POST["body"]); $body .= "\n\n===\nTo unsubscribe or change subscriber options visit:\n"; $body .= "http://$sys_domain" . $sys_install_folder . "?action=subscriberoptions&email=%email%"; $mailtos = array(); foreach ($customers as $key=>$val) { if (!array_key_exists($key, $mailtos)) { $mailtos[$key]=$customers[$key]; } } $totalmails=count($mailtos); echo <<< END
     
    Broadcast Mail to
    ALL Resellers & All Customers
    Subject: -- All Affiliates - All Customers
    Message:
     
    Mailing Resellers
      Sending $totalmails emails END; foreach($refs as $affiliate){ $firstname = $affiliate['firstname']; $lastname = $affiliate ['lastname']; $fullname = $affiliate['firstname']." ".$affiliate['lastname']; if ($affiliate['pref_email']=="") { $email = $affiliate['email']; } else { $email = $affiliate['pref_email']; } $afflink = "http://".$sys_domain.$sys_install_folder."?e=".$affiliate['nickname']; # Replace tokens. $a1=array('%firstname%','%lastname%','%fullname%','%email%','%afflink%','%itemname%','%otoname%'); $a2=array(_decode($firstname), _decode($lastname),_decode($fullname), _decode($email), _decode($afflink), _decode($sys_item_name), _decode($sys_oto_name)); $sendsubject=str_replace($a1, $a2, $subject); $sendbody=str_replace($a1, $a2, $body); # Send the mailer. @mail($email, $sendsubject, $sendbody, $headers); echo "
    1. $fullname - $email ..
    2. "; flush(); } echo <<< END
    Finished Sending Emails
     
    Mailing All Customers
      Sending $totalmails emails END; foreach($mailtos as $cust){ $firstname = $cust['firstname']; $lastname = $cust ['lastname']; $fullname = $cust['firstname']." ".$cust['lastname']; $email = $cust['payer_email']; # Replace tokens. $a1=array('%firstname%','%lastname%','%fullname%','%email%','%itemname%','%otoname%'); $a2=array(_decode($firstname), _decode($lastname),_decode($fullname), _decode($email), _decode($sys_item_name), _decode($sys_oto_name)); $sendsubject=str_replace($a1, $a2, $subject); $sendbody=str_replace($a1, $a2, $body); # Send the mailer. @mail($email, $sendsubject, $sendbody, $headers); echo "
    1. $fullname - $email ..
    2. "; flush(); } echo <<< END
    Finished Sending Emails
    END; // END EMAIL ALL CUSTOMERS // ----------------------------------------------------------------------- } echo <<< END $pagefooter; END; exit; break; // ---------------------------------------------------------------- case "fraud": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } # Show all fraudulent transactions. $sql="SELECT * FROM fraud WHERE productID = ".$productID. " ORDER BY purchased DESC"; $fres=@mysql_query($sql); $rcount=@mysql_num_rows($fres); echo <<< END $pageheader   Fraud Report for
    $sys_item_name
    $rcount total fraudulent transactions. Fraudulent buyers do not receive the download. You can report fraudulent buyers to PayPal at 888-215-5506. END; $bgcolor = "#ffffff"; while($frec=@mysql_fetch_assoc($fres)) { $purchased = $frec['purchased']; $expires = $frec['expires']; $txn_id=$frec['txn_id']; $item_number=$frec['item_number']; $receiver_email=$frec['receiver_email']; $payer_email=$frec['payer_email']; $firstname=$frec['firstname']; $lastname=$frec['lastname']; $payment_amount=$frec['payment_amount']; echo <<< END END; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo <<< END
    Transaction ID Item Number Payee Email Customer Email Customer Name Payment Date  
    $txn_id $item_number $receiver_email $payer_email $firstname $lastname $payment_amount $purchased approve
      $pagefooter END; exit; break; case "approve": # Add record into sales table, since it wasn't actually fraud. $txn_id = $_REQUEST["id"]; $sql="SELECT * FROM fraud WHERE txn_id ='".$txn_id."'"; $result=@mysql_query($sql); $frec=@mysql_fetch_assoc($result); $productID=$frec['productID']; $txn_id=$frec['txn_id']; $item_name=$frec['item_name']; $item_number=$frec['item_number']; $receiver_email=$frec['receiver_email']; $payer_email=$frec['payer_email']; $firstname=$frec['firstname']; $lastname=$frec['lastname']; $business=$frec['business']; $payment_amount=$frec['payment_amount']; $purchased = $frec['purchased']; $expires = date('Y-m-d H:i:s',(time() + (3600 * $sys_expire))); $referrer=$frec['referrer']; $affiliate=$frec['affiliate']; $ip_address=$frec['ip_address']; $country=$frec['country']; $state=$frec['state']; $zip=$frec['zip']; $salesletter=$frec['salesletter']; # Write info to IPN file # ______________________ $sql="INSERT INTO sales (productID,txn_id,item_name,item_number,receiver_email,payer_email,firstname,lastname,business,payment_amount,expires,purchased,referrer,affiliate,ip_address,country,state,zip,salesletter) VALUES('".$productID."','".$txn_id."','".$item_name."','".$item_number."','".$receiver_email."','".$payer_email."','".$firstname."','".$lastname."','".$business."',".$payment_amount.",'".$expires."','".$purchased."','".$referrer."','".$affiliate."','".$ip_address."','".$country."','".$state."','".$zip."','".$salesletter."')"; $result=@mysql_query($sql); if(substr($sys_support, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; $support = "For support, visit our web site at:\n\n$sys_support"; } else { $eaddress = $sys_support; $support = "If you have any questions or support needs you may simply reply to this email."; } $subject = "Your download link."; $body = "$firstname,\n\nThank you for your purchase.\nTo download your copy of $item_name, click here:\n\nhttp://$sys_domain" . $sys_install_folder . "?action=download&id=$txn_id\n\nYou have $sys_expire hours to download before the link expires.\nWe appreciate your business.\n$support\n\nThanks again.\n"; # Send download notification to purchaser. @mail($payer_email, $subject, $body, "From: $sys_item_name <$eaddress>\r\nReply-To: $eaddress\r\nX-Mailer: PHP" . phpversion()); echo <<< END $pageheader

    The customer has been emailed their download link.

    END; exit; break; case "import": # Import sales records, etc. from 7DS if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if (isset($_POST["import"])) { if(!isset($_POST['import_folder'])) { $_SESSION['errmsg'] = "Folder Location is Required"; header("Location: $_SERVER[PHP_SELF]?action=import"); exit; } $import_folder = trim($_POST['import_folder'],"/"); $import_folder = "../" . $import_folder . "/"; $ipnFilename = "ipn.txt"; $ipnFile = $import_folder . $ipnFilename; $fraudFilename = "fraud.txt"; $fraudFile = $import_folder . $fraudFilename; $unsubsFilename = "unsubs.txt"; $unsubsFile = $import_folder . $unsubsFilename; $tafFilename = "tellafriend.txt"; $tafFile = $import_folder . $tafFilename; // Make sure we can read the ipn file if (!is_readable($ipnFile)) { $_SESSION['errmsg'] = "$7 Script Sales File ($ipnFile) Not Found"; header("Location: $_SERVER[PHP_SELF]?action=import"); exit; } $sales = @file($ipnFile); foreach($sales as $sale){ $sale = explode("|", str_replace(array("\r", "\n"), "", $sale)); $expires = date('Y-m-d H:i:s',$sale[9]); $purchased = date('Y-m-d H:i:s',$sale[11]); $sql="INSERT INTO sales (productID,txn_id,item_name,item_number,receiver_email,payer_email,firstname,lastname,business,payment_amount,expires,purchased,referrer,affiliate,ip_address,country,state,zip,salesletter) VALUES('".$productID."','".$sale[0]."','".$sale[1]."','".$sale[2]."','".$sale[3]."','".$sale[4]."','".$sale[5]."','".$sale[6]."','".$sale[7]."',".$sale[8].",'".$expires."','".$purchased."','".$sale[12]."','".$sale[13]."','".$sale[14]."','".$sale[15]."','".$sale[16]."','".$sale[17]."','".$sale[18]."')"; $result=@mysql_query($sql); } if (is_readable($fraudFile)) { $frauds = @file($fraudFile); foreach($frauds as $fraud){ $fraud = explode("|", str_replace(array("\r", "\n"), "", $fraud)); $expires = date('Y-m-d H:i:s',$fraud[9]); $purchased = date('Y-m-d H:i:s',$fraud[11]); $sql="INSERT INTO fraud (productID,txn_id,item_name,item_number,receiver_email,payer_email,firstname,lastname,business,payment_amount,expires,purchased,referrer,affiliate,ip_address,country,state,zip,salesletter) VALUES('".$productID."','".$fraud[0]."','".$fraud[1]."','".$fraud[2]."','".$fraud[3]."','".$fraud[4]."','".$fraud[5]."','".$fraud[6]."','".$fraud[7]."',".$fraud[8].",'".$expires."','".$purchased."','".$fraud[12]."','".$fraud[13]."','".$fraud[14]."','".$fraud[15]."','".$fraud[16]."','".$fraud[17]."','".$fraud[18]."')"; $result=@mysql_query($sql); } } if (is_readable($unsubsFile)) { $unsubs = @file($unsubsFile); foreach($unsubs as $unsub){ $unsub = str_replace(array("\r", "\n"), "", $unsub); $sql="INSERT INTO aff_optouts (email) VALUES('".$unsub."')"; $result=@mysql_query($sql); } } $tafcount = @file_get_contents($tafFile); if($tafcount){ $sql="UPDATE products SET taf_count=".$tafcount." WHERE id=".$productID; $result=@mysql_query($sql); } $_SESSION['errmsg'] = $sys_item_name." Data Imported from $7 Script"; } echo <<< END $pageheader   Import $sys_item_name Data from
    7 Dollar Scripts
    END; if(isset($_SESSION['errmsg'])){ $message=$_SESSION['errmsg']; echo "$message"; unset ($_SESSION['errmsg']); } echo <<< END  
    END; # Get product $sql="select id,item_name from products WHERE productID =".$productID; $pres=@mysql_query($sql); $prow=@mysql_fetch_array($pres); echo <<< END Input Folder Name Where $7 Scripts Files are Located:

     
    $pagefooter END; exit; break; case "export": # Export sales records unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } $first = true; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=export.csv"); header("Content-Transfer-Encoding: binary"); $sql="SELECT * FROM sales WHERE productID ='".$productID."'"; $result=@mysql_query($sql); while($sales = @mysql_fetch_array($result)){ if($first){ # Output headers. echo '"Transaction ID","Refunded","Item Name","Item Number","Reseller Email","Customer Email","First Name","Last Name","Company","Payment","Bought","Expires","Referrer","Reseller","IP","Country","State","Zipcode","Salesletter"' . "\r\n"; $first = false; } $productID=$sales['productID']; $txn_id=$sales['txn_id']; $refunded=$sales['refunded']; $item_name=$sales['item_name']; $item_number=$sales['item_number']; $receiver_email=$sales['receiver_email']; $payer_email=$sales['payer_email']; $firstname=$sales['firstname']; $lastname=$sales['lastname']; $business=$sales['business']; $payment_amount=$sales['payment_amount']; $purchased = $sales['purchased']; $expires = $sales['expires']; $referrer=$sales['referrer']; $affiliate=$sales['affiliate']; $ip_address=$sales['ip_address']; $country=$sales['country']; $state=$sales['state']; $zip=$sales['zip']; $salesletter=$sales['salesletter']; echo "\"$txn_id\",\"$refunded\",\"$item_name\",\"$item_number\",\"$receiver_email\",\"$payer_email\",\"$firstname\",\"$lastname\",\"$business\",\"$payment_amount\",\"$purchased\",\"$expires\",\"$referrer\",\"$affiliate\",\"$ip_address\",\"$country\",\"$state\",\"$zip\",\"$salesletter\"\r\n"; } exit; break; case "search": # Show sales search form. echo <<< END $pageheader $pagefooter END; exit; break; case "srchrslt": echo <<< END $pageheader
     
     
    Find Sales Records Where
    $pagefooter END; exit; break; case "slsltrs": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if(isset($_POST['add'])){ $template = trim($_POST['template']); if($template==" " || $template=="") { $_SESSION['errmsg'] = "Sales Letter Empty"; } else { $sql="INSERT INTO salesletters (productID,template) VALUES ('".$productID."','".$template."')"; $result=@mysql_query($sql); } } if(isset($_GET['disable'])) { $template=$_GET['template']; $sql="UPDATE salesletters SET disabled=1 WHERE productID=".$productID." AND template='".$template."'"; $sres=@mysql_query($sql); } if(isset($_GET['enable'])) { $template=$_GET['template']; $sql="UPDATE salesletters SET disabled=0 WHERE productID=".$productID." AND template='".$template."'"; $sres=@mysql_query($sql); } echo <<< END $pageheader
     
    Matching Records:

    Click on the 'Expires' date of a sale to re-validate the customer's download link for another $sys_expire hours.

    END; $matches = 0; $field = strtolower($_POST['field']); switch ($srchtype){ case 1: $comparetype = "="; $query = strtolower($_POST['query']); break; default: $comparetype = " LIKE "; $query = "%".strtolower($_POST['query'])."%"; $break; } $sql="SELECT * FROM sales WHERE ".$field.$comparetype."'".$query."'"; $slsrslt=@mysql_query($sql); while($slsrec=@mysql_fetch_assoc($slsrslt)) { $matches++; $txn_id = $slsrec['txn_id']; $refunded = $slsrec['refunded']; $item_number = $slsrec['item_number']; $receiver_email = $slsrec['receiver_email']; $payer_email = $slsrec['payer_email']; $custname = $slsrec['firstname']." ".$slsrec['lastname']; $business = $slsrec['business']; $payment_amount = $slsrec['payment_amount']; $purchased = $slsrec['purchased']; $expires = $slsrec['expires']; $sql="SELECT * FROM products WHERE id=".$slsrec['productID']; $prow=@mysql_query($sql); $prec=@mysql_fetch_assoc($prow); $pfolder=$prec['install_folder']; echo <<< END END; } echo <<< END
    Transaction ID Item Number Payee Customer Email Customer Name/Business Payment Bought Expires
    END; if($refunded) { echo $txn_id; } else { echo "$txn_id"; } echo <<< END $item_number $receiver_email $payer_email $custname
    $business
    $payment_amount $purchased END; if($refunded) { echo $expires; } else { echo "$expires"; } echo <<< END

    $matches matching record(s) found.

    $pagefooter END; exit; break; case "bans": if(isset($_POST['add'])){ $email = strtolower($_POST['email']); $sql="INSERT INTO banned (email) VALUES ('".$email."')"; $result=@mysql_query($sql); } echo <<< END $pageheader
     
    Ban Resellers & Partners
    END; $bgcolor = "white"; $sql="SELECT * FROM banned ORDER BY email"; $result=@mysql_query($sql); while($record=@mysql_fetch_assoc($result)) { $email = $record['email']; echo <<< END END; if($bgcolor=="white"){ $bgcolor = "#ccffcc"; } else { $bgcolor = "white"; } } echo <<< END
    Banned Emails
    $email
     
     
    $pagefooter END; exit; break; case "coupons": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } if(isset($_POST['add'])){ $code = urlencode($_POST['code']); $price = $_POST['price']; $expires = date('Y-m-d H:i:s:',strtotime(trim($_POST['expiredate']))); if($code==" " || $code=="") { $_SESSION['errmsg'] = "Coupon Code Empty"; } elseif($price == " " || $price == "") { $_SESSION['errmsg'] = "Price Empty"; } else { $sql="INSERT INTO coupons (productID,code,price,expires) VALUES ('".$productID."','".$code."','".$price."','".$expires."')"; $result=@mysql_query($sql); } } echo <<< END $pageheader
    END; if(isset($_SESSION['errmsg'])){ echo "".$_SESSION['errmsg'].""; unset ($_SESSION['errmsg']); } echo <<< END
    Sales Letters for
    $sys_item_name
    END; $bgcolor = "white"; $sql="SELECT * FROM salesletters WHERE productID='".$productID."' ORDER BY template"; $result=@mysql_query($sql); while($srec=@mysql_fetch_assoc($result)) { $template = $srec['template']; $visits = $srec['hits']; $disabled=$srec['disabled']; $count=0; $sql="SELECT id FROM sales WHERE productID='".$productID."' AND salesletter = '".$template."' AND item_number = '".$sys_item_number."'"; $slsrslt=@mysql_query($sql); while($slsrec=@mysql_fetch_assoc($slsrslt)) { $count++; } echo <<< END "; if($bgcolor=="white"){ $bgcolor = "#ccffcc"; } else { $bgcolor = "white"; } } echo <<< END
    Sales letter Visitors # Sales Disable? Delete?
    $template $visits $count END; if($disabled){ echo "enable"; }else{ echo "disable"; } echo " "; if($count==0){ ?> Delete Sales Letter
     
    END; if(isset($_SESSION['errmsg'])){ echo "".$_SESSION['errmsg'].""; echo "
    ".$_POST['expiredate']; unset ($_SESSION['errmsg']); } echo <<< END
    END; ?>
    Discount Coupons for
    $sys_item_name
    Coupon Code Price Expires
    "> Pick a date
    $pagefooter END; exit; break; case "prodlist": unset ($_SESSION['errmsg']); echo <<< END $pageheader
    Coupon Code Price Expires Delete?
    Delete Discount Coupon
     
     
    $pagefooter END; exit; break; case "conversion": unset ($_SESSION['errmsg']); if(!isset($_SESSION['product']) || $_SESSION['product'] == 0){ $_SESSION['errmsg'] = "no product"; header("Location: $_SERVER[PHP_SELF]"); exit; } # Show conversion report. echo <<< END $pageheader $pagefooter END; exit; break; case "moreaddons": echo <<< END $pageheader
    END; if(isset($_SESSION['errmsg'])){ echo "".$_SESSION['errmsg'].""; unset ($_SESSION['errmsg']); } echo <<< END
    Product List for
    $sys_domain
    END; $bgcolor = "#ffffff"; $sql="SELECT * FROM products ORDER BY item_name"; $result=@mysql_query($sql); while($prec=@mysql_fetch_assoc($result)) { $product = $prec['item_name']; $id = $prec['id']; $folder=$prec['install_folder']; $count=0; $sql="SELECT id FROM sales WHERE productID='".$id."'"; $slsrslt=@mysql_query($sql); while($slsrec=@mysql_fetch_assoc($slsrslt)) { $count++; } echo <<< END "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo <<< END
    Item Name Install Folder # Sales Delete?
    $product $folder $count END; if($count==0){ ?> Delete Product
     
     
    Conversion Report for
    $sys_item_name
    END; $bgcolor = "white"; $sql="SELECT * FROM salesletters WHERE productID='".$productID."' ORDER BY template"; $result=@mysql_query($sql); while($srec=@mysql_fetch_assoc($result)) { $template = $srec['template']; $visits = $srec['hits']; $count=0; $sql="SELECT id FROM sales WHERE productID='".$productID."' AND salesletter = '".$template."' AND item_number = '".$sys_item_number."'"; $slsrslt=@mysql_query($sql); while($slsrec=@mysql_fetch_assoc($slsrslt)) { $count++; } if($visits>0){ $conversion = round(($count/$visits)*100, 2); } else { $conversion = "-"; } echo <<< END END; $count=0; if($bgcolor=="white"){ $bgcolor = "#ccffcc"; } else { $bgcolor = "white"; } } echo <<< END
    Sales Letter Sales Visits conversion rate
    $template $count $visits $conversion%
     
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "Select a Product First"; if($_SESSION['errmsg'] == 'product selected') echo "Un-Select the Product First"; unset ($_SESSION['errmsg']); } echo <<< END
    END; $addon_contents=getremotecontents("http://rapidactionprofits.com/AddOns.php"); echo $addon_contents; echo <<
    $pagefooter END; exit; break; default: if(isset ($_POST['product'])) $_SESSION['product']=$_POST['product']; echo <<< END $pageheader
    END; if(isset($_SESSION['errmsg'])){ if($_SESSION['errmsg'] == 'no product') echo "Select a Product First"; if($_SESSION['errmsg'] == 'product selected') echo "Un-Select the Product First"; unset ($_SESSION['errmsg']); } echo <<< END
    END; $dash_contents=getremotecontents("http://rapidactionprofits.com/dashboard.php"); echo $dash_contents; echo <<
    $pagefooter END; exit; break; } ?>