コード例 #1
0
ファイル: db.php プロジェクト: hassanazimi/PostgreSQL
function main()
{
    if (isset($_REQUEST['a'])) {
        jump($_REQUEST["a"]);
    }
    main_page();
}
コード例 #2
0
 function _initialize()
 {
     $model = M('config');
     $list = $model->select();
     foreach ($list as $v) {
         $GLOBALS[$v['varname']] = $v['value'];
     }
     import('ORG.File');
     import('ORG.Plugin');
     //设置发信配置
     C('MAIL_ADDRESS', $GLOBALS['cfg_smtp_usermail']);
     C('MAIL_SMTP', $GLOBALS['cfg_smtp_server']);
     C('MAIL_LOGINNAME', $GLOBALS['cfg_smtp_user']);
     C('MAIL_PASSWORD', $GLOBALS['cfg_smtp_password']);
     //登陆判断
     $this->isLogin() ? define('USER_LOGINED', true) : define('USER_LOGINED', false);
     global $cfg_mb_open, $cfg_mb_reginfo;
     if ($cfg_mb_open == 1) {
         $this->error('系统会员功能已禁用!');
     }
     //缓存用户信息
     if (USER_LOGINED == true) {
         $model = M('member');
         $list = $model->where(array('id' => cookie('uid')))->find();
         $GLOBALS['member'] = $list;
         if ($list['status'] == 1 && !in_array(MODULE_NAME, array('Index', 'Public'))) {
             jump(U('Index/myfile'));
         }
     }
 }
コード例 #3
0
ファイル: fun.php プロジェクト: emaste-r/GunCMS
function checklogin($x)
{
    global $islogin;
    /*
    home.php  对应 islogin = 1
    login.php 对应 islogin = 2
    如果session == 1,但此刻不在home.php($islogin!=1),那么就跳到home.php
    如果session没设置,且此刻不在login.php($islogin!=2),那么就跳到login.php
    */
    if ($x) {
        if ($islogin != 1) {
            jump('home.php');
        }
    } else {
        if ($islogin != 2) {
            jump('login.php');
        }
    }
    /*
    if($x){
    	if($x==1){
    		if($islogin!=1){
    			jump('home.php');
    		}
    	}else{
    		jump('login.php');	
    	}
    }elseif($islogin!=2){
    	jump('login.php');	
    }
    */
}
コード例 #4
0
function main()
{
    if (!isset($_REQUEST['a'])) {
        $_REQUEST['a'] = '';
    }
    jump($_REQUEST["a"]);
}
コード例 #5
0
ファイル: admin.cls.php プロジェクト: iquanxin/march
 public final function check_login()
 {
     if (M == 'admin' && C == 'index' && A == 'login') {
         return true;
     } else {
         $userid = getCookie('userid');
         if (!isset($_SESSION['userid']) || !isset($_SESSION['roleid']) || !$_SESSION['userid'] || !$_SESSION['roleid'] || $userid != $_SESSION['userid']) {
             jump('登陆', '?m=admin&c=index&a=login');
         }
     }
 }
コード例 #6
0
 protected function checksafeauth()
 {
     $safeauth = F('safeauth', '', COMMON_PATH);
     if (empty($safeauth)) {
         jump(U('Index/main'));
     }
     $safeauthset = cookie('safeauthset');
     if (empty($safeauthset)) {
         $this->display('Public:checksafeauth');
         exit;
     }
 }
コード例 #7
0
ファイル: login.php プロジェクト: lughong/test
 public function logining()
 {
     $username = isset($_POST['username']) ? htmlspecialchars(trim($_POST['username'])) : '';
     $password = isset($_POST['password']) ? htmlspecialchars(trim($_POST['password'])) : '';
     //查询用户名和密码是否正确
     $rs = User::isUsernamePassWord($username, $password);
     if ($rs) {
         $url = User::getUserLoginUrl($rs['id']);
     } else {
         $url = url("myweb", "login::index");
     }
     jump($url);
 }
コード例 #8
0
ファイル: common.class.php プロジェクト: KienShin/rbac0
 /**
  * 验证用户是否有权限
  * @param string $name
  * @return string
  */
 public function check_permission($name)
 {
     if (!empty($_SESSION)) {
         foreach ($_SESSION['permission'] as $value) {
             $check_array[] = $value['fname'];
         }
         if (!in_array($name, $check_array)) {
             jump('您没有这样的操作权限', "pages/404.php", '', 0);
             die;
         } else {
             return $name;
         }
     }
 }
コード例 #9
0
 public function doTopLogin()
 {
     $data['username'] = I('post.email');
     $data['password'] = I('post.password');
     $data['password'] = md5($data['password']);
     //查询数据库
     $userres = M('users')->where($data)->find();
     //如果存在,写入session ,返回session数组
     if ($userres) {
         //写入session
         session('user', $userres);
         //返回成功信息
         jump('登陆成功', __APP__);
     } else {
         jump('用户名或密码错误', __APP__);
     }
 }
コード例 #10
0
ファイル: User.class.php プロジェクト: lughong/shop
 public static function isLogin()
 {
     if (!self::_isLogin()) {
         if ($_COOKIE['is_login']) {
             $username = $_COOKIE['is_login']['username'];
             $rs = self::getUserInfoByUsername($username);
             if ($rs) {
                 self::userLogin($rs[0]['id']);
                 return true;
             } else {
                 return false;
             }
         } else {
             $last_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : HOMEURL;
             LuS::set('last_url', $last_url);
             $url = url("login", "login::index");
             jump($url);
         }
     } else {
         return true;
     }
 }
コード例 #11
0
ファイル: nissen.php プロジェクト: kratskij/adventofcode
function compute($registers, $input)
{
    while ($row = current($input)) {
        #echo "$row\n";
        $parts = explode(" ", $row);
        $cmd = array_shift($parts);
        $reg = str_replace(",", "", array_shift($parts));
        $val = $parts ? (int) array_shift($parts) : false;
        switch ($cmd) {
            case "hlf":
                $registers[$reg] /= 2;
                break;
            case "tpl":
                $registers[$reg] *= 3;
                break;
            case "inc":
                $registers[$reg] += 1;
                break;
            case "jmp":
                jump($reg, $input);
                break;
            case "jie":
                if ($registers[$reg] % 2 == 0) {
                    jump($val, $input);
                }
                break;
            case "jio":
                if ($registers[$reg] == 1) {
                    jump($val, $input);
                }
                break;
            default:
                echo "wtf!!\n";
        }
        next($input);
    }
    return $registers;
}
コード例 #12
0
ファイル: function.php プロジェクト: startwang/news
/**
 * 管理员权限验证
 *
 */
function adminCheck($permission = '')
{
    openSession();
    if (empty($_SESSION['admin'])) {
        jump(U('index/login'));
    }
    $adm = json_decode($_SESSION['admin']);
    if (empty($adm)) {
        echo 'no adm';
        exit;
    }
    if (!empty($permission)) {
        $adm = json_decode($_SESSION['admin']);
        $p = ',' . $adm->a_permission . ',';
        if (!is_numeric(strpos($p, ',superadmin,'))) {
            $permission = ',' . $permission . ',';
            if (!is_numeric(strpos($p, $permission))) {
                echo '您没权限访问此页面';
                exit;
            }
        }
    }
}
コード例 #13
0
ファイル: init.php プロジェクト: lyghlqlxx/nuomi_shop
<?php

//开启session
session_start();
//设置字符集
header("content-type:text/html;charset=utf-8");
//定义绝对路径
define('PATH', str_replace('\\', '/', dirname(__FILE__)) . '/../');
$des = strtolower(explode('/', $_SERVER['SERVER_PROTOCOL'])[0]) . '://' . $_SERVER['SERVER_NAME'];
$search = $_SERVER['DOCUMENT_ROOT'];
//用于跳转
define('APP', str_replace($search, $des, PATH));
include PATH . 'include/config.php';
include PATH . 'include/funcs.php';
if (!isset($_SESSION['login']['lv'])) {
    exit(jump('还没有登陆', APP . 'login.php'));
}
?>


コード例 #14
0
<?php

/*
	Xiuno BBS 3.0 插件实例
	广告插件卸载程序
*/
define('DEBUG', 1);
// 发布的时候改为 0
define('APP_NAME', 'bbs');
// 应用的名称
define('APP_PATH', '../../');
// 应用的路径
chdir(APP_PATH);
$conf = (include './conf/conf.php');
include './xiunophp/xiunophp.php';
include './model.inc.php';
$pconf = xn_json_decode(file_get_contents('./plugin/xn_ad/conf.json'));
$pconf['installed'] == 0 and message(-1, '插件已经卸载。');
$user = user_token_get('', 'bbs');
$user['gid'] != 1 and message(-1, jump('需要管理员权限才能完成卸载。', 'user-login.htm'));
// 第一处卸载
plugin_unstall_before('./pc/view/thread.htm', '<?php echo $first[\'message\']; ?>', file_get_contents('./plugin/xn_ad/ad_1.htm'));
// 第二处卸载
plugin_install_remove('./pc/view/footer_debug.inc.htm', file_get_contents('./plugin/xn_ad/ad_2.htm'));
json_conf_set('installed', 0, './plugin/xn_ad/conf.json');
message(0, '卸载完成!');
コード例 #15
0
 public function weixinpay()
 {
     $commonUtil = new CommonUtil();
     $wxPayHelper = new WxPayHelper();
     $source = Input::safeHtml($_POST['source']);
     //接收来源属性
     $custom_id = intval($_POST['custom_id']);
     //接收客户id
     $order_id = intval($_POST['trade_no']);
     //接收订单id
     $merchant_url = Input::safeHtml($_POST['merchant_url']);
     //操作中断返回地址
     //获取商城id
     $shop_id = $_GET['shop_id'];
     //获取商品名称
     $shop_name = M(C('DB_WECHAT_NAME') . '.wxh_order_detail')->where("is_del = 0 and order_id = '" . $order_id . "' and source = '" . $source . "'")->getField('commodity_name');
     //echo M()->getLastSql();
     //dump($shop_name);
     // echo '<br >access_token为:'.$wxPayHelper->access_token(false);
     //获取订单信息
     $order_info = M(C('DB_WECHAT_NAME') . '.wxh_order')->where('is_del = 0 and status = 5 and id = ' . $order_id . ' and user_id = ' . $_SESSION['U_IF']['member_id'])->field('from_id, price, add_time')->find();
     //$price = $order_info['price'];
     //验证post参数,非法返回
     if ($source == '' || $custom_id <= 0 || $order_id <= 0 || $merchant_url == '') {
         die(jump(array('jumpmsg' => '参数非法')));
     }
     //获取订单编号 :来源+订单ID+客户ID+用户ID
     $order_no = $source . '_' . $order_id . '_' . $custom_id . '_' . $_SESSION['U_IF']['member_id'];
     //echo $order_no;
     //$wxpay_config = C('WX_PAY_CONFIG');
     //dump($wxpay_config);
     //echo $total_fee = round($price,2);   //付款金额
     //获取银行通道类型
     $wxPayHelper->setParameter("bank_type", "WX");
     //商品描述
     $wxPayHelper->setParameter("body", $shop_name);
     //商户号
     $wxPayHelper->setParameter("partner", $wxPayHelper->getPartnerId());
     //商户订单号
     $wxPayHelper->setParameter("out_trade_no", $order_no);
     //订单总金额
     $wxPayHelper->setParameter("total_fee", '1');
     //支付币种
     $wxPayHelper->setParameter("fee_type", "1");
     //通知url
     $wxPayHelper->setParameter("notify_url", "http://test.weixinhai.net/shop.php/Wxpay/payNotifyUrl/shop_id/" . $shop_id);
     //订单生成的机器IP
     $wxPayHelper->setParameter("spbill_create_ip", get_client_ip());
     //字符编码
     $wxPayHelper->setParameter("input_charset", "UTF-8");
     //生成jsapi支付请求json
     //dump($wxPayHelper->parameters);
     $data = array('merchant_url' => $merchant_url, 'custom_id' => $custom_id, 'shop_name' => $shop_name, 'order_info' => $order_info);
     $msg = $wxPayHelper->create_biz_package();
     $this->assign('merchant_url', $merchant_url);
     $this->assign('custom_id', $custom_id);
     $this->assign('data', $data);
     $this->assign('msg', $msg);
     $this->display('./shop/Tpl/Index/weixinpay.html');
     //dump($msg);
 }
コード例 #16
0
ファイル: label.php プロジェクト: xubo245/liuyangzhang
/**
*插入与更新标签
**/
function do_post()
{
    global $db, $pre, $lid, $ch, $chtype, $tag, $type, $code, $div, $hide, $js_time, $userdb, $timestamp, $typesystem, $ch_pagetype, $ch_module, $ch_fid, $ch_ifjs, $CHDB, $webdb, $FROMURL, $viewurl, $mystyle;
    //修复旧版的
    $db->query("UPDATE `{$pre}label` SET chtype=99,module=0 WHERE module='-99'");
    if ($lid) {
        $db->query("UPDATE `{$pre}label` SET ch='{$ch}',chtype='{$chtype}',tag='{$tag}',type='{$type}',code='{$code}',divcode='{$div}',hide='{$hide}',js_time='{$js_time}',uid='{$userdb['uid']}',username='******'username']}',posttime='{$timestamp}',typesystem='{$typesystem}',pagetype='{$ch_pagetype}',module='{$ch_module}',fid='{$ch_fid}',if_js='{$ch_ifjs}',style='{$mystyle}' WHERE lid='{$lid}' ");
        //die("s");
    } else {
        $db->query("INSERT INTO `{$pre}label` ( `ch`, `chtype`, `tag`, `type`, `code`, `divcode`, `hide`, `js_time`, `uid`, `username`, `posttime`,`typesystem`, `pagetype`, `module`, `fid`,`if_js`,`style`) VALUES ('{$ch}','{$chtype}','{$tag}','{$type}','{$code}','{$div}','{$hide}','{$js_time}','{$userdb['uid']}','{$userdb['username']}','{$posttime}','{$typesystem}','{$ch_pagetype}','{$ch_module}','{$ch_fid}','{$ch_ifjs}','{$mystyle}')");
    }
    //头与尾
    if ($chtype == 99) {
        label_hf();
    }
    if ($ch_ifjs) {
        //返回到JS调用页
        header("location:index.php?lfj=js&job=show&id={$lid}&{$timestamp}");
        exit;
    }
    make_tag_cache();
    SetModule_config();
    jump("<CENTER>[<A HREF='{$viewurl}' target='_blank'>点击浏览效果</A>] [<A HREF='{$FROMURL}'>继续修改</A>]  [<A HREF='{$viewurl}&jobs=show'>返回频道/专题</A>]</CENTER>", "{$FROMURL}", 600);
}
コード例 #17
0
ファイル: lookback.php プロジェクト: alpaca-nemesis/xxl
<?php

require_once 'func.php';
//$chapter = xss($_POST['c']);
session_begin();
if (!isset($_SESSION['user']) || !isset($_SESSION['pass'])) {
    jump('unit.php');
}
require_once 'config.php';
$link = conn_db($hostname, $username, $password, $database);
if (!$link) {
    echo "Mysql conncet ERROR";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>错题回顾</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>

<body>
<h1><center>信息论课程在线答题系统</center></h1>

<div align="right">
<table width="20%" style="margin-right:20px;margin_top:0px" border='0'>
<tr align="right">
<td>
コード例 #18
0
ファイル: module.php プロジェクト: GHubgenius/qbbj
    $db->query("INSERT INTO `{$table}` ( `c_key` , `c_value` , `c_descrip` ) VALUES ('module_id', '{$newid}', '')");
    $db->query("INSERT INTO `{$table}` ( `c_key` , `c_value` , `c_descrip` ) VALUES ('module_pre', '{$postdb['pre']}', '')");
    $writefile = "<?php\r\n";
    $query = $db->query("SELECT * FROM `{$table}`");
    while ($rs = $db->fetch_array($query)) {
        $rs[c_value] = addslashes($rs[c_value]);
        $writefile .= "\$webdb['{$rs['c_key']}']='{$rs['c_value']}';\r\n";
    }
    write_file(ROOT_PATH . "{$postdb['dir']}/data/config.php", $writefile);
    jump("复制成功,请设置一下新模块的后台权限", "index.php?lfj=group&job=admin_gr&gid=3", 10);
} elseif ($action == "order") {
    foreach ($postdb as $key => $value) {
        $db->query("UPDATE {$pre}module SET list='{$value}' WHERE id='{$key}'");
    }
    make_module_cache();
    jump("操作成功", "index.php?lfj=module&job=list", 1);
}
function strlen_lable($num, $sring)
{
    $sring = stripslashes($sring);
    $num = strlen($sring);
    return "s:{$num}:\"{$sring}\";";
}
function copy_module_file($path, $newp)
{
    if (!is_dir($newp)) {
        mkdir($newp);
    }
    if (file_exists($path)) {
        if (is_file($path)) {
            copy($path, $newp);
コード例 #19
0
ファイル: login.php プロジェクト: robertpop/NS
<?php

if (Admin::isLogged()) {
    jump('index.php?page=home');
}
if ($config->isPost()) {
    // vine din forma
    if (Admin::login($_POST['email'], $_POST['password'])) {
        jump('index.php?page=home');
    } else {
        $smarty->assign('error_login', 'Login failed!');
    }
}
// incarcam pagina de login
$smarty->assign('CONTENT', 'components/login.tpl');
コード例 #20
0
ファイル: index.php プロジェクト: auishik/nsu-ed
<?php

require_once "../includes/head.php";
/*session_start();
  if(isset($_SESSION["username"])) $USERNAME= $_SESSION["username"];
  else $USERNAME= NULL;
  $USERID= GetId($USERNAME);*/
if ($USERNAME == NULL) {
    jump("/index.php?id=1");
}
?>

<!doctype html>
<html lang="en-US">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Profile - NSU-ED</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/custom.css">
    <!--[if lt IE 9]>
  <script src="/js/html5shiv.min.js"></script>
  <script src="/js/respond.min.js"></script>
<![endif]-->
</head>

<body id="page_profile">
<?php 
コード例 #21
0
ファイル: group.php プロジェクト: xubo245/liuyangzhang
    $useHomepageStyle[intval($powerdb[useHomepageStyle])] = ' checked ';
    $view_buy_view_contact[intval($powerdb[view_buy_view_contact])] = ' checked ';
    $sell_postauto_yz[intval($powerdb[sell_postauto_yz])] = ' checked ';
    $buy_postauto_yz[intval($powerdb[buy_postauto_yz])] = ' checked ';
    $post_pingpai_yz[intval($powerdb[post_pingpai_yz])] = ' checked ';
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/group/mod.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == "admin_gr" && $Apower[group_list_admin]) {
    require "menu.php";
    $adminDB = $menudb;
    $rsdb = $db->get_one("SELECT * FROM {$pre}group WHERE gid='{$gid}'");
    $grdb = unserialize($rsdb[allowadmindb]);
    $mygrdb = $grdb[mymenu];
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/group/admin_gr.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == "admin_gr" && $Apower[group_list_admin]) {
    if (!$adgrdb) {
        $allowadmin = 0;
    } else {
        $allowadmin = 1;
    }
    $adgrdb[mymenu] = $myadgrdb;
    $db->query("UPDATE {$pre}group SET allowadmindb='" . serialize($adgrdb) . "',allowadmin='{$allowadmin}' WHERE gid='{$gid}'");
    write_group_cache();
    jump("修改成功", "{$FROMURL}", 1);
} elseif ($action == "set" && $Apower[group_list_admin]) {
    write_config_cache($webdbs);
    jump("修改成功", $FROMURL);
}
コード例 #22
0
ファイル: hack.php プロジェクト: GHubgenius/qbbj
    $rs = $db->get_one("SELECT * FROM {$pre}hack WHERE `name`='{$postdb['name']}' AND keywords!='{$keywords}'");
    if ($rs) {
        showmsg("名称已经存在了.不能重复");
    }
    if (!$postdb[adminurl] || !$postdb[class2]) {
        $postdb[class1] = $postdb[class2] = '';
    }
    $db->query("UPDATE `{$pre}hack` SET name='{$postdb['name']}',hackfile='{$postdb['hackfile']}',hacksqltable='{$postdb['hacksqltable']}',about='{$postdb['about']}',adminurl='{$postdb['adminurl']}',class1='{$postdb['class1']}',class2='{$postdb['class2']}',list='{$postdb['list']}',linkname='{$postdb['linkname']}' WHERE keywords='{$keywords}'");
    write_hackmenu_cache();
    jump("修改成功", $FROMURL, 1);
} elseif ($action == 'delete' && $Apower[hack_list]) {
    $rsdb = $db->get_one("SELECT * FROM {$pre}hack WHERE keywords='{$keywords}' ");
    $db->query("DELETE FROM {$pre}hack WHERE keywords='{$keywords}'");
    $detail = explode("\r\n", $rsdb[hackfile]);
    foreach ($detail as $key => $value) {
        if ($value) {
            del_file(ROOT_PATH . $value);
        }
    }
    $detail = explode("\r\n", $rsdb[hacksqltable]);
    foreach ($detail as $key => $value) {
        if ($value) {
            if ($pre != 'qb_') {
                $value = str_replace("qb_", $pre, $value);
            }
            $db->query("DROP TABLE IF EXISTS `{$value}`");
        }
    }
    write_hackmenu_cache();
    jump("插件删除成功", $FROMURL, 600);
}
コード例 #23
0
ファイル: add_edit.php プロジェクト: robertpop/NS
        $error_nr++;
    }
    if (!isset($_POST['c_probability']) || $_POST['c_probability'] == '') {
        Messages::addError('Code required!');
        $error_nr++;
    }
    if ($error_nr > 0) {
        $_SESSION['post'] = $_POST;
        jump("index.php?page=noscripts&action=add_edit" . $append);
    }
    if (isset($_GET['id']) && $_GET['id'] != '') {
        //edit
        $c = new Noscripts($_GET['id']);
        Messages::addNotice('Code edited!');
    } else {
        //add
        $c = new Noscripts();
        Messages::addNotice('Code added!');
    }
    $c->name = $_POST['c_name'];
    $c->code = $_POST['c_code'];
    $c->probability = $_POST['c_probability'];
    $c->status = $_POST['c_status'];
    $c->save();
    jump('?page=noscripts');
}
if (isset($_GET['todo']) && $_GET['todo'] == 'edit') {
    $c = new Noscripts(@$_GET['id']);
    $smarty->assign('c', $c);
    $smarty->assign('edit', 1);
}
コード例 #24
0
ファイル: score.php プロジェクト: alpaca-nemesis/xxl
require_once '../func.php';
session_begin();
?>
<html>
<head>
<title>信息论课程在线答题系统</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>
<body>
<?php 
if (!isset($_SESSION['user']) || !isset($_SESSION['pass']) || $_SESSION['user'] != "admin") {
    jump('../unit.php');
} else {
    require_once '../config.php';
    $link = conn_db($hostname, $username, $password, $database);
    if (!$link) {
        echo "Mysql conncet ERROR";
    }
    ?>
<h1><center>信息论课程在线答题系统管理后台</center></h1>
<div align="right" style="margin-right:20px;"><a href="logout.php">注销	</a></div>
<hr>
<br>
<h2><center>成绩统计</center></h2>
<table class="table table-striped" width="62%" border='1' align="center">
        <tr>
        <td align="center" >
コード例 #25
0
ファイル: home.php プロジェクト: lughong/shop
 public function outlogin()
 {
     User::outLogin();
     $url = HOMEURL;
     jump($url);
 }
コード例 #26
0
</style>
</head>
<body>
<?php 
if (!empty($_GET["fid"]) && is_numeric($_GET["fid"])) {
    $sql = "select * from hy_product where id=" . $_GET["fid"];
    $rs = mysql_query($sql, $conn);
    $row = mysql_fetch_assoc($rs);
    $sql = "select * from hy_product_category_parameter where fid=" . $row["fid"] . " order by sortnum asc";
    $rs = mysql_query($sql, $conn);
    $pcrow = mysql_fetch_assoc($rs);
    $sql = "select pp.id,pcp.name,pp.myvalue from hy_product_parameter as pp left join hy_product_category_parameter as pcp on pp.parameter_id=pcp.id left join hy_product as p on pp.product_id=p.id where pp.product_id=" . $_GET["fid"] . " order by pcp.sortnum asc";
    $rs = mysql_query($sql, $conn);
} else {
    msg('参数不正确!');
    jump($_SERVER['HTTP_REFERER']);
}
?>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="98%" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt" style="text-indent:5px">修改参数</div></td>
      </tr>
    </table></td>
    <td width="1%" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><p>&nbsp;</p>
コード例 #27
0
 public function index()
 {
     $kinfo = '';
     //标题后面附加的城市后缀
     if ($this->pcid) {
         //检查城市或者城市群
         if ($this->pcid > 1000) {
             $kinfo = $this->cgroup[$this->pcid]['name'];
             $this->assign('city_group', $this->cgroup[$this->pcid]['name']);
         } else {
             $kinfo = get_cityname($this->pcid);
         }
         $this->assign("cityname", $kinfo);
     }
     //检查城市或者城市群
     /*$this->assign('pick',$this->_new_list(2001,'h','0,1',$this->pcid));
      	$this->assign('pick2',$this->_new_list(2001,'p','0,2',$this->pcid));*/
     $slide = $this->_new_list('3001', 'l', '0,5', $this->pcid);
     //dump($slide);
     $this->assign('slide', $slide);
     $pick8 = $this->_new_list('', 'f', '0,20', $this->pcid, '11,12');
     shuffle($pick8);
     $this->assign('pick8', $pick8);
     $this->assign('do', $this->_new_list(2004, '', '0,1', $this->pcid));
     //$this->assign('biz_news',$this->_new_list(2003,'','0,10'));
     $group = $this->_get_group('hot', '0,4');
     $this->assign('group', $group);
     $this->assign('city_type', $this->_get_tree(1000));
     $this->assign('classifieds_type', $this->_get_tree(1));
     $classifieds_type = $this->_get_classifieds_type();
     $classifieds = array();
     foreach ($classifieds_type as $v) {
         $classifieds = array_merge($classifieds, $this->_get_carc($v['id'], '0,10', 0));
         //$this->pcid
     }
     $classifieds_ch = trim($classifieds_ch, ',');
     shuffle($classifieds);
     $this->assign('classifieds', $classifieds);
     //dump($classifieds);
     unset($classifieds);
     $dao = D("Archives");
     $citygui_featured = array();
     $condition = array();
     $condition['ismake'] = '1';
     $condition['channel'] = '2';
     $condition['_string'] = "FIND_IN_SET('f',`flag`) > 0";
     if ($this->pcid == '0') {
         $condition['_string'] .= "";
     } elseif ($this->pcid < 1000) {
         $condition['_string'] .= " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $condition['_string'] .= " AND (cid in ({$city_temp['id']}) or cid='0')";
     }
     $citygui_featured = $dao->where($condition)->order("pubdate DESC")->limit("0,20")->findAll();
     shuffle($citygui_featured);
     $this->assign('citygui_featured', $citygui_featured);
     unset($citygui_featured);
     $classifieds_featured = array();
     $condition = array();
     $condition['ismake'] = '1';
     $classifieds_ch = '4,5,6,7,8,9';
     $condition['channel'] = array('in', "{$classifieds_ch}");
     $condition['_string'] = "FIND_IN_SET('f',`flag`) > 0";
     if ($this->pcid == '0') {
         $condition['_string'] .= "";
     } elseif ($this->pcid < 1000) {
         $condition['_string'] .= " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $condition['_string'] .= " AND (cid in ({$city_temp['id']}) or cid='0')";
     }
     $classifieds_featured = $dao->where($condition)->order("pubdate DESC")->limit("0,20")->findAll();
     shuffle($classifieds_featured);
     $this->assign('classifieds_featured', $classifieds_featured);
     unset($classifieds_featured, $dao);
     $event = array();
     $event = $this->new_event();
     $this->assign('event', $event);
     $fair = array();
     $fair = $this->new_fair();
     $this->assign('fair', $fair);
     $page = array();
     $page['title'] = '缤纷中国 Beingfunchina: Being fun in China, start with us!' . $kinfo;
     $page['keywords'] = '缤纷中国,City Guide, Classifieds, Feature Columns, China Fairs, Events, E-magazines, Groups' . $kinfo;
     $page['description'] = $kinfo . '缤纷中国 Beingfunchina is an English website providing practical and localized information, supporting free posts of classifieds and facilitating interpersonal communication for foreigners in China. Our channels include City Guide, Classifieds, Feature Columns, China Fairs, Events, E-magazines and Groups. ';
     $this->assign('page', $page);
     $ad = array();
     $ad['right'] = '';
     $ads = M("Ad");
     $condition = array();
     $condition['wz'] = 'index';
     $condition['is_show'] = '1';
     $condition['begintime'] = array('lt', time());
     $condition['endtime'] = array('gt', time());
     $condition['_string'] = "FIND_IN_SET('" . $this->pcid . "',`cid`) > 0";
     $adlist = $ads->where($condition)->findAll();
     shuffle($adlist);
     foreach ($adlist as $adl) {
         if ($adl['type'] == 'banner') {
             if (empty($adl['adcode'])) {
                 $ad['banner'][] = '<a href="' . jump($adl['adlink'], $adl['id']) . '" target="' . $adl['isclose'] . '" alt="' . $adl['title'] . '"><img src="' . $adl['picurl'] . '" /></a>';
             } else {
                 $ad['banner'][] = $adl['adcode'];
             }
         } elseif ($adl['type'] == 'right') {
             if (empty($adl['adcode'])) {
                 $ad['right'] .= '<a href="' . jump($adl['adlink'], $adl['id']) . '" target="' . $adl['isclose'] . '" alt="' . $adl['title'] . '"><img src="' . $adl['picurl'] . '" /></a><br>';
             } else {
                 $ad['right'] .= $adl['adcode'];
             }
         } elseif ($adl['type'] == 'left') {
             if (empty($adl['adcode'])) {
                 $ad['left'] .= '<a href="' . jump($adl['adlink'], $adl['id']) . '" target="' . $adl['isclose'] . '" alt="' . $adl['title'] . '"><img src="' . $adl['picurl'] . '" /></a><br>';
             } else {
                 $ad['left'] .= $adl['adcode'];
             }
         }
     }
     $this->assign('ad', $ad);
     $chau_list = array();
     /*$chau_list['0']['id']='1';
       $chau_list['0']['name']='Asia';
       $chau_list['0']['ename']='asia';*/
     $chau_list['1']['id'] = '2';
     $chau_list['1']['name'] = 'Europe';
     $chau_list['1']['ename'] = 'europe';
     $chau_list['1']['url'] = 'http://www.listenlive.eu';
     $chau_list['2']['id'] = '3';
     $chau_list['2']['name'] = 'Canadian';
     $chau_list['2']['ename'] = 'canadian';
     $chau_list['3']['id'] = '4';
     $chau_list['3']['name'] = 'United States';
     $chau_list['3']['ename'] = 'unitedstates';
     /*$chau_list['4']['id']='5';
       $chau_list['4']['name']='South America';
       $chau_list['4']['ename']='south_america';*/
     $chau_list['5']['id'] = '6';
     $chau_list['5']['name'] = 'Australia';
     $chau_list['5']['ename'] = 'oceania';
     $chau_list['6']['id'] = '7';
     $chau_list['6']['name'] = 'New Zealand';
     $chau_list['6']['ename'] = 'newzealand';
     $this->assign('chau', $chau_list);
     $cityname = array(1 => array('GUANGZHOU', 'CH006'), 2 => array('BEIJING', 'CH002'), 3 => array('SHANGHAI', 'CH024'), 4 => array('SHENZHEN', 'CH006'));
     $incity = empty($this->pcid) ? $cityname['2'] : $cityname[$this->pcid];
     $this->assign('city_name', $incity);
     $dao = D("Magazines");
     $magazine_index = array();
     $condition = array("showtime" => array('lt', time()));
     $magazine_index = $dao->where($condition)->order("id DESC")->find();
     $this->assign('magazine_index', $magazine_index);
     $this->display();
 }
コード例 #28
0
ファイル: add_craft.php プロジェクト: ab300819/CraftManage
//    '机加工' => 'add_machine.php',
//    '铸造' => 'add_foundry.php',
//    '焊接' => 'add_welding.php',
//    '锻造' => 'add_forging.php',
//    '热处理' => 'add_heat.php',
//    '装配' => 'add_assembly.php',
//
//);
//$metallurgy = array(
//    '机加工' => 'add_metallurgy.php'
//);
$list = $db->get_choice_select(PRODUCT, $head, "id={$id}");
if ($list == null) {
    echo "<script>\n            alert('没有相关产品!');\n            window.history.back();\n          </script>";
} else {
    jump($list, $id);
}
function jump($list, $id)
{
    if ($list['belong'] == '核电') {
        switch ($list['craft_type']) {
            case '机加工':
                echo "<script>window.location='../panel_machine.php?id='+{$id};</script>";
                break;
            case '铸造':
                echo "<script>window.location='../panel_foundry.php?id='+{$id};</script>";
                break;
            case '焊接':
                echo "<script>window.location='../panel_welding.php?id='+{$id};</script>";
                break;
            case '锻造':
コード例 #29
0
 public function del()
 {
     if (!USER_LOGINED) {
         jump(U('Public/login'));
     }
     global $cfg_money_articledel, $member;
     $map['id'] = $this->_get('id', false);
     $model = M('archive');
     $list = $model->where($map)->find();
     if (!$list) {
         $this->error('文档不存在!');
     }
     if ($list['arcrank'] != 4) {
         $this->error('文档已经被审核通过了!');
     }
     if ($list['mid'] != $member['id']) {
         $this->error('无权操作!');
     }
     $map['arcrank'] = 8;
     $model->save($map);
     //积分变动
     $membermodel = M('member');
     $membermodel->where(array('id' => $member['id']))->setDec('money', $cfg_money_articledel);
     $from = empty($_SERVER['HTTP_REFERER']) ? U('Archive/index?status=0') : $_SERVER['HTTP_REFERER'];
     $this->success('操作成功!', $from);
 }
コード例 #30
0
 public function remoteinstall()
 {
     $url = $this->_get('url');
     if ($ext != '.zip') {
         //兼容旧版本
         $url = xbase64_decode($url);
         $ext = strtolower(strrchr($url, '.'));
         $filepath = ltrim(strrchr($url, '/'), '/');
         if ($ext != '.zip') {
             $this->error('远程文件格式必须为.zip');
         }
     }
     $content = fopen_url($url);
     if (empty($content)) {
         $this->assign('waitSecond', 20);
         $this->error('远程获取文件失败!,<a href="' . $url . '" target="_blank">本地下载安装</a>');
     }
     $filename = substr($filepath, 0, -4);
     //检测是否已经安装
     $model = M('arcmodel');
     $id = $model->order('id desc')->getField('id') + 1;
     if ($model->where("nid='" . $filename . "'")->find()) {
         $this->error('系统已安装当前模型!');
     }
     //获取数据并解压缩
     $tplpath = './Public/Model/' . $filename;
     File::write_file($filepath, $content);
     import('ORG.PclZip');
     $zip = new PclZip($filepath);
     $zip->extract(PCLZIP_OPT_PATH, $tplpath);
     //删除压缩包
     @unlink($filepath);
     //导入数据
     $sqlfile = $tplpath . '/data.sql';
     if (is_file($sqlfile)) {
         $sql = explode('###', strtr(File::read_file($sqlfile), array('#@__' => C('DB_PREFIX'), '__LINE__' => $id)));
         foreach ($sql as $v) {
             $model->execute(trim($v));
         }
     }
     //刷新缓存
     jump(U('Arcmodel/over'));
 }