Esempio n. 1
0
    $i = 1;
    foreach ($products as $product) {
        ?>
                            <tr>
                                <td><?php 
        echo $product->title;
        ?>
</td>
                                <td><strong class="text-highlighted"><?php 
        echo $products_data[$product->id_product]['customers'];
        ?>
</strong></td>
                                <td>
                                    <strong class="text-highlighted">
                                        <?php 
        echo $num_format == 'MONEY' ? i18n::format_currency($products_data[$product->id_product]['total']) : Num::format($products_data[$product->id_product]['total'], 0);
        ?>
                                    </strong>
                                </td>
                                <td class="col-xs-2">
                                    <div class="progress">
                                        <div class="progress-bar" style="width: <?php 
        echo $current_total > 0 ? number_format($products_data[$product->id_product]['total'] / $current_total * 100, 2) : 0;
        ?>
%;">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        <?php 
    }
Esempio n. 2
0
?>
?email=<?php 
echo $order->user->email;
?>
">
                <?if ($order->status==Model_Order::STATUS_CREATED):?>
                    <?php 
echo __('Not paid');
?>
                <?elseif ($order->status==Model_Order::STATUS_PAID):?>
                    <?php 
echo __('Paid');
?>
                <?endif?>
                    <?php 
echo i18n::format_currency($order->amount, $order->currency);
?>
                </a>
            <?endif?>
            </td>
	    	
	    	<td>
	    		<? if ($ad->status == Model_Ad::STATUS_PUBLISHED):?>	    	
			    	<?php 
echo Date::format($ad->published, core::config('general.date_format'));
?>
		    	
			     <? endif ?>
	    	</td>
            <td>
                <?php 
Esempio n. 3
0
 /**
  * returns the price of the product formated using the product currency, without VAT added
  * @return float 
  */
 public function formated_price()
 {
     return i18n::format_currency($this->final_price(FALSE), $this->currency);
 }
Esempio n. 4
0
									<td class="text-right"><h4><strong><?php 
echo __('Total');
?>
: </strong></h4></td>
									<?php 
if ($order->id_product == Model_Order::PRODUCT_AD_SELL and isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
    ?>
				                    	<td class="text-center text-danger"><h4><strong><?php 
    echo i18n::money_format($order->amount + $order->ad->cf_shipping, $order->currency);
    ?>
</strong></h4></td>
				                    <?php 
} else {
    ?>
				                    	<td class="text-center text-danger"><h4><strong><?php 
    echo $order->id_product == Model_Order::PRODUCT_AD_SELL ? i18n::money_format($order->amount, $order->currency) : i18n::format_currency($order->amount, $order->currency);
    ?>
</strong></h4></td>
				                    <?php 
}
?>
								</tr>
			                    <tr>
			                    	<td></td>
			                    	<td class="text-right">
			                    		<?php 
if (!core::get('print')) {
    ?>
				                        	<div class="pull-right">
				                            	<a target="_blank" class="btn btn-xs btn-success" title="<?php 
    echo __('Print this');
Esempio n. 5
0
        ?>
            <tr>
                <td><?php 
        echo $p->id_order;
        ?>
</td>
                <td><?php 
        echo $p->paymethod;
        ?>
</td>
                <td><?php 
        echo $p->pay_date;
        ?>
</td>
                <td><?php 
        echo i18n::format_currency($p->amount, $p->currency);
        ?>
</td>
                <td><?php 
        echo Model_Order::$statuses[$p->status];
        ?>
</td>
            </tr>
        <?php 
    }
    ?>
 
        </tbody>

    </table>
</div>
Esempio n. 6
0
                <?endif?>

                <hr>
                <a href="<?php 
echo Route::url('default', array('controller' => 'plan', 'action' => 'buy', 'id' => $plan->seoname));
?>
" 
                    class="btn btn-<?php 
echo $current_plan ? 'primary' : 'success';
?>
 btn-block">
                    <?if($current_plan==TRUE):?>
                        <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span> <?php 
echo _e('Renew');
?>
                    <?else:?>
                        <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php 
echo _e('Sign Up');
?>
                    <?endif?>
                    <b><?php 
echo i18n::format_currency($plan->price, core::config('payment.paypal_currency'));
?>
</b>
                </a>
                
            </div>
        </div>
    <?endforeach?>
</div>    
Esempio n. 7
0
        </div>
    </div>
    <div class="col-sm-6 col-md-3">
        <div class="statcard statcard-success">
            <a href="<?php 
echo Route::url('oc-panel', array('controller' => Request::current()->controller(), 'action' => 'sales'));
?>
" class="display-block">
                <div class="p-a">
                    <span class="statcard-desc"><?php 
echo __('Sales');
?>
</span>
                    <h2 class="statcard-number">
                        <?php 
echo i18n::format_currency($sales_total);
?>
                        <small class="delta-indicator <?php 
echo Num::percent_change($sales_total, $sales_total_past) < 0 ? 'delta-negative' : 'delta-positive';
?>
"><?php 
echo Num::percent_change($sales_total, $sales_total_past);
?>
</small> 
                        <small class="ago"><?php 
echo sprintf(__('%s days ago'), $days_ago);
?>
</small>
                    </h2>
                    <hr class="statcard-hr">
                </div>
Esempio n. 8
0
                <?if(core::config('payment.pay_to_go_on_top') > 0 && core::config('payment.to_top') != FALSE):?>
                    <p class="text-info"><?php 
echo __('Your Advertisement can go on top again! For only ') . i18n::format_currency(core::config('payment.pay_to_go_on_top'), core::config('payment.paypal_currency'));
?>
</p>
                    <a class="btn btn-xs btn-primary" type="button" href="<?php 
echo Route::url('default', array('action' => 'to_top', 'controller' => 'ad', 'id' => $ad->id_ad));
?>
"><?php 
echo __('Go Top!');
?>
</a>
                <?endif?>
                <?if(core::config('payment.to_featured') != FALSE AND $ad->featured < Date::unix2mysql()):?>
                    <p class="text-info"><?php 
echo __('Your Advertisement can go to featured! For only ') . i18n::format_currency(Model_Order::get_featured_price(), core::config('payment.paypal_currency'));
?>
</p>
                    <a class="btn btn-xs btn-primary" type="button" href="<?php 
echo Route::url('default', array('action' => 'to_featured', 'controller' => 'ad', 'id' => $ad->id_ad));
?>
"><?php 
echo __('Go Featured!');
?>
</a>
                <?endif?>
            </div>
        <?endif?>
    <?endif?>
    <!-- end paypal button -->
    
Esempio n. 9
0
 /**
  * generates a new commission for the affiliate
  * @param  Model_Order $order   
  * @param  Model_Product      $product [description]
  * @return void               
  */
 public static function sale(Model_Order $order, Model_Product $product = NULL)
 {
     //do we have an affiliate?
     if (self::current()->loaded()) {
         if ($product === NULL) {
             $product = $order->product;
         }
         //this is how much we actually pay to the affiliate
         $commission = $order->amount / 100 * $product->affiliate_percentage;
         //doesnt make sense to add a commission of 0,no?
         if ($commission > 0) {
             $aff = new self();
             $aff->id_order = $order->id_order;
             $aff->id_product = $product->id_product;
             $aff->id_user = self::current()->id_user;
             $aff->percentage = $product->affiliate_percentage;
             $aff->currency = $product->currency;
             $aff->amount = $commission;
             $aff->date_to_pay = Date::unix2mysql(time() + 24 * 60 * 60 * core::config('affiliate.payment_days'));
             $aff->ip_address = ip2long(Request::$client_ip);
             $aff->status = Model_Affiliate::STATUS_CREATED;
             try {
                 $aff->save();
                 //send email to affiliate
                 $params = array('[AMOUNT]' => i18n::format_currency($commission, $product->currency), '[URL.AFF]' => self::current()->ql('oc-panel', array('controller' => 'profile', 'action' => 'affiliate')));
                 self::current()->email('affiliate-commission', $params);
             } catch (Exception $e) {
                 Kohana::$log->add(Log::ERROR, $e->getMessage());
             }
         }
     }
 }
Esempio n. 10
0
    ?>
        <a class="btn btn-success" href="<?php 
    echo Route::url('ad', array('controller' => 'ad', 'category' => $ad->category->seoname, 'seotitle' => $ad->seotitle));
    ?>
"><?php 
    echo __('Go to Your Ad');
    ?>
</a>
    <?php 
}
?>

    <?php 
if (core::config('payment.to_featured') != FALSE and $ad->featured < Date::unix2mysql()) {
    ?>
        <a class="btn btn-primary" type="button" href="<?php 
    echo Route::url('default', array('action' => 'to_featured', 'controller' => 'ad', 'id' => $ad->id_ad));
    ?>
">
            <?php 
    echo __('Go Featured!');
    ?>
 <?php 
    echo i18n::format_currency(Model_Order::get_featured_price(), core::config('payment.paypal_currency'));
    ?>
        </a>
    <?php 
}
?>
</p>
Esempio n. 11
0
">
                                <?php 
    echo $u->name;
    ?>
</a>
                        </td>
                        <td><?php 
    echo $u->email;
    ?>
</td>
                        <td><?php 
    echo $u->paypal_email;
    ?>
</td>
                        <td><?php 
    echo i18n::format_currency($users_to_pay[$u->id_user]['total']);
    ?>
</td>
                        <?php 
    if (Valid::email($u->paypal_email)) {
        ?>
                        <td>
                            <a target="_blank"href="https://www.paypal.com/cgi-bin/webscr?business=<?php 
        echo $u->paypal_email;
        ?>
&cmd=_xclick&currency_code=USD&amount=<?php 
        echo round($users_to_pay[$u->id_user]['total'], 2);
        ?>
&item_name=Commissions_<?php 
        echo date('Y-m-d');
        ?>
Esempio n. 12
0
 /**
  * confirm payment for order
  *
  * @param string    $id_order [unique indentifier of order]
  * @param string    $txn_id id of the transaction depending on provider
  */
 public function confirm_payment($paymethod = 'paypal', $txn_id = NULL, $pay_date = NULL, $amount = NULL, $currency = NULL)
 {
     // update orders
     if ($this->loaded()) {
         $product = $this->product;
         $user = $this->user;
         $this->status = self::STATUS_PAID;
         $this->pay_date = $pay_date === NULL ? Date::unix2mysql() : $pay_date;
         $this->paymethod = $paymethod;
         $this->txn_id = $txn_id;
         if ($product->support_days > 0) {
             $this->support_date = Date::unix2mysql(Date::mysql2unix($this->pay_date) + $product->support_days * 24 * 60 * 60);
         }
         if ($amount !== NULL) {
             $this->amount = $amount;
         }
         if ($currency !== NULL) {
             $this->currency = $currency;
         }
         try {
             $this->save();
         } catch (Exception $e) {
             throw HTTP_Exception::factory(500, $e->getMessage());
         }
         //if saved delete coupon from session and -- number of coupons.
         Model_Coupon::sale($this->coupon);
         //add affiliate commision
         Model_Affiliate::sale($this, $product);
         //generate licenses
         $licenses = Model_License::generate($user, $this, $product);
         $license = '';
         //loop all the licenses to an string
         if (count($licenses) > 0) {
             $license = '\\n\\n==== ' . __('Your Licenses') . ' ====';
             foreach ($licenses as $l) {
                 $license .= '\\n' . $l->license;
             }
         }
         //download link
         $download = '';
         if ($product->has_file() == TRUE) {
             $dwnl_link = $user->ql('oc-panel', array('controller' => 'profile', 'action' => 'download', 'id' => $this->id_order));
             $download = '\\n\\n==== ' . __('Download') . ' ====\\n<a href="' . $dwnl_link . '">' . $dwnl_link . '</a>';
         }
         //theres an expire? 0 = unlimited
         $expire = '';
         $expire_hours = Core::config('product.download_hours');
         $expire_times = Core::config('product.download_times');
         if (($expire_hours > 0 or $expire_times > 0) and $product->has_file() == TRUE) {
             if ($expire_hours > 0 and $expire_times > 0) {
                 $expire = sprintf(__('Your download expires in %u hours and can be downloaded %u times.'), $expire_hours, $expire_times);
             } elseif ($expire_hours > 0) {
                 $expire = sprintf(__('Your download expires in %u hours.'), $expire_hours);
             } elseif ($expire_times > 0) {
                 $expire = sprintf(__('Can be downloaded %u times.'), $expire_times);
             }
             $expire = '\\n' . $expire;
         }
         //param for sale email
         $params = array('[DATE]' => $this->pay_date, '[ORDER.ID]' => $this->id_order, '[USER.NAME]' => $user->name, '[USER.EMAIL]' => $user->email, '[PRODUCT.TITLE]' => $product->title, '[PRODUCT.PRICE]' => i18n::format_currency($this->amount, $this->currency), '[PRODUCT.NOTES]' => Text::bb2html($product->email_purchase_notes, TRUE, FALSE, FALSE), '[DOWNLOAD]' => $download, '[EXPIRE]' => $expire, '[LICENSE]' => $license);
         //send email with order details download link and product notes
         $user->email('new-sale', $params);
         //notify to seller
         if (core::config('email.new_sale_notify')) {
             Email::send(core::config('email.notify_email'), '', 'New Sale! ' . $product->title, 'New Sale! ' . $product->title, core::config('email.notify_email'), '');
         }
         return TRUE;
     }
     return FALSE;
 }
Esempio n. 13
0
        <div class="statcard statcard-success">
            <a href="<?php 
echo Route::url('oc-panel', array('controller' => Request::current()->controller(), 'action' => 'fees'));
?>
?<?php 
echo http_build_query(['rel' => ''] + Request::current()->query());
?>
" class="display-block">
                <div class="p-a">
                    <span class="statcard-desc"><?php 
echo __('Fees');
?>
</span>
                    <h2 class="statcard-number">
                        <?php 
echo i18n::format_currency($fees_total);
?>
                        <small class="delta-indicator <?php 
echo Num::percent_change($fees_total, $fees_total_past) < 0 ? 'delta-negative' : 'delta-positive';
?>
"><?php 
echo Num::percent_change($fees_total, $fees_total_past);
?>
</small> 
                        <small class="ago"><?php 
echo sprintf(__('%s days ago'), $days_ago);
?>
</small>
                    </h2>
                    <hr class="statcard-hr">
                </div>