本文整理汇总了PHP中JRequest::getFloat方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::getFloat方法的具体用法?PHP JRequest::getFloat怎么用?PHP JRequest::getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::getFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkout
function checkout()
{
$Itemid=JRequest::getInt('Itemid');
$price=JRequest::getFloat('amount');
if ($price<=0){
JError::raiseWarning(510,JText::_("FACTORY_AMOUNT_MUST_BE"));
$this->setRedirect("index.php?option=".APP_EXTENSION."&task=balance.addfunds&Itemid=".$Itemid);
return;
}
$currency= JModelLegacy::getInstance('currency','JTheFactoryModel');
$default_currency=$currency->getDefault();
$modelorder=JTheFactoryPricingHelper::getModel('orders');
$item=new stdClass();
$item->itemname=$this->name;
$item->itemdetails=JText::_($this->description);
$item->iteminfo=null;
$item->price=$price;
$item->currency=$default_currency;
$item->quantity=1;
$item->params='';
$order=$modelorder->createNewOrder($item,$price,$default_currency,null,'P');
$this->setRedirect("index.php?option=".APP_EXTENSION."&task=orderprocessor.checkout&orderid=$order->id&Itemid=".$Itemid);
}
示例2: search
function search()
{
$session =& JFactory::getSession();
/* kiem tra neu ko phai o trang chu thi se ko chay vao day lan nua
* Session van se con...
*/
// start debug
// echo "<pre>";
// print_r($_GET['limitstart']);
// echo "</pre>";
// // end debug
// if( isset($_POST['Itemid']) && $_POST['Itemid'] == 1)
// {
$params = array('key_search' => JRequest::getVar('key_search', ''), 'project_group_id' => JRequest::getInt('project_group_id', 0), 'Itemid' => JRequest::getInt('Itemid', 0), 'cat' => JRequest::getVar('cat', ''), 'type_id' => JRequest::getInt('type_id', 0), 'department_id' => JRequest::getInt('department_id', 0), 'town_id' => JRequest::getInt('town_id', 0), 'budget_min' => JRequest::getFloat('gia_tu', 0.0), 'budget_max' => JRequest::getFloat('gia_den', 0.0), 'living_space_min' => JRequest::getInt('dientich_tu', 0), 'living_space_max' => JRequest::getInt('dientich_den', 0), 'rooms_min' => JRequest::getInt('rooms_min', 0), 'advantages' => JRequest::getVar('loaidiaoc', array(), '', 'array'), 'directions' => JRequest::getInt('directions', 0));
$session->set('params', $params, 'jea_search');
// }
if (JRequest::getVar('catDirect', '') != '') {
$params = array();
$session->set('params', $params, 'jea_search');
} else {
$params = $session->get('params', array(), 'jea_search');
}
// Bug correction on search pagination
if ($limit = JRequest::getInt('limit', 0)) {
$params['limit'] = $limit;
$session->set('params', $params, 'jea_search');
}
if (!empty($params)) {
JRequest::set($params, 'POST');
} else {
$params = array('key_search' => JRequest::getVar('key_search', ''));
JRequest::set($params, 'POST');
}
$this->display();
}
示例3: languagepack
/**
* @return null
* @throws KlarnaApiException
*/
public function languagepack()
{
$sSubAction = JRequest::getWord('subAction');
if (!isset($this->template['name']) || $this->template['name'] == '') {
$this->template['name'] = "default";
}
if ($sSubAction == "klarna_box") {
$sNewISO = JRequest::getWord('newIso');
$sCountry = JRequest::getWord('country');
$iSum = JRequest::getFloat('sum', 0);
$iInvoiceFee = JRequest::getFloat('fee', 0);
$iFlag = JRequest::getInt('flag');
$sType = JRequest::getWord('type');
$aParams = JRequest::getVar('params');
$aValues = JRequest::getVar('values');
// foreach($aValues as $key => $value) {
// $aValues[$key] = utf8_encode($value);
// }
// foreach($aParams as $key => $value) {
// $aParams[$key] = utf8_decode($value);
// }
if ($sType != "part" && $sType != "invoice" && $sType != "spec") {
throw new KlarnaApiException("Invalid parameters");
}
$this->api->setCountry($sCountry);
if ($sType == 'spec') {
$types = array(KlarnaPClass::SPECIAL);
} else {
$types = array(KlarnaPClass::CAMPAIGN, KlarnaPClass::ACCOUNT, KlarnaPClass::FIXED);
}
$oApi = new KlarnaAPI($sCountry, $sNewISO, $sType, $iSum, $iFlag, $this->api, $types, VMKLARNAPLUGINWEBROOT);
// $oApi->addSetupValue ('web_root', $this->webroot);
// $oApi->setPaths ();
$oApi->addSetupValue('eid', $this->eid);
if ($sType == 'invoice') {
$oApi->setInvoiceFee($iInvoiceFee);
}
$oApi->setCurrency($this->api->getCurrency());
if (count($this->coSetup) > 0) {
$oApi->addMultipleSetupValues($this->coSetup);
}
return $oApi->retrieveLayout($aParams, $aValues);
// if ($sType == 'spec') {
// return $oApi->retrieveHTML($aParams, $aValues, null, $this->template);
// } else {
// return $oApi->retrieveHTML ($aParams, $aValues);
// }
} else {
if ($sSubAction == 'jsLanguagePack') {
$sNewISO = JRequest::getWord('newIso');
$sFetch = "";
} else {
throw new KlarnaApiException("Invalid sub-action");
}
}
}
示例4: display
function display($tpl = null)
{
jincimport('statistics.statisticfactory');
JHTML::stylesheet('administrator/components/com_jinc/assets/css/jinc_admin.css');
JToolBarHelper::title(JText::_('COM_JINC_STATISTICS'), 'jinc');
jincimport('utility.jinchelper');
JINCHelper::helpOnLine(91);
$session =& JFactory::getSession();
$config =& JFactory::getConfig();
$tzoffset = $config->getValue('config.offset');
$this->news_id = JRequest::getInt('id', 0);
$this->stat_type = JRequest::getInt('stat_type', STATISTICFACTORY_SUBS_TYPE);
$this->time_type = JRequest::getInt('time_type', STATISTICFACTORY_STAT_DAILY);
$start_date = JRequest::getFloat('start_date', time());
$end_date = JRequest::getFloat('end_date', time());
$sdate =& JFactory::getDate($start_date, $tzoffset);
$edate =& JFactory::getDate($end_date, $tzoffset);
$this->start_time = $sdate;
$this->end_time = $edate;
$this->values = $session->get('stats.values');
$this->legend = $session->get('stats.legend');
parent::display($tpl);
}
示例5: getAmount
public function getAmount($param)
{
//$amount = JRequest::getFloat('Amount','');
//converto in euro l'importo pagato
$amount = number_format(JRequest::getFloat('udf4'), 2, '.', '');
return $amount;
//return parent::getResult($param);;
}
示例6: delBid
function delBid()
{
header("Content-type: text/html; charset=utf-8");
$app = JFactory::getApplication();
$id = JRequest::getInt('id', 0);
$cid = JRequest::getInt('cid', 0);
$bid = JRequest::getFloat('bid', 0);
$db = JFactory::getDBO();
$user = JFactory::getUser();
$itemid = JRequest::getVar('Itemid');
$par = JComponentHelper::getParams('com_djclassifieds');
$m_type = '';
$query = "SELECT i.*, c.name as c_name, c.alias as c_alias FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "WHERE i.id = " . $id . " ";
$db->setQuery($query);
$item = $db->loadObject();
if (!$item->alias) {
$item->alias = DJClassifiedsSEO::getAliasName($item->name);
}
if (!$item->c_alias) {
$item->c_alias = DJClassifiedsSEO::getAliasName($item->c_name);
}
$link = DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias);
if ($user->id > 0) {
if ($item) {
if ($item->user_id == $user->id && $item->user_id > 0) {
$query = "DELETE FROM #__djcf_auctions WHERE item_id = " . $item->id . " AND id=" . $bid;
$db->setQuery($query);
$db->query();
$price_start = $item->price_start;
$query = "SELECT a.* FROM #__djcf_auctions a " . " WHERE a.item_id=" . $item->id . " ORDER BY a.date DESC LIMIT 1";
$db->setQuery($query);
$last_bid = $db->loadObject();
if ($last_bid) {
$price_start = $last_bid->price;
}
$query = "UPDATE #__djcf_items SET price='" . $price_start . "' " . " WHERE id=" . $item->id;
$db->setQuery($query);
$db->query();
$msg = JText::_('COM_DJCLASSIFIEDS_BID_DELETED');
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
$m_type = 'error';
}
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
$m_type = 'error';
}
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN');
$m_type = 'error';
}
$link = JRoute::_($link);
$app->redirect($link, $msg, $m_type);
die('aaaa');
}
示例7: getItems
function getItems($catlist = '')
{
$par = JComponentHelper::getParams('com_djclassifieds');
$limit = JRequest::getVar('limit', $par->get('limit_djitem_show'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
$user = JFactory::getUser();
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$where = '';
if ($catlist) {
$where = ' AND i.cat_id IN (' . $catlist . ') ';
}
$uid = JRequest::getVar('uid', '0', '', 'int');
if ($uid > 0) {
$where .= " AND i.user_id=" . $uid . " ";
}
$fav_s = '';
$fav_lj = '';
if ($par->get('favourite', '1') && $user->id > 0) {
$fav_lj = "LEFT JOIN ( SELECT * FROM #__djcf_favourites WHERE user_id=" . $user->id . ") f ON i.id=f.item_id ";
$fav_s = ',f.id as f_id ';
$fav = JRequest::getVar('fav', '0', '', 'int');
if ($fav > 0) {
$where .= " AND f.id IS NOT NULL ";
}
}
$search = '';
$search_fields = '';
$cat_id = 0;
$reg_id = 0;
$search_radius_v = '';
$search_radius_h = '';
if (JRequest::getVar('se', '0', '', 'string') != '0') {
if (JRequest::getVar('search', JText::_('COM_DJCLASSIFIEDS_SEARCH'), '', 'string') != JText::_('COM_DJCLASSIFIEDS_SEARCH')) {
$search_word = $db->Quote('%' . $db->escape(JRequest::getVar('search', '', '', 'string'), true) . '%');
$search = " AND (CONCAT_WS(i.name,i.intro_desc,i.description) LIKE " . $search_word . " OR c.name LIKE " . $search_word . " OR r.name LIKE " . $search_word . " ) ";
}
if (isset($_GET['se_cats'])) {
$cat_id = end($_GET['se_cats']);
if ($cat_id == '' && count($_GET['se_cats']) > 2) {
$cat_id = $_GET['se_cats'][count($_GET['se_cats']) - 2];
}
}
$cat_id = str_ireplace('p', '', $cat_id);
if ($cat_id > 0) {
$cats = DJClassifiedsCategory::getSubCat($cat_id, 1);
$catlist = $cat_id;
foreach ($cats as $c) {
$catlist .= ',' . $c->id;
}
$search .= ' AND i.cat_id IN (' . $catlist . ') ';
$search_fields = $this->getSearchFields();
}
if (isset($_GET['se_regs'])) {
$reg_id = end($_GET['se_regs']);
if ($reg_id == '' && count($_GET['se_regs']) > 2) {
$reg_id = $_GET['se_regs'][count($_GET['se_regs']) - 2];
}
$reg_id = (int) $reg_id;
}
if ($reg_id > 0) {
$regs = DJClassifiedsRegion::getSubReg($reg_id, 1);
$reglist = $reg_id;
foreach ($regs as $r) {
$reglist .= ',' . $r->id;
}
$search .= ' AND i.region_id IN (' . $reglist . ') ';
}
$se_price_from = JRequest::getInt('se_price_f', '');
$se_price_to = JRequest::getInt('se_price_t', '');
if ($se_price_from) {
$search .= " AND ABS(i.price) >= " . $se_price_from . " ";
}
if ($se_price_to && $se_price_to > $se_price_from) {
$search .= " AND ABS(i.price) <= " . $se_price_to . " ";
}
$type_id = JRequest::getInt('se_type_id', '0');
if ($type_id > 0) {
$where .= " AND i.type_id=" . $type_id . " ";
}
$days_l = JRequest::getInt('days_l', '0');
if ($days_l > 0) {
$date_limit = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d") - $days_l, date("Y")));
$where .= " AND i.date_start >= '" . $date_limit . "' ";
}
$only_img = JRequest::getInt('se_only_img', 0);
if ($only_img == 1) {
$search .= " AND img.img_c>0 ";
}
$only_video = JRequest::getInt('se_only_video', 0);
if ($only_video == 1) {
$search .= " AND i.video!='' ";
}
$postcode = JRequest::getVar('se_postcode', '');
$radius = JRequest::getFloat('se_radius', 0);
if ($postcode != '' && $postcode != JText::_('COM_DJCLASSIFIEDS_SEARCH_MODULE_POSTCODE') && $radius) {
$postcode_country = JRequest::getVar('se_postcode_c', '');
$post_coord = DJClassifiedsGeocode::getLocationPostCode($postcode, $postcode_country);
$radius_unit = JRequest::getCmd('se_radius_unit', 'km');
if ($radius_unit == 'mile') {
//.........这里部分代码省略.........
示例8: suggest
function suggest() {
$database = JFactory::getDBO();
$my = JFactory::getUser();
$cfg = BidsHelperTools::getConfig();
$auction_id = JRequest::getInt('id', 0);
$suggest_id = JRequest::getInt('s_id', 0);
$suggest = JRequest::getFloat('bid_suggest', 0);
$q = JRequest::getInt('quantity', 1);
$bidsSuggest = JTable::getInstance('bidsuggestion');
$auctionmodel = $this->getModel('auction');
if (!$auctionmodel->load($auction_id)) {
$this->setRedirect('index.php?option=com_bids', JText::_('COM_BIDS_DOES_NOT_EXIST'));
return;
}
$auction = $auctionmodel->get('auction');
$redirect_link = JHtml::_('auctiondetails.auctionDetailsURL', $auction, false);
if (!$suggest_id && $auction->userid == $my->id) {
$this->setRedirect($redirect_link, JText::_('COM_BIDS_ERR_NO_SELF_BIDDING'));
return;
}
if (!$cfg->bin_opt_price_suggestion
|| $auction->auction_type != AUCTION_TYPE_BIN_ONLY
|| !$auction->params["price_suggest"]) {
$this->setRedirect($redirect_link, JText::_('COM_BIDS_ERR_NO_PRICE_SUGGEST'));
return;
}
if ($suggest<=0) {
$this->setRedirect($redirect_link, JText::_('COM_BIDS_ERR_VALID_SUGGEST'));
return;
}
$database->setQuery('SELECT COUNT(1) FROM #__bid_suggestions WHERE userid = '.$database->quote($my->id).' AND auction_id='.$database->quote($auction_id));
$nrSuggestions = $database->loadResult();
if ($cfg->bin_opt_limit_suggestions <= $nrSuggestions) {
$this->setRedirect($redirect_link, JText::_('COM_BIDS_ERR_PRICE_SUGGESTED'));
return;
}
$bidsSuggest->auction_id = $auction_id;
$bidsSuggest->userid = $my->id;
$bidsSuggest->modified = gmdate('Y-m-d H:i');
$bidsSuggest->bid_price = $suggest;
$bidsSuggest->parent_id = $suggest_id;
$bidsSuggest->quantity = $q;
if ($auction->params["price_suggest_min"] <= $suggest) {
$bidsSuggest->status = 2;
$msg = JText::_('COM_BIDS_MSG_PRICE_SUGGESTED');
} else {
// suggested price must be higher than the lowest suggestion allowed
$bidsSuggest->status = 0;
$msg = JText::_('COM_BIDS_ERR_LOW_PRICE_SUGGESTED');
}
JTheFactoryEventsHelper::triggerEvent('onBeforeSaveSuggestion',array($auction,$bidsSuggest));
$bidsSuggest->store();
JTheFactoryEventsHelper::triggerEvent('onAfterSaveSuggestion',array($auction,$bidsSuggest));
if ($bidsSuggest->status===0){
JTheFactoryEventsHelper::triggerEvent('onRejectSuggestion',array($auction,$bidsSuggest));
}
$this->setRedirect($redirect_link, $msg);
}
示例9: testGetFloat
/**
* Test JRequest::getFloat
*
* @return void
*/
public function testGetFloat()
{
$this->assertTrue(0.0 === JRequest::getFloat('nonExistant'));
}
示例10: display
function display($tpl = NULL, $preparecontent = false)
{
$document = JFactory::getDocument();
$language = $document->getLanguage();
// load scripts
$document->addScript('components/com_bookingforconnector/assets/js/jquery.validate.min.js');
$document->addScript('components/com_bookingforconnector/assets/js/additional-methods.min.js');
// Initialise variables
$state = $this->get('State');
$actionmode = JRequest::getVar('actionmode', "");
$item = $this->get('Item');
$params =& $state->params;
$this->assignRef('state', $state);
$this->assignRef('params', $params);
$this->assignRef('language', $language);
$this->assignRef('item', $item);
$this->assignRef('actionmode', $actionmode);
if ($actionmode == "orderpayment") {
//recupero quanti pagamenti sono stati effettuati
$item->paymentCount = BFCHelper::getTotalOrderPayments($item->order->OrderId);
$item->overrideAmount = JRequest::getFloat('overrideAmount');
//sostituisco i dati dell'ordine da pagare con i dati passati e l'ordine con un suffisso in più
/*$item = $this->get('Item');*/
/*$item = "fet";*/
}
if ($actionmode != '' && $actionmode != 'cancel' && $actionmode != 'donation' && $actionmode != 'orderpayment') {
if ($item->order->Status != 5) {
$hasPayed = $this->processPayment($actionmode, $item->order->OrderId);
/* eccezione per setefi che pretende un url di ritorno */
} else {
//$hasPayed = true;
$hasPayed = $this->processOrderPayment($actionmode, $item->order->OrderId, $language);
}
/*
$link = '';
if ($hasPayed){
}
$app = JFactory::getApplication();
$app->redirect($link, $msg);
*/
}
if ($actionmode == '' && $actionmode != 'donation') {
if ($item->order->Status != 5) {
$this->inizializePayment($item->order->OrderId);
}
}
if ($actionmode == 'orderpaid') {
$hasPayed = $item->order->Status == 5;
}
// assegno il riferimento dopo gli altri altrimenti non ho nessuna associazione
$this->assignRef('hasPayed', $hasPayed);
/*
$items = $this->get('Items');
$pagination = $this->get('Pagination');
$sortColumn = $state->get('list.ordering');
$sortDirection = $state->get('list.direction');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
$pagination->setAdditionalUrlParam("filter_order", $ordering);
$pagination->setAdditionalUrlParam("filter_order_Dir", $direction);
$this->assignRef('items', $items);
$this->assignRef('pagination', $pagination);
*/
// Display the view
parent::display($tpl);
}
示例11: getIssuesZipped
public function getIssuesZipped()
{
//get request
$showComments = JRequest::getInt('showComments');
$limit = JRequest::getInt('limit');
//get boundaries
$x0up = JRequest::getFloat('x0up');
$x0down = JRequest::getFloat('x0down');
$y0up = JRequest::getFloat('y0up');
$y0down = JRequest::getFloat('y0down');
//get model and items
$items = array();
if (!empty($x0up) && !empty($x0down) && !empty($y0up) && !empty($y0down)) {
$model = $this->getModel('issues');
$items = $model->getItemsInBoundaries($x0up, $x0down, $y0up, $y0down, $limit);
} else {
$model = $this->getModel('issues');
$items = $model->getItems();
}
//clean up and prepare for json
foreach ($items as $item) {
unset($item->params);
if (!$showComments) {
unset($item->discussion);
}
}
//$document = &JFactory::getDocument();
//$document->setMimeEncoding('text/xml');
if (function_exists('ob_gzhandler')) {
$document =& JFactory::getDocument();
//$document->setMimeEncoding('application/json', true);
//JResponse::setHeader('Content-Encoding','gzip');
JResponse::setheader("Content-Type: text/html; charset=ISO-8859-1", true);
//ob_start('ob_gzhandler');
//echo json_encode($items);
//$var = ob_get_clean();//ob_end_flush();
//echo $var;
//echo gzcompress(json_encode($items), 9);
echo gzdeflate(json_encode($items), 1);
return;
}
echo json_encode($items);
return;
}
示例12: getProperties
function getProperties($all = false)
{
$result = array();
$mainframe =& JFactory::getApplication();
$params =& ComJea::getParams();
$default_limit = $params->get('list_limit', 10);
if ($all === false) {
$limit = $mainframe->getUserStateFromRequest('com_jea.limit', 'limit', $default_limit, 'int');
} else {
$limit = 0;
}
$limitstart = JRequest::getInt('limitstart', 0);
$order = $this->_db->getEscaped(JRequest::getCmd('filter_order', 'id'));
$order_dir = $this->_db->getEscaped(JRequest::getCmd('filter_order_Dir', 'desc'));
$select = $this->_getSqlBaseSelect();
// $where = 'WHERE published=1 AND tp.is_renting=';
$cat = JRequest::getCmd('cat', $params->get('cat', 'all'));
if (JRequest::getVar('catDirect')) {
$cat = JRequest::getVar('catDirect');
}
if (JRequest::getVar('searchDirect')) {
$cat = 'selling';
}
//echo "cat ne:$cat";
//Minh them code cho phan search
if ($cat == 'all') {
$where = 'WHERE tp.published=1 AND tp.success = 0 ';
if (JRequest::getInt('area_id')) {
$where .= " AND tp.area_id=" . JRequest::getInt('area_id');
}
} else {
if ($cat != 'selling' && $cat != 'renting' && $cat != 'needbuying' && $cat != 'needrenting') {
$where = 'WHERE tp.published=1 AND tp.success = 0 ';
} else {
$where = 'WHERE tp.published=1 AND tp.success = 0 AND tp.kind_id=';
if ($cat == 'selling') {
$where .= '1';
}
if ($cat == 'renting') {
$where .= '2';
}
if ($cat == 'needbuying') {
$where .= '3';
}
if ($cat == 'needrenting') {
$where .= '4';
}
}
if (JRequest::getInt('area_id')) {
$where .= " AND tp.area_id=" . JRequest::getInt('area_id');
}
}
//Ket thuc
//$where .= ($cat == 'renting') ? '1' : '0' ; code cu
//if(JRequest::getVar('catDirect') || JRequest::getInt('area_id'))
if (0) {
} else {
/* Tim theo ma tai san */
$maTs = JRequest::getVar('mataisan');
if ($maTs != NULL) {
if (is_numeric($maTs)) {
global $mainframe;
$mainframe->redirect('index.php?option=com_jea&view=properties&Itemid=10&id= ' . $maTs);
} else {
$msgbox = JText::_('NOSEARCHMTS');
echo "<script>alert('{$msgbox}');document.location.href='index.php'</script>";
}
}
if ($key_search = JRequest::getVar('key_search', $params->get('key_search', ''))) {
$where .= " AND ( tp.ref LIKE '%{$key_search}%' OR tp.address LIKE '%{$key_search}%' OR tp.description LIKE '%{$key_search}%' OR tp.name_vl LIKE '%{$key_search}%' OR tp.address_vl LIKE '%{$key_search}%')";
}
if ($type_id = JRequest::getInt('type_id', $params->get('type_id', 0))) {
$where .= ' AND tp.type_id = ' . intval($type_id);
}
if ($department_id = JRequest::getInt('department_id', $params->get('department_id', 0))) {
$where .= ' AND tp.department_id = ' . intval($department_id);
}
if ($town_id = JRequest::getInt('town_id', $params->get('town_id', 0))) {
$where .= ' AND tp.town_id = ' . intval($town_id);
}
if ($area_id = JRequest::getInt('area_id', $params->get('area_id', 0))) {
$where .= ' AND tp.area_id = ' . intval($area_id);
}
$budget_min = JRequest::getFloat('budget_min', 0.0);
$budget_max = JRequest::getFloat('budget_max', 0.0);
$session =& JFactory::getSession();
if ($budget_min != 0) {
@($_SESSION["gia_tu1"] = $budget_min);
@($_SESSION["gia_den1"] = $budget_max);
} else {
if ($budget_min == 0 && $budget_max == 0) {
@($budget_min = $_SESSION["gia_tu1"]);
@($budget_max = $_SESSION["gia_den1"]);
}
}
/* neu ton tai loai tin dang, loai dia oc, dia diem thi se gan gia tu gia den vao*/
if (isset($_GET['catDirect']) || isset($_GET['type_id']) || isset($_GET['town_id']) || isset($_GET['limitstart'])) {
/* neu ton tai gia tu gia den se lay gia tu gia den */
if (isset($_GET['gia_tu']) && isset($_GET['gia_den'])) {
$budget_min = $_GET['gia_tu'];
//.........这里部分代码省略.........
示例13: display
function display($tpl = NULL, $preparecontent = false)
{
$document = JFactory::getDocument();
$language = $document->getLanguage();
// load scripts
$document->addScript('components/com_bookingforconnector/assets/js/jquery.validate.min.js');
$document->addScript('components/com_bookingforconnector/assets/js/additional-methods.min.js');
// Initialise variables
$trackorder = false;
$state = $this->get('State');
$actionmode = JRequest::getVar('actionmode', "");
$item = $this->get('Item');
$params =& $state->params;
$this->assignRef('state', $state);
$this->assignRef('params', $params);
$this->assignRef('language', $language);
$this->assignRef('item', $item);
$this->assignRef('actionmode', $actionmode);
if ($actionmode == "orderpayment") {
//recupero quanti pagamenti sono stati effettuati
$item->paymentCount = BFCHelper::getTotalOrderPayments($item->order->OrderId);
$item->overrideAmount = JRequest::getFloat('overrideAmount');
//sostituisco i dati dell'ordine da pagare con i dati passati e l'ordine con un suffisso in più
/*$item = $this->get('Item');*/
/*$item = "fet";*/
}
if ($actionmode == "orderpaid") {
$trackorder = true;
}
if ($actionmode != '' && $actionmode != 'cancel' && $actionmode != 'donation' && $actionmode != 'orderpayment') {
if ($item->order->Status != 5) {
$hasPayed = $this->processPayment($actionmode, $item->order->OrderId);
/* eccezione per setefi che pretende un url di ritorno */
} else {
//$hasPayed = true;
$hasPayed = $this->processOrderPayment($actionmode, $item->order->OrderId, $language);
}
/*
$link = '';
if ($hasPayed){
}
$app = JFactory::getApplication();
$app->redirect($link, $msg);
*/
}
if ($actionmode == '' && $actionmode != 'donation') {
if ($item->order->Status != 5) {
$this->inizializePayment($item->order->OrderId);
}
}
if ($actionmode == 'orderpaid') {
$hasPayed = $item->order->Status == 5;
}
if (isset($trackorder) && $trackorder) {
$merchants = array();
$merchants[] = $item->order->MerchantId;
$criteoConfig = BFCHelper::getCriteoConfiguration(4, $merchants, $item->order->OrderId);
if (isset($criteoConfig) && isset($criteoConfig->enabled) && $criteoConfig->enabled && count($criteoConfig->merchants) > 0) {
$document->addScript('//static.criteo.net/js/ld/ld.js');
$document->addScriptDeclaration('window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{ event: "setAccount", account: ' . $criteoConfig->campaignid . '},
{ event: "setSiteType", type: "d" },
{ event: "setEmail", email: "" },
{ event: "trackTransaction", id: "' . $criteoConfig->transactionid . '", item: [' . json_encode($criteoConfig->orderdetails) . '] }
);');
}
$analyticsEnabled = $this->checkAnalytics("Sales Resource List");
if ($analyticsEnabled && $config->get('eecenabled', 0) == 1) {
$purchaseObject = new stdClass();
$purchaseObject->id = "" . $item->order->OrderId;
$purchaseObject->affiliation = "" . $item->order->Label;
$purchaseObject->revenue = "" . $item->order->TotalAmount;
$purchaseObject->tax = 0.0;
$allobjects = array();
$svcTotal = 0;
$allservices = array_values(array_filter(simpledom_load_string($order->NotesData)->xpath("//price"), function ($prc) {
return (string) $prc->tag == "extrarequested";
}));
foreach ($allservices as $svc) {
$svcObj = new stdClass();
$svcObj->id = "" . (int) $svc->priceId . " - Service";
$svcObj->name = (string) $svc->name;
$svcObj->category = "Services";
$svcObj->brand = $item->Name;
$svcObj->variant = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
$svcObj->price = round((double) $svc->discountedamount / (int) $svc->quantity, 2);
$svcObj->quantity = (int) $svc->quantity;
$allobjects[] = $svcObj;
$svcTotal += (double) $svc->discountedamount;
}
$mainObj = new stdClass();
$mainObj->id = "" . $item->order->RequestedItemId . " - Resource";
$mainObj->name = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
$mainObj->variant = (string) BFCHelper::getItem($order->NotesData, 'refid', 'rateplan');
$mainObj->category = $item->MainCategoryName;
$mainObj->brand = $item->Name;
$mainObj->price = $item->order->TotalAmount - $svcTotal;
$mainObj->quantity = 1;
//.........这里部分代码省略.........
示例14: getVar
function __construct($paypal_email,$type = 'paypal_express') {
// Notify string
$this->paypal_mode = $type;
if($type == 'paypal_express')
{
$this->paypal_email= $paypal_email;
$this->paypal_receiver_email= $paypal_email;
$this->business= JRequest :: getVar('business'); //trim(stripslashes($this->_POST['business']));
$this->item_name= JRequest :: getVar('item_name'); //trim(stripslashes($this->_POST['item_name']));
$this->item_number= JRequest :: getVar('item_number'); //trim(stripslashes(@ $this->_POST['item_number']));
$this->payment_status= JRequest :: getVar('payment_status'); //trim(stripslashes($this->_POST['payment_status']));
// The order total amount including taxes, shipping and discounts
$this->mc_gross= JRequest :: getVar('mc_gross'); //trim(stripslashes($this->_POST['mc_gross']));
// Can be USD, GBP, EUR, CAD, JPY
$this->currency_code= JRequest :: getVar('mc_currency'); //trim(stripslashes($this->_POST['mc_currency']));
$this->txn_id= JRequest :: getVar('txn_id'); //trim(stripslashes($this->_POST['txn_id']));
$this->receiver_email= JRequest :: getVar('receiver_email'); //trim(stripslashes($this->_POST['receiver_email']));
$this->payer_email= JRequest :: getVar('payer_email'); //trim(stripslashes($this->_POST['payer_email']));
$this->payment_date= JRequest :: getVar('payment_date'); //trim(stripslashes($this->_POST['payment_date']));
// The Order Number (not order_id !)
$this->invoice= JRequest :: getVar('invoice',JRequest :: getCmd('parent_txn_id')); //trim(stripslashes($this->_POST['invoice']));
$this->amount= JRequest :: getVar('amount'); //trim(stripslashes(@ $this->_POST['amount']));
$this->quantity= JRequest :: getVar('quantity'); //trim(stripslashes($this->_POST['quantity']));
$this->pending_reason= JRequest :: getVar('pending_reason'); //trim(stripslashes(@ $this->_POST['pending_reason']));
$this->payment_method= JRequest :: getVar('payment_method'); //trim(stripslashes(@ $this->_POST['payment_method'])); // deprecated
$this->payment_type= JRequest :: getVar('payment_type'); //trim(stripslashes(@ $this->_POST['payment_type']));
// Billto
$this->first_name= JRequest :: getVar('first_name'); //trim(stripslashes($this->_POST['first_name']));
$this->last_name= JRequest :: getVar('last_name'); //trim(stripslashes($this->_POST['last_name']));
$this->address_street= JRequest :: getVar('address_street'); //trim(stripslashes(@ $this->_POST['address_street']));
$this->address_city= JRequest :: getVar('address_city'); //trim(stripslashes(@ $this->_POST['address_city']));
$this->address_state= JRequest :: getVar('address_state'); //trim(stripslashes(@ $this->_POST['address_state']));
$this->address_zipcode= JRequest :: getVar('address_zip'); //trim(stripslashes(@ $this->_POST['address_zip']));
$this->address_country= JRequest :: getVar('address_country'); //trim(stripslashes(@ $this->_POST['address_country']));
$this->residence_country= JRequest :: getVar('residence_country'); //trim(stripslashes(@ $this->_POST['residence_country']));
$this->address_status= JRequest :: getVar('address_status'); //trim(stripslashes(@ $this->_POST['address_status']));
$this->payer_status= JRequest :: getVar('payer_status'); //trim(stripslashes($this->_POST['payer_status']));
$this->notify_version= JRequest :: getVar('notify_version'); //trim(stripslashes($this->_POST['notify_version']));
$this->verify_sign= JRequest :: getVar('verify_sign'); //trim(stripslashes($this->_POST['verify_sign']));
$this->custom= JRequest :: getVar('custom'); //trim(stripslashes(@ $this->_POST['custom']));
$this->txn_type= JRequest :: getVar('txn_type'); //trim(stripslashes($this->_POST['txn_type']));
$this->subscr_id= JRequest :: getVar('subscr_id');
}
else
{
$this->first_name= JRequest :: getCmd('first_name'); //trim(stripslashes($this->_POST['first_name']));
$this->last_name= JRequest :: getCmd('last_name'); //trim(stripslashes($this->_POST['last_name']));
$this->address_street= JRequest :: getString('address_street'); //trim(stripslashes(@ $this->_POST['address_street']));
$this->address_city= JRequest :: getString('address_city'); //trim(stripslashes(@ $this->_POST['address_city']));
$this->address_state= JRequest :: getString('address_state'); //trim(stripslashes(@ $this->_POST['address_state']));
$this->address_zipcode= JRequest :: getCmd('address_zip'); //trim(stripslashes(@ $this->_POST['address_zip']));
$this->address_country= JRequest :: getString('address_country'); //trim(stripslashes(@ $this->_POST['address_country']));
$this->residence_country= JRequest :: getString('residence_country'); //trim(stripslashes(@ $this->_POST['residence_country']));
$this->address_status= JRequest :: getCmd('address_status'); //trim(stripslashes(@ $this->_POST['address_status']));
//trim(stripslashes($this->_POST['payer_status']));
$this->custom= JRequest :: getCmd('custom');
// common
$this->business = JRequest :: getString('business');
$this->receiver_email = JRequest :: getString('receiver_email');
$this->payer_email = JRequest :: getString('payer_email');
$this->test_ipn = JRequest :: getString('test_ipn');
$this->payer_status= JRequest :: getCmd('payer_status');
$this->payment_date= JRequest :: getString('payment_date');
$this->notify_version= JRequest :: getCmd('notify_version'); //trim(stripslashes($this->_POST['notify_version']));
$this->verify_sign= JRequest :: getCmd('verify_sign');
// common variables between profile created & recurring payment
$this->init_txn_id = JRequest :: getCmd('initial_payment_txn_id');
$this->init_txn_status = JRequest :: getCmd('initial_payment_status');
$this->init_payment_amount = JRequest :: getCmd('initial_payment_amount');
$this->profile_status = JRequest :: getCmd('profile_status');
$this->currency_code = JRequest :: getCmd('currency_code'); // Can be USD, GBP, EUR, CAD, JPY
$this->recurring_payment_id = JRequest :: getCmd('recurring_payment_id');
$this->amount= JRequest :: getFloat('amount');
$this->amount_per_cycle= JRequest :: getFloat('amount_per_cycle');
$this->payment_cycle = JRequest :: getFloat('payment_cycle');
$this->txn_type= JRequest :: getCmd('txn_type');
// recurring payment
$this->mc_gross = JRequest :: getFloat('mc_gross');
$this->mc_fee = JRequest :: getFloat('mc_fee');
$this->payment_fee = JRequest :: getFloat('payment_fee');
$this->payment_gross = JRequest :: getFloat('payment_gross');
$this->txn_id = JRequest :: getCmd('txn_id');
$this->payment_status = JRequest :: getCmd('payment_status');
$this->mc_currency = JRequest :: getCmd('mc_currency'); // Can be USD, GBP, EUR, CAD, JPY
// transaction refunded
$this->parent_txn_id = JRequest :: getCmd('parent_txn_id');
$this->reason_code = JRequest :: getString('reason_code');
$this->invoice= JRequest :: getVar('invoice',JRequest :: getCmd('parent_txn_id'));
$this->rp_invoice_id = JRequest :: getVar('rp_invoice_id',null);
if (!empty($this->rp_invoice_id) && empty($this->invoice))
{
$this->invoice = $this->rp_invoice_id;
}
//.........这里部分代码省略.........
示例15: config
/**
* Funkce pro zobrazení nastavení komponenty
*/
public function config()
{
require_once JPATH_COMPONENT . DS . 'models' . DS . 'config.php';
require_once JPATH_COMPONENT . DS . 'views' . DS . 'config' . DS . 'config.html.php';
$configModel = new ConfigModel();
$view = new MappingViewConfig();
$view->assignRef('configModel', $configModel);
/*pokud máme odeslané nastavení, tak ho uložíme...*/
if (JRequest::getString('submitConfig', "") == "ok") {
foreach ($_POST as $key => $value) {
if (ereg("^config#", $key)) {
/*jde o naše nastavení*/
$keynameArr = split("#", $key);
switch ($keynameArr) {
case "matchRate":
$valueX = JRequest::getFloat($key, 1);
break;
case "assignClass":
$valueX = JRequest::getInt($key, 1);
break;
default:
$valueX = $value;
break;
}
$configModel->saveConfigValue($keynameArr[1], $keynameArr[2], $valueX);
}
}
$view->assign('message', JText::_('SETTINGS_SAVED'));
}
/**/
$view->display();
}