| demon |
| Moderator |

 |
|
| Joined: Sep 22, 2010 |
| Posts: 485 |
|
|
|
 |
 |
 |
|
| Code: | <?php
class AdminBoletoItau extends AdminTab
{
private $module = 'itauboleto';
public function __construct()
{
global $cookie, $_LANGADM;
$langFile = _PS_MODULE_DIR_ . $this->module . "/" . Language::getIsoById((int) ($cookie->id_lang)) . ".php";
if (file_exists($langFile)) {
require_once $langFile;
foreach ($_MODULE as $key => $value)
if (substr(strip_tags($key), 0, 5) == "Admin")
$_LANGADM[str_replace("_", "", strip_tags($key))] = $value;
}
parent::__construct();
}
public function display()
{
return $this->displayForm();
}
public function displayForm()
{
global $cookie;
$itauBoleto = new itauBoleto();
$itauBoletoExt = $itauBoleto->instanceClass(false, false, false, false);
$varUrl = __PS_BASE_URI__ . "modules/" . $itauBoleto->name . "/actions.php";
echo '\n <script type=\"text/javascript\">\n var urlCall = \"".$varUrl."\";
\n function updateDate()\n {\n $("#select").html("Atualizando...\");
\n $.ajax({\n type: \"POST\",\n url: urlCall,\n data: \"os=" + \$("#os").val() + \"&action=updatedate\",\n success: function(msg)\n {\n $(\"#select").html("OK!");
\n $("#show\").html(msg);
\n }\n });
\n }\n\n function updateStatus()\n {\n $(\"#paid").html(\"Atualizando...\");
\n $.ajax({\n type: "POST\",\n url: urlCall,\n data: \"order=" + \$("#order\").val() + \"&action=updatestatus",\n success: function(msg)\n {\n \$(\"#paid").html(\"OK!\");
\n $("#show").html(msg);
\n }\n });
\n }\n\n function sendPage(page)\n {\n $(\"#update").html(\"Buscando...\");
\n $.ajax({\n type: \"POST\",\n url: urlCall,\n data: \"page=" + page + \"&action=sendpage",\n success: function(msg)\n {\n $("#update").html(\"OK!");
\n $("#show").html(msg);
\n }\n });
\n }\n\n function viewXml()\n {\n \$(\"#xml\").html(\"Atualizando...\");
\n $.ajax({\n type: "POST\",\n url: urlCall,\n data: \"ofx=" + \$(\"#ofx").val() + "&action=viewfile",\n success: function(msg)\n {\n $("#xml\").html(\"OK!\");
\n \$(\"#viewxml\").html(msg);
\n }\n });
\n }\n \t</script> ';
$itauBoleto = new itauBoleto();
$result = $itauBoletoExt->getItauBoletoAllFields();
if (!$result) {
echo "<table class=\"table\" width=\"900\" cellpadding=\"0\" cellspacing=\"2\" id=\"form\">\n <tr><th>\".$itauBoleto->getL(\"There are no transactions to show.\").\"</th></tr></table>";
} else
echo "\n <div id=\"show\" name=\"show\">";
$itauBoletoExt->updateView(0, $cookie->id_lang);
echo "</div>";
}
}
include_once(PS_ADMIN_DIR . "/../classes/AdminTab.php");
include_once(_PS_MODULE_DIR_ . "/itauboleto/itauboleto.php");
include(dirname(__FILE__) . "/itauboletoext.php");
?> |
|
|