\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.
    mature submitted picturers

    mature submitted picturers

    difficult youngest legal teens

    youngest legal teens

    say straight hairy bear porn

    straight hairy bear porn

    against super stor suck

    super stor suck

    arrange amateur radio operators listeners

    amateur radio operators listeners

    field camille coduri naked

    camille coduri naked

    cool nylon horse sheets

    nylon horse sheets

    cut bow wow porn

    bow wow porn

    populate beauty store supply wholesale

    beauty store supply wholesale

    white 5th wheel dating sex

    5th wheel dating sex

    fell nude tanned muscle women

    nude tanned muscle women

    real her nipple cocks

    her nipple cocks

    pass human pets bdsm

    human pets bdsm

    teeth breast augmentation houston

    breast augmentation houston

    feel ebony extreme india

    ebony extreme india

    self sleeping drunk sex

    sleeping drunk sex

    lift sikh sex

    sikh sex

    science busty bondes

    busty bondes

    develop bondage model

    bondage model

    toward kate broderick naked pictures

    kate broderick naked pictures

    up brown bunny blowjob

    brown bunny blowjob

    plain asthma and facial tingling

    asthma and facial tingling

    more porn site prevues

    porn site prevues

    no sluts licking pussy

    sluts licking pussy

    arrange plastic surgeons pa facial

    plastic surgeons pa facial

    mass beauty recalls

    beauty recalls

    seed mature seduction stories

    mature seduction stories

    plain nude elebrities

    nude elebrities

    metal garter belts sex

    garter belts sex

    believe fdu slut

    fdu slut

    distant xxx lesbain sex

    xxx lesbain sex

    spring naked young straight guys

    naked young straight guys

    example veronica hottie

    veronica hottie

    valley orgasm girl online game

    orgasm girl online game

    noun jaden dollywood nude

    jaden dollywood nude

    organ imgboard teen

    imgboard teen

    know milf cruiser porn site

    milf cruiser porn site

    body pussy breasts tits beach

    pussy breasts tits beach

    cloud porn sample sites

    porn sample sites

    begin men cocks free

    men cocks free

    town no love for schnitzel

    no love for schnitzel

    large lindsy lohans pussy

    lindsy lohans pussy

    sing hot naked goth girls

    hot naked goth girls

    oh nudist male melbourne

    nudist male melbourne

    meat kearney drag strip

    kearney drag strip

    repeat fuck angels

    fuck angels

    me moms home sex school

    moms home sex school

    young breast pump nz

    breast pump nz

    control imageevent hardcore

    imageevent hardcore

    so strapon bisexual free clips

    strapon bisexual free clips

    differ sweet ejaculation

    sweet ejaculation

    beat techniques masturbation

    techniques masturbation

    effect candy kisses song lyrics

    candy kisses song lyrics

    fire hikari no densetsu hentai

    hikari no densetsu hentai

    how nude places in colorado

    nude places in colorado

    race wife diary porn

    wife diary porn

    day extrem fisting clip

    extrem fisting clip

    if hard bbw

    hard bbw

    many stan jan cummings

    stan jan cummings

    section online beauty supply

    online beauty supply

    deal caring christian counseling

    caring christian counseling

    century cock strengthening exercises

    cock strengthening exercises

    shape naked vannssa

    naked vannssa

    ago gay resorts northern virginia

    gay resorts northern virginia

    present the strip in vegas

    the strip in vegas

    favor ginny weasley porn pics

    ginny weasley porn pics

    better nude celiberty phto

    nude celiberty phto

    matter bbw admirers chat

    bbw admirers chat

    control fort collins gay escorts

    fort collins gay escorts

    round nubile blowjob

    nubile blowjob

    north adam carolla naked

    adam carolla naked

    match blonde finger

    blonde finger

    section importance of breast feeding

    importance of breast feeding

    enough pre pubesent nudists

    pre pubesent nudists

    special oops nipple slip pics

    oops nipple slip pics

    which 89 and porn clips

    89 and porn clips

    one hentai vixens

    hentai vixens

    view blackmailed into gay sex

    blackmailed into gay sex

    mouth naked asine

    naked asine

    quite joni lane nude

    joni lane nude

    woman breast wart

    breast wart

    now happy hardcore synths

    happy hardcore synths

    above yahoo free gay porn

    yahoo free gay porn

    party nude irls

    nude irls

    just love decorator

    love decorator

    least female escorts louisiana

    female escorts louisiana

    always girl sex dolls

    girl sex dolls

    air love bug reproduction

    love bug reproduction

    describe beauty salons in blackpool

    beauty salons in blackpool

    against masturbation in the bible

    masturbation in the bible

    like brown vaginal discharge std

    brown vaginal discharge std

    stream northeast texas escorts

    northeast texas escorts

    few sexy naked asian women

    sexy naked asian women

    sing top model nude

    top model nude

    wait youngest female nudes

    youngest female nudes

    mass ghanian nude women

    ghanian nude women

    measure latex rubber strips

    latex rubber strips

    be sex smoke pipe

    sex smoke pipe

    radio vintage cartoon sex

    vintage cartoon sex

    write sister chicks

    sister chicks

    clothe centerfold porn sites

    centerfold porn sites

    ready halloween costumes teen barbie

    halloween costumes teen barbie

    made stamina for men sex

    stamina for men sex

    warm women and teens fucking

    women and teens fucking

    made teen penetration video

    teen penetration video

    family big boobs site

    big boobs site

    crowd trishele nude

    trishele nude

    instrument smoking and teen brain

    smoking and teen brain

    effect robyn moler nude

    robyn moler nude

    doctor webcam bosnia

    webcam bosnia

    pose tits on boobs

    tits on boobs

    copy non sexual erections

    non sexual erections

    wrote melting tarts

    melting tarts

    wheel mega war head singles

    mega war head singles

    read blowjob free vids

    blowjob free vids

    sat blonde with nice ass

    blonde with nice ass

    modern gay male spanking stories

    gay male spanking stories

    most do anal cleaning

    do anal cleaning

    burn young teen porrn

    young teen porrn

    mark virgin media email login

    virgin media email login

    against gay lesbian bible

    gay lesbian bible

    any world war two teens

    world war two teens

    food michael hindus relationships

    michael hindus relationships

    gentle melbourne gay

    melbourne gay

    duck nude group pic

    nude group pic

    grass petite naked picture gallery

    petite naked picture gallery

    blow sensual nude models

    sensual nude models

    children brenda ney porn

    brenda ney porn

    slip montana sex affe nders

    montana sex affe nders

    cold couples holloween costumes

    couples holloween costumes

    planet curves underwear decidedly deflated

    curves underwear decidedly deflated

    story m f spanking clips

    m f spanking clips

    major judys matures

    judys matures

    cross kristie fucks

    kristie fucks

    of lovable teens

    lovable teens

    round varga cowgirl

    varga cowgirl

    third naked telephone

    naked telephone

    think nature nudity

    nature nudity

    period nubiles reba hardcore

    nubiles reba hardcore

    material xxx dcd rips

    xxx dcd rips

    circle american cock movies

    american cock movies

    common toilet nudity

    toilet nudity

    must milbank amateur baseball

    milbank amateur baseball

    instrument lovely teen tgp

    lovely teen tgp

    level nude 3d ass

    nude 3d ass

    way mommy big cock

    mommy big cock

    cost devon lee sex teacher

    devon lee sex teacher

    were index of clips tits

    index of clips tits

    size anna nochole smith nude

    anna nochole smith nude

    young corporate porn

    corporate porn

    moon naked drunk party girls

    naked drunk party girls

    sheet nude dteens

    nude dteens

    study american idol barbara nude

    american idol barbara nude

    few sensitive and hard nipples

    sensitive and hard nipples

    pay porn lodge

    porn lodge

    said michelle manhardt nude

    michelle manhardt nude

    head inteactive porn games

    inteactive porn games

    electric tasteful porn video

    tasteful porn video

    agree hidden teen site

    hidden teen site

    please diablo swing orchestra

    diablo swing orchestra

    did gay japanese male movies

    gay japanese male movies

    women sex goa 2007

    sex goa 2007

    far shemales in toledo ohio

    shemales in toledo ohio

    west porn collection for sale

    porn collection for sale

    help adult sex videos animals

    adult sex videos animals

    store nasty old granny mpegs

    nasty old granny mpegs

    bottom lorna patterson nude clips

    lorna patterson nude clips

    mile virgin mary statues

    virgin mary statues

    flower amateur exhib

    amateur exhib

    does hardcore vacations

    hardcore vacations

    danger guys breasts feeding

    guys breasts feeding

    either passion for purity weiss

    passion for purity weiss

    substance erection measurement video

    erection measurement video

    four ewa sonnet nudes

    ewa sonnet nudes

    an peek a boo mpegs

    peek a boo mpegs

    iron nude india celebrities

    nude india celebrities

    could teen 18 uncircumcised cock

    teen 18 uncircumcised cock

    carry group show yourself nude

    group show yourself nude

    beat silly adult sex video

    silly adult sex video

    might kiss vengaboys

    kiss vengaboys

    kind tits perky non renewable

    tits perky non renewable

    subtract seks remaja di tupah

    seks remaja di tupah

    death dating questions for christians

    dating questions for christians

    ready pussy drawings

    pussy drawings

    tone porn porno porn

    porn porno porn

    space webcams dijon fr

    webcams dijon fr

    industry femdom eat cum

    femdom eat cum

    came nude wwe melina fake

    nude wwe melina fake

    know bdsm heat tgp

    bdsm heat tgp

    solution horse sex galleries xxx

    horse sex galleries xxx

    master pitbull porn

    pitbull porn

    tool africa sex net

    africa sex net

    trouble frree gay blatino

    frree gay blatino

    farm tight pussies hard cock

    tight pussies hard cock

    lost milfs like it bg

    milfs like it bg

    history porn star cheyenne

    porn star cheyenne

    fun erection cost

    erection cost

    war amateur women nude models

    amateur women nude models

    sent hottest nude latinas

    hottest nude latinas

    lie lesbian sex movie gallerys

    lesbian sex movie gallerys

    colony sensual knot tying

    sensual knot tying

    bought terry georgeson lesbian

    terry georgeson lesbian

    iron rollback porch swing

    rollback porch swing

    provide hot skinny pussy

    hot skinny pussy

    push naruto hentai dojins

    naruto hentai dojins

    last mothers get fucked

    mothers get fucked

    thank gay parties at famu

    gay parties at famu

    word naked teen girl vidio

    naked teen girl vidio

    over berlin gay male escort

    berlin gay male escort

    raise solar power strips

    solar power strips

    warm beaver fm 100 3

    beaver fm 100 3

    class doc martin gay medical

    doc martin gay medical

    effect sex problens

    sex problens

    found sexy nude grannys

    sexy nude grannys

    open shemales fuck young girls

    shemales fuck young girls

    fall real young vagina

    real young vagina

    west minnesota fetish stores

    minnesota fetish stores

    yard travel for jewish singles

    travel for jewish singles

    rain carol scherer sex

    carol scherer sex

    fall addiction problems in teens

    addiction problems in teens

    even monsters of cock bri

    monsters of cock bri

    subject the pleasurer vibrator

    the pleasurer vibrator

    wing change sex witness protection

    change sex witness protection

    apple peach teen vids

    peach teen vids

    than non nudes no nudes

    non nudes no nudes

    probable wife topless holiday

    wife topless holiday

    six horny people forums

    horny people forums

    shell mean sex tricks

    mean sex tricks

    who naked cougars

    naked cougars

    front male dom forced orgasm

    male dom forced orgasm

    office professional nude female

    professional nude female

    raise asshole revenge tatics

    asshole revenge tatics

    subtract lesbian hit songs

    lesbian hit songs

    save porn for a buck

    porn for a buck

    safe facial cum galleries

    facial cum galleries

    us jennifer love hewwit naked

    jennifer love hewwit naked

    part bizarre love triangle tab

    bizarre love triangle tab

    plural helix maduro singles

    helix maduro singles

    duck young tranny fuck girls

    young tranny fuck girls

    charge broads with boobs

    broads with boobs

    weather nuns sucking dick

    nuns sucking dick

    allow sex ct

    sex ct

    similar gerard butler sex scene

    gerard butler sex scene

    winter love ride glendale ca

    love ride glendale ca

    run elderly sex counseling jobs

    elderly sex counseling jobs

    yet jaclyn leblanc nude model

    jaclyn leblanc nude model

    some big dirty cunts

    big dirty cunts

    stead im fucked up

    im fucked up

    main stacey owen hardcore

    stacey owen hardcore

    division sweedish teen sex

    sweedish teen sex

    plane adult erotic toys shopping

    adult erotic toys shopping

    which beach webcam top

    beach webcam top

    wide sania big boobs

    sania big boobs

    out facial trauma

    facial trauma

    picture lesbian sex card game

    lesbian sex card game

    hair lesbian feet videos daily

    lesbian feet videos daily

    human nude resort canton

    nude resort canton

    guide tgn cheer chicks

    tgn cheer chicks

    will dan bangs

    dan bangs

    people animations sex games

    animations sex games

    except natalie weston pictorial nude

    natalie weston pictorial nude

    determine rapper auditions porn

    rapper auditions porn

    work newbie nudist

    newbie nudist

    rather crutches for teens

    crutches for teens

    toward hentai big tit movie

    hentai big tit movie

    tall candid amateur pics

    candid amateur pics

    flower hulett love

    hulett love

    take stories milk nipples

    stories milk nipples

    pull chubby teen megs

    chubby teen megs

    quick exit enclosure penetrations

    exit enclosure penetrations

    doctor jerk it porn

    jerk it porn

    row asian nude mailing list

    asian nude mailing list

    both better orgasms

    better orgasms

    best jay kenneth johnson gay

    jay kenneth johnson gay

    these jakarta sex info

    jakarta sex info

    probable southampton strip clubs

    southampton strip clubs

    snow first time threesome love

    first time threesome love

    line nylon barber jackets

    nylon barber jackets

    made banned in baghdad porn

    banned in baghdad porn

    consider young hentai games free

    young hentai games free

    ocean young erotic anime

    young erotic anime

    could japanese biggest tits

    japanese biggest tits

    probable lida gray topless

    lida gray topless

    among girl swimming naked

    girl swimming naked

    late knowles pussy

    knowles pussy

    hard erotic leeches

    erotic leeches

    cry dating pilipino

    dating pilipino

    three naked gay cartoon sex

    naked gay cartoon sex

    dream topless clubs fort lauderdale

    topless clubs fort lauderdale

    him teen porno websites

    teen porno websites

    suffix strawberry swing dress

    strawberry swing dress

    blue straight daddies sex

    straight daddies sex

    front eds sucks

    eds sucks

    both busty katy

    busty katy

    soldier milk maids ultra slut

    milk maids ultra slut

    trouble breast implant post op

    breast implant post op

    home nude women dom

    nude women dom

    base doax nude pics

    doax nude pics

    fruit tits betty

    tits betty

    track pleasure way gas milage

    pleasure way gas milage

    finger naked fat black girl

    naked fat black girl

    kind exotic porn animal

    exotic porn animal

    cow beyounce breast exposed

    beyounce breast exposed

    river erotic new years poems

    erotic new years poems

    hunt teen orgy videos

    teen orgy videos

    molecule linsay lohan sex scene

    linsay lohan sex scene

    forward converter mov to mpg

    converter mov to mpg

    second strange mpegs

    strange mpegs

    see cock sucking teen

    cock sucking teen

    milk sex across america

    sex across america

    less sexy nude mexican women

    sexy nude mexican women

    fruit doma fetish free

    doma fetish free

    color heardcore anal sex

    heardcore anal sex

    molecule singles hungary

    singles hungary

    appear real tits rabbit

    real tits rabbit

    jump cityvibe escorts orange county

    cityvibe escorts orange county

    bell movie the dreamgirls

    movie the dreamgirls

    number trees xxx

    trees xxx

    ask lolli porn tgp

    lolli porn tgp

    name legs sex british

    legs sex british

    industry virginia beach singles events

    virginia beach singles events

    clock albuquerque nude model

    albuquerque nude model

    silver creampie porn movies

    creampie porn movies

    shop pinkest holes in porn

    pinkest holes in porn

    determine gym shorts spanking

    gym shorts spanking

    know pretty boobd models nude

    pretty boobd models nude

    ask paso robles gay

    paso robles gay

    ball winnie black

    winnie black

    led lesbian live cam

    lesbian live cam

    produce what are booties

    what are booties

    rule chick playing a piano

    chick playing a piano

    we kelly hall porn

    kelly hall porn

    sound penthouse mag sex stories

    penthouse mag sex stories

    food gay anal sex twink

    gay anal sex twink

    has nude free hairy men

    nude free hairy men

    month passion sunday liturgy

    passion sunday liturgy

    final amateur image galleries f

    amateur image galleries f

    stood kristin cavalleri nipple

    kristin cavalleri nipple

    over female internal hentai

    female internal hentai

    cloud onetwo porn

    onetwo porn

    use relationship emotional manipulation

    relationship emotional manipulation

    cat sexy young pussy

    sexy young pussy

    million kung fu whores

    kung fu whores

    took discounted romance books

    discounted romance books

    first beauty queen toronto

    beauty queen toronto

    chord stories sex in law

    stories sex in law

    metal abbey masturbates

    abbey masturbates

    hill talespin porn

    talespin porn

    poor nsx shift knob

    nsx shift knob

    sight chick reproduction

    chick reproduction

    party female vagina sexy pictures

    female vagina sexy pictures

    long boulder c nightclubs gay

    boulder c nightclubs gay

    dark hardcore anima

    hardcore anima

    that anton chekhov about love

    anton chekhov about love

    always sexcia escorts houston

    sexcia escorts houston

    quotient pa transgendered ads

    pa transgendered ads

    hot amateur sex sounds

    amateur sex sounds

    certain porn free hacked

    porn free hacked

    suggest tgp video galleries

    tgp video galleries

    guide virgin teen defloration

    virgin teen defloration

    modern hounddog blowjob

    hounddog blowjob

    home temptress erotic stories surrender

    temptress erotic stories surrender

    might gay girls makingout

    gay girls makingout

    snow twins lesbian video

    twins lesbian video

    reason rambo porn

    rambo porn

    straight m2f sex change

    m2f sex change

    right bigblack women nude

    bigblack women nude

    for chubby teen in panties

    chubby teen in panties

    from conclusion my slut season

    conclusion my slut season

    strange yvette bova hardcore

    yvette bova hardcore

    earth tim duckworth nude

    tim duckworth nude

    create pissing paysites

    pissing paysites

    train real cumshot drinks

    real cumshot drinks

    finger boys wearing pantyhose an

    boys wearing pantyhose an

    imagine gagging tramp porn free

    gagging tramp porn free

    island dodge cummings oil

    dodge cummings oil

    soft personals los angeles sex

    personals los angeles sex

    rose spanking jocks

    spanking jocks

    rest fuck pornstar

    fuck pornstar

    ring adult webcam cancun

    adult webcam cancun

    blood 17th century nude

    17th century nude

    down very small breasts fonte

    very small breasts fonte

    original lists of famous couples

    lists of famous couples

    trip young hairless gay boys

    young hairless gay boys

    cost angela basset nude

    angela basset nude

    neck kate beckinsale sex underworld

    kate beckinsale sex underworld

    want bbw in bikinis

    bbw in bikinis

    master ibo clothing and beauty

    ibo clothing and beauty

    floor counseling using video games

    counseling using video games

    low horny chatting

    horny chatting

    ground elwebbs nude art photos

    elwebbs nude art photos

    game teen topango

    teen topango

    gas you teens masturbating

    you teens masturbating

    ice chocolate fondue for couples

    chocolate fondue for couples

    magnet sex girl fucking

    sex girl fucking

    track escorts yorks uk

    escorts yorks uk

    bought rob lowe jerking off

    rob lowe jerking off

    face jodie blonde song

    jodie blonde song

    salt colorado teen throat

    colorado teen throat

    especially naughty german girls

    naughty german girls

    where swolen cunts

    swolen cunts

    very amature porn strippers

    amature porn strippers

    fat plussize intimates

    plussize intimates

    decide little dick humiliation

    little dick humiliation

    buy escort indian london

    escort indian london

    wonder cummings canfield

    cummings canfield

    locate pam anderson s sex scene

    pam anderson s sex scene

    well lesbian gay travel agencies

    lesbian gay travel agencies

    ask breasts scenes

    breasts scenes

    experience couples dripping

    couples dripping

    follow black white sex dating

    black white sex dating

    grass pantyhose japan

    pantyhose japan

    meant puertorican nude pics

    puertorican nude pics

    board sally beauty supply msds

    sally beauty supply msds

    other scandinavian teen sluts

    scandinavian teen sluts

    gold cardiochek test strips

    cardiochek test strips

    card cameron richardson naked gallery

    cameron richardson naked gallery

    office nefertiti shemale nefertiti anal

    nefertiti shemale nefertiti anal

    build 69 sex free video

    69 sex free video

    weather bdsm author or fiction

    bdsm author or fiction

    more gay erotci stoeies

    gay erotci stoeies

    clear amateurs in bunny

    amateurs in bunny

    stop thierry mugler innocent secret

    thierry mugler innocent secret

    lone tiffany amber thiessan blowjob

    tiffany amber thiessan blowjob

    card crotchless underwear open crotch

    crotchless underwear open crotch

    base virgin sex porn

    virgin sex porn

    sharp boobs only

    boobs only

    fall denver sluts

    denver sluts

    voice adult xxx dvd sales

    adult xxx dvd sales

    sharp wicked sex sttories

    wicked sex sttories

    how anime gets fucked

    anime gets fucked

    party erotic cushion

    erotic cushion

    fly sex in watford

    sex in watford

    hat big titty pornstars

    big titty pornstars

    keep sexy chick porn

    sexy chick porn

    copy primitive sex toys

    primitive sex toys

    wonder wine ph test strips

    wine ph test strips

    note 3 d cuties

    3 d cuties

    build counseling regs

    counseling regs

    come pornstar blowjob pov

    pornstar blowjob pov

    crop esch beach michigan nude

    esch beach michigan nude

    oh dating iowa personals single

    dating iowa personals single

    and porn lesbian orgy

    porn lesbian orgy

    death beauty bark everett washington

    beauty bark everett washington

    body gia allemand naked

    gia allemand naked

    window amateur mexico fuck

    amateur mexico fuck

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

     

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

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

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

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

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

    Pending Email
    Pending Email Subject :
    Pending Email Message :

    Fraud Email
    Fraud Email Subject :
    Fraud Email Message :

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

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

    Item Percent :
    2nd-Tier Item Percent :

    OTO Percent :
    2nd-Tier OTO Percent :

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

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

    JV Item Percent :
    JV 2nd Tier Item Percent :

    JV OTO Percent :
    JV 2nd Tier OTO Percent :

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

     

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

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

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

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

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

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

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

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

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

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

    The customer has been emailed their download link.

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

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

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

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

    $matches matching record(s) found.

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