$mosConfig_dbprefix = $jc->dbprefix; $mosConfig_host = $jc->host; $mosConfig_password = $jc->password; $mosConfig_user = $jc->user; $link = mysql_connect($mosConfig_host,$mosConfig_user,$mosConfig_password); mysql_select_db($mosConfig_db,$link); $dm = new docmanpaypal(); if (!$dm->constructRun) { $dm->__construct(); } $seller_user_id = mysql_result(mysql_query("select dmsubmitedby from $mosConfig_dbprefix" . "docman where id = " . (int)JRequest::getVar('id') . " limit 1"),0); $cfg = $dm->getConfig($seller_user_id); if ($dm->hasLicense == false) { $product_price = 0.10; } if ($task == 'submit_order') { mysql_query("insert into $mosConfig_dbprefix" . "docmanpaypalsessions values ('$key','0');"); if (is_numeric(JRequest::getVar('id')) and JRequest::getVar('id') > 0) { $product_price = mysql_result(mysql_query("select price from $mosConfig_dbprefix" . "docmanpaypal where `id` = " . JRequest::getVar('id')),0); $product_name = mysql_result(mysql_query("select dmname from $mosConfig_dbprefix" . "docman where `id` = " . JRequest::getVar('id')),0); } else { die("<h1>Failure.</h1>"); } ?> <body onload="document.BB_BuyButtonForm.submit();"> <form action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/<?php echo $cfg['googleCheckout_MerchantID']; ?>" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">
case "saveconfig": if ($v15) { JToolBarHelper::title(JText::_("DOCman PayPal IPN Configuration Saved!"), 'docmanPayPalLogo'); } $dm->saveConfig(); $mainframe->redirect('index.php?&option=com_docmanpaypal&task=config', JText::_("COM_DOCMANPAYPAL_DMP_CONFIGURATIONSAVED")); //echo "<h1>" . JText::_("COM_DOCMANPAYPAL_DMP_OPERATION_COMPLETED") . "</h1>"; break; case "config": $dm->hackDOCman(); if ($v15) { JToolBarHelper::title(JText::_("DOCman PayPal IPN " . $dm->getVersion() . ' ' . JText::_("COM_DOCMANPAYPAL_DMP_CONFIGURATION")), 'docmanPayPalLogo'); JToolBarHelper::apply('saveconfig'); //JToolBarHelper::help('loadhelp'); } $dmpcfg = $dm->getConfig(); //var_dump($dmpcfg); ?> <link rel="stylesheet" href="components/com_docmanpaypal/css/redmond/jquery-ui-1.8.4.custom.css" type="text/css" media="all" /> <script src="components/com_docmanpaypal/js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="components/com_docmanpaypal/js/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script> <script src="components/com_docmanpaypal/js/iphone-style-checkboxes.js" type="text/javascript"></script> <script> jQuery.noConflict(); jQuery(document).ready(function() { jQuery(':checkbox').iphoneStyle(); }); </script>
} else { include_once JPATH_COMPONENT . DS .'lang'. DS .'en.php'; } $option = 'com_docmanpaypal'; $task = JRequest::getVar('task'); require_once("administrator/components/com_docmanpaypal/docmanpaypal.class.php"); $componentdir = '/administrator' . $componentdir; $database = JFactory::getDBO(); $dm = new docmanpaypal(); if (!$dm->constructRun) { $dm->__construct(); } $cfg = $dm->getConfig(); $document = JFactory::getDocument(); switch ($task) { case "order": if ($dm->cfg['requireRegistration'] > 0) { if ($my->id == 0) { $mainframe->redirect('index.php',_DMP_YOUNEEDTOLOGIN); } } $cfg = $dm->getConfig(); $mode = JRequest::getVar('mode','single'); echo $cfg['merchant_header']; ?> <form action="<?php echo JURI::base(); ?>" method="GET">
$dm->__construct(); } $doc_id = JRequest::getVar('id',null,null,'int'); $key = JRequest::getVar('key'); $order_id = JRequest::getVar('order_id',null,null,'int'); if (!$doc_id) { $doc_id = (int)JRequest::getVar('alias'); } $item = $dm->getItem($doc_id); $my = JFactory::getUser(); $dm->cfg = $dm->getConfig(); $price = $dm->getPrice($doc_id); /** * free for user /** * @author Deian * * free for user type */ //die(print_r($my,true)); //die("{$my->usertype} | " . $dm->cfg['free_for_usertypes']); //if (array_key_exists(,explode(",",$dm->cfg['free_for_usertypes']))) {