コード例 #1
0
ファイル: default.php プロジェクト: politik86/test2
    ?>
								<form method="post" name="sa_BillForm" id="sa_BillForm" class="form-horizontal form-validate" onsubmit="return validateForm();">
									<?php 
    if (!empty($showBilltab)) {
        ?>
								<div class="tab-pane step-pane sa_build_ad_billing" id="step<?php 
        echo $sa_stpeNo;
        ?>
">
									<?php 
        //echo $this->loadTemplate('pricing');
        ?>

									<?php 
        $socialadshelper = new socialadshelper();
        $billpath = $socialadshelper->getViewpath('buildad', 'default_billing', 'ADMINISTRATOR');
        ob_start();
        include $billpath;
        $html = ob_get_contents();
        ob_end_clean();
        echo $html;
        ?>
								</div>
								<?php 
        $sa_stpeNo++;
    } else {
        //  this field should be in the   <form name='adsform'
        // already billing address is saved
        ?>
									<input type="hidden" id="sa_hide_billTab" name="sa_hide_billTab" value="1" />
									<?php 
コード例 #2
0
ファイル: buildad.php プロジェクト: politik86/test2
 function autoSave()
 {
     $mainframe = JFactory::getApplication();
     $input = JFactory::getApplication()->input;
     $session = JFactory::getSession();
     $post = $input->post;
     $model = $this->getModel('buildad');
     $stepId = $input->get('stepId', '', 'STRING');
     $retdata = array();
     $retdata['stepId'] = $stepId;
     $retdata['payAndReviewHtml'] = '';
     $retdata['adPreviewHtml'] = '';
     $retdata['billingDetail'] = '';
     $socialadshelper = new socialadshelper();
     $Itemid = $socialadshelper->getSocialadsItemid('managead');
     $retdata['Itemid'] = $Itemid;
     $adminApproval = 1;
     // Save step-1 : design ad data
     if ($stepId == 'ad-design') {
         $model = $this->getModel('buildad');
         $response = $model->saveDesignAd($post, $adminApproval);
         if ($response) {
         }
     }
     // Save step-2 : targeting ad data
     if ($stepId == 'ad-targeting') {
         $model = $this->getModel('buildad');
         $response = $model->saveTargetingData($post);
         if ($response) {
         }
     }
     // Save ad pricing data
     if ($stepId == 'ad-pricing') {
         $response = $model->savePricingData($post);
         if ($response) {
         }
         //vm:
         $ad_creator_id = $input->get('ad_creator_id', 0);
         $this->country = $model->getCountry();
         $this->userbill = $model->getbillDetails($ad_creator_id);
         if ($ad_creator_id) {
             $billpath = $socialadshelper->getViewpath('buildad', 'default_billing', 'ADMINISTRATOR');
             ob_start();
             include $billpath;
             $html = ob_get_contents();
             ob_end_clean();
             $retdata['billingDetail'] = $html;
         }
     }
     // VM:
     // if billing tab is hide
     $sa_hide_billTab = $input->get('sa_hide_billTab', 0);
     // if 0 means billing details are not saved
     if (!empty($sa_hide_billTab) && $stepId == 'ad-pricing' || $stepId == 'ad-billing') {
         $user = JFactory::getUser();
         $ad_id = $session->get('ad_id');
         $order_id = $model->getIdFromAnyFieldValue($ad_id, 'ad_id', '#__ad_payment_info');
         $billdata = $post->get('bill', array(), "ARRAY");
         $ad_creator_id = $input->get('ad_creator_id', 0);
         // save billing detail
         if (!empty($billdata) && $ad_creator_id) {
             $model->billingaddr($ad_creator_id, $billdata);
         }
         $showBillLink = $sa_hide_billTab;
         $billpath = $socialadshelper->getViewpath('buildad', 'default_adsummary', 'ADMINISTRATOR');
         ob_start();
         include $billpath;
         $html = ob_get_contents();
         ob_end_clean();
         $retdata['payAndReviewHtml'] = $html;
     }
     // VM: end
     // Start :-> Amol
     //If campaign is selected then get ad preview html
     if ($stepId == 'ad-pricing') {
         $ad_id = $session->get('ad_id');
         $AdPreviewData = $model->getAdPreviewData($ad_id);
         $path = $socialadshelper->getViewpath('buildad', 'default_showadscamp', 'ADMINISTRATOR', 'ADMINISTRATOR');
         ob_start();
         include $path;
         $html = ob_get_contents();
         ob_end_clean();
         $retdata['adPreviewHtml'] = $html;
     }
     // end :-> Amol
     echo json_encode($retdata);
     jexit();
 }
コード例 #3
0
ファイル: default_1.php プロジェクト: politik86/test2
						<?php 
$socialadshelper = new socialadshelper();
$billpath = $socialadshelper->getViewpath('checkout', 'billing');
ob_start();
include $billpath;
$html = ob_get_contents();
ob_end_clean();
echo $html;
?>
						<br>
					</div>
					<div class="tab-pane step-pane" id="adsstep2">
						<h2>adsstep 2]</h2>
						<?php 
$socialadshelper = new socialadshelper();
$billpath = $socialadshelper->getViewpath('checkout', 'adsummary');
ob_start();
include $billpath;
$html = ob_get_contents();
ob_end_clean();
echo $html;
?>
						<br>
					</div>
					<div class="tab-pane step-pane" id="adsstep3">
						<h2>Okay</h2>
						Now you are at the 3rd step of this wizard example.<br>
					</div>
				</div>

				<br>
コード例 #4
0
ファイル: helper.php プロジェクト: politik86/test2
 function getInvoiceDetail($order_id, $pg_nm, $payPerAd = 1)
 {
     if (empty($order_id)) {
         return;
     }
     $mainframe = JFactory::getApplication();
     $site = $mainframe->getCfg('sitename');
     require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
     $db = JFactory::getDBO();
     $query = "SELECT p.id as order_id,p.`ad_id`,p.mdate,p.ad_amount,p.transaction_id,p.status,p.processor,p.payee_id,u.username,u.id, u.email\n\t\tFROM #__ad_payment_info as p, #__users as u\n\t\t\tWHERE p.payee_id=u.id\n\t\t\tAND p.id=" . $order_id;
     $db->setQuery($query);
     $orderDetails = $db->loadObject();
     $body = JText::_('PAY_PAYMENT_BODY');
     $socialadshelper = new socialadshelper();
     // GET USER ID FOR BILL INFO
     //$userId = $socialadshelper->getOrderUserId($order_id);
     //GET BILL INFO
     JLoader::import('buildad', JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'models');
     $socialadsModelBuildad = new socialadsModelBuildad();
     $billinfo = $socialadsModelBuildad->getbillDetails($orderDetails->id);
     // DEFINE ORDER STATUS
     if ($orderDetails->status == 'C') {
         $orderstatus = JText::_('ADS_INVOICE_STATUS_COMPLEATE');
     } else {
         if ($orderDetails->status == 'P') {
             $orderstatus = JText::_('ADS_INVOICE_STATUS_PENDING');
         } else {
             if ($orderDetails->status == 'E') {
                 $orderstatus = JText::_('ADS_INVOICE_STATUS_COMPLEATE_ERROR_OCCURED');
             } else {
                 $orderstatus = JText::_('ADS_INVOICE_AMOUNT_CANCELLED');
             }
         }
     }
     $inv_adver_Html = "";
     $sa_displayblocks = array();
     // if ad wallet
     if ($payPerAd == 0) {
         $sa_displayblocks = array('invoiceDetail' => 1, 'billingDetail' => 0, 'adsDetail' => 0);
     }
     $billpath = $socialadshelper->getViewpath('payment', 'invoice');
     ob_start();
     include $billpath;
     $inv_adver_Html = ob_get_contents();
     ob_end_clean();
     //-----------------------------
     jimport('joomla.utilities.utility');
     global $mainframe;
     $app = JFactory::getApplication();
     $mainframe = JFactory::getApplication();
     $sitelink = JUri::root();
     $manageAdLink = "<a href='" . $sitelink . "administrator" . DS . "index.php?option=com_socialads&view=approveads' targe='_blank'>" . JText::_("COM_SOCIALADS_EMAIL_THIS_LINK") . "</a>";
     // GET config details
     $frommail = $mainframe->getCfg('mailfrom');
     $fromname = $mainframe->getCfg('fromname');
     $adTitle = $socialadshelper->getAdTitle($orderDetails->ad_id);
     $siteName = $mainframe->getCfg('sitename');
     $today = date('Y-m-d H:i:s');
     if (empty($orderDetails->payee_id)) {
         // return payee id not found
         return;
     }
     $user = JFactory::getUser($orderDetails->payee_id);
     $adUserName = $user->username;
     $recipient = $user->email;
     $displayOrderid = sprintf("%05s", $order_id);
     // if paper mode
     if ($payPerAd == 1) {
         $approve_msg = JText::_("COM_SOCIALADS_INVOICE_MAIL_ADMIN_APPROCE_NO_MSG");
         if ($socialads_config['approval'] == 1) {
             $approve_msg = JText::_("COM_SOCIALADS_INVOICE_MAIL_ADMIN_APPROCE_YES_MSG");
         }
         // FOR ADVERTISER INVICE AND ORDER CONFIRM MAIL
         $advertiserEmailBody = JText::_("COM_SOCIALADS_INVOICE_MAIL_CONTENT");
         // NOW find & REPLACE TAG
         $find = array('[SEND_TO_NAME]', '[ADVERTISER_NAME]', '[SITENAME]', '[SITELINK]', '[ADTITLE]', '[CONTENT]', '[TIMESTAMP]', '[ORDERID]', '[ADMIN_APPROVAL_MSG]');
         $replace = array($adUserName, $adUserName, $siteName, $sitelink, $adTitle, $content, $today, $displayOrderid, $approve_msg);
         $advertiserEmailBody = str_replace($find, $replace, $advertiserEmailBody);
         $advertiserEmailBody = $advertiserEmailBody . "<br> <br>" . $inv_adver_Html;
         $subject = JText::sprintf('ADS_INVOICE_MAIL_SUB', $displayOrderid);
         $status = $socialadshelper->sendmail($recipient, $subject, $advertiserEmailBody, '', 0, "");
         // -------------- ADMIN INVOICE MAIL  COPY --------------------
         $adminEmailBody = JText::_("COM_SOCIALADS_INVOICE_MAIL_CONTENT_ADMIN_COPY");
         $orderPrice = $orderDetails->ad_amount . " " . $socialads_config["currency"];
         $admin_approve_msg = '';
         //!$app->isAdmin() &&
         $admin_approve_msg = '';
         if ($socialads_config['approval'] == 1) {
             $admin_approve_msg = JText::sprintf("COM_SOCIALADS_APPRVE_MAIL_TO_ADMIN_ADD_MSG", $manageAdLink);
         }
         $find = array('[SEND_TO_NAME]', '[ADVERTISER_NAME]', '[SITENAME]', '[VALUE]', '[ORDERID]', '[ADMIN_APPROVAL_MSG]');
         $replace = array($fromname, $adUserName, $siteName, $orderPrice, $displayOrderid, $admin_approve_msg);
         $adminEmailBody = str_replace($find, $replace, $adminEmailBody);
         $adminEmailBody = $adminEmailBody . "<br> <br>" . $inv_adver_Html;
         $subject = JText::sprintf('COM_SOCIALADS_INVOICE_MAIL_ADVERTISER_ADMIN_SUBJECT', $displayOrderid);
         $status = $socialadshelper->sendmail($frommail, $subject, $adminEmailBody, '', 0, "");
     } else {
         // ADVERTISER MAIL
         $advertiserEmailBody = JText::_("COM_SOCIALADS_WALLET_ADDED_BALACE_ADVETISER_EMAIL");
         // NOW find & REPLACE TAG
         $find = array('[SEND_TO_NAME]', '[SITENAME]', '[ORDERID]');
         $replace = array($adUserName, $siteName, $displayOrderid);
         $advertiserEmailBody = str_replace($find, $replace, $advertiserEmailBody);
         $advertiserEmailBody = $advertiserEmailBody . "<br> <br>" . $inv_adver_Html;
         $subject = JText::sprintf('COM_SOCIALADS_WALLET_ADDED_BALACE_ADVETISER_EMAIL_SUBJECT', $displayOrderid);
         $status = $socialadshelper->sendmail($recipient, $subject, $advertiserEmailBody, '', 0, "");
         // ADMIN INVOICE MAIL  COPY
         $adminEmailBody = JText::_("COM_SOCIALADS_INVOICE_MAIL_CONTENT_ADMIN_COPY");
         $orderPrice = $orderDetails->ad_amount . " " . $socialads_config["currency"];
         $find = array('[SEND_TO_NAME]', '[ADVERTISER_NAME]', '[SITENAME]', '[VALUE]', '[ORDERID]', '[ADMIN_APPROVAL_MSG]');
         $replace = array($fromname, $adUserName, $siteName, $orderPrice, $displayOrderid, '');
         $adminEmailBody = str_replace($find, $replace, $adminEmailBody);
         $adminEmailBody = $adminEmailBody . "<br> <br>" . $inv_adver_Html;
         $subject = JText::sprintf('COM_SOCIALADS_INVOICE_MAIL_ADVERTISER_ADMIN_SUBJECT', $displayOrderid);
         $status = $socialadshelper->sendmail($frommail, $subject, $adminEmailBody, '', 0, "");
         // ad wallet mode
     }
 }
コード例 #5
0
ファイル: buildad.php プロジェクト: politik86/test2
 function autoSave()
 {
     $mainframe = JFactory::getApplication();
     $input = JFactory::getApplication()->input;
     $session = JFactory::getSession();
     $post = $input->post;
     $model = $this->getModel('buildad');
     $stepId = $input->get('stepId', '', 'STRING');
     $retdata = array();
     $retdata['stepId'] = $stepId;
     $retdata['payAndReviewHtml'] = '';
     $retdata['adPreviewHtml'] = '';
     $retdata['camp_id'] = '';
     $retdata['sa_sentApproveMail'] = '';
     $socialadshelper = new socialadshelper();
     $Itemid = $socialadshelper->getSocialadsItemid('managead');
     $retdata['Itemid'] = $Itemid;
     // Save step-1 : design ad data
     if ($stepId == 'ad-design') {
         $user = JFactory::getUser();
         $adminApproval = 0;
         if (isset($user->groups['8']) || isset($user->groups['7']) || isset($user->groups['Super Users']) || isset($user->groups['Administrator']) || $user->usertype == "Super Users" || isset($user->groups['Super Users']) || isset($user->groups['Administrator']) || $user->usertype == "Super Administrator" || $user->usertype == "Administrator") {
             $adminApproval = 1;
         }
         $model = $this->getModel('buildad');
         $response = $model->saveDesignAd($post, $adminApproval);
         // vm:start
         if ($response && $response['sa_sentApproveMail']) {
             $retdata['sa_sentApproveMail'] = $response['sa_sentApproveMail'];
         } else {
             if ($response === false) {
                 return false;
             }
         }
         // vm:end
     }
     // Save step-2 : targeting ad data
     if ($stepId == 'ad-targeting') {
         $model = $this->getModel('buildad');
         $response = $model->saveTargetingData($post);
         if ($response === false) {
             return false;
         }
     }
     // Save ad pricing data
     if ($stepId == 'ad-pricing') {
         $response = $model->savePricingData($post);
         if (isset($response['camp_id'])) {
             $retdata['camp_id'] = $response['camp_id'];
         }
         if ($response === false) {
             return false;
         }
     }
     // VM:
     // if billing tab is hide
     $sa_hide_billTab = $input->get('sa_hide_billTab', 0);
     // if 0 means billing details are not saved
     if (!empty($sa_hide_billTab) && $stepId == 'ad-pricing' || $stepId == 'ad-billing') {
         $user = JFactory::getUser();
         $ad_id = $session->get('ad_id');
         $createAdHelper = new createAdHelper();
         $order_id = $createAdHelper->getLatestPendigOrder($ad_id, $user->id);
         $billdata = $post->get('bill', array(), "ARRAY");
         // save billing detail
         if (!empty($billdata)) {
             $model->billingaddr($user->id, $billdata);
         }
         $showBillLink = $sa_hide_billTab;
         $billpath = $socialadshelper->getViewpath('buildad', 'default_adsummary');
         ob_start();
         include $billpath;
         $html = ob_get_contents();
         ob_end_clean();
         $retdata['payAndReviewHtml'] = $html;
     }
     // VM: end
     // Start :-> Amol
     //If campaign is selected then get ad preview html
     if ($stepId == 'ad-pricing') {
         $ad_id = $session->get('ad_id');
         $AdPreviewData = $model->getAdPreviewData($ad_id);
         $path = $socialadshelper->getViewpath('buildad', 'default_showadscamp');
         ob_start();
         include $path;
         $html = ob_get_contents();
         ob_end_clean();
         $retdata['adPreviewHtml'] = $html;
     }
     // end :-> Amol
     echo json_encode($retdata);
     jexit();
 }
コード例 #6
0
ファイル: default_billing.php プロジェクト: politik86/test2
 *  @license    GNU General Public License version 2, or later
 */
defined('_JEXEC') or die('Restricted access');
//JHtml::_('behavior.formvalidation');
//jimport( 'joomla.form.formvalidator' );
JHtml::_('behavior.tooltip');
JHtmlBehavior::framework();
//$params = JComponentHelper::getParams( 'com_socialads' );
$baseurl = JRoute::_(JUri::root() . 'index.php');
?>

<fieldset class="sa_fieldset">
	<legend class="hidden-desktop"><?php 
echo JText::_('COM_SOCIALADS_CKOUT_BILL_DETAILS');
?>
</legend>
	<div id="ads_mainwrapper" class="row-fluid form-horizontal">
	<?php 
$socialadshelper = new socialadshelper();
$buildformPath = $socialadshelper->getViewpath('buildad', 'billform');
ob_start();
include $buildformPath;
$billhtml = ob_get_contents();
ob_end_clean();
echo $billhtml;
?>
	</div>

</fieldset>

コード例 #7
0
ファイル: default.php プロジェクト: politik86/test2
    ?>
								<form method="post" name="sa_BillForm" id="sa_BillForm" class="form-horizontal form-validate" onsubmit="return validateForm();">
									<?php 
    if (!empty($showBilltab)) {
        ?>
								<div class="tab-pane step-pane" id="step<?php 
        echo $sa_stpeNo;
        ?>
">
									<?php 
        //echo $this->loadTemplate('pricing');
        ?>

									<?php 
        $socialadshelper = new socialadshelper();
        $billpath = $socialadshelper->getViewpath('buildad', 'default_billing');
        ob_start();
        include $billpath;
        $html = ob_get_contents();
        ob_end_clean();
        echo $html;
        ?>
								</div>
								<?php 
        $sa_stpeNo++;
    } else {
        //  this field should be in the   <form name='adsform'
        // already billing address is saved
        ?>
									<input type="hidden" id="sa_hide_billTab" name="sa_hide_billTab" value="1" />
									<?php 
コード例 #8
0
ファイル: adsummary.php プロジェクト: politik86/test2
<?php

/**
 *  @package    Social Ads
 *  @copyright  Copyright (c) 2009-2013 TechJoomla. All rights reserved.
 *  @license    GNU General Public License version 2, or later
 */
defined('_JEXEC') or die('Restricted access');
// show show ad review view
$ads_calledFromCkout = 1;
// used in showad view
$socialadshelper = new socialadshelper();
$billpath = $socialadshelper->getViewpath('showad', 'default');
ob_start();
include $billpath;
$html = ob_get_contents();
ob_end_clean();
echo $html;
// show payment gateway
$default = "";
$lable = JText::_('ADS_SEL_GATEWAY');
$gateway_div_style = 1;
if (!empty($this->gateways)) {
    $default = $this->gateways[0]->id;
    // id and value is same
}
if (!empty($this->gateways) && count($this->gateways) == 1) {
    $default = $this->gateways[0]->id;
    // id and value is same
    $lable = JText::_('QTC_GATEWAY_IS');
    $gateway_div_style = 0;