public function getLogUrl()
 {
     $url = "";
     $auth = new PayqrModuleAuth();
     if ($user = $auth->getUser()) {
         $url = PayqrModule::getBaseUrl() . "/log.php?user_id={$user->user_id}&key={$this->log_key}";
     }
     return $url;
 }
 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;
     }
 }
Ejemplo n.º 3
0
 private function setOptions()
 {
     $db = PayqrModuleDb::getInstance();
     $auth = new PayqrModuleAuth();
     $user = $auth->getUser();
     if ($user) {
         $query = "select settings from " . PayqrModuleDb::getUserTable() . " where user_id={$user->user_id}";
     } else {
         $query = "select settings from " . PayqrModuleDb::getUserTable() . " limit 1";
     }
     $result = $db->query($query);
     if ($settings = json_decode($result->settings)) {
         foreach ($settings as $item) {
             $this->options[$item->key] = $item->value;
         }
     }
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
<?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;