Esempio n. 1
0
<?php

// make payment to Echo SPB
include "/home/www/cb3/ales/config.php";
$link = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_set_charset('utf8', $link);
pay_on_behalf_of_echo(1111);
function pay_on_behalf_of_echo($cartoon_id)
{
    // constants
    $license_num = uniqid() . "_" . $cartoon_id;
    $sessionid = uniqid();
    $price = "250";
    $date_today = time();
    $date_download = date('y-m-d H:i:s');
    // wp_purchase_logs
    $sql = "INSERT INTO `cartoonbankru`.`wp_purchase_logs` (`id`, `totalprice`, `statusno`, `sessionid`, `transactid`, `authcode`, `user_id`, `firstname`, `lastname`, `email`, `address`, `phone`, `downloadid`, `processed`, `date`, `payment_arrived_date`, `gateway`, `shipping_country`, `shipping_region`) VALUES (NULL, '" . $price . "', '0', '" . $sessionid . "', '0', '0', '131', 'Валерий', 'Нечай', '*****@*****.**', 'эхомскспбру', '+7(921)9341454', '0', '1', '" . $date_today . "', '', 'wallet', '', '')";
    $result = mysql_query($sql);
    if (!$result) {
        die('Invalid query: ' . mysql_error());
    }
    $purchase_id = mysql_insert_id();
    if (!$purchase_id) {
        die('Can\'t get inserted line id: ' . mysql_error());
    }
    // wp_cart_contents
    $sql = "INSERT INTO `cartoonbankru`.`wp_cart_contents` (`id`, `prodid`, `purchaseid`, `price`, `pnp`, `gst`, `quantity`, `license`) VALUES (NULL, '" . $cartoon_id . "', '" . $purchase_id . "', '" . $price . "', '0', '', '1', '" . $license_num . "')";
    $result = mysql_query($sql);
    if (!$result) {
        die('Invalid query: ' . mysql_error());
    }
Esempio n. 2
0
$export_dir = "/home/www/cb3/ales/echo/";
if (file_exists($export_dir . $slidename)) {
    wtrmark($export_dir . $slidename, $wm, $author . ' © cartoonbank.ru для echomsk.spb.ru');
}
//send email
//email content
$_link = "http://cartoonbank.ru/?page_id=29&brand=" . $brand;
$_link_cartoon = "http://cartoonbank.ru/?page_id=29&cartoonid=" . $ID;
$content = "Автор: " . $author . "\n\r";
$content .= "Название: " . $title . "\n\r";
//$content .= $_link_cartoon."\n\r";
$content .= "Cсылка на страницу с карикатурой: " . $_link_cartoon . "\n\r";
// send email to Echo with image and license attachment
send_email_multi_attachments($content);
//payment for Echo
pay_on_behalf_of_echo($image_id);
notify_artist($purchase_id);
mysql_close($link);
?>


<?php 
function wtrmark($sourcefile, $watermarkfile, $text)
{
    $logopath = "/home/www/cb3/img/cb-logo-300.png";
    $logofile_id = imagecreatefrompng($logopath);
    imageAlphaBlending($logofile_id, true);
    imageSaveAlpha($logofile_id, true);
    $fileType = strtolower(substr($sourcefile, strlen($sourcefile) - 3));
    switch ($fileType) {
        case 'gif':