コード例 #1
0
ファイル: view.php プロジェクト: w3hacker/queryphp
 public function fetch($viewfile = '', $display = false)
 {
     $content = "";
     if (!I("view")) {
         //检查有没有自己设置的主题
         if (isset($GLOBALS['config']['theme']) && file_exists($GLOBALS['config']['theme'] . "/" . $viewfile . ".php")) {
             $viewfile = $GLOBAL['config']['theme'] . "/" . $viewfile . ".php";
         } elseif (file_exists(P("webprojectpath") . "view/" . $viewfile . ".php")) {
             $viewfile = P("webprojectpath") . "view/" . $viewfile . ".php";
         } elseif (file_exists(P("webprojectpath") . "view/" . C("router")->controller . "/" . $viewfile . ".php")) {
             $viewfile = P("webprojectpath") . "view/" . C("router")->controller . "/" . $viewfile . ".php";
         } elseif (file_exists(P("viewpath") . "view/" . $viewfile . ".php")) {
             $viewfile = P("viewpath") . "view/" . $viewfile . ".php";
         } elseif (file_exists(P("viewpath") . "view/" . C("router")->controller . "/" . $viewfile . ".php")) {
             $viewfile = P("viewpath") . "view/" . C("router")->controller . "/" . $viewfile . ".php";
         }
         ob_start();
         ob_implicit_flush(0);
         extract($this->vvar, EXTR_OVERWRITE);
         include $viewfile;
         $content = ob_get_clean();
     } elseif (I("view") == "Smarty") {
         $Smarty = C("Smarty");
         $Smarty->assign($this->vvar);
         $content = $Smarty->fetch($viewfile);
     }
     return $content;
 }
コード例 #2
0
ファイル: waterimg.class.php プロジェクト: w3hacker/queryphp
 function __construct($path = "", $waterfilname = 'site_water.png', $width = 120, $height = 25)
 {
     $this->waterpath = $path ? $path : P("frameworkpath") . "config/";
     $this->waterfilename = $waterfilname;
     $this->width = $width;
     $this->height = $height;
     $this->bgcolor = '#F0F0F0';
 }
コード例 #3
0
ファイル: common.php プロジェクト: steem/qwp
function initialize_request()
{
    global $MODULE, $PAGE, $OP, $F, $S;
    $MODULE = P('m');
    $PAGE = P('p');
    $OP = P('op');
    $F = P('f', array());
    $S = P('s', array());
}
コード例 #4
0
ファイル: mylog.php プロジェクト: w3hacker/queryphp
 public function __construct($message, $code = 0)
 {
     // 自定义的代码
     // 确保所有变量都被正确赋值
     parent::__construct($message, $code);
     ob_start();
     print_r($GLOBALS);
     $str = "\n-----------------------------------" . $this->getCode() . "----------------------------------------\n";
     file_put_contents(P("frameworkpath") . "log/" . date("Y_m_d") . ".txt", $str . ob_get_clean() . $this->__toString() . $str, FILE_APPEND);
 }
コード例 #5
0
ファイル: ops_edit.php プロジェクト: steem/qwp
function edit_user(&$msg, &$data)
{
    global $F;
    $id = P('id');
    if (!$id || $id == '1') {
        return false;
    }
    // just for demo of file upload
    unset($F['avatar']);
    db_update('qwp_user')->fields($F)->condition('id', $id)->execute();
    $msg = L('Save user info successfully');
}
コード例 #6
0
 protected function search($e)
 {
     $q = $this->post->textVal('txtQuery');
     // load remote html page
     $url = $this->url . urlencode($q);
     $searchPage = new RaxanWebPage($url);
     // find the search titles (h3)
     $titles = $searchPage->find('h3');
     $html = '';
     foreach ($titles->get() as $node) {
         $html .= '<div class="bmm">' . P($node)->html() . "</div>\n";
         //
     }
     $this->result->html($html);
 }
コード例 #7
0
ファイル: table_ops_list.php プロジェクト: steem/qwp
function list_users(&$msg, &$data)
{
    $r = intval(S('r', 0));
    $page = intval(P('page', 1));
    $page_size = intval(P('psize', 30));
    $page *= $page_size;
    $data['total'] = 5 * $page_size;
    $data['data'] = array();
    for ($i = 0; $i < $page_size; ++$i) {
        if ($i < $r) {
            continue;
        }
        $data['data'][] = array('id' => $i, 'name' => 'Test ' . ($i + $page - $page_size + 1), 'age' => rand(10, 30), 'phone' => random_string());
        usleep(30000);
    }
}
コード例 #8
0
ファイル: ChannelChatCheck.php プロジェクト: svn2github/ybtx
function Main()
{
    $now = Date("Y-m-d H:i:s");
    P($now . "==============================\n");
    global $tbl_gm_db, $tbl_serv_db, $tbl_game_server;
    $str = "(";
    $qs = "select * from tbl_channel_word";
    $result = MySQLQuery($qs, "GMS");
    $words = array();
    while ($row = mysql_fetch_row($result)) {
        array_push($words, "lcc.lcc_sMsg like '%" . $row[0] . "%'");
    }
    $str .= implode(" or ", $words);
    $str .= ")";
    P("Number of Check Word: " . count($words) . "\n");
    $qs = "select gv_value from tbl_gm_variable where gv_name = 'ChannelChatStemp'";
    $result = MySQLQuery($qs, "GMS");
    if ($row = mysql_fetch_row($result)) {
        P("Last updated at: " . $row[0] . "\n");
        $str .= " and lcc.lcc_dtChatTime > '" . $row[0] . "' and lcc.lcc_dtChatTime <= '" . $now . "'";
    }
    $qs = "update tbl_gm_variable set gv_value = '" . $now . "' where gv_name = 'ChannelChatStemp'";
    MySQLQuery($qs, "GMS");
    foreach ($tbl_serv_db as $key => $dbinfo) {
        P("Server: " . $key . "\t");
        $insert = array();
        $qs = "select lcc.cs_uId,lcc.lcc_dtChatTime,{$key} as serv_id,lcc.lcc_sMsg,lcc.lcc_sChannelName from tbl_log_channel_chat lcc where " . $str;
        $result = MySQLQuery($qs, "GameLog", $key);
        while ($row = mysql_fetch_row($result)) {
            $qs = "select c.c_sName, us.us_sName from tbl_char c, tbl_char_static cs, tbl_user_static us where c.cs_uId = cs.cs_uId and cs.us_uId = us.us_uId and cs.cs_uId = " . $row[0];
            $rs = MySQLQuery($qs, "Game", $key);
            if ($r = mysql_fetch_row($rs)) {
                $row[0] = $r[0];
                $user_name = $r[1];
            } else {
                $row[0] = "[" . $row[0] . "]";
            }
            array_push($insert, "insert into tbl_channel_chat values('" . $row[0] . "','" . $row[3] . "','" . $row[1] . "','" . Local2UTF8($row[4]) . "'," . $row[2] . ",'" . $user_name . "')");
        }
        P("Number of Chat: " . count($insert) . "\n");
        foreach ($insert as $query) {
            MySQLQuery($query, "GMS");
        }
    }
}
コード例 #9
0
ファイル: ops_list.php プロジェクト: steem/qwp
function list_users(&$msg, &$data)
{
    get_user_data_modal($user_modal);
    $user_id = P('id');
    $options = array('data modal' => $user_modal, 'left join' => array(array('qwp_role', 'r', 'r.id=u.role')), 'where' => 'u.id<>1 and role<>1');
    if ($user_id) {
        $data = array();
        if ($user_id != '1' && is_digits($user_id)) {
            $options['where'] .= ' and u.id=' . $user_id;
            qwp_db_get_data(array('qwp_user', 'u'), $data, null, $options);
        }
    } else {
        $options['default order'] = array('role', array('id', 'desc'));
        $options['search condition'] = array('condition' => array('fields' => array('u.name' => 'like', 'avatar' => 'set_avatar_condition', 'gender' => array('s' => array('<>', 'x'))), 'condition' => array('op' => 'or', 'fields' => array('phone' => 'like', 'account' => 'like', 'email' => 'like', 'name' => 'like'))));
        $options['search converter'] = 'convert_search_data';
        qwp_db_retrieve_data(array('qwp_user', 'u'), $data, $options);
    }
}
コード例 #10
0
ファイル: imgcode.class.php プロジェクト: w3hacker/queryphp
 public function encode()
 {
     Header("Content-type: image/PNG");
     $str = array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D', 4 => 'E', 5 => 'F', 6 => 'G', 7 => 'H', 8 => 'K', 9 => 'N', 10 => 'M', 11 => 'P', 12 => 'R', 13 => 'S', 14 => 'T', 15 => 'U', 16 => 'V', 17 => 'W', 18 => 'X', 19 => '2', 20 => '3', 21 => '4', 22 => '5', 23 => '6', 24 => '7', 25 => '8', 26 => '9');
     $image_x = 140;
     $image_y = 80;
     $im = imagecreate($image_x, $image_y);
     $fnt = P("frameworkpath") . "config/mask.TTF";
     //显示的字体样式
     $white = imagecolorallocate($im, rand(100, 160), rand(100, 160), rand(100, 160));
     imagearc($im, 150, 8, 20, 20, 75, 170, $white);
     imagearc($im, 180, 7, 50, 30, 75, 175, $white);
     imageline($im, 20, 20, 180, 30, $white);
     imageline($im, 20, 18, 170, 50, $white);
     imageline($im, 25, 50, 80, 50, $white);
     $noise_num = 50;
     $line_num = 80;
     $font_color[0] = imagecolorallocate($im, 0xa5, 0x20, 0xb5);
     $font_color[1] = imagecolorallocate($im, 0x60, 0xb0, 0xc5);
     $font_color[2] = imagecolorallocate($im, 0x0, 0xe0, 0x70);
     $font_color[3] = imagecolorallocate($im, 0x90, 0x0, 0x70);
     $rectangle_color = imagecolorallocate($im, 0x80, 0x80, 0x80);
     $noise_color = imagecolorallocate($im, 0x0, 0x0, 0x0);
     $line_color = imagecolorallocate($im, 0x80, 0x80, 0x40);
     $n = rand(0, 3);
     for ($i = 0; $i < $noise_num; $i++) {
         imagefilledellipse($im, mt_rand(0, $image_x), mt_rand(0, $image_y), rand(3, 8), rand(3, 8), $font_color[$n]);
         imageline($im, mt_rand(0, $image_x), mt_rand(0, $image_y), mt_rand(0, $image_x), mt_rand(0, $image_y), $line_color);
     }
     $s = '';
     for ($i = 0; $i < 5; $i++) {
         $n = rand(0, 26);
         $str3 = $str[intval($n)];
         $s .= $str3;
         $fix = rand(0, 1) ? '-' : '';
         imagettftext($im, rand(24, 32), $fix . rand(10, 30), 25 * $i + 10, rand(30, 50), $font_color[rand(0, 2)], $fnt, $str3);
     }
     $_SESSION['verifier'] = $s;
     ImagePNG($im);
     ImageDestroy($im);
 }
コード例 #11
0
ファイル: _While.29.php プロジェクト: exakat/exakat
function O()
{
    $e = P($b['Q']);
    $f = R($e);
    $g = "S{$eT}{$eU}{$eV}";
    $h = W($g);
    if (!$h) {
        X(Y());
        return $this->E();
    }
    if (!AA($h)) {
        AB('AC');
        return $this->E();
    } else {
        $i = <<<AE
AF{$b['Q']}AH
AE;
        while ($j = AI($h)) {
            $g = "AJ{$j['AK']}AL";
            $k = W($g);
            $l = AI($k);
            $i .= <<<AO
AP
AO;
            if ($j['AQ']) {
                $i .= "AR{$j['AQ']}AU";
            }
            if ($j['AQ'] == 0) {
                if ($j['AW'] != 0) {
                    $i .= "AX{$l['AY']}AZ{$j['BA']}BB{$j['BC']}BD";
                } else {
                    $i .= "AX{$l['AY']}AZ{$j['BA']}BB{$j['BJ']}BK{$j['BL']}BM{$j['BN']}BD";
                }
            }
            $i .= 'BP';
        }
        return $i . $this->E();
    }
}
コード例 #12
0
ファイル: setting.php プロジェクト: cloverink/lotto
        $bank = P("bank");
        $txtWithdraw = P("txtDeposit");
        $txtDTWithdraw = P("txtDTWithdraw");
        $trans = Trans::getInstance();
        $ret = $trans->saveWithdraw($txtWithdraw, $txtDTWithdraw, $bank);
        if ($ret == -1) {
            array_push($errmsg, "รายการนี้ได้มีการแจ้งเข้ามาแล้ว กรุณารอผู้ดูแลยืนยันข้อมูลสักครู่ค่ะ");
        } elseif ($ret == -2) {
            array_push($errmsg, "จำนวนเงินที่ถอนมีมากกว่าเงินในระบบ");
        } elseif ($ret == -3) {
            array_push($errmsg, "รายการที่เรียกขอเข้ามา มีจำนวนมากกว่าเงินในระบบ ท่านต้องยกเลิกรายการเก่าเสียก่อน");
        } else {
            array_push($sucmsg, "ได้รับการแจ้งถอนเงินเข้ามาแล้ว กรุณารอสักครู่ ระบบกำลังดำเนินการ");
        }
    } elseif ($submit == "frmBankWithdrawCancel") {
        $tid = P("tid");
        $ret = Trans::getInstance()->setWithdrawCancelByOwn($tid);
        if ($ret == 1) {
            array_push($sucmsg, "ยกเลิกรายการเสร็จสมบูรณ์");
        } elseif ($ret == -1) {
            array_push($errmsg, "ทำรายการไม่สมบูรณ์");
        }
    }
} elseif (REQUEST_METHOD == "GET" && isset($_SESSION["FB_TOKEN"])) {
    $data = file_get_contents("https://graph.facebook.com/v2.5/me?fields=name,email,picture&access_token=" . $_SESSION["FB_TOKEN"]);
    $data = json_decode($data, true);
    $fbid = $data["id"];
    $fbtoken = $_SESSION["FB_TOKEN"];
    $user = (new Users())->getCurrentUser();
    $ret = $user->fbConnect($fbid, $fbtoken);
    if ($ret == 1) {
コード例 #13
0
ファイル: reset.php プロジェクト: cloverink/lotto
<?php

$errmsg = array();
$sucmsg = array();
$complete_flag = false;
$token = G("token");
if (empty($token)) {
    array_push($errmsg, "การทำรายการไม่ถูกต้อง");
}
if (REQUEST_METHOD == "POST") {
    $retoken = P("retoken");
    $txtPassword1 = P("txtPassword1");
    $txtPassword2 = P("txtPassword2");
    if (empty($retoken)) {
        array_push($errmsg, "การทำรายการไม่ถูกต้อง กรุณาเริ่มทำรายการใหม่");
    }
    if (strlen($txtPassword1) == 0) {
        array_push($errmsg, "กรุณาใส่รหัสผ่าน");
    }
    if ($txtPassword1 !== $txtPassword2) {
        array_push($errmsg, "รหัสผ่านไม่ตรงกัน");
    }
    // no error then reset email
    if (count($errmsg) == 0) {
        $user = new Users();
        $user->resetPassword($txtPassword1, $retoken);
        array_push($sucmsg, "เปลี่ยนรหัสผ่านเสร็จสมบูรณ์");
        logout();
        $complete_flag = true;
    }
}
コード例 #14
0
 /**
  * Returns all relevant library directories of the current gateway module
  *
  * - The lib folder of th current module
  * - The application lib folder
  * - The project lib folder
  * - All lib folders of the installed plugins
  *
  * @return array The array with absolute paths of all lib-folders
  */
 protected function getProjectLibDirectories()
 {
     // get the application lib directories
     $lib_dirs = array();
     $lib_dirs[] = P("frameworkpath") . "lib";
     // get the cross application lib dir (i.e. apps/frontend/lib)
     $lib_dirs[] = P("webprojectpath") . "lib";
     // get the project lib dir
     $lib_dirs[] = P("webprojectpath") . "class";
     $lib_dirs[] = P("frameworkpath") . "class";
     $lib_dirs[] = P("webprojectpath") . "lib/services";
     $lib_dirs[] = P("frameworkpath") . "lib/services";
     // get the plugin lib dirs
     if (isset($GLOBALS['config']['frameworklib']) && is_array($GLOBALS['config']['frameworklib'])) {
         $lib_dirs = array_merge($lib_dirs, $GLOBALS['config']['frameworklib']);
     }
     return $lib_dirs;
 }
コード例 #15
0
ファイル: db.php プロジェクト: steem/qwp
function qwp_db_retrieve_data($table_name, &$data, &$options)
{
    if (isset($options['data modal'])) {
        qwp_db_get_fields_from_modal($options['data modal'], $fields);
        if (isset($options['data modal']['alias'])) {
            if (isset($options['alias'])) {
                copy_from($options['alias'], $options['data modal']['alias']);
            } else {
                $options['alias'] = $options['data modal']['alias'];
            }
        }
    } else {
        $fields = $options['fields'];
    }
    qwp_db_init_order_by($options);
    qwp_db_init_search_params($options);
    qwp_create_query($query, $table_name, $fields, $options);
    $enable_pager = P('enable_pager', true, $options);
    $total = 0;
    if ($enable_pager) {
        $total = qwp_db_calc_data_count($query);
    }
    if (!is_array($data)) {
        $data = array();
    }
    if (isset($data["data"])) {
        $data["total"] = $total + count($data["data"]);
    } else {
        $data["total"] = $total;
        $data["data"] = array();
    }
    if (!$enable_pager || $enable_pager && $total > 0) {
        if ($enable_pager) {
            $data['page'] = qwp_db_set_pager($query, $total);
        }
        $result = $query->execute();
        if (isset($options['data converter'])) {
            $data_converter = $options['data converter'];
            while ($r = $result->fetchAssoc()) {
                $data_converter($r);
                $data["data"][] = $r;
            }
        } else {
            while ($r = $result->fetchAssoc()) {
                $data["data"][] = $r;
            }
        }
        if (!$enable_pager) {
            $data["total"] = count($data["data"]);
        }
    }
}
コード例 #16
0
ファイル: Sequence.74.php プロジェクト: exakat/exakat
<?php

if (!B('C')) {
    exit('D');
}
E('F', G);
@(list($a['H'], $b['I'], $c['J'], $d['K'], $e['L']) = M(N('O', P($f['Q']))));
コード例 #17
0
<?php

include $_SERVER['DOCUMENT_ROOT'] . "/__header.php";
$bgcolor1 = P("bgcolor1", "#fcd903");
$bgcolor2 = P("bgcolor2", "#faa401");
?>

<div id="nav" class="container-fluid">
  <i class="fa fa-angle-right" aria-hidden="true"></i> Code Snippets 
  <i class="fa fa-angle-right" aria-hidden="true"></i> Category Top banner
</div>

<br>


<div class="container wrapper">
  <div class="row">

      <div class="wrapper flashsale" data-countdown='true' data-title="ดีลเด็ด 24 ชั่วโมง"></div>

  </div>
</div>

<br><br>

<div class="container pull-left">
  <div class="row">

  <form method="post">
    <div class="row">
    <div class="col-xs-3">
コード例 #18
0
ファイル: menu.php プロジェクト: cloverink/lzd
<?php

include "__header.php";
include "__nav.php";
?>

<?php 
$topimg = P("topimg", "http://srv-live.lazada.co.th/cms/201602/hsh_Landing_Page.jpg");
$toplink = P("toplink", "http://www.lazada.co.th/home-sweet-home-sale");
$menu = P("menu", "http://srv-live.lazada.co.th/cms/201602/hsh_MO_1.jpg");
$menumo = P("menumo", "http://srv-live.lazada.co.th/cms/201602/hsh_MO_2.jpg");
$links = trim(P("links", "http://www.lazada.co.th/home-sweet-home-sale-sweet-appliances\nhttp://www.lazada.co.th/home-sweet-home-sale-home-living\nhttp://www.lazada.co.th/home-sweet-home-sale-sweet-electronics\nhttp://www.lazada.co.th/home-sweet-home-sale-cameras-gadgets\nhttp://www.lazada.co.th/home-sweet-home-sale-computers-laptops\nhttp://www.lazada.co.th/home-sweet-home-sale-toys-kids-babies\nhttp://www.lazada.co.th/home-sweet-home-sale-movies-games-music\nhttp://www.lazada.co.th/home-sweet-home-sale-indoor-sports"));
list($width, $height, $type, $attr) = getimagesize($menu);
$lines_arr = preg_split('/\\n/', $links);
$num_newlines = count($lines_arr);
?>

<form method="post">

    <div class="panel panel-default container menu">
      <div class="panel-body row">
        
        <div class="col-md-6">

            <div class="form-group">
            <label for="txtTopImage">Top Image</label>
            <input type="text" class="form-control" id="txtTopImage" name="topimg" placeholder="Top Image" value="<?php 
echo $topimg;
?>
">
            </div>
コード例 #19
0
ファイル: req.php プロジェクト: cloverink/lzd
<?php

header('Content-Type: application/json; charset=utf-8');
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include "conn.php";
include "phpQuery.php";
login();
$vocher = req(URL_VOCHER . P("code"));
$data = array();
$doc = phpQuery::newDocument($vocher);
$tr = $doc['".grid tbody tr"'];
foreach ($tr as $o) {
    $td = pq($o)->find("td");
    array_push($data, array('id' => array_pop(explode("/", $td->eq(0)->find("a")->attr("href"))), 'status' => explode(".", array_pop(explode("_", array_pop(explode("/", $td->eq(1)->find("a img")->attr("src"))))))[0], 'code' => $td->eq(2)->text(), 'valid_from' => $td->eq(3)->text(), 'valid_until' => $td->eq(4)->text(), 'created_at' => $td->eq(5)->text(), 'created_by' => $td->eq(6)->text(), 'discount' => $td->eq(7)->text(), 'times' => $td->eq(8)->text(), 'amount' => $td->eq(9)->text(), 'template' => $td->eq(10)->find("a")->text()));
}
echo json_encode($data);
コード例 #20
0
        $this->C = 'N' . O(P($this->C, R($b->C)), 'D');
        break;
    default:
        $c = 'U';
        while ($this->V($b)) {
            $c .= 'W';
            $b = $b->X();
        }
        $this->C = static::Z($c) . 'D' . O(P($this->C, R($b->C)), 'D');
}
switch (B2) {
    case $this->C === 'D':
        $this->C = 'F' . $this->C;
        break;
    case $this->C === $b->C:
        $this->C = 'F';
        break;
    case $this->L($b):
        $this->C = 'N' . O(P($this->C, R($b->C)), 'D');
        break;
    case $this->C === 'D':
        $this->C = 'F' . $this->C;
        break;
    default:
        $c = 'U';
        while ($this->V($b)) {
            $c .= 'W';
            $b = $b->X();
        }
        $this->C = static::Z($c) . 'D' . O(P($this->C, R($b->C)), 'D');
}
コード例 #21
0
 public function adduserimport()
 {
     if (strtolower(substr($_FILES['userfile']['name'], -4)) == '.xls') {
         if (move_uploaded_file($_FILES['userfile']['tmp_name'], P("webprojectpath") . "temp/tempuser.xls")) {
             if (file_exists(P("webprojectpath") . "temp/tempuser.xls")) {
                 $m = M("r.user");
                 date_default_timezone_set('Asia/Shanghai');
                 import('@plugin.Classes.PHPExcel.IOFactory');
                 $objPHPExcel = PHPExcel_IOFactory::load(P("webprojectpath") . "temp/tempuser.xls");
                 $objWorksheet = $objPHPExcel->getActiveSheet();
                 $highestRow = $objWorksheet->getHighestRow();
                 // e.g. 10
                 $highestColumn = $objWorksheet->getHighestColumn();
                 // e.g 'F'
                 $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
                 // e.g. 5
                 $row = 1;
                 $user = array();
                 for ($col = 0; $col < $highestColumnIndex; ++$col) {
                     $user[$col] = $objWorksheet->getCellByColumnAndRow($col, $row)->getValue();
                 }
                 $tmkey = array();
                 //映射字段
                 if (is_array($user)) {
                     foreach ($user as $key => $value) {
                         $value = str_replace(" ", "", trim($value));
                         switch ($value) {
                             case '姓名':
                                 $tmkey['realname'] = $key;
                                 break;
                             case '职务':
                                 $tmkey['job'] = $key;
                                 break;
                             case '性别':
                                 $tmkey['sex'] = $key;
                                 break;
                             case '用户名':
                                 $tmkey['username'] = $key;
                                 break;
                             case '密码':
                                 $tmkey['password'] = $key;
                                 break;
                             case 'email':
                                 $tmkey['email'] = $key;
                                 break;
                             case '电子邮件':
                                 $tmkey['email'] = $key;
                                 break;
                         }
                     }
                     if (empty($tmkey)) {
                         $tmkey['realname'] = 0;
                         $tmkey['job'] = 1;
                         $tmkey['sex'] = 2;
                         $tmkey['username'] = 3;
                         $tmkey['password'] = 4;
                     }
                 }
                 $projectid = $_SESSION['cid'] != '' ? $_SESSION['cid'] : intval($_POST['projectid']);
                 $utable = '';
                 $utable .= '<table width="720" border="0" align="center" cellpadding="2" cellspacing="1" class="forumline">' . "\n";
                 $utable .= '<tr>' . "\n";
                 for ($col = 0; $col <= $highestColumnIndex; ++$col) {
                     $utable .= '<td class="row1">' . $user[$col] . '</td>' . "\n";
                 }
                 $utable .= '</tr>' . "\n";
                 for ($row = 2; $row <= $highestRow; ++$row) {
                     $utable .= '<tr>' . "\n";
                     $user = array();
                     for ($col = 0; $col <= $highestColumnIndex; ++$col) {
                         $user[$col] = $objWorksheet->getCellByColumnAndRow($col, $row)->getValue();
                     }
                     $m->clearEdit();
                     $username = trim($user[$tmkey['username']]);
                     if ($username != '') {
                         $u = $m->where("username='******'")->limit(1)->fetch()->getData();
                         if (isset($u['username']) && $u['username'] == $username) {
                             $username = $username . rand(1000, 9999);
                             $user[$tmkey['username']] = $username;
                         }
                         $m->clearEdit();
                         $m->username = $username;
                         $m->password = md5(trim($user[$tmkey['password']]));
                         $m->realname = trim($user[$tmkey['realname']]);
                         $m->setprojectid($projectid);
                         if (isset($tmkey['email'])) {
                             $m->email = trim($user[$tmkey['email']]);
                         }
                         $m->job = trim($user[$tmkey['job']]);
                         $m->sex = trim($user[$tmkey['sex']]) == '男' ? 1 : 0;
                         $m->save();
                     }
                     for ($col = 0; $col <= $highestColumnIndex; ++$col) {
                         $utable .= '<td>' . $user[$col] . '</td>' . "\n";
                     }
                     $utable .= '</tr>' . "\n";
                 }
                 $utable .= '</table>' . "\n";
                 unlink(P("webprojectpath") . "temp/tempuser.xls");
             } else {
                 redirect(url_for("rbac/userimport"), "读取用户名单出错!", 3);
             }
         } else {
             redirect(url_for("rbac/userimport"), "用户名单文件出错!", 3);
         }
     } else {
         redirect(url_for("rbac/userimport"), "提交用户名单文件有误!", 3);
     }
     $this->utable = $utable;
 }
コード例 #22
0
ファイル: login.php プロジェクト: cloverink/lotto
            $fbid = $data['id'];
            $user = new Users();
            $res = $user->fbAuth($fbid, $_SESSION["FB_TOKEN"]);
            if ($res) {
                header("Location: /");
            } else {
                array_push($errmsg, "ยืนยันตัวตนด้วย Facebook ไม่สมบูรณ์ ไม่พบผู้ใช้ในระบบ");
            }
        } else {
            array_push($errmsg, "ยืนยันตัวตนด้วย Facebook ไม่สมบูรณ์");
        }
    }
    unset($_SESSION["FB_TOKEN"]);
} elseif (REQUEST_METHOD == "POST") {
    $txtEmail = P("txtEmail");
    $txtPassword = P("txtPassword");
    $rememberMe = isset($_POST["rememberme"]);
    if (!validateEmail($txtEmail)) {
        array_push($errmsg, "รูปแบบ email ไม่ถูกต้อง");
    }
    if (strlen($txtPassword) == 0) {
        array_push($errmsg, "กรุณาใส่รหัสผ่าน");
    }
    if (count($errmsg) == 0) {
        $user = new Users();
        $res = $user->Auth($txtEmail, $txtPassword, $rememberMe);
        if ($res) {
            header("Location: /");
        } else {
            array_push($errmsg, "Email หรือ รหัสผ่านไม่ถูกต้อง");
        }
コード例 #23
0
ファイル: api.php プロジェクト: JasonLeemz/CatDoc
 public function delete()
 {
     $id = P('id');
     $where = "id={$id}";
     $this->model->delete($where);
 }
echo P($data['firstname']);
?>
 <?php 
echo P($data['lastname']);
?>
</li>
    <li>email: <?php 
echo P($data['email']);
?>
</li>
    <li>access key: <b><?php 
echo P($data['accessKey']);
?>
</b></li>
    <li>number of persons total: <?php 
echo P($data['nPersons']);
?>
</li>
    <li>need WiFi access: <?php 
echo B($data['needInet']);
?>
</li>
    <li>is veggie: <?php 
echo B($data['isVeggie']);
?>
</li>
    <li>is walking impaired: <?php 
echo B($data['isImpaired']);
?>
</li>
    <li>looks for room mates: <?php 
コード例 #25
0
ファイル: config.php プロジェクト: badxchen/KODExplorer
    }
    if ($_SERVER['HTTPS'] === 1) {
        //Apache
        return true;
    } elseif ($_SERVER['HTTPS'] === 'on') {
        //IIS
        return true;
    } elseif ($_SERVER['SERVER_PORT'] == 443) {
        //其他
        return true;
    }
    return false;
}
define('WEB_ROOT', $web_root);
define('HOST', (is_HTTPS() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/');
define('BASIC_PATH', P(dirname(dirname(__FILE__))) . '/');
define('APPHOST', HOST . str_replace(WEB_ROOT, '', BASIC_PATH));
//程序根目录
define('TEMPLATE', BASIC_PATH . 'template/');
//模版文件路径
define('CONTROLLER_DIR', BASIC_PATH . 'controller/');
//控制器目录
define('MODEL_DIR', BASIC_PATH . 'model/');
//模型目录
define('LIB_DIR', BASIC_PATH . 'lib/');
//库目录
define('FUNCTION_DIR', LIB_DIR . 'function/');
//函数库目录
define('CLASS_DIR', LIB_DIR . 'class/');
//内目录
define('CORER_DIR', LIB_DIR . 'core/');
コード例 #26
0
ファイル: home.php プロジェクト: steem/qwp
<?php

if (!defined('QWP_ROOT')) {
    exit('Invalid Request');
}
?>
<div class="container">
    <form class="form-signin" method="post" action="<?php 
echo qwp_uri_current_ops('login');
?>
">
        <input type="hidden" name="dsturl" value="<?php 
echo P('dsturl');
?>
">
        <h2>Please sign in ...</h2>
        <label for="inputEmail" class="sr-only">Email address</label>
        <input type="text" name="f[user]" id="inputEmail" class="form-control" placeholder="Email address" value="*****@*****.**">
        <label for="inputPassword" class="sr-only">Password</label>
        <input type="password" name="f[pwd]" id="inputPassword" class="form-control" placeholder="Password" value="123Qwe">
        <div class="checkbox">
            <label>
                <input type="checkbox" value="remember-me"> Remember me
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
    </form>

</div> <!-- /container -->
コード例 #27
0
ファイル: verify.php プロジェクト: cloverink/lotto
<?php

include "../conf/conn.php";
$_SESSION['verify'] = array();
$_SESSION['verify']["error"] = array();
if (REQUEST_METHOD != "POST") {
    header("Location: /verify");
}
$txtPassword = trim(P("txtPassword"));
$txtPassword2 = trim(P("txtPassword2"));
$v = trim(P("v"));
if (empty($txtPassword)) {
    $_SESSION['verify']["error"]["txtPassword"] = "******";
}
if (empty($txtPassword2)) {
    $_SESSION['verify']["error"]["txtPassword2"] = "กรุณายืนยันรหัสผ่าน";
}
if (!empty($txtPassword) && !empty($txtPassword2)) {
    if ($txtPassword != $txtPassword2) {
        $_SESSION['verify']["error"]["txtPassword2"] = "รหัสผ่านไม่ตรงกัน";
    }
}
$_SESSION['verify']["txtPassword"] = $txtPassword;
if (count($_SESSION['verify']["error"]) > 0) {
    header("Location: /verify?v={$v}");
    exit;
}
//////////////////////// PASS
unset($_SESSION['verify']);
$sql = "select *, md5(concat(' ', email)) ver FROM `usr` having ver = '{$v}'";
$res = mysql_query($sql);
コード例 #28
0
ファイル: function.php プロジェクト: greatwhole/myspace
function PD($string)
{
    P($string);
    die;
}
コード例 #29
0
ファイル: login.php プロジェクト: cloverink/lotto
<?php

include "../conf/conn.php";
$_SESSION['login'] = array();
$_SESSION['login']["error"] = array();
if (REQUEST_METHOD != "POST") {
    header("Location: /login");
}
$txtEmail = trim(P("txtEmail"));
$txtPwd = trim(P("txtPwd"));
$rememberMe = P("rememberMe");
if (empty($txtEmail)) {
    $_SESSION['login']["error"]["txtEmail"] = "กรุณากรอก Email";
} else {
    if (filter_var($txtEmail, FILTER_VALIDATE_EMAIL) === false) {
        $_SESSION['login']["error"]["txtEmail"] = "Email ไม่ถูกต้อง";
    }
}
if (empty($txtPwd)) {
    $_SESSION['login']["error"]["txtPwd"] = "กรุณากรอกรหัสผ่าน";
}
if (!empty($txtEmail) && !empty($txtPwd)) {
    $pwd = md5("{$txtEmail} {$txtPwd}");
    $pww = base64_encode($pwd);
}
exit;
$_SESSION['login']["txtEmail"] = $txtEmail;
if (count($_SESSION['login']["error"]) > 0) {
    header("Location: /login");
    exit;
}
<h2>Payment Instructions</h2>

<p>
    Please transfer the registration fee of <b>CHF <?php 
echo P($data["price"]);
?>
.&mdash;</b> with bank transfer.
</p>
<p>
    To:<br>
    Rechnungswesen der Universitat Zurich<br>
    LISA Symposium<br>
    8057 Zurich <br>
    IBAN-Nr.: CH12 0900 0000 3109 1810 4<br>
    Swift/BIC: POFICHBEXXX
</p>
<p>
    From / Message: <?php 
echo sprintf('%03d', intval($data["id"]));
?>
 <?php 
echo P($data["lastname"]);
?>
</p>