本文整理汇总了PHP中JFactory::getAPPlication方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::getAPPlication方法的具体用法?PHP JFactory::getAPPlication怎么用?PHP JFactory::getAPPlication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFactory
的用法示例。
在下文中一共展示了JFactory::getAPPlication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
function view()
{
$returnpage = JRequest::getVar("returnpage", "");
$Itemid = JRequest::getVar("Itemid", "0");
if ($returnpage != "" && $returnpage == "enroll") {
$user = JFactory::getUser();
if ($user->id != "0") {
$app = JFactory::getAPPlication("site");
$course_id = JRequest::getVar("course_id", "0");
$link = "index.php?option=com_guru&view=guruPrograms&task=enroll&cid=" . intval($course_id) . "&Itemid=" . intval($Itemid);
$app->redirect($link);
}
}
JRequest::setVar('view', 'guruLogin');
parent::display();
}
示例2: FEPluginHandler
//.........这里部分代码省略.........
$db->query();
$order_cost = $cost;
if (isset($new_cost) && trim($new_cost) != "") {
$order_cost = $new_cost;
}
$orderid_from_request = JRequest::getVar("orderid", "0");
if (intval($orderid_from_request) == 0) {
$insersql = "INSERT INTO #__ad_agency_order (`oid`,`tid`,`aid`,`type`,`quantity`,`cost`,`order_date`,`payment_type`,`card_number`,`expiration`,`card_name`,`notes`,`status`,`pack_id`,`currency`, `promocodeid`) VALUES ('','" . intval($tid) . "','" . intval($aid) . "','" . trim($type) . "','" . intval($quantity) . "','" . trim($order_cost) . "','" . trim($order_date) . "','" . addslashes(trim($payment_type)) . "','" . trim($confirm_data) . "','','','" . addslashes(trim($notes)) . "','not_paid','0','" . trim($currencydef) . "', '" . intval($promocode) . "');";
$db->setQuery($insersql);
$db->query();
$sql = "select max(oid) from #__ad_agency_order";
$db->setQuery($sql);
$db->query();
$orderid = $db->loadColumn();
$orderid = $orderid["0"];
} else {
$orderid = intval($orderid_from_request);
}
} elseif ($renew == "renew") {
$orderid = intval(JRequest::getVar("orderid", "0"));
// not redirect to pypal if package is free
if ($cost == 0 || $cost == "0.0" || $cost == "0.00" || $cost == "0.000" || $cost == "0.0000") {
$package_id = JRequest::getVar("otid", "0");
$sql = "select * from #__ad_agency_order_type where `tid`=" . intval($package_id);
$db->setQuery($sql);
$db->query();
$package_content = $db->loadAssocList();
if (isset($package_content) && count($package_content) > 0) {
$campaign_id = JRequest::getVar("campaign_id", "0");
$cost = $package_content["0"]["cost"];
$quantity = $package_content["0"]["quantity"];
//$date_today = date("Y-m-d H:i:s");
$jnow = JFactory::getDate();
$date_today = $jnow->toSql();
$date_today_int = strtotime($date_today);
$validity = '0000-00-00 00:00:00';
if (trim($package_content["0"]["validity"]) != "") {
$pack_validity_str = trim($package_content["0"]["validity"]);
$pack_validity_array = explode("|", $pack_validity_str);
$validity_date = strtotime("+" . $pack_validity_array["0"] . " " . $pack_validity_array["1"], $date_today_int);
$validity = date("Y-m-d H:i:s", $validity_date);
}
$sql = "update #__ad_agency_campaign set `start_date` = '" . trim($date_today) . "', `quantity`='" . intval($quantity) . "', `validity`='" . trim($validity) . "', `cost`='" . trim($cost) . "' where id=" . intval($campaign_id);
$db->setQuery($sql);
$db->query();
$Itemid = JRequest::getInt('Itemid', '0');
$link = "index.php?option=com_adagency&controller=adagencyCampaigns" . $Itemid;
$app = JFactory::getAPPlication("site");
$app->redirect(JRoute::_($link), JText::_("ADAG_RENEWED_SUCCESSFUL"));
}
}
}
if (!isset($orderid) || $orderid == 0) {
$sql = "SELECT oid FROM #__ad_agency_order ORDER BY oid DESC LIMIT 1";
$db->setQuery($sql);
$orderid = $db->loadColumn();
$orderid = $orderid["0"];
}
$item = new stdClass();
$item->oid = $orderid;
@($item->product_name = $item->name = $type_row->description);
//$notes;
$item->amount = $cost;
$item->quantity = 1;
$item->tid = $tid;
$items[] = $item;
$tax = array();
$tax['currency'] = $configs->currencydef;
$tax['value'] = $cost;
$tax['shipping'] = 0;
$tax['taxed'] = $cost;
$profile = null;
$sql = "SELECT * FROM #__ad_agency_advertis WHERE user_id = " . intval($my->id);
$db->setQuery($sql);
$profile = $db->loadObject();
if (is_null($profile)) {
$profile = new stdClass();
}
$profile->_sid = $orderid;
$profile->_user_id = $my->id;
$profile->_user = $my;
$redirect = 1;
$result = "";
$autorenew = JRequest::getVar("aurorenew", "0");
if ($autorenew == 1) {
if ($type_row->type == "fr") {
// Flat Rate - based on time, days or months.
$result = $plugin->instance->getFEDataRenew($items, $tax, $redirect, $profile, $plugin, $configs);
} else {
$result = $plugin->instance->getFEData($items, $tax, $redirect, $profile, $plugin, $configs);
}
} else {
if (isset($_SESSION["new_cost"]) && trim($_SESSION["new_cost"]) == 0) {
$this->goToSuccessURL($orderid);
} else {
$result = $plugin->instance->getFEData($items, $tax, $redirect, $profile, $plugin, $configs);
}
}
return $result;
}