Пример #1
0
                //paid
                $order_paid[$i] = false;
            } else {
                $order_paid[$i] = true;
            }
        }
        mysql_free_result($result);
        echo <<<EOT
\t<tbody>
EOT;
        for ($k = 0; $k < count($this_id); $k++) {
            $thistime = date('H:i:s', $otime[$k]);
            $thisdate = date('M-d-Y', $otime[$k]);
            $button_list[$k] = '';
            if ($CONFIG['photo_shop_download_enable'] == '1') {
                if (photo_shop_ipn_download_check($uid, $oid[$k])) {
                    // sre there to download items
                    //download files link
                    //get order? is paid?
                    if (verify_paid($oid[$k]) === true) {
                        $button_list[$k] .= "<a href=\"index.php?file=photo_shop/photo_shop_myorders&oid={$oid[$k]}&uid={$uid}&download=create_dir\"> <img src=\"{$THEME_DIR}images/d.gif\" border=\"0\" width=\"14\" height=\"14\" title=\"{$lang_photoshop_ipn['ipn_button_create_dir']}\" alt=\"{$lang_photoshop_ipn['ipn_button_create_dir']}\"></a>";
                        $button_list[$k] .= "<a href=\"index.php?file=photo_shop/photo_shop_myorders&oid={$oid[$k]}&uid={$uid}&download=copy_files\"> <img src=\"{$THEME_DIR}images/c.gif\" border=\"0\" width=\"14\" height=\"14\" title=\"{$lang_photoshop_ipn['ipn_button_copy_files']}\" alt=\"{$lang_photoshop_ipn['ipn_button_copy_files']}\"></a>";
                    }
                }
            }
            echo <<<EOT
\t\t<tr>
\t\t<td class="alt1 smallfont" width="50px">
\t\tp<img src="{$icon_type2[$k]}" alt="" border="0" /><br>
\t\ts<img src="{$icon_type3[$k]}" alt="" border="0" />
\t\t</td>
Пример #2
0
 $uid = $row['uid'];
 mysql_free_result($result);
 //check if invoice AND gross AND seller_email AND currency match, else spoofed data
 if (strtolower(trim($p->ipn_data['business'])) == trim($CONFIG['photo_shop_paypal_email']) && trim($p->ipn_data['mc_currency']) == trim($CONFIG['photo_shop_paypal_currency']) && trim($p->ipn_data['mc_gross']) == trim($gross)) {
     //mark items of the current order paid
     $result2 = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE oid=" . $invoice . ";");
     while ($i = mysql_fetch_array($result2)) {
         $id = $i['id'];
         $status = $i['status'] | 2;
         cpg_db_query("UPDATE {$CONFIG['TABLE_SHOP']} SET status={$status} WHERE id ='" . $i['id'] . "';");
     }
     mysql_free_result($result2);
     //if we set download instead of prints
     if ($CONFIG['photo_shop_download_enable'] == '1') {
         //first check if we have items to download, if yes, create down dir, send passwords etc
         if (photo_shop_ipn_download_check($uid, $invoice)) {
             $CONFIG['photo_shop_download_passwd_mail'] == '1' ? $send_admin_mail = true : ($send_admin_mail = false);
             //create download folder, htaccess, htpasswd, resize images and copy them to download folder
             if (photo_shop_ipn_download($uid, $invoice, $send_admin_mail, true)) {
                 //success, email admin
                 cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body);
             } else {
                 cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_problem'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body);
             }
         }
     } else {
         // email user admin, order is paid... prints need to be sent
         cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body);
         //mail user... maybe redundant..  has already received shop thank you message and all the paypal emails
     }
 } else {
require "plugins/photo_shop/lang/{$lang}.php";
$order = isset($_GET['order']) ? $_GET['order'] : null;
$return_lnk = isset($_GET['return_lnk']) ? $_GET['return_lnk'] : null;
if (isset($order)) {
    //first get the order id using the hash
    $sql = "SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE order_md5_id='{$order}' AND cd='1'";
    $result = cpg_db_query($sql);
    $row = cpg_db_fetch_row($result);
    mysql_free_result($result);
    $oid = $row['oid'];
    $uid = $row['uid'];
    if (!$oid) {
        // if there's no matching order id die
        cpg_die(ERROR, $lang_photoshop_ipn['ipn_no_order_match'], __FILE__, __LINE__);
    }
    if (!photo_shop_ipn_download_check($uid, $oid)) {
        cpg_die(ERROR, "No items to download", __FILE__, __LINE__);
    }
    //define pathes
    $filepath = 'downloads/' . $uid . '_' . $oid;
    $dest_dir = $CONFIG['fullpath'] . $filepath;
    $dest_dir .= '/';
    $filepath .= '/';
    if (!is_dir($dest_dir)) {
        // download dir doesn't exist... die
        if (GALLERY_ADMIN_MODE) {
            pageheader();
            msg_box("{$dest_dir} {$lang_photoshop_ipn['ipn_no_folder']}", "{$dest_dir} {$lang_photoshop_ipn['ipn_no_folder']}", $lang_photoshop_ipn['ipn_continue'], str_replace('&amp;', '&', "index.php?file=photo_shop/photo_shop_admin&amp;box={$_REQUEST['box']}"), '100%');
            pagefooter();
            die;
        } else {
Пример #4
0
     //there's a free item in the cart
     //if ($order_price == 0){
     //mark items of the current order paid
     /*
     $result2 = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE oid=".$order_id.";");
     while($i=mysql_fetch_array($result2))
     {
     	$id = $i['id'];
     	$status = $i['status'] | 2;
     	cpg_db_query("UPDATE {$CONFIG['TABLE_SHOP']} SET status=$status WHERE id ='".$i['id']."';");
     }
     mysql_free_result($result2);
     */
     if ($CONFIG['photo_shop_download_enable'] == '1') {
         //first check if we have items to download, if yes, create down dir, send passwords etc
         if (photo_shop_ipn_download_check(USER_ID, $order_id)) {
             $CONFIG['photo_shop_download_passwd_mail'] == '1' ? $send_admin_mail = true : ($send_admin_mail = false);
             //create download folder, htaccess, htpasswd, resize images and copy them to download folder
             if (photo_shop_ipn_download(USER_ID, $order_id, $send_admin_mail, true)) {
                 //success, email admin
                 cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body);
             } else {
                 cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_problem'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body);
             }
         }
     }
 }
 msg_box('', $msg_box_txt, $lang_continue, $CONFIG['ecards_more_pic_target'] . 'index.php');
 //comment out if you don't want the orders to appeare on the order confirmed page
 starttable('100%', $lang_photoshop['myorders'], 1);
 echo photoshop_create_table($shop_array_photos, 'photo', 'html');