function sajax_get_my_uri() { //print_r($_SERVER["REQUEST_URI"]); // $sajax_remote_uri = $_SERVER["REQUEST_URI"]; //change to $sajax_remote_uri = DigiComSiteHelperDigiCom::getLiveSite(); $sajax_remote_uri .= "/index.php?option=com_digicom"; //if there are any problems with country/province lists populating if (!strpos($sajax_remote_uri, "?option=com_digicom")) { $sajax_remote_uri .= '&option=com_digicom'; } return $sajax_remote_uri . "&no_html=1&view=sajax"; }
/** * Get return url * @param <boolean> $type - true if success url, false to fail url */ function getReturnUrl($type) { global $Itemid; $conf = $this->getInstance("config", "digicomModel"); $configs = $conf->getConfigs(); if ($configs->get('afterpurchase', 1) == 0) { $controller = "Downloads"; $task = "show"; } else { $controller = "Orders"; $task = "list"; } $order_id = JRequest::getVar('order_id', ''); $sid = JRequest::getVar('sid', $order_id); $mosConfig_live_site = DigiComSiteHelperDigiCom::getLiveSite(); $success_url = $mosConfig_live_site . "/index.php?option=com_digicom&controller=" . $controller . "&task=" . $task . "&success=1&sid=" . $sid; $failed_url = $mosConfig_live_site . "/index.php?option=com_digicom&controller=" . $controller . "&task=" . $task . "&success=0&sid=" . $sid; $success_url = str_replace("https://", "http://", $success_url); $failed_url = str_replace("https://", "http://", $failed_url); $success_url = JRoute::_($success_url . '&Itemid=' . $Itemid); $failed_url = JRoute::_($failed_url . '&Itemid=' . $Itemid); if ($type) { return $success_url; } else { return $failed_url; } }
function affiliate($total, $orderid, $configs) { $mosConfig_live_site = DigiComSiteHelperDigiCom::getLiveSite(); $my = JFactory::getUser(); if ($configs->get('idevaff', 'notapplied') == 'notapplied') { return; } @session_start(); $idev_psystems_1 = $total; $idev_psystems_2 = $orderid; $name = "iJoomla Products"; $email = $my->email; //"*****@*****.**"; $item_number = 1; $ip_address = $_SERVER['REMOTE_ADDR']; if ($configs->get('idevaff', 'notapplied') == 'standalone' && file_exists(JPATH_SITE . "/" . $configs->get('idevpath', 'notapplied') . "/sale.php")) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $mosConfig_live_site . "/" . $configs->get('idevpath', 'notapplied') . "/sale.php?profile=72198&idev_saleamt=" . $total . "&idev_ordernum=" . $orderid . "&ip_address=" . $ip_address); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); curl_close($ch); } else { if ($configs->get('idevaff', 'notapplied') == 'component') { $orderidvar = $configs->get('orderidvar', ''); $ordersubtotvar = $configs->get('ordersubtotalvar', ''); echo '<img border="0" src="' . $mosConfig_live_site . '/components/com_idevaffiliate/sale.php?' . $ordersubtotvar . '=' . sprintf("%.2f", $total) . '&' . $orderidvar . '=' . $orderid . '" width="1" height="1">'; } } }