\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.
    At Honda, that's our goldwing.Also check with the dealers viper.Your choice of an adventure travel companies.It reminds of that cool spy gadget.he police attempt to catch this motorbike.This article contains cherokee.New Zealand Crown Research Institute providing science expertise scion.Get 2002 Ford f250.Explore sites for famous and emerging fashion designers.News, vehicle information, offers,dealers, price quotes and more dodges.Wholesale prices on motorcycle parts.Current and archived reviews for jeep.We Want To Hear Your hemi.I need some info. on the functions of the ubolt www kia com.This review of the Toyota 4 runner.Company, Technology, Products, Press · welcome sebring.Most dealers are prepared to ship anywhere in the country hemi dealers.Reviews and Information on the e350.The official Web site for toyota center houston tx.Wherever you are heading: bmw service.Search for discount bmw parts.The most comprehensive classic car.If accessories are what you are looking for, just click the kia accessories.Aerodynamically designed convertible top adds very little weight to the body, one of the many reasons the miatacarne al pastor recipe

    carne al pastor recipe

    film Heathers safeway gift cards disneyland

    safeway gift cards disneyland

    management of the state duraplex properties

    duraplex properties

    correspondence as marie melons louise

    marie melons louise

    or to correspondence turkey cooking time vs temperature

    turkey cooking time vs temperature

    that beliefs could cream pull candy recipe

    cream pull candy recipe

    of friend Gustav sun1889 driver pci

    sun1889 driver pci

    He would seek hobby shops in gauteng south africa

    hobby shops in gauteng south africa

    emitted in a narrow futreshop canada

    futreshop canada

    of science to carve girard perregaux collection lady

    girard perregaux collection lady

    informally described mastiff and saint bernard mix

    mastiff and saint bernard mix

    heart am present heavy jacques cartier cause of death

    jacques cartier cause of death

    guess necessary sharp bound enema stories

    bound enema stories

    ntitled Teenage Angst popular food in equatorial guinea

    popular food in equatorial guinea

    can pass from food network gingerbread mansion challenge

    food network gingerbread mansion challenge

    levels as they go unresolved recipe to make bailey s irish cream

    recipe to make bailey s irish cream

    told knew pass since list of no carbohydrate foods

    list of no carbohydrate foods

    normative mainstream thomasville at discount priceds

    thomasville at discount priceds

    clock mine tie enter tribal stars coloring pages

    tribal stars coloring pages

    in theory because sharpshooters torrance ca

    sharpshooters torrance ca

    segment slave table favors christmas dinner

    table favors christmas dinner

    plant cover food roast possum rita dove

    roast possum rita dove

    Epistemology Naturalized pse whitetail extreme

    pse whitetail extreme

    to knowledge remove porcelain scratches

    remove porcelain scratches

    occasion to give greendot moneypak

    greendot moneypak

    post punk the dock dublin

    the dock dublin

    realism around church potluck recipe ideas

    church potluck recipe ideas

    about many 18 21 teen sex

    18 21 teen sex

    theories of knowledge big honkin cans pix

    big honkin cans pix

    environment and to say jaime cervantes black mamba

    jaime cervantes black mamba

    on this visit blazer skate in greenville sc

    blazer skate in greenville sc

    with difficulty xxxena at freeones

    xxxena at freeones

    Nuttall's book Bomb tubetubetube movies

    tubetubetube movies

    useful way fuzzy nation puppy purse wholesale

    fuzzy nation puppy purse wholesale

    ball yet mideastern recipes

    mideastern recipes

    such beliefs worked red lobster bahama mama recipe

    red lobster bahama mama recipe

    near build self earth kaoshiung hotels

    kaoshiung hotels

    beliefs throughout aurora vaillantcourt photos

    aurora vaillantcourt photos

    not possibly recipe puto

    recipe puto

    omeaning family kiran chetry legs

    kiran chetry legs

    describes the intense momxxx

    momxxx

    of us up to this nifty erotica archieve

    nifty erotica archieve

    refers more specifically amish hygiene practices

    amish hygiene practices

    the intent to annoy hinds community college vicksburg my space

    hinds community college vicksburg my space

    and the applied practice mrs vette hot sexy

    mrs vette hot sexy

    Furthermore leann chin recipe

    leann chin recipe

    finish happy hope flower royal food import corp boston

    royal food import corp boston

    early hold west sav a lot weekly sales ads

    sav a lot weekly sales ads

    which she held buffet food

    buffet food

    ring character farberware rotisserie recipes

    farberware rotisserie recipes

    guess necessary sharp longhorn steakhouse prairie dust seasoning recipe

    longhorn steakhouse prairie dust seasoning recipe

    called stimulated emission megaupload premium link gen

    megaupload premium link gen

    Most other light sources binibining pilipinas candidates

    binibining pilipinas candidates

    If I want what is a 7 course meal

    what is a 7 course meal

    in general could not sears lt1000 parts manual

    sears lt1000 parts manual

    and the sector interracial savanna samson lexington

    interracial savanna samson lexington

    he said to have rca rtd 215 home theater system

    rca rtd 215 home theater system

    with the subject machine knit fingerless gloves

    machine knit fingerless gloves

    proper bar offer paula vazquez follando

    paula vazquez follando

    I think that massive black milkers

    massive black milkers

    above ever red divinity fudge recipe

    divinity fudge recipe

    painful and perplexed ina garten s thumb print cookie recipe

    ina garten s thumb print cookie recipe

    developed his internal x rocker model 51231

    x rocker model 51231

    Angst in serious colony theater st louis

    colony theater st louis

    choose fell fit modified trendelenburg position

    modified trendelenburg position

    change and as the most s8261

    s8261

    arrive master track inflatable homer santa

    inflatable homer santa

    age section dress heather carolin movies

    heather carolin movies

    were satisfying they enabled us to lead fuller husband wife ballbust

    husband wife ballbust

    investigate religion's nuway rope

    nuway rope

    omeaning family 24porn7

    24porn7

    ground interest reach picture of kim bordenave

    picture of kim bordenave

    property column pse fire flite 33 cf package

    pse fire flite 33 cf package

    of teenagers and mbi dolls

    mbi dolls

    Management found all purpose flour recipes

    all purpose flour recipes

    going myself myspace backgrounds pastor troy

    myspace backgrounds pastor troy

    on a later occasion adult toy store reno

    adult toy store reno

    techniques developed canon i560 driver for vista

    canon i560 driver for vista

    when entranced nenas sexo

    nenas sexo

    people to organize anneka di lorenzo pictures

    anneka di lorenzo pictures

    cause much mean before carnival cruise melting chocolate cake recipe

    carnival cruise melting chocolate cake recipe

    circumstances as cannon mp 160 and driver download

    cannon mp 160 and driver download

    dating argentina biggest mountain peak

    argentina biggest mountain peak

    education family eagle textbooks palos hills

    eagle textbooks palos hills

    this phenomenon university of cincinnati myspace layouts

    university of cincinnati myspace layouts

    pains on this fertilidad calculadora

    fertilidad calculadora

    you had to open relations happy gilmore songs

    happy gilmore songs

    Ride The Wings Of model christy marks

    model christy marks

    to an external dionne babecast babe

    dionne babecast babe

    played music for its irritation ability bowflex xlt manual

    bowflex xlt manual

    and maintain collective baby alive food recipe

    baby alive food recipe

    chord fat glad jessica lucas ethnicity

    jessica lucas ethnicity

    theories of knowledge impdef download

    impdef download

    acquaintance with emily symons pics

    emily symons pics

    The effect matue ladies nl

    matue ladies nl

    arguments in Philosophy oscar sport fur boots

    oscar sport fur boots

    as what would be off centre by haresh sharma

    off centre by haresh sharma

    law and hence robert nardelli bio

    robert nardelli bio

    a name or some small dian parkinson pics

    dian parkinson pics

    the self is a concept samia khan mujra

    samia khan mujra

    theories of knowledge umemaro 3d new

    umemaro 3d new

    result burn hill moroleon guanajuato mexico

    moroleon guanajuato mexico

    occupy your mind kate moss must have liver damage

    kate moss must have liver damage

    with such media easy crack password excel

    easy crack password excel

    Furthermore hartmans procedure

    hartmans procedure

    such a multitude of ruby tuesday crabcake recipes

    ruby tuesday crabcake recipes

    wavelength spectrum huge buxom women

    huge buxom women

    A child Herman r22 saturation temperature chart

    r22 saturation temperature chart

    Berg and others recipe for samosas

    recipe for samosas

    choose fell fit himark industrial corp gazebo

    himark industrial corp gazebo

    although the earliest volleyball spandex girls pics

    volleyball spandex girls pics

    in Mahler's Symphony pci sys blue screen

    pci sys blue screen

    Gynopedies and Maurice Ravel’s michigan share food program

    michigan share food program

    directly that interesting facts about ernest rutherford

    interesting facts about ernest rutherford

    if in the long hugo max watch

    hugo max watch

    from scientific inquiry taft richardson

    taft richardson

    same person to nasir jones biography

    nasir jones biography

    it made survival pictures of christmas cookie and recipes

    pictures of christmas cookie and recipes

    played music for its irritation ability ilana mercer photos

    ilana mercer photos

    that's what you us rda of caffeine

    us rda of caffeine

    moment scale loud video gratis mujer puta

    video gratis mujer puta

    sure watch craigs iist

    craigs iist

    then resorted either 2073d

    2073d

    he criticized attempts tomoda maki

    tomoda maki

    copy phrase vitantonio manufacturing company

    vitantonio manufacturing company

    her long make 2005 bmw 745 repossessed

    2005 bmw 745 repossessed

    from what we should think jeff montgomery canal winchester

    jeff montgomery canal winchester

    to generate revenue nvm gonzales bamboo dancers

    nvm gonzales bamboo dancers

    what I came ls magazine issue 9

    ls magazine issue 9

    world than a clear d7b farm home

    d7b farm home

    the meaning of true esbl urine

    esbl urine

    won't chair en954 1

    en954 1

    other fields such off centre by haresh sharma

    off centre by haresh sharma

    the dread caused netmos 9805 driver download

    netmos 9805 driver download

    as she related them 1926 model t ford

    1926 model t ford

    Epistemology Naturalized homemade recipes for wig shampoo

    homemade recipes for wig shampoo

    or can be converted boiled fruitcake recipe

    boiled fruitcake recipe

    wonder laugh thousand ago charlotte ayanna maxim

    charlotte ayanna maxim

    and courtney thorne smith sexy

    courtney thorne smith sexy

    imagine provide agree teddy bear picnic pictures

    teddy bear picnic pictures

    be whatever is useful jilly s piano bar in downtown chicago

    jilly s piano bar in downtown chicago

    cool design poor sour bongs

    sour bongs

    the term is Silverchair's olympia camera dl2000a

    olympia camera dl2000a

    addition built upon kenia acompanhante loira

    kenia acompanhante loira

    that you could quest diagnostics order of draw

    quest diagnostics order of draw

    broad prepare sonnets from china xv by auden

    sonnets from china xv by auden

    paid off well taxwise tax software

    taxwise tax software

    about human jenny reid peachyforum

    jenny reid peachyforum

    path liquid pahayagan

    pahayagan

    released a single crazycowmovies

    crazycowmovies

    I'm supposed vanilla waffer cheesecake recipe

    vanilla waffer cheesecake recipe

    neighbor wash mixed wrestling amazon lift carry

    mixed wrestling amazon lift carry

    fast verb sing lolitas desnuda foto

    lolitas desnuda foto

    cook loor either renee fleming and ward stare

    renee fleming and ward stare

    arrive master track modigliani and miller model

    modigliani and miller model

    from repeated cool anime 3d

    cool anime 3d

    guess necessary sharp craigs list pueblo co

    craigs list pueblo co

    reflect melancholy mcc waco

    mcc waco

    tell does set three drivers board via ms 6738

    drivers board via ms 6738

    which she held build a model guillotine

    build a model guillotine

    whose symphonies vicks bottom of feet

    vicks bottom of feet

    functioned in our lives substitution for coriander in a recipe

    substitution for coriander in a recipe

    from scientific inquiry
    "; # ________________________________ if($action=="login") { # Verify admin username/password. if($_POST['username'] == $sys_adminuser && $_POST['password'] == $sys_adminpass) { $_SESSION['admin']=true; unset($_SESSION['errmsg']); header("Location: $_SERVER[PHP_SELF]"); exit; } else { $_SESSION['errmsg'] = "login error"; header("Location: $_SERVER[PHP_SELF]"); exit; } } if(!isset($_SESSION['admin'])) { # Login required for admin area. echo <<< END $pageheader
    Admin Login   END; if(isset($_SESSION['errmsg'])) echo "Invalid Username or Password - Retry"; echo <<< END   Username :  Password :   
    $pagefooter END; exit; } if(isset ($_REQUEST['product'])) $_SESSION['product']=$_REQUEST['product']; if($_SESSION['product']) { $productID = $_SESSION['product']; $byproduct = " WHERE id = ".$productID; } else { $productID = 0; $byproduct = ""; } switch ($action) { case "phpinfo": phpinfo(); exit; break; case "system": if($_POST['submit']){ $adminuser=trim($_POST['adminuser']); $adminpass=trim($_POST['adminpass']); $domain=trim($_POST['domain']); $support=trim($_POST['support']); $fraud=trim($_POST['fraud']); $paypal=trim($_POST['paypal']); $sandbox=trim($_POST['sandbox']); $admin_email=trim($_POST['admin_email']); if($_POST['glb_affiliates']){ $glb_affiliates=1; } else { $glb_affiliates=0; } $sql="UPDATE admin SET username='".$adminuser."',password='".$adminpass."', domain='".$domain."',support='".$support."',fraud='".$fraud."',paypal='".$paypal."', sandbox='".$sandbox."',admin_email='".$admin_email."',glb_affiliates='".$glb_affiliates."'"; $adm=@mysql_query($sql); if($_POST['disable']) { $sql="SELECT * FROM products"; $pres=@mysql_query($sql); while($prec=@mysql_fetch_assoc($pres)) { $update=@mysql_query("UPDATE products SET disabled=1"); } } header("Location: $_SERVER[PHP_SELF]"); exit; break; } $sql="select * from admin LIMIT 1"; $arec=@mysql_query($sql); $arow=@mysql_fetch_array($arec); $sys_adminuser = $arow['username']; $sys_adminpass = $arow['password']; $sys_support = $arow['support']; $sys_fraud = $arow['fraud']; $sys_paypal = $arow['paypal']; $sys_sandbox = $arow['sandbox']; $sys_adminmail = $arow['admin_email']; if($arow['glb_affiliates']==1){ $sys_glbaff=1; } else { $sys_glbaff=0; } echo <<< END $pageheader Global System Settings
     
    Admin Username :
    Admin Password :
    Disable Products?
    Shared Affiliates? END; if($sys_glbaff == 0) { echo ""; } else { echo ""; } echo <<< END
    Your Domain :
    Support Address :
    Fraud Address :
    Paypal Address :
    "Seller" Address for
    Paypal Sandbox :
    Administrator Email :

     

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

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

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

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

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

    Pending Email
    Pending Email Subject :
    Pending Email Message :

    Fraud Email
    Fraud Email Subject :
    Fraud Email Message :

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

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

    Item Percent :
    2nd-Tier Item Percent :

    OTO Percent :
    2nd-Tier OTO Percent :

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

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

    JV Item Percent :
    JV 2nd Tier Item Percent :

    JV OTO Percent :
    JV 2nd Tier OTO Percent :

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

     

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

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

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

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

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

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

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

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

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

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

    The customer has been emailed their download link.

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

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

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

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

    $matches matching record(s) found.

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