<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install SYSTEM "http://dev.joomla.org/xml/1.5/plugin-install.dtd"> <install version="1.5" type="plugin" group="content"> <name>Активация карты оплаты</name> <author>Kayfolom</author> <authorEmail>ekorepov@ukhta-inform.ru</authorEmail> <authorUrl>authorUrl</authorUrl> <creationDate>2009</creationDate> <copyright>c</copyright> <license>license</license> <version>1.0</version> <description>Активация карты оплаты</description> <files> <filename plugin="card_payment">card_payment.php</filename> </files> <params /> </install>
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); //@ini_set("display_errors", "1"); //error_reporting(E_ALL); jimport( 'joomla.plugin.plugin' ); require_once("./urfa/URFAClient.php"); $mainframe->registerEvent( 'onPrepareContent', 'plgUserCardPayment' ); function plgUserCardPayment(&$row, &$params, $page=0){ $card_id_length = 6; $card_secret_length = 12; $pos = strpos($row->text, '{user_card_payment}'); if ($pos!==false) { $row->text = preg_replace('/{user_card_payment}/', '', $row->text); //***************** Обработка активации карты $card_payment_message = ''; $urfa_card_id = JRequest::getVar('urfa_card_id'); $urfa_card_secret = JRequest::getVar('urfa_card_secret'); if (isset($urfa_card_id) && isset($urfa_card_secret)) { if ($urfa_card_id!='' && $urfa_card_secret!='') { try { $urfa_user5 = new URFAClient_User5($_SESSION['URFA']['login'], $_SESSION['URFA']['password']); } catch (Exception $exception) { echo "Error in line ", $exception->getLine(); echo $exception->getMessage(); } $urfa_user5->rpcf_user5_card_payment($_SESSION['URFA']['basic_account'],$urfa_card_id,$urfa_card_secret); //-0x4205 } else $card_payment_message = 'Заполните все поля!'; } //***************** Обработка активации карты конец //******************************* Форма активации карты начало if (isset($uri->_vars['urfa_card_id'])) { unset($uri->_vars['urfa_card_id']); } if (isset($uri->_vars['urfa_card_secret'])) { unset($uri->_vars['urfa_card_secret']); } $form_title = '<FORM METHOD="POST">'; $form_footer = '</FORM>'; $form_body = ''; $form_body = $form_body.'Номер карты : <input name="urfa_card_id" MAXLENGTH="'.$card_id_length.'" size="'.$card_id_length.'" value=""></input><BR><BR>'; $form_body = $form_body.'Пароль карты : <input name="urfa_card_secret" MAXLENGTH="'.$card_secret_length.'" size="'.$card_secret_length.'" value=""></input><BR><BR>'; $form_body = $form_body.'<input type="submit" value="Активировать">'; $form_card_payment = $form_title.$form_body.$form_footer; //******************************* Форма активации карты конец $row->text = preg_replace('/{form_card_payment}/', $form_card_payment, $row->text); $row->text = preg_replace('/{card_payment_message}/', $card_payment_message, $row->text); } }
Активация карты оплаты
|
{form_card_payment}
|
{payment_report_table}
|