Esempio n. 1
0
<?php

define('IN_SUSTC', true);
define('SC_ROOT', substr(__FILE__, 0, -9));
//strlen('index.php')
require_once SC_ROOT . 'src/config.php';
require_once SC_ROOT . 'src/core.php';
$sustc = new core();
if (!$sustc->user->islogin()) {
    dredirect('/user/signin');
}
include template('index/news');
Esempio n. 2
0
   case 'notify':
     $trade = new Alipay();
     $trade->notify();
     break;
   case 'return':
     $trade = new Alipay();
     unset($_GET['action']);
     unset($_GET['do']);
     $result = $trade->callback();
     include template('user/deposit_return');
     break;
   }
   exit();
 }
 if (!$sustc->user->islogin()) {
   dredirect('/user/signin?redirect=/user/deposit');
 }
 if (is_post()) {
   $err['code'] = -1;
   $err['success'] = false;
   $depo = isset($_POST['deposit']) ? $_POST['deposit'] : false;
   if ($depo && isset($_POST['formhash'])
       && $sustc->security->check_formhash($_POST['formhash'])) {
     $price = isset($depo['price']) ? intval($depo['price']) : 0;
     if (isset($depo['method']) && $depo['method'] == 'alipay'
         && in_array($price, array(500, 1000, 2000, 5000))) {
       $trade = new Alipay();
       //echo '<!DOCTYPE html><html><head></head><body>';
       $trade_html = $trade->create_trade($price);
       //echo '</body></html>';
       include template('user/deposit_call');
Esempio n. 3
0
<?php

define('IN_SUSTC', true);
define('SC_ROOT', substr(__FILE__, 0, -12));
//strlen('download.php')
require_once SC_ROOT . 'src/config.php';
require_once SC_ROOT . 'src/core.php';
$sustc = new core();
$fid = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($fid) {
    $attach = DB::fetch_first('SELECT * FROM ' . DB::table('attachment') . ' WHERE ' . DB::implode(array('id' => $fid)));
    dredirect('/data/attach/' . $attach['savepath'] . $attach['id'] . '.' . $attach['ext']);
}
Esempio n. 4
0
            }
            echo json_encode($api, JSON_UNESCAPED_UNICODE);
        } else {
            if ($action == 'cancel') {
                global $_G;
                $qid = 0;
                if (is_post()) {
                    //$err['code'] = -1;
                    if (isset($_POST['formhash']) && $sustc->security->check_formhash($_POST['formhash'])) {
                        if (isset($_POST['queue_id'])) {
                            $qid = intval($_POST['queue_id']);
                        }
                    }
                }
                if ($qid) {
                    $queue = DB::fetch_first('SELECT * FROM ' . DB::table('print_queue') . ' WHERE ' . DB::implode(array('id' => $qid)));
                    if ($queue && $queue['uid'] == $_G['uid']) {
                        if ($queue['status'] == CLOUDPRINT_QUEUE_STATUS_WAITING) {
                            DB::update('print_queue', array('status' => CLOUDPRINT_QUEUE_STATUS_CANCEL, 'endtime' => TIMESTAMP), array('id' => $qid, 'status' => CLOUDPRINT_QUEUE_STATUS_WAITING));
                        }
                    }
                    dredirect('/print/status/' . $qid);
                } else {
                    dredirect('/print/status');
                }
            } else {
                include template('print/index');
            }
        }
    }
}