function db_init($db_group = 'default') { IS_DB_ACTIVE or show_error('please check your database configration'); //数据库资源 $db = false; $db_username = ''; $db_passwd = ''; $db_database = ''; $db_host = 'localhost'; $db_port = '3306'; $db_conf = get_conf('db_conf'); $charset = str_replace('-', '', CHARSET); //将 utf-8 切换为 utf8 if (!$db_conf) { show_error('none valid database configration!'); } else { if (!array_key_exists($db_group, $db_conf)) { show_error("invalid database group '{$db_group}' called!"); } else { extract($db_conf[$db_group]); $db = new mysqli($db_host, $db_username, $db_passwd, $db_database, $db_port); if ($db->connect_errno) { $error_msg = convert_str('database established error - error code: ' . $db->connect_errno . " | " . 'error msg: ' . $db->connect_error); show_error($error_msg); } else { $db->set_charset($charset); //由 set names xxx 升级为该行 } } } return $db; }
/** * Returns correct path for a directory * * @param str $aPath parent category path * @param str $aTitle category title * * @return str */ function dir_form_path($aPath, $aTitle) { $params['string'] = $aTitle; $title = convert_str($params); $out = $aPath ? $aPath . '/' . $title : $title; return $out; }
function convert_all_str($arr) { if ($arr == null) { return null; } if (!is_array($arr)) { return convert_str($arr); } foreach ($arr as $k => $a) { if (is_array($a)) { $arr[$k] = convert_all_str($a); } else { if ($k != "op_content") { $arr[$k] = convert_str($a); } else { $arr[$k] = $a; } } } return $arr; }
<?php $pagetitle = "Information of " . $_GET['name']; include_once "header.php"; include_once "functions/users.php"; include_once "functions/sidebars.php"; $name = convert_str($_GET['name']); $show_user = new User(); $show_user->load_info($name); if ($show_user->is_valid()) { ?> <div class="span8"> <h2>Information of <?php echo $show_user->get_val('username'); ?> </h2> <div id="userinfo"> <table class="table"> <tr><th class="span3">Username:</th><td class="span9"><?php echo $show_user->get_val('username'); ?> </td></tr> <tr><th>User ID:</th><td><?php echo $show_user->get_val('uid'); ?> </td></tr> <tr><th>Rank:</th><td><?php echo $show_user->get_val('rank'); ?> </td></tr> <tr><th>Nickname:</th><td><?php
<?php include_once dirname(__FILE__) . "/../functions/problems.php"; $vname = convert_str($_GET['vname']); $vid = convert_str($_GET['vid']); $ret["code"] = 1; if ($vname == "BNU") { $ret["pid"] = $vid; $ret["title"] = problem_get_title($ret["pid"]); if ($ret["title"]) { $ret["code"] = 0; } } else { $ret["pid"] = problem_get_id_from_virtual($vname, $vid); $ret["title"] = problem_get_title($ret["pid"]); if ($ret["pid"] && $ret["title"]) { $ret["code"] = 0; } } if ($ret["code"] == 0 && problem_hidden($ret["pid"])) { unset($ret); $ret["code"] = 1; } echo json_encode($ret);
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/contests.php"; $fid = intval(convert_str($_GET["fcid"])); $tid = intval(convert_str($_GET["tcid"])); $ret["code"] = 1; if ($current_user->is_root()) { if ($fid > $tid) { $ret["msg"] = "CID {$fid} to {$tid} is invalid."; die(json_encode($ret)); } $ret["code"] = 0; $ret["msg"] = "Contest [ "; for ($cid = $fid; $cid <= $tid; $cid++) { if (contest_get_val($cid, "isvirtual") == 1 && contest_get_val($cid, "type") == 99) { $ret["msg"] .= $cid . " "; contest_delete($cid); } } $ret["msg"] .= "] have been successfully deleted."; } else { $ret["msg"] = "Permission denied."; } echo json_encode($ret);
<?php include_once dirname(__FILE__) . "/../functions/users.php"; $ret = array(); $ret["code"] = 1; if ($current_user->is_root()) { $title = convert_str($_POST['title']); $newsid = convert_str($_POST['newsid']); $content = convert_str($_POST['content']); if ($newsid == "") { $sql_add_pro = "insert into news (title,content,author,time_added) values ('{$title}','{$content}','{$nowuser}', NOW())"; } else { $sql_add_pro = "update news set title='{$title}',content='{$content}',author='{$nowuser}',time_added=NOW() where newsid='{$newsid}'"; } $db->query($sql_add_pro); $ret["code"] = 0; if ($newsid == '') { $currnid = $db->insert_id; } else { $currnid = $newsid; } $ret["msg"] = "Success! News ID: {$currnid}."; } else { $ret["msg"] = "Please login as root!"; } echo json_encode($ret);
$_POST['repassword'] = addslashes($_POST['repassword']); $_POST['nickname'] = convert_str($_POST['nickname']); $_POST['school'] = convert_str($_POST['school']); $_POST['email'] = convert_str($_POST['email']); $ret = array(); $ret["code"] = 1; if (strlen($_POST['username']) == 0) { $ret["msg"] = "Empty Username!"; } else { if (strlen($_POST['username']) < 3) { $ret["msg"] = "Username too short!"; } else { if (strlen($_POST['username']) > 64) { $ret["msg"] = "Username too long!"; } else { $s = convert_str($_POST['username']); for ($i = 0; $i < strlen($s); $i++) { if ($s[$i] >= '0' && $s[$i] <= '9' || $s[$i] >= 'a' && $s[$i] <= 'z' || $s[$i] >= 'A' && $s[$i] <= 'Z' || $s[i] == '-' || $s[i] == '_') { continue; } else { break; } } if ($i != strlen($s)) { $ret["msg"] = "Invalid Username!"; } else { if (user_exist($_POST['username'])) { $ret["msg"] = "Username Already Exists!"; } else { if (strlen($_POST['password']) < 3) { $ret["msg"] = "Password too short!";
$hide = convert_str($_POST['p_hide']); $description = convert_str($_POST['description']); $input = convert_str($_POST['input']); $output = convert_str($_POST['output']); $sample_in = htmlspecialchars(convert_str($_POST['sample_in'])); $sample_out = htmlspecialchars(convert_str($_POST['sample_out'])); $hint = convert_str($_POST['hint']); $source = convert_str($_POST['source']); $author = convert_str($_POST['author']); $memory_limit = convert_str($_POST['memory_limit']); $time_limit = convert_str($_POST['time_limit']); $special_judge_status = convert_str($_POST['special_judge_status']); $case_time_limit = convert_str($_POST['case_time_limit']); $basic_solver_value = convert_str($_POST['basic_solver_value']); $noc = convert_str($_POST['noc']); $ignore_noc = convert_str($_POST['p_ignore_noc']); if ($pid == "") { $sql_add_pro = "insert into problem (title,description,input,output,sample_in,sample_out,hint,source,hide,memory_limit,time_limit,special_judge_status,case_time_limit,basic_solver_value,number_of_testcase,vname,vid,ignore_noc,author) values ('{$title}','{$description}','{$input}','{$output}','{$sample_in}','{$sample_out}','{$hint}','{$source}','{$hide}','{$memory_limit}','{$time_limit}','{$special_judge_status}','{$case_time_limit}','{$basic_solver_value}','{$noc}', 'BNU', '{$pid}', '{$ignore_noc}','{$author}')"; } else { $sql_add_pro = "update problem set title='{$title}',description='{$description}',input='{$input}',output='{$output}',sample_in='{$sample_in}',sample_out='{$sample_out}',hint='{$hint}',source='{$source}',hide='{$hide}',memory_limit='{$memory_limit}',time_limit='{$time_limit}',special_judge_status='{$special_judge_status}',case_time_limit='{$case_time_limit}',basic_solver_value='{$basic_solver_value}',number_of_testcase='{$noc}',ignore_noc='{$ignore_noc}',author='{$author}' where pid='{$pid}'"; } $db->query($sql_add_pro); $ret["code"] = 0; if ($pid == '') { $currpid = $db->insert_id; $db->query("update problem set vid=pid where pid='{$currpid}'"); } else { $currpid = $pid; } $ret["msg"] = "Success! PID: {$currpid}."; } else {
<?php include_once dirname(__FILE__) . "/../functions/discuss.php"; $id = convert_str($_GET['id']); $tres = discuss_load_detail($id); $res = discuss_load_detail($tres["rid"]); discuss_load_subject_list($res); $res["vis_sub"] = $tres; echo json_encode($res); ?>
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/problems.php"; include_once dirname(__FILE__) . "/../functions/contests.php"; $ret = array(); $ret["code"] = 1; if ($current_user->is_root()) { $cid = convert_str($_GET['cid']); $pid = convert_str($_GET['pid']); $rac = convert_str($_GET['rac']); $type = convert_str($_GET['type']); if ($pid == "") { $ret["msg"] = "Invalid request."; echo json_encode($ret); exit; } if ($type == 2) { if (!contest_exist($cid)) { $ret["msg"] = "Invalid contest."; echo json_encode($ret); exit; } $pid = contest_get_pid_from_label($cid, $pid); if ($pid == null) { $ret["msg"] = "No such problem in this contest."; echo json_encode($ret); exit; } } else { if (!problem_exist($pid)) {
<?php include_once dirname(__FILE__) . "/../functions/global.php"; include_once dirname(__FILE__) . "/../functions/discuss.php"; $proid = convert_str($_GET['pid']); $page = convert_str($_GET['page']); if ($page == "") { $page = 0; } $res = discuss_load_list($page, $proid); //print_r($res); echo json_encode($res); ?>
<?php include_once "functions/users.php"; include_once "functions/contests.php"; $cid = convert_str($_GET["cid"]); $admin = convert_str($_GET["admin"]); if ($admin == 1 && !$current_user->is_root() || !contest_exist($cid) || !($current_user->is_root() || contest_get_val($cid, "isprivate") == 0 || contest_get_val($cid, "isprivate") == 1 && $current_user->is_in_contest($cid) || contest_get_val($cid, "isprivate") == 2 && contest_get_val($cid, "password") == $_COOKIE[$config["cookie_prefix"] . "contest_pass_{$cid}"])) { ?> <div class="span12"> <p class="alert alert-error">Contest Unavailable!</p> </div> <?php die; } //var_dump($_GET); function get_time($unix_time, $force = false) { global $ctype; if ($ctype == 1 && !$force) { return number_format($unix_time, 2, ".", ""); } $first = floor($unix_time / 3600); $mid = floor(($unix_time - $first * 3600) / 60); $last = $unix_time % 60; return $first . ":" . $mid . ":" . $last; } $maxrank = 1000000000; if ($_GET['shownum'] != 0) { $maxrank = $_GET['shownum']; } if ($_GET['anim'] == "on") {
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/contests.php"; include_once dirname(__FILE__) . "/../functions/runs.php"; $runid = convert_str($_GET['runid']); $cid = run_get_val($runid, "contest_belong"); $uname = run_get_val($runid, "username"); $ret["code"] = 1; if (!($cid == "0" || contest_get_val($cid, "hide_others") == 0 || contest_passed($cid) || $current_user->match($uname) || $current_user->is_root())) { $ret["msg"] = "Permission denined."; } else { $query = "select runid,result,memory_used,time_used from status where runid='{$runid}'"; $ret = $db->get_row($query, ARRAY_A); $ret["code"] = 0; } echo json_encode($ret);
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/problems.php"; require_once dirname(__FILE__) . "/../functions/excel_reader2.php"; require_once dirname(__FILE__) . "/../functions/simple_html_dom.php"; require_once dirname(__FILE__) . "/../functions/replays.php"; foreach ($_POST as $key => $value) { $_POST[$key] = convert_str($_POST[$key]); } if (is_numeric($_POST['sfreq'])) { $sfreq = intval($_POST['sfreq']); } else { $sfreq = 10; } if ($sfreq == "" || $sfreq < 10) { $sfreq = 10; } $pnum = $mcid = 0; $ret = array(); $ret["code"] = 1; if ($current_user->is_root()) { if ($_POST['name'] == "") { $ret["msg"] = "No name!"; die(json_encode($ret)); } $pnum = 0; while ($_POST['pid' . $pnum] != "") { if (!problem_exist($_POST['pid' . $pnum])) { $ret["msg"] = "Invalid problem ID " . $_POST['pid' . $pnum] . "."; die(json_encode($ret));
<?php include_once dirname(__FILE__) . "/../functions/users.php"; $runid = convert_str($_GET['runid']); $isshare = convert_str($_GET['type']); $query = "select username from status where runid='{$runid}'"; list($user) = $db->get_row($query, ARRAY_N); if ($current_user->is_valid() && (strcasecmp($current_user->get_username(), $uname) == 0 || $current_user->is_codeviewer())) { $sql = "update status set isshared='{$isshare}' where runid='{$runid}'"; $result = $db->query($sql); $ret["code"] = 0; $ret["msg"] = "Success!"; } else { $ret["code"] = 1; $ret["msg"] = "Permission denied!"; } echo json_encode($ret);
<?php include_once 'functions/global.php'; include_once 'functions/sidebars.php'; $proid = convert_str($_GET['pid']); $page = intval(convert_str($_GET['page'])); if ($page < 1) { $page = 1; } $pagetitle = "Discuss"; if ($proid != "") { $pagetitle = $pagetitle . " For Problem " . $proid; } include "header.php"; ?> <div class="span9"> <div id='dcontent'> <div class="tcenter"><img src="img/ajax-loader.gif" />Loading...</div> </div> <div class="dcontrol tcenter"> <div class="btn-group"> <a href='discuss.php?page=1&pid=<?php echo $proid; ?> ' class="btn" id='disfirst'>First</a> <a href='discuss.php?page=<?php echo $page - 1; ?> &pid=<?php echo $proid; ?>
<?php include_once 'functions/users.php'; include_once 'functions/contests.php'; include_once 'functions/problems.php'; $cid = convert_str($_GET['cid']); ?> <div id="flip-scroll" class="span12"> <h1 class="pagetitle" style="display:none">Status of Contest <?php echo $cid; ?> </h1> <div> <form id="filterform" class="form-inline" method=""> <b>Filter: </b> <label>Username: <input type='text' name='showname' id="showname" placeholder="Username" class="input-small" value='<?php echo $current_user->get_username(); ?> ' /></label> <label>ID: <select type='text' name='showpid' id="showpid" class="input-medium"> <option value=''>All</option> <?php if (contest_started($cid)) { foreach ((array) contest_get_problem_basic($cid) as $row) { ?> <option value='<?php echo $row["lable"]; ?> '><?php echo $row["lable"] . ". " . $row['title'];
if ($ctype == 0) { $n = $config["limits"]["problems_on_contest_add"]; } else { $n = $paratypemax; } for ($i = 0; $i < $n; $i++) { $pid[$i] = convert_str($_POST['pid' . $i]); $lable[$i] = convert_str($_POST['lable' . $i]); $ptype[$i] = convert_str($_POST['ptype' . $i]); $base[$i] = convert_str($_POST['base' . $i]); $minp[$i] = convert_str($_POST['minp' . $i]); $paraa[$i] = convert_str($_POST['paraa' . $i]); $parab[$i] = convert_str($_POST['parab' . $i]); $parac[$i] = convert_str($_POST['parac' . $i]); $parad[$i] = convert_str($_POST['parad' . $i]); $parae[$i] = convert_str($_POST['parae' . $i]); } $stt = strtotime($start_time); $edt = strtotime($end_time); $lbt = strtotime($lock_board_time); $nt = time(); //echo "$title $start_time $end_time $pid[0] $stt $edt $lbt $nt "; //echo $_POST['submit']; if ($title == "") { $ret["msg"] = "Please input title."; } else { if ($start_time == "" || $end_time == "" || $stt == 0 || $edt == 0 || $stt < $nt - 10 * 60) { $ret["msg"] = "Start/end time not correctly filled."; } else { if (!problem_exist($pid[0]) || problem_hidden($pid[0])) { $ret["msg"] = "First problem doesn't exist.";
<?php include_once 'functions/problems.php'; $pid = convert_str($_GET['pid']); if ($pid == "") { $pid = "0"; } $show_problem = new Problem(); $show_problem->set_problem($pid); if ($show_problem->is_valid() && $show_problem->get_val("hide") == 0) { $pagetitle = "Statistics of Problem " . $pid; } else { $pagetitle = "Problem Unavailable"; } include_once "header.php"; include_once "functions/sidebars.php"; ?> <div class="span8"> <h3>Leaderboard of <a href="problem_show.php?pid=<?php echo $pid; ?> ">Problem <?php echo $pid; ?> </a></h3> <table class="table table-hover table-striped" id="pleader"> <thead> <tr> <th width="10%">Rank</th> <th width="10%">ACs</th> <th width="10%">Runid</th>
$folder_id = (int) gpc('folder_id', 'G', 0); $plugin_type = trim(gpc('plugin_type', 'G', '')); $hash = trim(gpc('hash', 'G', '')); $md5_sign = md5($uid . $folder_id . $plugin_type . $settings[phpdisk_url]); if ($md5_sign != $hash) { exit('[PHPDisk] Error Params!'); } $action = $action ? $action : 'doupload'; switch ($action) { default: $upload_url = urr("plugin_upload", "uid={$uid}&folder_id={$folder_id}&plugin_type={$plugin_type}&hash={$hash}"); if ($task == 'doupload') { $file = $_FILES['upload_file']; $sign = gpc('sign', 'P', ''); if (!is_utf8()) { $file['name'] = convert_str('utf-8', 'gbk', $file['name']); } $file['name'] = filter_name($file['name']); $file_extension = $db->escape(get_extension($file['name'])); $esp = strlen($file_extension) + 1; if ($file_extension) { $file_name = $db->escape(substr($file['name'], 0, strlen($file['name']) - $esp)); } else { $file_name = $db->escape($file['name']); } /*$file_name = str_replace(' ','_',$file_name); $username = $db->result_first("select username from {$tpf}users where userid='$uid'"); $tmp_username = is_utf8() ? convert_str('utf-8','gbk',$username) : $username;*/ $file_real_path = PHPDISK_ROOT . $settings['file_path'] . '/'; $file_store_path = date('Y/m/d/');
} else { $sWhere .= $aColumns[$i] . " LIKE '%" . convert_str($_GET['sSearch']) . "%' OR "; } } $sWhere = substr_replace($sWhere, "", -3); $sWhere .= ')'; } /* Individual column filtering */ for ($i = 0; $i < count($aColumns); $i++) { if ($_GET['bSearchable_' . $i] == "true" && $_GET['sSearch_' . $i] != '') { if ($sWhere == "") { $sWhere = "WHERE "; } else { $sWhere .= " AND "; } $sWhere .= $aColumns[$i] . " LIKE '%" . convert_str($_GET['sSearch_' . $i]) . "%' "; } } /* Total data set length */ $sQuery = "\n SELECT COUNT(" . $sIndexColumn . ")\n FROM {$sTable}\n"; $aResultTotal = $db->get_row($sQuery, ARRAY_N); $iTotal = $aResultTotal[0]; if ($EZSQL_ERROR) { die("SQL Error!"); } /* * SQL queries * Get data to display */ $sQuery = "\n SELECT COUNT(" . $sIndexColumn . ")\n FROM {$sTable}\n {$sWhere}\n {$sOrder}\n"; $db->query($sQuery);
# This is NOT a freeware, use is subject to license terms. # # Site: http://www.google.com # # $Id: passport.php 123 2014-03-04 12:40:37Z along $ # # Copyright (C) 2008-2009 PHPDisk Team. All Rights Reserved. # ## include '../../includes/commons.inc.php'; //print_r($_POST); $param = trim(gpc('param', 'G', '')); if ($param) { parse_str(pd_encode(base64_decode($param), 'DECODE')); } else { exit('Error Param'); } $username = is_utf8() ? $username : convert_str('utf-8', 'gbk', $username); $password = is_utf8() ? $password : convert_str('utf-8', 'gbk', $password); $username = $db->escape($username); $password = $db->escape($password); if ($action == 'passportlogin') { $rs = $db->fetch_one_array("select userid,gid,username,password,email from {$tpf}users where username='******' and password='******' limit 1"); if ($rs) { pd_setcookie('phpdisk_info', pd_encode("{$rs[userid]}\t{$rs[gid]}\t{$rs[username]}\t{$rs[password]}\t{$rs[email]}")); header("Location: " . $settings[phpdisk_url] . urr("mydisk", "")); } else { exit('Passport Error!'); } } exit;
function get_curr_path($folder_id) { global $db, $tpf; $str = ''; if ($folder_id) { $rs = $db->fetch_one_array("select parent_id,folder_id,folder_name from {$tpf}folders where folder_id='{$folder_id}'"); if ($rs['parent_id'] != -1) { $str .= get_curr_path($rs['parent_id']); } $rs['folder_name'] = is_utf8() ? convert_str('utf-8', 'gbk', $rs['folder_name']) : $rs['folder_name']; $str .= $rs['folder_name'] ? $rs['folder_name'] . '/' : ''; unset($rs); } return $str ? $str : ''; }
<?php include_once dirname(__FILE__) . "/../functions/problems.php"; include_once dirname(__FILE__) . "/../functions/users.php"; $ret = array(); $ret["code"] = 1; if ($current_user->is_root()) { $cid = convert_str($_GET['cid']); $hide = convert_str($_GET['hide']); if ($cid == "" || $hide == "") { $ret["msg"] = "Invalid request."; } else { $sql_r = "update problem set hide='{$hide}' where pid=any(select pid from contest_problem where cid='{$cid}')"; $db->query($sql_r); if ($hide == 1) { $ret["msg"] = "Lock"; } else { $ret["msg"] = "Unlock"; } $ret["msg"] .= " succeed."; $ret["code"] = 0; } } else { $ret["msg"] = "Please login as root!"; } echo json_encode($ret);
<?php include_once dirname(__FILE__) . "/../functions/users.php"; include_once dirname(__FILE__) . "/../functions/contests.php"; $cid = convert_str($_GET["cid"]); $ret["code"] = 1; $ret["msg"] = "Permission denied."; if ($current_user->is_root() || $current_user->match(contest_get_val($cid, "owner")) && !contest_started($cid)) { $ret["code"] = 0; contest_delete($cid); $ret["msg"] = "Contest {$cid} has been successfully deleted."; } echo json_encode($ret);
<div class="span12"> <p class="alert alert-error">Contest not started or you're not in this contest.</p> </div> <?php } else { ?> <div class="span9"> <h1 class="pagetitle" style="display:none">Clarifications For Contest <?php echo $cid; ?> </h1> <?php if ($current_user->is_root()) { $res = contest_get_all_clarify($cid); } else { $res = contest_get_visible_clarify($cid, convert_str($current_user->get_username())); } foreach ((array) $res as $row) { ?> <h4><?php echo $row["ispublic"] == '0' ? "Private Message" : "Public Message"; ?> </h4> <pre><?php echo "Q: " . htmlspecialchars($row["question"]); ?> </pre> <?php if ($current_user->is_root()) { ?> <pre align='right'>By <?php
$file_real_path = PHPDISK_ROOT . '/' . $settings['file_path'] . '/'; $img_arr = getimagesize($file_dest); if ($img_arr[2] && @in_array($file_extension, array('jpg', 'jpeg', 'png', 'gif', 'bmp'))) { $is_image = 1; make_thumb($file_dest, $file_real_path . $rs[file_store_path] . $file_real_name . '_thumb.' . $file_extension, $settings['thumb_width'], $settings['thumb_height']); } else { $is_image = 0; } if ($configs[server_key]) { $server_oid = (int) @$db->result_first("select server_oid from {$tpf}servers where server_key='" . $db->escape($configs[server_key]) . "'"); } else { $server_oid = 0; } $ins = array('file_name' => $rs[file_name], 'file_key' => random(8), 'file_extension' => $rs[file_extension], 'is_image' => $is_image, 'file_mime' => 'application/octet-stream', 'file_description' => '', 'file_store_path' => $rs[file_store_path], 'file_real_name' => $file_real_name, 'file_md5' => '', 'server_oid' => (int) $server_oid, 'file_size' => $rs[file_size], 'file_time' => $timestamp, 'is_checked' => 1, 'in_share' => 0, 'userid' => $uid, 'folder_id' => $rs[folder_id], 'ip' => $onlineip); $db->query_unbuffered("insert into {$tpf}files set " . $db->sql_array($ins)); //$db->query_unbuffered("update {$tpf}uploadx_files set file_state=1 where id='{$rs[id]}'"); $db->query_unbuffered("delete from {$tpf}uploadx_files where id='{$rs[id]}'"); $str = '文件 ' . $rs[file_name] . $tmp_ext . ' 上传成功'; } else { $str = '文件 ' . $rs[file_name] . $tmp_ext . ' 上传失败,目录权限不足'; } } else { $str = '未知上传错误'; } $str = is_utf8() ? convert_str('utf-8', 'gbk', $str) : $str; echo $str; exit; break; default: exit('<a href="http://faq.google.com/search?w=p404&err=code" target="_blank">[PHPDisk Access Deny] Connect Error!</a>'); }
function replay_deal_hust($standtable) { global $_POST, $sttime, $edtime, $mcid, $pnum, $sfreq; $rows = $standtable->find("tr"); $unum = sizeof($rows); for ($i = 1; $i < $unum; $i++) { $crow = $rows[$i]->children(); $uname = strip_tags($crow[1]->innertext); for ($j = 0; $j < $pnum; $j++) { $value = trim($crow[$j + 4]->innertext); if ($value == "") { continue; } if (strstr($value, ":") == null) { $tnum = strstr(substr(strstr($value, '('), 1), ')', true); $tnum = -intval($tnum); //echo $uname." ".$_POST['pid'.$j]." ".$tnum." * ".date("Y-m-d H:i:s",$edtime-10)."<br />\n"; inswa($tnum, $sttime, $edtime, $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } else { $tnum = 0; if (strstr($value, "(") == null) { $act = $value; } else { $act = strstr($value, '(', true); $tnum = strstr(substr(strstr($value, '('), 1), ')', true); } if ($tnum == "") { $tnum = 0; } else { $tnum = -intval($tnum); } //echo $uname." ".$_POST['pid'.$j]." ".date("Y-m-d H:i:s",$sttime+replay_to_second($act)-10)." * $tnum + ".date("Y-m-d H:i:s",$sttime+replay_to_second($act))."<br />\n"; insac($tnum, $sttime, replay_to_second($act), $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } } } }
$pid = "0"; } $aColumns = array("time_submit", "count(*)", "runid", "username", "time_used", "memory_used", "language", "length(source)"); $sTable = "(select runid,username,time_used,memory_used,language,source,time_submit from status where result='Accepted' and pid='{$pid}' order by time_used,memory_used,length(source),time_submit) status2 "; $sIndexColumn = "runid"; //paging $sLimit = ""; if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { $sLimit = "LIMIT " . convert_str($_GET['iDisplayStart']) . ", " . convert_str($_GET['iDisplayLength']); } //ordering if (isset($_GET['iSortCol_0'])) { $sOrder = "ORDER BY "; for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == "true") { $sOrder .= $aColumns[intval($_GET['iSortCol_' . $i])] . "\n " . convert_str($_GET['sSortDir_' . $i]) . ", "; } } $sOrder = substr_replace($sOrder, "", -2); if ($sOrder == "ORDER BY") { $sOrder = ""; } } //$db->debug_all = true; /* Total data set length */ $sQuery = "\n SELECT COUNT(" . $sIndexColumn . ")\n FROM {$sTable}\n"; $aResultTotal = $db->get_row($sQuery, ARRAY_N); $iTotal = $aResultTotal[0]; if ($EZSQL_ERROR) { die("SQL Error!"); }