本文整理汇总了PHP中EnmasseHelper类的典型用法代码示例。如果您正苦于以下问题:PHP EnmasseHelper类的具体用法?PHP EnmasseHelper怎么用?PHP EnmasseHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EnmasseHelper类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dealSetLocationCookie
function dealSetLocationCookie()
{
$locationId = JRequest::getInt('locationId', null);
$email = JRequest::getVar('email');
$oMenu = JFactory::getApplication()->getMenu();
$oItem = $oMenu->getItems('link', 'index.php?option=com_enmasse&view=dealtoday', true);
////////// Integration with ACY Mailing //////////
$integrationClass = EnmasseHelper::getSubscriptionClassFromSetting();
$acy_path = JPATH_SITE . DS . 'components' . DS . 'com_acymailing';
if (file_exists($acy_path)) {
if ($integrationClass == 'acystarter' || $integrationClass == 'acyenterprise') {
require_once JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "subscription" . DS . $integrationClass . DS . $integrationClass . ".class.php";
if ($integrationClass == 'acystarter') {
$acy = new acystarter();
} elseif ($integrationClass == 'acyenterprise') {
$acy = new acyenterprise();
}
$acy->updateSubscriptionList($locationId, $email);
}
}
/////////////////////////////////////////////////
if (!empty($locationId)) {
//set cookie locationId with lifetime is 365 days
$dtLifeTime = time() + 365 * 24 * 60 * 60;
setcookie(self::CS_SESSION_LOCATIONID, $locationId, $dtLifeTime, '/');
$oDeal = JModel::getInstance('deal', 'enmasseModel')->getDealMaxSoldQtyFromLocation($locationId);
if ($oDeal->id) {
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_enmasse&controller=deal&task=view&id=' . $oDeal->id . '&Itemid=' . $oItem->id, false));
}
}
$link = JRoute::_('index.php?option=com_enmasse&controller=deal&task=today&Itemid=' . $oItem->id, false);
JFactory::getApplication()->redirect($link);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:33,代码来源:deal.php
示例2: display
function display($tpl = null)
{
$id = JRequest::getVar('id', 0);
$bFlag = JRequest::getVar('sideDealFlag', false);
$upcoming = JRequest::getVar('upcoming');
$deal = JModel::getInstance('deal', 'enmasseModel')->viewDeal($id);
//we must check $deal->id because $deal was loaded from JTable so it alway not null.
if (empty($deal->id)) {
$link = JRoute::_("index.php?option=com_enmasse&controller=deal&task=listing", false);
$msg = JText::_('DEAL_NOT_FOUND');
JFactory::getApplication()->redirect($link, $msg, 'error');
}
$deal->merchant = JModel::getInstance('merchant', 'enmasseModel')->getById($deal->merchant_id);
$deal->merchant->branches = json_decode($deal->merchant->branches, true);
$this->assignRef('deal', $deal);
$this->assignRef('sideDealFlag', $bFlag);
//Referral ID
$referralId = JRequest::getVar('referralid');
$this->assignRef('referralId', $referralId);
if ($upcoming) {
$this->assignRef('upcoming', $upcoming);
}
$this->_setPath('template', JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "theme" . DS . EnmasseHelper::getThemeFromSetting() . DS . "tmpl" . DS);
$this->_layout = "deal_detail";
parent::display($tpl);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:26,代码来源:view.html.php
示例3: getViewData
function getViewData($params)
{
$data = new JObject();
$data->module = EnmasseHelper::getModuleById($params->module_id);
$data->locationList = JModel::getInstance('location', 'enmasseModel')->listAllPublished();
return $data;
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:7,代码来源:acystarter.class.php
示例4: display
public function display($tpl = null)
{
$task = JRequest::getWord('task');
TOOLBAR_enmasse::_SMENU();
TOOLBAR_enmasse::_PARTIAL_ORDER();
$filter = JRequest::getVar('filter', array());
// Weird that only this will caused warning...
if (!isset($filter['deal_name'])) {
$filter['deal_name'] = "";
}
if (!isset($filter['deal_code'])) {
$filter['deal_code'] = "";
}
if (!isset($filter['status'])) {
$filter['status'] = "";
}
if (!isset($filter['year'])) {
$filter['year'] = "";
}
if (!isset($filter['month'])) {
$filter['month'] = "";
}
//filter partial order
$filter['partial'] = true;
JRequest::setVar('filter', $filter);
$oOrderModel = JModel::getInstance('order', 'enmasseModel');
$orderList = $oOrderModel->search($filter['status'], $filter['deal_code'], $filter['deal_name'], "created_at", "DESC", true);
$pagination = $oOrderModel->getPagination();
$this->statusList = EnmasseHelper::$ORDER_STATUS_LIST;
$this->filter = $filter;
$this->orderList = $orderList;
$this->pagination = $pagination;
$this->deliveryPersons = EnmasseHelper::getDeliveryPersons();
parent::display($tpl);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:35,代码来源:view.html.php
示例5: checkAccess
private function checkAccess()
{
$userGroup = JFactory::getUser()->groups;
$delivererGroup = EnmasseHelper::getSetting()->delivery_group;
if (!in_array($delivererGroup, $userGroup)) {
$msg = JText::_('NO_PRIVILEDGE_FOR_ACCESSING');
JFactory::getApplication()->redirect(JURI::base(), $msg, 'error');
} else {
return true;
}
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:11,代码来源:deliverer.php
示例6: sendMail
function sendMail()
{
$post = JRequest::get('post');
$share_url = JURI::base() . 'index.php?option=com_enmasse&controller=deal&task=view&id=' . $post['dealid'];
if ($post['userid'] != '0') {
$share_url .= '&referralid=' . $post['userid'];
}
$share_url .= '&Itemid=' . $post['itemid'];
$content = $post['content'] . "<br/>" . JText::_('DEAL_LINK') . ": " . $share_url;
if (EnmasseHelper::sendMail($post['recipient'], $post['subject'], $content)) {
$this->setRedirect('index.php?option=com_enmasse&controller=mail&task=mailForm&tmpl=component&success=1');
} else {
$this->setRedirect('index.php?option=com_enmasse&controller=mail&task=mailForm&tmpl=component');
}
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:15,代码来源:mail.php
示例7: doRefund
function doRefund()
{
$post = JRequest::get('post');
$orderId = $post['orderid'];
$pointRefund = $post['point'];
$buyerId = $post['buyerid'];
//Get Id of current user
$user = JFactory::getUser();
$userId = $user->get('id');
$pointPaid = EnmasseHelper::getPointPaidByOrderId($orderId);
$totalPrice = EnmasseHelper::getTotalPriceByOrderId($orderId);
$orderStatus = EnmasseHelper::getOrderStatusByOrderId($orderId);
$refundedAmount = EnmasseHelper::getRefundedAmountByOrderId($orderId);
//Check the last time to be sure we do for right buyer and do on a right order
$pass = true;
if ($pointRefund == '') {
$msg = JText::_('INVALID_POINT');
$pass = false;
}
if ($pointPaid < 0) {
$msg = JText::_('NOT_PAID_WITH_POINT');
$pass = false;
}
if ($pointRefund > $totalPrice) {
$msg = JText::_('POINT_NOT_GREATE_TOTAL_PRICE');
$pass = false;
}
if ($buyerId != $userId) {
$msg = JText::_('NOT_OWNER');
$pass = false;
}
if ($refundedAmount != 0) {
$msg = JText::_('ALREADY_REQUESTED');
$pass = false;
}
if ($pass) {
if (JModel::getInstance('point', 'enmasseModel')->doRefund($userId, $orderId, $pointRefund)) {
$msg = JText::_('REFUND_SUCCESSFULLY');
} else {
$msg = JText::_('REFUND_FAILED');
}
$link = JRoute::_("index.php?option=com_enmasse&controller=point&task=refundForm&orderid=" . $orderId . "&buyerid=" . $buyerid, false);
JFactory::getApplication()->redirect($link, $msg);
} else {
$link = JRoute::_("index.php?option=com_enmasse&controller=point&task=refundForm&orderid=" . $orderId . "&buyerid=" . $buyerid, false);
JFactory::getApplication()->redirect($link, $msg);
}
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:48,代码来源:point.php
示例8: submit_review
function submit_review()
{
$nDealId = JRequest::getVar('nDealId');
$nRating = JRequest::getVar('nRating');
$sReviewBody = JRequest::getVar('sReviewBody');
// Be sure this is a valid deal id
if ($nDealId > 0) {
// Check for a valid rating number and review content
// User has to select his/her rating (the number is from 1 to 5)
// and has enter his/her review
if ($nRating <= 0 || $nRating > 5) {
$sMessage = JText::_('PLEASE_RATE');
$sRedirectUrl = JRoute::_('index.php?option=com_enmasse&controller=deal&task=comment&id=' . $nDealId, false);
} elseif ($sReviewBody == '') {
$sMessage = JText::_('PLEASE_ENTER_REVIEW');
$sRedirectUrl = JRoute::_('index.php?option=com_enmasse&controller=deal&task=comment&id=' . $nDealId, false);
} else {
if (EnmasseHelper::checkSpammer(JFactory::getUser()->get('id'))) {
// If this user is a spammer, lie to him/her that the review is submitted but actually we store nothing
$sMessage = JText::_('REVIEW_SUBMITTED_SUCCESSFULLY');
$sRedirectUrl = JRoute::_('index.php?option=com_enmasse&controller=deal&task=comment&id=' . $nDealId, false);
} else {
$aComment = array();
$aComment['deal_id'] = $nDealId;
$aComment['user_id'] = JFactory::getUser()->get('id');
$aComment['comment'] = $sReviewBody;
$aComment['rating'] = $nRating;
$aComment['created_at'] = DatetimeWrapper::getDatetimeOfNow();
$aComment['status'] = 0;
$oRow = JModel::getInstance('comment', 'enmasseModel')->store($aComment);
if ($oRow->success) {
$sMessage = JText::_('REVIEW_SUBMITTED_SUCCESSFULLY');
} else {
$sMessage = JText::_('SAVE_REVIEW_FAILED');
}
$sRedirectUrl = JRoute::_('index.php?option=com_enmasse&controller=deal&task=comment&id=' . $nDealId, false);
}
}
} else {
$sMessage = JText::_('SAVE_REVIEW_FAILED');
$sRedirectUrl = JRoute::_('index.php?option=com_enmasse&view=dealtoday', false);
}
$this->setRedirect($sRedirectUrl, $sMessage);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:44,代码来源:comment.php
示例9: Copyright
/* ------------------------------------------------------------------------
# En Masse - Social Buying Extension 2010
# ------------------------------------------------------------------------
# By Matamko.com
# Copyright (C) 2010 Matamko.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.matamko.com
# Technical Support: Visit our forum at www.matamko.com
------------------------------------------------------------------------- */
jimport('joomla.application.module.helper');
$oMenu = JFactory::getApplication()->getMenu();
$oItem = $oMenu->getItems('link', 'index.php?option=com_enmasse&view=dealtoday', true);
$sRedirectLink = JRoute::_('index.php?option=com_enmasse&controller=deal&task=today&Itemid=' . $oItem->id, false);
?>
<link href="components/com_enmasse/theme/<?php
echo EnmasseHelper::getThemeFromSetting();
?>
/css/subscript.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function submit_multiform()
{
var numberForms = document.forms.length;
//alert(numberForms);
var formIndex;
for (formIndex = 0; formIndex < numberForms; formIndex++)
{
formName = document.forms[formIndex].name.toString();
if(formName.substring(0,14) == 'formAcymailing')
{
开发者ID:marsa1985,项目名称:kazabiz,代码行数:31,代码来源:sub_page.php
示例10: Copyright
<?php
/*------------------------------------------------------------------------
# En Masse - Social Buying Extension 2010
# ------------------------------------------------------------------------
# By Matamko.com
# Copyright (C) 2010 Matamko.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.matamko.com
# Technical Support: Visit our forum at www.matamko.com
-------------------------------------------------------------------------*/
require_once JPATH_ADMINISTRATOR . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "EnmasseHelper.class.php";
$theme = EnmasseHelper::getThemeFromSetting();
JFactory::getDocument()->addStyleSheet('components/com_enmasse/theme/' . $theme . '/css/screen.css');
$rows = $this->dealList;
$option = 'com_enmasse';
$filter = $this->filter;
$emptyJOpt = JHTML::_('select.option', '', JText::_(''));
// create list status for combobox
$statusJOptList = array();
array_push($statusJOptList, $emptyJOpt);
foreach ($this->statusList as $key => $name) {
$var = JHTML::_('select.option', $key, JText::_('DEAL_' . str_replace(' ', '_', $name)));
array_push($statusJOptList, $var);
}
$publishedJOptList = array();
array_push($publishedJOptList, $emptyJOpt);
array_push($publishedJOptList, JHTML::_('select.option', 1, JText::_('PUBLISHED')));
array_push($publishedJOptList, JHTML::_('select.option', 0, JText::_('NOT_PUBLISHED')));
// create list merchant for combobox
$merchantJOptList = array();
开发者ID:marsa1985,项目名称:kazabiz,代码行数:31,代码来源:sales_person_deal_report.php
注:本文中的EnmasseHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论