コード例 #1
0
ファイル: paywithcard.php プロジェクト: carriercomm/Nuance
<?php

include_once '../include/ucp.php';
if (!$user->isValid()) {
    redirect('login.php');
} else {
    if (!$user->isEnabled()) {
        redirect('disabled.php');
    } else {
        loadPlugin('ucp', 'scratchcard');
        $sc = new ScratchCard();
        $currentDate = new DateTime('midnight');
        $startDate = new DateTime('first day of this month midnight');
        $endDate = new DateTime('first day of next month midnight');
        $withdrawalDay = configgetvalue('system', 'cash', NULL, 'withdrawalDay');
        $withdrawalDay -= 1;
        if ($withdrawalDay) {
            $startDate->modify("+{$withdrawalDay} day");
            $endDate->modify("+{$withdrawalDay} day");
        }
        if ($currentDate < $startDate) {
            $startDate->modify("-1 month");
            $endDate->modify("-1 month");
        }
        $currency = configgetvalue('system', 'main', NULL, 'currency');
        $tariffPrice = smoneyf($user->calculateTariffPrice());
        $formattedTariffPrice = sprintf(_ngettext("%s {$currency}", "%s {$currency}", $tariffPrice), $tariffPrice);
        $fenom->display($theme->getTemplateLocation('header.tpl'), $headerData);
        if (isset($_POST['code'])) {
            $paySum = $sc->pay($_POST['code'], $user->getId());
            if ($paySum) {
コード例 #2
0
ファイル: ajax.php プロジェクト: carriercomm/Nuance
     }
     sort($tzlist);
     foreach ($tzlist as $name => $value) {
         $assocTzlist[$value] = array($value, $value);
     }
     $response->header = array(array('id', 'varchar'), array('name', 'varchar'));
     $response->data = $assocTzlist;
     $response->success = true;
     break;
 case 'generatescratch':
     //$response=new response;
     if (!isset($_GET['count']) && !isset($_GET['value']) && !intval($_GET['count']) && !intval($_GET['value'])) {
         $response->success = false;
     }
     loadPlugin('acp', 'scratchcard');
     $sc = new ScratchCard($response);
     $sc->generate(intval($_GET['count']), intval($_GET['value']));
     $response = $sc->response;
     break;
 case 'getschema':
     loadPlugin('acp', 'schemacompare');
     $sc = new schemacompare();
     $response->header = array("databasePrefix" => DB_TABLE_PREFIX);
     $response->data = $sc->getSchema();
     break;
 case 'shownotifications':
     payment(1);
     return;
     break;
 case 'clearnotifications':
     payment(2);