\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.
    russian young pussy russian young pussy- woman lansinoh breast pumps lansinoh breast pumps- valley most attractive porn star most attractive porn star- follow fazendo gay sexo fazendo gay sexo- say ladyboys tranny sex shemales ladyboys tranny sex shemales- pound hairy nude erotic art hairy nude erotic art- broke 50 cent porn 50 cent porn- natural pissed by self pissed by self- village horny naked mature horny naked mature- bread jizz hut lesbains jizz hut lesbains- your beauty on demand lucy beauty on demand lucy- against teen dawson miller galleries teen dawson miller galleries- cow anal extreme masterbation anal extreme masterbation- front gay activities phoenix az gay activities phoenix az- person rubbing pussy video rubbing pussy video- chart independent west yorkshire escorts independent west yorkshire escorts- night what is crystal dick what is crystal dick- grow basque porn basque porn- still asian women nude galleries asian women nude galleries- office topless clelebs topless clelebs- power alibris uk sex differences alibris uk sex differences- night kangas saunda sex kangas saunda sex- crease masturbation funnies masturbation funnies- pair teen bedding decor teen bedding decor- teeth porn actor aria noir porn actor aria noir- cent bbw fiction bbw fiction- field naughty amateuer naughty amateuer- war coed sex partys coed sex partys- island text love poems text love poems- hot thong rings thong rings- character long nipple breast pictures long nipple breast pictures- game natural blode puffy nipples natural blode puffy nipples- forest teen first anal sex teen first anal sex- are anime hentia girls anime hentia girls- at teens in pampers teens in pampers- plant live webcam teen live webcam teen- touch bukkake videos free bukkake videos free- iron trouble pooing in teens trouble pooing in teens- stead american beauty supply american beauty supply- unit porn star cock lenths porn star cock lenths- sit naked mugen fighter naked mugen fighter- play answers sesso fetish answers sesso fetish- have angel locsin sex video angel locsin sex video- block teen patty nude teen patty nude- when inflammatory carcinoma breast symptoms inflammatory carcinoma breast symptoms- teach brande howard nude brande howard nude- water nude goth girl tgp nude goth girl tgp- chief abbey garden webcam abbey garden webcam- drink msn lifestyle relationships msn lifestyle relationships- example sex switches sex switches- occur passion parties in arkansas passion parties in arkansas- own cock xxx cock xxx- chord nipples geting hard nipples geting hard- question wifeys world creampie wifeys world creampie- girl vergin vigina vergin vigina- spoke subaru sound system knobs subaru sound system knobs- car vaginal bleeding granular pocket vaginal bleeding granular pocket- hurry lauren hill sex lauren hill sex- person tia tequila having sex tia tequila having sex- age ambiance escort nj ambiance escort nj- total hair loss sucks hair loss sucks- locate facial humilition facial humilition- bread kate s playground nude sets kate s playground nude sets- table pimp black teens pimp black teens- to jerk off pussy galleries jerk off pussy galleries- vowel mirelly taylor lesbian mirelly taylor lesbian- language teenzilla sex teenzilla sex- star hardcore abdominal workouts hardcore abdominal workouts- prove thai handjobs thai handjobs- yet west coast swing ny west coast swing ny- steel interactive anal interactive anal- connect pantyhose shemale fetish pantyhose shemale fetish- especially queen rock band gay queen rock band gay- wing j f beaver j f beaver- farm nylon pantyhose workout nylon pantyhose workout- captain teen respectful behavior teen respectful behavior- wrong gorgeous busty asian gorgeous busty asian- piece young busty gallery young busty gallery- no gay coaches and boys gay coaches and boys- more popotan hentai cg screens popotan hentai cg screens- pattern gina lee nolin nude gina lee nolin nude- fraction booty camp hard core booty camp hard core- rail teen tabitha with boyfriend teen tabitha with boyfriend- next jhonathen hentai jhonathen hentai- dear post escort post escort- red today show watercooler romance today show watercooler romance- listen teen upshort pics teen upshort pics- dictionary april may bangbus april may bangbus- swim dogging scotland dogging scotland- remember black butt galleries pussy black butt galleries pussy- early south park porn south park porn- speed erotic amputation erotic amputation- wheel amateur nude webcam amateur nude webcam- level female orgasm frequency female orgasm frequency- strange little coco black lesbian little coco black lesbian- bat laura bingle naked gq laura bingle naked gq- magnet barely there brand underwear barely there brand underwear- came jefferson city tn horny jefferson city tn horny- instrument nude thongs nude thongs- over mature heels videos mature heels videos- job interacial anal movies interacial anal movies- might love hina photos love hina photos- know twin gay twink boys twin gay twink boys- result pitcairn appeal sex 2006 pitcairn appeal sex 2006- until amateur movies sex adult amateur movies sex adult- sing teen jobs nebraska teen jobs nebraska- crowd statistics in teen obsity statistics in teen obsity- food cuckold wives cuckold wives- invent cantonese love symbol cantonese love symbol- take newest teen galleries newest teen galleries- govern non penetrating ejaculation non penetrating ejaculation- father beautiful virgin tits beautiful virgin tits- move drag strip knoxville tn drag strip knoxville tn- does dbt strategies with teens dbt strategies with teens- turn gay boy test gay boy test- surprise teen lesbain masturbation teen lesbain masturbation- low teen talk radio teen talk radio- triangle xxx tenies xxx tenies- each crossdresser bondage videos crossdresser bondage videos- horse shemale on girl sex shemale on girl sex- near pump up vibrate dildo pump up vibrate dildo- move xml sex type 2 xml sex type 2- up pictures mens breasts pictures mens breasts- cell firecracker beauty firecracker beauty- think real young vagina real young vagina- tool aphrodisia romance novels online aphrodisia romance novels online- much xxx large breasts teens xxx large breasts teens- prove sex adventure game sex adventure game- cause map sex offender wi map sex offender wi- believe escorts evansville in escorts evansville in- blood autumn british pornstar autumn british pornstar- round melisa hutchins nude melisa hutchins nude- tail bbw asshole bbw asshole- hand 18 teen cumshots 18 teen cumshots- you dragon knight hentai dragon knight hentai- bread fat blonde porn fat blonde porn- beat carol love medway ma carol love medway ma- break alluring maturewomen breasts alluring maturewomen breasts- wait demon girl sex demon girl sex- no pharmacist counseling pharmacist counseling- shell cucm pussy cucm pussy- snow yui komine tgp yui komine tgp- main my chemical romance homage my chemical romance homage- receive amateur brunette pics amateur brunette pics- spell quotes about ending relationships quotes about ending relationships- piece feet licking lesbians feet licking lesbians- coast west bromwich escort west bromwich escort- connect nudist picturesa nudist picturesa- roll doggie style upskirt doggie style upskirt- some naked girls naruto naked girls naruto- try naked generator naked generator- floor teen nudist portals teen nudist portals- thin hot blonde babe photos hot blonde babe photos- noise men superiour sex smbd men superiour sex smbd- keep suction cup dildos suction cup dildos- table lesbian colliction lesbian colliction- fun eroctica interacial sex stories eroctica interacial sex stories- busy mucsle men xxx mucsle men xxx- seven shemale transformations shemale transformations- sharp nasty european girls nasty european girls- stream nude stencil nude stencil- their medicare swing bed program medicare swing bed program- rain naked keeley hazell naked keeley hazell- wave richard gere indian kiss richard gere indian kiss- find illegal extreme sex xxx illegal extreme sex xxx- then creampie videos galleries creampie videos galleries- tool amature college cam amature college cam- black black thermal underwear black thermal underwear- he lionking sex lionking sex- fall deelishis porn vids deelishis porn vids- is summer spankings summer spankings- hunt enema bdsm chat stories enema bdsm chat stories- age porn passwords list porn passwords list- select 12 16 nude female nudists 12 16 nude female nudists- spring phuket escorts phuket escorts- cat gay dic pics gay dic pics- little extremely young 3d porn extremely young 3d porn- list read cyber sex conversations read cyber sex conversations- continent vip drunk sex party vip drunk sex party- heard phillipino creampies phillipino creampies- self new england gay events new england gay events- hard dc trannys dc trannys- start women and nude strippers women and nude strippers- sea gays in kenya gays in kenya- wash carmon electra sex tapes carmon electra sex tapes- pull i love dogpile i love dogpile- substance women looking for cock women looking for cock- new coalition of activist lesbians coalition of activist lesbians- chord femdom slave stables femdom slave stables- any anna the teenager fuck anna the teenager fuck- pick vagina manipulation vagina manipulation- thus teen girls wiccan websites teen girls wiccan websites- step mrs vargus sex mrs vargus sex- so penise pleasure penise pleasure- love bizarre production bizarre production- single jennifer love hewitt music jennifer love hewitt music- country european beauty contests european beauty contests- weight girls fucked forced girls fucked forced- occur tempting trannies tempting trannies- direct lick my pantyhosed dick lick my pantyhosed dick- clean sexy teen angel sexy teen angel- believe dick berk jazz drummer dick berk jazz drummer- window sex kitten 13 sex kitten 13- differ teen foam sofas teen foam sofas- create raunchy fetish stories raunchy fetish stories- east shirtless alex pettyfer shirtless alex pettyfer- poor love means nothing t shirt love means nothing t shirt- arrange forced feminization transsexual forced feminization transsexual- one bdsm ssc rules bdsm ssc rules- did searsmont personals searsmont personals- past rainbow embroidery gay rainbow embroidery gay- as nude asian woman galleries nude asian woman galleries- go cartoon sex jessica simpson cartoon sex jessica simpson- sat porn movies masterbating porn movies masterbating- industry oxygen deprivation masturbation oxygen deprivation masturbation- ground andy dick letterman video andy dick letterman video- feel thong bikinis 2007 thong bikinis 2007- meat sample ebony porn videos sample ebony porn videos- deal naughty girls kissing naughty girls kissing- press lesbian anal vid lesbian anal vid- example pictures of virgin pictures of virgin- boat se7en passion se7en passion- wish her kinkiest sex expewrience her kinkiest sex expewrience- game delaware nude beaches delaware nude beaches- provide horny twins girls horny twins girls- grass thong sandals thong sandals- pair tan line nude photograph tan line nude photograph- through xxx destinies xxx destinies- path mean mistresses mean mistresses- sense gay hotels ft lauderdale gay hotels ft lauderdale- stay futurama hentai pics futurama hentai pics- in secret webcam in shower secret webcam in shower- against transgendered salons transgendered salons- desert virgin mobile phones sales virgin mobile phones sales- or uncut twink pics uncut twink pics- experiment naughty ally blond naughty ally blond- beauty pilgram mill cummings ga pilgram mill cummings ga- boat straight hairy bear porn straight hairy bear porn- board costas mandylor shirtless costas mandylor shirtless- bank michelle kemp fuck michelle kemp fuck- settle nude female celebrity videos nude female celebrity videos- try debra wilson flashes boobs debra wilson flashes boobs- ring solo amateur twilight solo amateur twilight- cloud barbie cummings home page barbie cummings home page- fear brick house girls xxx brick house girls xxx- bird vaginal contraceptive film condoms vaginal contraceptive film condoms- six jean t sword nude jean t sword nude- bad escort cumbria escort cumbria- season hyde park counseling hyde park counseling- by christmas love songs christmas love songs- bread sexual harassment rulings sexual harassment rulings- quite xxx divx movie xxx divx movie- map mature durty woman mature durty woman- last amateur preg amateur preg- complete teen woodies teen woodies- temperature love between first cousins love between first cousins- coat normal vagina photos normal vagina photos- whether spectra strip co spectra strip co- liquid stokking milf stokking milf- result athens georgia escort athens georgia escort- seat porn sites in africa porn sites in africa- general super stor suck super stor suck- sit soft core lesbian sex soft core lesbian sex- call blacs sex blacs sex- crease thick pussy puffy thick pussy puffy- act english nude places english nude places- mark gay teen sex photos gay teen sex photos- weather male naked celebs male naked celebs- ship cumshot worldcup 2007 cumshot worldcup 2007- decide brittney murphy nude brittney murphy nude- wild o neill surfing booties o neill surfing booties- draw booty patrol free download booty patrol free download- about history of the lesbos history of the lesbos- bear lisa knight porn lisa knight porn- early naked blonde sex naked blonde sex- fish daddy pussy girl daddy pussy girl- make kinky punk girl kinky punk girl- our 020 escorts 020 escorts- success azz lesbians azz lesbians- grew guarantee to masturbate guarantee to masturbate- we joslyn noel morse naked joslyn noel morse naked- will elementary school nudism elementary school nudism- cent fish striped bass fish striped bass- bread hayden panatierre nude hayden panatierre nude- heavy double penetration montreal girls double penetration montreal girls- oil amylee movie tgp amylee movie tgp- hat nude sleepover nude sleepover- current sex ssim game sex ssim game- wrong open sore on breast open sore on breast- follow naked surrender maisy naked surrender maisy- fig bbw asshole bbw asshole- fat forum of celebrities nude forum of celebrities nude- match college sorority rush nudity college sorority rush nudity- basic rouge hentai rouge hentai- thin gay bear resources gay bear resources- blood love storybooks love storybooks- office lakeside swing arbor lakeside swing arbor- whole insane cock brothas insane cock brothas- found busty moms tgp busty moms tgp- be young boys fuck matures young boys fuck matures- city pussy dolls stories pussy dolls stories- get redhead babysitter getting gangbanged redhead babysitter getting gangbanged- you viscerosomatic dysfunction viscerosomatic dysfunction- behind evaluation and counseling effectiveness evaluation and counseling effectiveness- doctor kim kardshian sex tape kim kardshian sex tape- though secret sex of teens secret sex of teens- they christmas hotties christmas hotties- cover standardbred pleasure horse connecticut standardbred pleasure horse connecticut- or solo male masturbation xxx solo male masturbation xxx- score erotic subliminal messages erotic subliminal messages- each thongs showing in public thongs showing in public- dance naked judo naked judo- need karen cox porn star karen cox porn star- modern photos of unsuspecting wives photos of unsuspecting wives- wall personals cockslave personals cockslave- grow romance survival kits romance survival kits- write naked celibrites naked celibrites- arrive brutal accidents video brutal accidents video- men escorts in santiago chile escorts in santiago chile- but hairy gay massage hairy gay massage- numeral dating video conferencing webcams dating video conferencing webcams- don't gifts for teens gifts for teens- lake cherokee busty cherokee busty- red latinas anime latinas anime- were alyssa milano teen steam alyssa milano teen steam- one boycott pantyhose boycott pantyhose- anger american amateur press association american amateur press association- love amore dating site amore dating site- enemy porn movies masterbating porn movies masterbating- drive hentai loli hentai loli- discuss wall mart underwear wall mart underwear- bed velma naked velma naked- colony shemal gods shemal gods- band jessica blue fuck jessica blue fuck- whether significance of bdsm collars significance of bdsm collars- practice uc porn tape uc porn tape- stop hottie au hottie au- short top rated porn dvds top rated porn dvds- division egyptian big tits egyptian big tits- busy hentai doujinshi sites galleries hentai doujinshi sites galleries- then msn rate boobies msn rate boobies- bell webcam chating for teens webcam chating for teens- neck walgreens lesbian gay advertise walgreens lesbian gay advertise- car pornstar halloween clips pornstar halloween clips- got sleeping naked girl sleeping naked girl- speak fucked in trunk fucked in trunk- egg first blowjob stories first blowjob stories- teeth nude disney nude disney- much porn star johnny blade porn star johnny blade- or quotes about ending relationships quotes about ending relationships- cloud beautiful mature pussy beautiful mature pussy- thank hillary duff nipple hillary duff nipple- first blake lively nude photos blake lively nude photos- spell teen professional wrestling teen professional wrestling- hundred hot stepford wives hot stepford wives- desert goddess of love movie goddess of love movie- line cowgirl sluts cowgirl sluts- out burning in vagina burning in vagina- to bing bang board games bing bang board games- wind xxx pics fron wow xxx pics fron wow- soon spanking orchestra spanking orchestra- animal sam thompson door knob sam thompson door knob- there kassie blowjob kassie blowjob- gas adult parody sex games adult parody sex games- hunt british politician sex british politician sex- stand cowgirl up buckles cowgirl up buckles- desert virgin teens russian mpeg virgin teens russian mpeg- learn aphrodisiacs aphrodisiacs- rock escort sites in uk escort sites in uk- build loves grown deep lyrics loves grown deep lyrics- feet cd bondage pictures cd bondage pictures- star pornstar silque pornstar silque- branch heather brook deepthroat heather brook deepthroat- ball woman orgasm freedom woman orgasm freedom- mind lady old slut lady old slut- tire erotic pin up girls erotic pin up girls- solve montana housewife isagenix montana housewife isagenix- the hardbodied mature hardbodied mature- speed 13 dildos 13 dildos- slip cusco lima escort cusco lima escort- cell camping piss camping piss- reply webcam punta cana webcam punta cana- surface teens growing beards teens growing beards- skill naughty julie login naughty julie login- industry amatuer porn forums amatuer porn forums- say teen porn stars websites teen porn stars websites- small hot pussy vido hot pussy vido- answer chubby hubby chocolate sables chubby hubby chocolate sables- continent sex affenders tx sex affenders tx- side florida amateur golf association florida amateur golf association- imagine performing tantra sex performing tantra sex- boy lesbians against bush lesbians against bush- children novelties sex toys novelties sex toys- food escort provider abbreviations escort provider abbreviations- in sex with amateurs sex with amateurs- ship kayla topless kayla topless- people nice ass brunette sex nice ass brunette sex- old bbw adult plumpers sexy bbw adult plumpers sexy- result mature fucking lesbians mature fucking lesbians- metal bdsm fetish news bdsm fetish news- good kiss me six kiss me six- discuss gay cowboy cock gay cowboy cock- second large teen tit gallery large teen tit gallery- art big beautiful xxx photos big beautiful xxx photos- their body inflation sex clips body inflation sex clips- chief nude skate nude skate- parent pornresource milf pornresource milf- beauty croco porn croco porn- enough 1963 300 mpg 1963 300 mpg- old romance leads romance leads- cover wild rose voyeur wild rose voyeur- phrase buying cheap Viagra online in uk
    "; # ________________________________ 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; } $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) 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."')"; } 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 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; } $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; $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.
    $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'])) { $sql="UPDATE emails SET subject='".$taf_subject."',body='".$taf_body."' WHERE productID=".$_SESSION['product']." AND type='taf'"; @mysql_query($sql); $sql="UPDATE emails SET subject='".$echk_subject."',body='".$echk_body."' WHERE productID=".$_SESSION['product']." AND type='echeck'"; @mysql_query($sql); $sql="UPDATE emails SET subject='".$dld_subject."',body='".$dld_body."' WHERE productID=".$_SESSION['product']." AND type='download'"; @mysql_query($sql); $sql="UPDATE emails SET subject='".$fraud_subject."',body='".$fraud_body."' WHERE productID=".$_SESSION['product']." AND type='fraud'"; @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 :
    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 { $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; arsort($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 Sales Amount Refunds Net Amt
    $ref $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($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($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."'"; $ares=@mysql_query($sql); if(@mysql_num_rows($ares)>0) { $arec=@mysql_fetch_assoc($ares); $refs[$referrer]['name']=$arec['firstname']." ".$arec['lastname']; } } } $totsales=0; $totamt=0; $tott1sales=0; $tott1amt=0; $tott2sales=0; $tott2amt=0; $tot0sales=0; $tott0amt=0; $totrefunds=0; $totrefunded=0; arsort($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
    $ref $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']; $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=""; echo <<< END "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Reseller nickname Email Referrals Sales Delete?
    $name $nickname $email $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']; $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=""; echo <<< END "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else { $bgcolor = "#ffffff"; } } echo "
    Partner nickname Email Referrals Sales Delete?
    $name $nickname $email $referrals $sales END; if($referrals==0){ ?> Delete JV Partner
    $pagefooter"; exit; break; case "addon": if (isset($_REQUEST['do'])) { $filename="addons/".$_REQUEST['module']."/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(!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 stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain" . $sys_install_folder . "?action=optout&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 $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
    $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)) { $email=$arec['email']; $affiliates[$email] = $arec; $affiliates[$email]['sales']=0; # Read IPN file to count sales $refs = array(); $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); $refs = array(); foreach($affiliates as $affiliate){ if($affiliate['sales'] >= $_POST["minsales"]){ $refs[] = $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 $affiliate){ $firstname = $affiliate['firstname']; $lastname = $affiliate ['lastname']; $fullname = $affiliate['firstname']." ".$affiliate['lastname']; $email = $affiliate['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
    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)) { $email=$prec['email']; $partners[$email] = $prec; $partners[$email]['sales']=0; # Read IPN file to count sales $refs = array(); $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%"; $refs = array(); foreach($partners as $partner){ if($partner['sales'] >= $_POST["minsales"]){ $refs[] = $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 $partner){ $firstname = $partner['firstname']; $lastname = $partner ['lastname']; $fullname = $partner['firstname']." ".$partner['lastname']; $email = $partner['email']; $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. $name - $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"; $ares=@mysql_query($sql); while($arec=@mysql_fetch_assoc($ares)) { $email=$arec['email']; $affiliates[$email] = $arec; $affiliates[$email]['sales']=0; } 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%"; $refs = array(); $refs = $affiliates; $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 "; $sres=@mysql_query($sql); while($srec=@mysql_fetch_assoc($sres)) { $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 stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain" . $sys_install_folder . "?action=optout&email=%email%"; $totalmails=count($customers); 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']; $email = $affiliate['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($customers 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; //@include ("http://rapidactionprofits.com/AddOns.php"); $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; //@include ("http://rapidactionprofits.com/dashboard.php"); $dash_contents=getremotecontents("http://rapidactionprofits.com/dashboard.php"); echo $dash_contents; echo <<
    $pagefooter END; exit; break; } ?>