public function getHtml() { $auth = new PayqrModuleAuth(); if (isset($_POST["exit"])) { $auth->logOut(); } $user = $auth->getUser(); if ($user) { $button = new PayqrButtonPage($user); if (isset($_POST["PayqrSettings"])) { $button->save($_POST["PayqrSettings"]); } $html = $button->getHtml(); return $html; } }
public function show() { //вызываем функционал библиотеки PayQR require_once __DIR__ . '/../../../payqr/PayqrConfig.php'; $auth = new PayqrModuleAuth(1); $user = $auth->getUser(); if ($user) { $html = '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>'; if (is_file(__DIR__ . '/js/button.js')) { $html .= file_get_contents(__DIR__ . '/js/button.js'); } if (is_file(__DIR__ . '/css/buttonstyle.css')) { $html .= file_get_contents(__DIR__ . '/css/buttonstyle.css'); } $button = new PayqrButtonPage($user); if (isset($_POST["PayqrSettings"])) { $button->save($_POST["PayqrSettings"]); } $html .= $button->getHtml(); echo $html; } }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require_once __DIR__ . '/../../PayqrConfig.php'; $auth = new PayqrModuleAuth(); if (isset($_POST["exit"])) { $auth->logOut(); } $user = $auth->getUser(); if ($user) { $button = new PayqrButtonPage($user); if (isset($_POST["PayqrSettings"])) { $button->save($_POST["PayqrSettings"]); } $html = $button->getHtml(); echo $html; } ?> <style> .row { margin: 5px 0; } label { font-weight: bold;