Exemplo n.º 1
0
 function weixin_login()
 {
     global $_G;
     //微信登录需要开发者 有进行开发者认证才能继续...
     $redirect_uri = urlencode($_G['siteurl']);
     if (!$_G[setting][weixin_appkey] || !$_G[setting][weixin_appsecret]) {
         msg('抱歉,站点未开启微信登录', 'error', 'm=member&a=login');
     }
     $appid = $_G['setting']['weixin_appkey'];
     $appsecret = $_G['setting']['weixin_appsecret'];
     if (isset($_GET['code']) && isset($_GET['state'])) {
         if ($_SESSION['weixin_state_key'] != $_GET['state']) {
             msg('抱歉,CSRF验证失败');
         }
         //get token
         $code = trim_html($_GET['code']);
         $token_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $appid . "&secret=" . $appsecret . "&code=" . $code . "&grant_type=authorization_code";
         $rs = fetch($token_url);
         if (!$rs) {
             msg('接口验证失败');
         }
         $data = json_decode($rs, 1);
         if ($data['errcode'] > 0 && $data['errmsg']) {
             msg($data['errmsg']);
         }
         $user_id = $data['openid'];
         //针对开发者用户唯一id
         //获取用户信息
         $url = 'https://api.weixin.qq.com/sns/userinfo?access_token=' . $data['access_token'] . '&openid=' . $user_id;
         $rs1 = fetch($url);
         if (!$rs1) {
             msg('获取用户信息失败');
         }
         $info = json_decode($rs1, 1);
         if ($info['errcode'] > 0 && $info['errmsg']) {
             msg($info['errmsg']);
         }
         $arr = array();
         $arr[login_id] = $info[unionid];
         //用户的唯一ID
         $arr[address] = $info[province] . $info[city];
         $arr[username] = $info[nickname];
         $arr[set] = intval($info[sex]);
         $arr[groupid] = 23;
         $arr[login_name] = 'weixin';
         $arr[picurl] = $info[headimgurl];
         $this->login_callback($arr);
     } else {
         if ($_GET['state'] && !$_GET['code']) {
             msg('授权取消');
         }
     }
     $state_key = authcode('weixin_login', 'ENCODE');
     //防止crfs攻略的随机字符串
     $_SESSION['weixin_state_key'] = $state_key;
     $start_url = "https://open.weixin.qq.com/connect/qrconnect?appid={$appid}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_login&state=" . $state_key . "#wechat_redirect";
     _header("Location:" . $start_url);
 }
Exemplo n.º 2
0
function home()
{
    if (!empty($_GET)) {
        return _header('Location: /', 301);
    }
    $html_title = 'workerman 一个高性能的PHP Socket 服务器框架';
    $html_keywords = 'workerman, php socket';
    $html_desc = 'Workerman是一款纯PHP开发的开源高性能的PHP socket服务器框架。支持TCP长连接,支持Websocket等诸多协议。被广泛的用于手机app、手游服务端、网络游戏服务器、聊天室、硬件通讯、智能家居、车联网、物联网等领域的开发。';
    $html_nav = 'home';
    $download_workerman_count_key = 'download_workerman_count';
    $workerman_download_count = \WorkerMan\Lib\Store::get($download_workerman_count_key);
    include NET_ROOT . '/Views/header.tpl.php';
    include NET_ROOT . '/Views/home.tpl.php';
    include NET_ROOT . '/Views/footer.tpl.php';
}
Exemplo n.º 3
0
 function dourl()
 {
     $id = (int) $_GET['id'];
     $mid = (int) $_GET['mid'];
     $__TABLE__ = 'article';
     if ($mid) {
         $model = $this->iCMS->getCache('system/models.cache', $mid);
         $__TABLE__ = $model['tbn'];
     }
     $rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__" . $__TABLE__ . "` WHERE `id`='{$id}'", ARRAY_A);
     include iPATH . 'include/forum.class.php';
     $forum = new forum();
     $F = $forum->forum[$rs['fid']];
     $iurl = $this->iCMS->iurl($mid ? 'content' : 'show', array($rs, $F));
     if (stristr($iurl->href, $mid ? 'content.php' : 'show.php')) {
         $iurl->href = '../' . $iurl->href;
     }
     _header($iurl->href);
 }
Exemplo n.º 4
0
function header_404()
{
    _header('HTTP/1.1 404 Not Found');
    //_header('location: /404.html');
    $sys = explode('/', $_SERVER['SERVER_SOFTWARE']);
    $c404 = "<html>\n<head><title>404 Not Found</title></head>\n<body bgcolor='#fff'>\n<center><h1>404 Not Found</h1></center>\n<hr><center>" . $sys[0] . "</center>\n</body>\n</html>";
    echo $c404;
    exit;
}
Exemplo n.º 5
0
 $temparr = array('forward' => rawurlencode($forward));
 if ($mode == 'js') {
     js_write(template(empty($curuser->info['mid']) ? 'jslogin' : 'jsloginok', $temparr));
     mexit();
 } else {
     if ($enable_pptin && !empty($pptin_url) && $pptin_login) {
         $url = $pptin_url . $pptin_login;
         $url .= (strpos($url, '?') ? '&' : '?') . "{$getval}=" . rawurlencode($forward);
         header('location:' . $url);
         exit;
     }
     if (empty($_sys) && ($html = template('login', $temparr))) {
         mexit($html);
     } else {
         include_once M_ROOT . "./include/cheader.inc.php";
         _header(lang('memberlogin'));
         $cookiedef = '1m';
         $cookiearr = array('0' => lang('inbrowser'), '1h' => '1' . lang('hours'), '1d' => '1' . lang('days'), '1w' => '1' . lang('weeks'), '1m' => '1' . lang('month'), '-1' => lang('saveforever'));
         echo '<form name="cmslogin" id="cmslogin" method="post" action="?forward=' . rawurlencode($forward) . ($infloat ? "&infloat={$infloat}&handlekey={$handlekey}" : '') . '" onsubmit="return checklogin(this)">';
         tabheader_e();
         echo '<tr class="header"><td colspan="2"><b>' . lang('memberlogin') . '&nbsp; &nbsp; >><a href="tools/lostpwd.php"' . (empty($infloat) ? '' : " onclick=\"return floatwin('open_{$handlekey}',this)\"") . '>' . lang('getpwd') . '</a></b></td></tr>';
         trbasic(lang('membercname'), 'username');
         trbasic(lang('loginpwd'), 'password', '', 'password');
         tr_regcode('login');
         trbasic('Cookie', 'expires', makeoption($cookiearr, $cookiedef), 'select');
         trhidden('client_t', '');
         $infloat && trhidden('infloat', 1);
         tabfooter('cmslogin', lang('login'));
         mexit('</div></body></html>');
     }
 }
Exemplo n.º 6
0
 */
require_once dirname(__FILE__) . '/config.php';
require_once iPATH . 'include/member.class.php';
switch ($_GET['do']) {
    case 'register':
        $iCMS->assign('config', array('seccode' => $iCMS->config['userseccode']));
        $iCMS->assign('forward', __REF__);
        $iCMS->iPrint("usercp/register.htm", "register");
        break;
    case 'agreement':
        $iCMS->assign('config', array('agreement' => str_replace("\n", "<br />", $iCMS->config['agreement'])));
        $iCMS->iPrint("usercp/agreement.htm", "agreement");
        break;
    case 'login':
        if (member::checklogin(true)) {
            _header($iCMS->config['usercpURL']);
        }
        $iCMS->assign('config', array('seccode' => $iCMS->config['userseccode']));
        $iCMS->assign('forward', __REF__);
        $iCMS->iPrint("usercp/login.htm", "login");
        break;
    case 'logout':
        member::cleancookie();
        break;
    default:
        require_once iPATH . 'include/UI.class.php';
        $action = $_POST['action'];
        //$forward= $_POST['forward'];
        if ($action == 'register') {
            ckseccode($_POST['seccode'], 'U') && javascript::json('seccode', 'error:seccode');
            $username = dhtmlspecialchars($_POST['username']);
Exemplo n.º 7
0
         _aenter($_da, 1);
         @extract($btags);
         extract($_da, EXTR_OVERWRITE);
         tpl_refresh($tplname);
         @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
         $_content = ob_get_contents();
         ob_clean();
         mexit($_content);
     }
 } else {
     load_cache('mlfields');
     include_once M_ROOT . "./include/fields.cls.php";
     include_once M_ROOT . "./include/upload.cls.php";
     include_once M_ROOT . "./include/cheader.inc.php";
     include_once M_ROOT . "./include/mcuedit.cls.php";
     $inajax ? aheader() : _header();
     if (!empty($mcommu['setting']['norepeat']) && ($cid = $db->result_one("SELECT cid FROM {$tblprefix}mflinks WHERE mid='{$mid}' AND fromid='{$memberid}' ORDER BY cid"))) {
         mcmessage('dorepeataddflink', axaction(2, M_REFERER));
     }
     $db->query("INSERT INTO {$tblprefix}mflinks SET\n\t\t\tmid='{$mid}',\n\t\t\tmname='" . $actuser->info['mname'] . "',\n\t\t\tfromid='{$memberid}',\n\t\t\tfromname='" . $curuser->info['mname'] . "',\n\t\t\tcreatedate='{$timestamp}'\n\t\t\t");
     if ($cid = $db->insert_id()) {
         $uedit = new cls_mcuedit();
         $uedit->read($cid, 'flink');
         foreach (array('fields') as $var) {
             ${$var} =& $uedit->{$var};
         }
         $c_upload = new cls_upload();
         $fields = fields_order($fields);
         $a_field = new cls_field();
         foreach ($fields as $k => $v) {
             if (!$v['isfunc'] && !$v['isadmin']) {
Exemplo n.º 8
0
 public function main()
 {
     global $_G;
     $aid = $_GET['aid'] ? $_GET['aid'] : get_goods_id($_GET['itemid']);
     if ($aid && $aid < 1) {
         msg('抱歉ID不存在');
     }
     if ($_GET['aid']) {
         $aid = intval($aid);
         $goods = D(array('and' => "aid = " . $aid, 'limit' => 1, 'all' => true, 'key' => 'goods_' . $aid));
     } else {
         $goods = D(array('and' => "num_iid = '{$aid}'", 'limit' => 1, 'all' => true, 'key' => 'goods_' . $aid));
     }
     if ($goods['status'] == 0 || $goods['status'] == 2) {
         msg('抱歉,当前商品 ' . $goods[status_text] . ' 暂时无法查看');
     }
     if ($_G[mobile]) {
         $url = URL . 'a=go_pay&num_iid=' . $goods[num_iid];
         _header("Location:" . $url);
     }
     $update = array();
     if ($goods['aid'] > 0) {
         if (!$goods[keywords]) {
             $keyword = get_keywords($goods['title'] . $goods['ly']);
             if ($keyword) {
                 $goods[keywords] = $keyword;
                 $update[keywords] = $keyword;
             }
         }
     }
     if ($goods['fid']) {
         $channel = $_G['all_channel']['k' . $goods[fid]];
     }
     $tpl = '';
     if ($channel) {
         $tpl = trim($channel['goods_tpl']);
     }
     $_G['channel'] = $channel;
     if ($goods[fid]) {
         $_G[fid] = $goods[fid];
     }
     if ($_G['setting']['get_message'] && !$goods['message']) {
         $message = top('m_taobao', 'get_message', $goods[num_iid]);
         if ($message) {
             $goods['message'] = $message;
             $update['message'] = $message;
         }
     }
     $up = D(array('and' => ' AND aid <' . $goods['aid'], 'table' => 'goods', 'order' => 'aid DESC'));
     $down = D(array('and' => ' AND aid >' . $goods['aid'], 'table' => 'goods', 'order' => 'aid ASC'));
     $goods[up] = $up[id] ? '<a href="' . $up[id_url] . '">' . $up[title] . '</a>' : '没有了';
     $goods[down] = $down[id] ? '<a href="' . $down[id_url] . '">' . $down[title] . '</a>' : '没有了';
     $this->add(array('goods' => $goods, 'up' => $up, 'down' => $down));
     if ($goods['aid'] > 0 && $update) {
         $update[views] = $goods['views'] + 1;
         DB::update('goods', $update, 'aid=' . $goods['aid']);
     }
     save_history(__CLASS__, $goods['aid']);
     $title = $goods['seo_title'] ? $goods['seo_title'] : $goods['title'];
     seo($title, $goods['keywords'], $goods['description']);
     $this->show($tpl);
 }
Exemplo n.º 9
0
function _setcookie($name, $value = null, $expire = null, $path = null, $domain = null, $secure = null, $httponly = null)
{
    global $SERVER;
    $out = @setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
    if ($out === false) {
        // TODO: Handle $domain, $secure and $httponly
        if (!($expire > 0)) {
            $expire = time() + 60 * 60 * 24;
        }
        // 1 day default cookie duration
        $datetime = new DateTime(date("Y-m-d H:i:s", $expire));
        $cookie_time = $datetime->format(DATE_COOKIE);
        if ($path == null) {
            $path = "/";
        }
        if ($domain == null) {
            $domain = $SERVER['domain'];
        }
        $ret .= "Set-Cookie: " . urlencode($name) . "=" . urlencode($value) . "; expires=" . $cookie_time . "; path=" . $path . "; domain=" . $domain . ";";
        _header($ret);
        return true;
    } else {
        return true;
    }
}
Exemplo n.º 10
0
<?php

/**
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
require_once "global.php";
empty($_GET['id']) && exit;
$iCMS->db->query("UPDATE `#iCMS@__article` SET hits=hits+1 WHERE `id` ='" . (int) $_GET['id'] . "' LIMIT 1");
_header(urldecode($_GET['url']));
Exemplo n.º 11
0
						<td colspan="2" align="center"><input type="submit" /></td>
					</tr>
				<table>
			</form>
		</div>
	<?php 
    echo _footer();
    // Create new user, after submiting the form
} elseif ($_GET['act'] == 'createNewUser') {
    $dbControlHandler = new SQLiteDatabase(DB_CONTROL_FILE);
    // Create Users Table
    $dbControlHandler->query("CREATE TABLE users(id INTEGER PRIMARY KEY, username CHAR(60), salt CHAR(10), password CHAR(32), permissions INTEGER);");
    $userName = $_POST['userName'];
    $userPw = $_POST['password'];
    addNewUser($dbControlHandler, $userName, $userPw, GLOBAL_ADMIN);
    $dbTrackHandler = new SQLiteDatabase(DB_TRACK_FILE);
    // Create Tracking Table
    $dbTrackHandler->query("BEGIN;\r\n\t\tCREATE TABLE computers(id INTEGER PRIMARY KEY, name CHAR(250), region INTEGER, x INTEGER, y INTEGER, comment INTEGER, icon CHAR(150), laststatus INTEGER, lastsignal INTEGER);\r\n\t\tCREATE TABLE miscrecords(id INTEGER PRIMARY KEY, name CHAR(250), timestamp INTEGER, recordtype INTEGER, data TEXT);\r\n\t\tCREATE TABLE trackrecords(id INTEGER PRIMARY KEY, name CHAR(250), time INTEGER, status INTEGER);\r\nCREATE TABLE zones(id INTEGER PRIMARY KEY, region_name CHAR(255), region_width INTEGER, region_height INTEGER, region_map_img CHAR(255));\r\n\t\tCOMMIT;");
    echo _header(_('New Database Setup'));
    ?>
		<div id="yui-main">
			<h1>Database Creation Completed!</h1>
			<div>
				<p>The Database Creation Process is completed. Please login to your root account!</p>
			</div>
		</div>
	<?php 
    echo _footer();
} else {
    die('Not Implemented!');
}
Exemplo n.º 12
0
 static function run()
 {
     global $_G;
     $m = 'index';
     $a = 'main';
     if (CURSCRIPT == 'main') {
         $m = 'index';
     } elseif ($_GET['m']) {
         $m = trim($_GET['m']);
     } elseif (isset($_GET['fid']) && $_GET['fid'] > 0) {
         $m = 'channel';
     } elseif (isset($_GET['aid']) && $_GET['aid'] > 0 || isset($_GET['itemid']) && $_GET['itemid'] > 0) {
         $m = 'goods';
     } else {
         $m = defined('IN_ADMIN') ? 'admin' : 'index';
     }
     $a = $_GET['a'] ? $_GET['a'] : 'main';
     if (!preg_match("/^[a-z_]+\$/is", $m)) {
         system_error('system', 'Module String Error');
         return false;
     }
     if (!preg_match("/^[a-z_]+\$/is", $a)) {
         system_error('system', 'Action String Error');
     }
     if (defined('IN_ADMIN') && !$_G[uid]) {
         login();
     }
     $jump_url = '';
     if (defined('IN_ADMIN')) {
         include libfile('config/admin');
         $group = $_G['group'][$_G['member']['groupid']];
         foreach ($menu as $k => $v) {
             $menu[$k]['select'] = 0;
             if (array_key_exists($k, $group[power]) || $_G['adminid'] == 1) {
                 $menu[$k]['select'] = 1;
             }
             foreach ($v['nav'] as $k1 => $v1) {
                 if (array_key_exists($v1['a'], $group[power][$k]) || $_G['member']['groupid'] == 1) {
                     $menu[$k]['nav'][$k1]['select'] = 1;
                     $menu[$k]['select'] = 1;
                     if (!$jump_url) {
                         $jump_url = 'm=' . $k . '&a=' . $v1['a'];
                     }
                 } else {
                     $menu[$k]['nav'][$k1]['select'] = 0;
                 }
             }
         }
         $_G['menu'] = $menu;
         seo('uz-system 后台管理          power by uz-system.com');
         include_once ROOT_PATH . "inc/admin_action/" . $m . ".action.php";
     } else {
         include_once libfile("action/" . $m);
     }
     if ($m == 'list') {
         $mm = '_' . $m;
         if (!class_exists($mm)) {
             system_error('system', 'Module not exists');
         }
         $class = new $mm();
     } else {
         if (!class_exists($m)) {
             system_error('system', 'Module not exists');
         }
         $class = new $m();
     }
     define('CURMODULE', $m);
     if (defined('IN_ADMIN') && $_G[uid] && $_G[member][groupid] != 1) {
         $group = $_G['group'][$_G['member']['groupid']];
         $gid = $_G['member']['groupid'];
         $power = $_G['group'][$gid]['power'];
         $power['login']['logout'] = 1;
         //验证登录进后入台权限
         if ($_G[group][$gid]['login_admin'] != 1) {
             logout();
             _header("Location:" . CURSCRIPT . ".php");
             //system_error('system','您当前用户组无权进入后台');
         }
         //验证后台模块权限
         if (!$power[$m]) {
             if ($m == 'admin' && $a == 'main' && $_G['member']['groupid'] != 1 && $jump_url) {
                 header("Location:" . URL . $jump_url);
                 echo '<script type="text/javascript">window.location.href = "' . URL . $jump_url . '";</script>';
                 exit;
             } else {
                 cpmsg('当前模块您无法进行操作', 'errr', $jump_url);
             }
         }
         if ($a == 'del' && $power[$m]['post'] == 1) {
         } else {
             if ($power[$m][$a] != 1) {
                 cpmsg('当前模块分类您无法进行操作', 'errr', $jump_url);
             }
         }
     }
     if ($a == 'list') {
         $a = '_list';
     }
     if (method_exists($class, $a)) {
         if ($a == '_list') {
             define('CURACTION', "list");
         } else {
             define('CURACTION', $a);
         }
         $class->{$a}();
         unset($class, $a, $power, $m);
     } elseif ($a == 'pages' && $_GET[show]) {
         $tpl = trim($_GET[show]);
         if (!preg_match("/^[a-z_]+\$/is", $tpl)) {
             system_error('system', 'Action String Error');
         }
         define('CURACTION', $tpl);
         $app = new $app();
         $app->show(CURMODULE . '/' . $tpl);
     } else {
         if (!$_G[uid] && defined('IN_ADMIN')) {
             header("Location:index.php");
             echo '<script type="text/javascript">window.location = "index.php";</script>';
             exit;
         }
         system_error('system', 'Action not exists');
     }
 }
function _fiche(&$PDOdb, &$dispatch)
{
    global $db, $conf, $langs;
    llxHeader();
    $form = new TFormCore('auto', 'asset', 'post');
    echo $form->hidden('action', 'save');
    echo $form->hidden('id', $dispatch->fk_object);
    echo $form->hidden('type_object', $dispatch->type_object);
    $object = _header($dispatch->fk_object, $dispatch->type_object);
    $pListe[0] = "Sélectionnez une ligne";
    foreach ($object->lines as $k => &$line) {
        $label = !empty($line->label) ? $line->label : $line->libelle;
        if (empty($label) && !empty($line->desc)) {
            $label = $line->desc;
        }
        $pListe[$line->id] = $k + 1 . '/ ' . $label;
    }
    print count($dispatch->TDispatchAsset) . ' équipement(s) lié(s)<br />';
    ?>
	<table width="100%" class="border">
		<tr class="liste_titre">
			<?php 
    if (GETPOST('type_object') !== 'ticketsup') {
        print '<td>Ligne concernée</td>';
    }
    ?>
			<td>Equipement</td>
			<?php 
    if (!empty($conf->global->USE_LOT_IN_OF)) {
        ?>
<td>Numéro de Lot</td><?php 
    }
    print '<td>DLUO</td>';
    ?>
			<?php 
    if ($conf->global->clinomadic->enabled) {
        ?>
				<td>IMEI</td>
				<td>Firmware</td>
				<?php 
    }
    ?>
			<td>&nbsp;</td>
		</tr>
		
	<?php 
    foreach ($dispatch->TDispatchAsset as $k => &$da) {
        if ($da->to_delete) {
            continue;
        }
        $class = $class == 'pair' ? 'impair' : 'pair';
        ?>
<tr class="<?php 
        echo $class;
        ?>
">
			<?php 
        if (GETPOST('type_object') !== 'ticketsup') {
            echo '<td>' . $pListe[$da->fk_object] . '</td>';
        }
        ?>
			<td><?php 
        echo $da->asset->getNomUrl(1, 0, 1);
        ?>
</td>
			<td><?php 
        echo $da->asset->lot_number;
        ?>
</td>
			<?php 
        if (!empty($conf->global->USE_LOT_IN_OF)) {
            ?>
<td><?php 
            echo $da->asset->dluo ? dol_print_date($da->asset->dluo) : 'N/A';
            ?>
</td><?php 
        }
        ?>
			
			
			
			<?php 
        if ($conf->global->clinomadic->enabled) {
            ?>
				<td>IMEI</td>
				<td>Firmware</td>
				<?php 
        }
        ?>
			<td><?php 
        if ($object->statut == 0 || $type_object == 'contrat') {
            echo '<a href="?action=delete-line&k=' . $k . '&id=' . $object->id . '&type_object=' . $dispatch->type_object . '">' . img_delete() . '</a>';
        }
        ?>
</td>
		</tr>
		
		<?php 
    }
    $formproduct = new FormProduct($db);
    if ($object->statut == 0 || $type_object == 'contrat') {
        ?>
<tr style="background-color: lightblue;">
			<?php 
        if (GETPOST('type_object') !== 'ticketsup') {
            echo '<td>' . $form->combo('', 'TLine[-1][fk_object]', $pListe, '') . '</td>';
        }
        ?>
			<td><?php 
        echo $form->texte('', 'TLine[-1][serial_number]', '', 30);
        ?>
</td>
			<?php 
        if (!empty($conf->global->USE_LOT_IN_OF)) {
            ?>
<td>&nbsp;</td><?php 
        }
        ?>
			<td>&nbsp;</td>
			<?php 
        if ($conf->global->clinomadic->enabled) {
            ?>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<?php 
        }
        ?>
			<td>Nouveau
			</td>
	</tr><?php 
    }
    ?>
	</table>
	<script type="text/javascript">
		$(document).ready(function() {
			    $( "input[name='TLine[-1][serial_number]']" ).autocomplete({
			      source: "<?php 
    echo dol_buildpath('/dispatch/script/interface.php', 1);
    ?>
?get=serial_number",
			      minLength: 1,
			      select: function( event, ui ) {
			        
			      }
			    });
		});
		
			
		</script>
	<?php 
    echo $form->btsubmit($langs->trans('Save'), 'bt_new');
    dol_fiche_end();
    $form->end();
    llxFooter();
}
Exemplo n.º 14
0
  
  </script>
  </div>
DIVMAP;
    echo _footer();
    die;
}
// If this is a request, then construct
// the SQL command.
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $retCacheId = generateStats($_POST);
    header("location: generate-report.php?cache_id={$retCacheId}");
    die;
}
// else, please display the request form.
echo _header("Statistics Generation");
echo <<<DIVMAP
<div id="yui-main">
\t<h2>Report Set-up</h2>
\t
\t<form action="generate-report.php" method="post">
\t<p>
\tPlease generate the report named 
\t\t<input id="reportName" name="reportName" value="Genie"> <br /> <br />
\t\t
\tabout
\t\t<select id="reportType" name="reportType">
\t\t  <option value="computerStats">Computer Availability</option>
\t\t  <option value="programUsage">Program Usage</option>
\t\t</select> <br /> <br />
\t\t
Exemplo n.º 15
0
 function doextractpic()
 {
     Admin::MP("menu_extract_pic");
     include iPATH . 'include/forum.class.php';
     set_time_limit(0);
     $speed = 100;
     //提取速度
     $action = $this->PG('action');
     $fids = $this->PG('fid');
     $startid = (int) $this->PG('startid');
     $endid = (int) $this->PG('endid');
     $starttime = $this->PG('starttime');
     $endtime = $this->PG('endtime');
     $totle = isset($_GET['totle']) ? $_GET['totle'] : 0;
     $loop = isset($_GET['loop']) ? $_GET['loop'] : 1;
     $i = isset($_GET['i']) ? $_GET['i'] : 0;
     empty($action) && javascript::alert("请选择操作项");
     if ($fids) {
         empty($fids) && javascript::alert("请选择版块");
         is_array($fids) && ($fids = implode(",", $fids));
         if (strstr($fids, 'all')) {
             $forum = new forum();
             $fids = substr($forum->fid(), 0, -1);
             if (empty($fids)) {
                 javascript::dialog("提取完毕", 'url:' . __SELF__ . '?mo=files&do=extract');
             } else {
                 _header(__SELF__ . '?mo=files&do=extractpic&fid=' . $fids . '&action=' . $action);
             }
         } else {
             $cArray = explode(',', $fids);
             $_Ccount = count($cArray);
             $k = isset($_GET['k']) ? $_GET['k'] : 0;
             $rs = iCMS_DB::getArray("SELECT id FROM #iCMS@__article WHERE fid in ({$fids}) and `status`='1'");
             empty($totle) && ($totle = count($rs));
             $tloop = ceil($totle / $speed);
             if ($loop <= $tloop) {
                 $max = $i + $speed > $totle ? $totle : $i + $speed;
                 for ($j = $i; $j < $max; $j++) {
                     if ($action == "thumb") {
                         if ($this->extractThumb($rs[$j]['id'])) {
                             $msg .= "文章ID:" . $rs[$j]['id'] . "提取…<span style='color:green;'>√</span><br />";
                         }
                     } elseif ($action == "into") {
                         $intoMsg = $this->into($rs[$j]['id']);
                         if ($intoMsg) {
                             $msg .= $intoMsg . "文章ID:" . $rs[$j]['id'] . "提取…<span style='color:green;'>√</span><br />";
                         }
                     }
                 }
                 javascript::dialog($msg ? $msg : "暂无提取信息!", 'src:' . __SELF__ . '?mo=files&do=extractpic&fid=' . $fids . '&totle=' . $totle . '&loop=' . ($loop + 1) . '&i=' . $j . '&action=' . $action);
             } else {
                 javascript::dialog("提取完毕", 'url:' . __SELF__ . '?mo=files&do=extract');
             }
         }
     } elseif ($startid && $endid) {
         $startid > $endid && !isset($_GET['g']) && javascript::alert("开始ID不能大于结束ID");
         empty($totle) && ($totle = $endid - $startid + 1);
         empty($i) && ($i = $startid);
         $tloop = ceil($totle / $speed);
         if ($loop <= $tloop) {
             $max = $i + $speed > $endid ? $endid : $i + $speed;
             for ($j = $i; $j <= $max; $j++) {
                 if ($action == "thumb") {
                     if ($this->extractThumb($j)) {
                         $msg .= "文章ID:" . $j . "提取…<span style='color:green;'>√</span><br />";
                     }
                 } elseif ($action == "into") {
                     $intoMsg = $this->into($j);
                     if ($intoMsg) {
                         $msg .= $intoMsg . "文章ID:" . $j . "提取…<span style='color:green;'>√</span><br />";
                     }
                 }
             }
             javascript::dialog($msg ? $msg : "暂无提取信息!", 'src:' . __SELF__ . '?mo=files&do=extractpic&startid=' . $startid . '&endid=' . $endid . '&g&loop=' . ($loop + 1) . '&i=' . $j . '&action=' . $action);
         } else {
             javascript::dialog("提取完毕", 'url:' . __SELF__ . '?mo=files&do=extract');
         }
     } elseif ($starttime) {
         $s = strtotime($starttime);
         $e = empty($endtime) ? time() + 86400 : strtotime($endtime);
         $rs = iCMS_DB::getArray("SELECT id FROM #iCMS@__article WHERE `pubdate`>='{$s}' and `pubdate`<='{$e}' and `status`='1'");
         empty($totle) && ($totle = count($rs));
         $tloop = ceil($totle / $speed);
         if ($loop <= $tloop) {
             $max = $i + $speed > $totle ? $totle : $i + $speed;
             for ($j = $i; $j < $max; $j++) {
                 if ($action == "thumb") {
                     if ($this->extractThumb($rs[$j]['id'])) {
                         $msg .= "文章ID:" . $rs[$j]['id'] . "提取…<span style='color:green;'>√</span><br />";
                     }
                 } elseif ($action == "into") {
                     $intoMsg = $this->into($rs[$j]['id']);
                     if ($intoMsg) {
                         $msg .= $intoMsg . "文章ID:" . $rs[$j]['id'] . "提取…<span style='color:green;'>√</span><br />";
                     }
                 }
             }
             javascript::dialog($msg ? $msg : "暂无提取信息!", 'src:' . __SELF__ . '?mo=files&do=extractpic&starttime=' . $starttime . '&endtime=' . $endtime . '&totle=' . $totle . '&loop=' . ($loop + 1) . '&i=' . $j . '&action=' . $action);
         } else {
             javascript::dialog("提取完毕", 'url:' . __SELF__ . '?mo=files&do=extract');
         }
     } else {
         javascript::alert("请选择方式");
     }
 }
Exemplo n.º 16
0
    $path = $url_info['path'];
} else {
    $path = '';
}
$tmp_arr = explode('/', $path);
foreach ($tmp_arr as $key => $value) {
    if (trim($value) == '') {
        unset($tmp_arr[$key]);
    }
}
$tmp_arr = array_values($tmp_arr);
if (isset($tmp_arr[0])) {
    $func = "\\Workerman\\Modules\\{$tmp_arr[0]}";
    if (isset($tmp_arr[1])) {
        $func .= '_' . $tmp_arr[1];
        unset($tmp_arr[1]);
    }
    unset($tmp_arr[0]);
} else {
    $func = "\\Workerman\\Modules\\home";
}
$func = str_replace('-', '_', $func);
if (!function_exists($func)) {
    foreach (glob(NET_ROOT . "/Modules/*") as $php_file) {
        require_once $php_file;
    }
}
if (!function_exists($func)) {
    return _header('Location: /' . (!empty($_GET) ? '?' . http_build_query($_GET) : ''));
}
call_user_func_array($func, $tmp_arr);
Exemplo n.º 17
0
$computersQuery = $dbTrackHandler->query("SELECT DISTINCT computers.*, child.region_name, child.id as region_id\n  FROM computers, zones as parent, zones as child\n  WHERE computers.region=child.id\n  AND (child.id={$regid} OR (parent.id={$regid} AND child.parent_id = parent.id))\n  ORDER BY child.id");
$regionHTML = '';
foreach ($computersQuery as $entry) {
    $regionHTML .= "\t\t\t\t" . '<div class="computerbit computerbit-noinfo" id="computer' . $entry['id'] . '" style="';
    if ($hasMap) {
        $regionHTML .= 'left: ' . ($entry['x'] - $iconOffsetX) . 'px; top: ' . ($entry['y'] - $iconOffsetY) . 'px; position: absolute;';
    }
    $regionHTML .= '" onClick="editComputerDetails(this, ' . $entry['id'] . ',\'' . $entry['name'] . '\',' . $entry['x'] . ',' . $entry['y'] . ');" >';
    $regionHTML .= '<a class="acomputer tips" rel="tip-computerdetails.php?id=' . $entry['id'] . '">&nbsp;';
    if (!$hasMap) {
        $regionHTML .= $entry['name'];
    }
    $regionHTML .= '</a></div>' . "\n";
}
unset($computersQuery);
echo _header("Viewing {$regionName}", $embedded);
echo <<<DIVMAP
<div id="yui-main">
\t\t<h2>Overview Map</h2>
\t\t<div class="mapscontainer">
\t\t<div class="regionmap" id="regionmap" style="{$regionCss}">
\t\t<div class="transparentregionlayer" id="regiontransparent" style="display: block; cursor: crosshair; width: 100%; height: 100%; background: transparent url(assets/bullet_placeholder.png) -16px -16px no-repeat;">
\t\t\t{$regionHTML}
\t\t</div>
\t\t</div>
                <div id="legends" style="text-align: center">
                Move mouse over a computer for more information.<br />
                Machine name (<font color="darkred">WCS</font><font color="darkblue">200</font><font color="darkgreen">03</font>) = <font color="darkred">BuildingAbbreviation</font><font color="darkblue">RoomNumber</font><font color="darkgreen">MachineNumber</font>.<br />
                <strong>Legends</strong>: <div class="computerbit computerbit-busy" style="position: static; display: inline">&nbsp; &nbsp;</div> Computer in use <div class="computerbit computerbit-available" style="position: static; display: inline">&nbsp; &nbsp;</div> Computer is available for use <div class="computerbit computerbit-noresponse" style="position: static; display: inline">&nbsp; &nbsp;</div> No information or computer is down.
                </div>
Exemplo n.º 18
0
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . 'include/cheader.inc.php';
_header(lang('addpre'));
echo '<div style="width:680px; height:530px; overflow:hidden; padding:3px; margin:0 auto;">';
//分为两种,一种是普通添加,一种是合辑内的添加
$aid = empty($aid) ? 0 : max(0, intval($aid));
if (!$aid) {
    load_cache('cotypes,channels,acatalogs');
    $nmuid = empty($nmuid) ? 0 : max(0, intval($nmuid));
    $u_coids = array();
    $u_chids = $u_nochids = '';
    if ($nmuid && ($u_url = read_cache('murl', $nmuid))) {
        $u_mtitle = @$u_url['mtitle'];
        $u_guide = @$u_url['guide'];
        foreach (array('coids') as $var) {
            if (!empty($u_url['setting'][$var])) {
                ${'u_' . $var} = explode(',', $u_url['setting'][$var]);
            }
        }
        foreach (array('chids', 'nochids') as $var) {
            if (!empty($u_url['setting'][$var])) {
                ${'u_' . $var} = '&' . $var . '=' . $u_url['setting'][$var];
            }
        }
    }
    $caid = empty($caid) ? 0 : max(0, intval($caid));
    foreach ($cotypes as $k => $v) {
        if (!$v['self_reg']) {
            ${'ccid' . $k} = empty(${'ccid' . $k}) ? '' : trim(${'ccid' . $k});
Exemplo n.º 19
0
 $mchid = empty($mchid) ? 1 : max(1, intval($mchid));
 if (!($mchannel = $mchannels[$mchid])) {
     message('choosememchann');
 }
 if (!submitcheck('register')) {
     if ($enable_pptin && !empty($pptin_url) && $pptin_register) {
         $url = $pptin_url . $pptin_register;
         $url .= (strpos($url, '?') ? '&' : '?') . "{$getval}=" . rawurlencode($forward);
         header('location:' . $url);
         exit;
     }
     if (!($tplname = @$mchannel['addtpl'])) {
         //系统自带的的模板
         include_once M_ROOT . './include/cheader.inc.php';
         load_cache('mtconfigs');
         _header(lang('register'));
         echo '<script type="text/javascript" src="include/js/register.js"></script>';
         $mchannel = $mchannels[$mchid];
         $mfields = read_cache('mfields', $mchid);
         foreach (array('additems') as $var) {
             ${$var} = !empty($mchannel[$var]) ? explode(',', $mchannel[$var]) : array();
         }
         tabheader(lang('newreg'), 'cmsregister', "?mchid={$mchid}&forward=" . rawurlencode($forward), 2, 1, 1);
         $muststr = '<span style="color:red">*</span>';
         $submitstr = tr_regcode('register') ? '' : "passinfo['code']=1;\n";
         trbasic($muststr . lang('membercname'), 'mname');
         trbasic($muststr . lang('password'), 'password', '', 'password');
         trbasic($muststr . lang('repwd'), 'password2', '', 'password');
         trbasic($muststr . lang('email'), 'email');
         $submitstr = "function checkChannel(form){\nvar i = true;\n{$submitstr}";
         if (in_array('mtcid', $additems)) {
Exemplo n.º 20
0
 function doCreateTag()
 {
     $speed = 25;
     //生成速度
     $sids = $this->PG('sortid');
     $startid = (int) $this->PG('startid');
     $endid = (int) $this->PG('endid');
     $starttime = $this->PG('starttime');
     $endtime = $this->PG('endtime');
     $cpageNum = 0;
     //$_GET['cpn'];
     $totle = isset($_GET['totle']) ? $_GET['totle'] : 0;
     $loop = isset($_GET['loop']) ? $_GET['loop'] : 1;
     $i = isset($_GET['i']) ? $_GET['i'] : 0;
     $isA = $this->isAll();
     if ($sids) {
         empty($sids) && javascript::alert("请选择分类");
         is_array($sids) && ($sids = implode(",", $sids));
         if (strstr($sids, 'all')) {
             $forum = new forum();
             $sids = substr($forum->fid(), 0, -1);
             _header(__SELF__ . '?mo=html&do=CreateTag&time=' . $this->cTime . '&cpn=' . $cpageNum . '&sortid=' . $sids . $isA);
         } else {
             $sArray = explode(',', $sids);
             $sCount = count($sArray);
             $cpage = isset($_GET['cpage']) ? $_GET['cpage'] : 1;
             $k = isset($_GET['k']) ? $_GET['k'] : 0;
             $rs = iCMS_DB::getArray("SELECT `id`,`name` FROM #iCMS@__tags WHERE `sortid` in ({$sids}) and `status`='1' order by id DESC");
             empty($totle) && ($totle = count($rs));
             $tloop = ceil($totle / $speed);
             if ($loop <= $tloop) {
                 $max = $i + $speed > $totle ? $totle : $i + $speed;
                 for ($j = $i; $j < $max; $j++) {
                     $c = iHtml::Tag($rs[$j]['name'], $cpage, $loop, $cpageNum);
                     $msg .= "标签: [" . $c['name'] . "] 生成…<span style='color:green;'>√</span><br />";
                 }
                 javascript::dialog($msg, 'src:' . __SELF__ . '?mo=html&do=CreateTag&sortid=' . $sids . '&totle=' . $totle . '&loop=' . ($loop + 1) . '&i=' . $j . $isA, 'ok', 0);
             } else {
                 $isA && javascript::dialog("标签更新完毕!<br />开始生成首页", 'url:' . __SELF__ . '?mo=html&do=index&all=true');
                 javascript::dialog("标签更新完毕");
             }
         }
         //		}elseif($startid && $endid){
         //			($startid>$endid &&!isset($_GET['g'])) && javascript::alert("开始ID不能大于结束ID");
         //			empty($totle)&&$totle=($endid-$startid)+1;
         //			empty($i)&&$i=$startid;
         //			$tloop=ceil($totle/$speed);
         //			if($loop<=$tloop){
         //				$max=$i+$speed>$endid?$endid:$i+$speed;
         //				for($j=$i;$j<=$max;$j++){
         //					iHtml::Tag($j);
         //					$msg.="标签ID:{$j}生成…<span style='color:green;'>√</span><br />";
         //				}
         // 				javascript::dialog($msg,'src:'.__SELF__.'?mo=html&do=CreateTag&startid='.$startid.'&endid='.$endid.'&g&loop='.($loop+1).'&i='.$j.$isA,'ok',0);
         //			}else{
         //				javascript::dialog("标签更新完毕");
         //			}
     } elseif ($starttime) {
         $s = strtotime($starttime);
         $e = empty($endtime) ? time() + 86400 : strtotime($endtime);
         $rs = iCMS_DB::getArray("SELECT id,name FROM #iCMS@__tags WHERE `updatetime`>='{$s}' and `updatetime`<='{$e}' and `status`='1' order by id DESC");
         empty($totle) && ($totle = count($rs));
         $tloop = ceil($totle / $speed);
         if ($loop <= $tloop) {
             $max = $i + $speed > $totle ? $totle : $i + $speed;
             for ($j = $i; $j < $max; $j++) {
                 iHtml::Tag($rs[$j]['name']);
                 $msg .= "标签:[" . $rs[$j]['name'] . "]生成…<span style='color:green;'>√</span><br />";
             }
             javascript::dialog($msg, 'src:' . __SELF__ . '?mo=html&do=CreateTag&starttime=' . $starttime . '&endtime=' . $endtime . '&totle=' . $totle . '&loop=' . ($loop + 1) . '&i=' . $j, 'ok', 0);
         } else {
             javascript::dialog("标签更新完毕");
         }
     } else {
         javascript::alert("请选择方式");
     }
 }
Exemplo n.º 21
0
/**
 * 下载手册
 */
function download_manual()
{
    _header('Content-Type: application/pdf');
    _header('Content-Disposition: attachment; filename="workerman-manual.pdf"');
    readfile(NET_ROOT . '/Web/downloads/workerman-manual.pdf');
}
Exemplo n.º 22
0
 function Show($argv, $page = 1, $tpl = true)
 {
     $catalog = $this->cache('catalog.cache', 'include/syscache', 0, true);
     $sql = $this->linkmodeSQL('a.id', 'a.customlink', $argv);
     //$this->mode=="CreateHtml" && $sql.=" and a.url=''";
     $rs = $this->db->getRow("SELECT a.*,d.tpl,d.body,d.subtitle FROM #iCMS@__article as a LEFT JOIN #iCMS@__articledata AS d ON a.id = d.aid WHERE {$sql} AND a.visible ='1'");
     empty($rs) && $this->error('error:page');
     if ($catalog[$rs->cid]['ishidden']) {
         return false;
     }
     if ($rs->url) {
         if ($this->mode == "CreateHtml") {
             return;
         } else {
             _header($rs->url);
         }
     }
     $rs->catalogdir = $this->cdir($catalog[$rs->cid]);
     $_urlArray = array('id' => $rs->id, 'cid' => $rs->cid, 'link' => $rs->customlink, 'url' => $rs->url, 'dir' => $rs->catalogdir, 'domain' => $catalog[$rs->cid]['domain'], 'pubdate' => $rs->pubdate);
     $_iurlArray = array('id' => $rs->id, 'link' => $rs->customlink, 'url' => $rs->url, 'dir' => $rs->catalogdir, 'pubdate' => $rs->pubdate);
     $iHtml = $this->iurl('show', $_iurlArray, $page - 1, iPATH);
     $rs->url = $this->iurl('show', $_urlArray);
     $tpl && $this->jumptohtml($iHtml, $rs->url);
     $this->get['id'] = $rs->id;
     $this->get['title'] = $rs->title;
     if ($this->config['linkmode'] == 'id') {
         $this->iList($rs->cid, false);
     } elseif ($this->config['linkmode'] == 'title') {
         $this->iList($rs->catalogdir, false);
     }
     if ($this->config['ishtm']) {
         $rs->hits = "<script src=\"" . $this->config['url'] . "/action.php?do=hits&id={$rs->id}&action=show\" language=\"javascript\"></script>";
         $rs->digg = "<script src=\"" . $this->config['url'] . "/action.php?do=digg&id={$rs->id}&action=show\" language=\"javascript\"></script>";
         $rs->comments = "<script src=\"" . $this->config['url'] . "/action.php?do=comment&id={$rs->id}\" language=\"javascript\"></script>";
     }
     $picArray = array();
     preg_match_all("/src=[\"|'| ]+((.*)\\.(gif|jpg|jpeg|bmp|png))/isU", $rs->body, $picArray);
     $pA = array_unique($picArray[1]);
     foreach ($pA as $key => $value) {
         $iValue = getfilepath(trim($value), iPATH, '+');
         file_exists($iValue) && ($rs->photo[] = trim($value));
     }
     $body = explode('<div style="page-break-after: always"><span style="display: none">&nbsp;</span></div>', $rs->body);
     $rs->pagetotal = count($body);
     $nBody = $body[intval($page - 1)];
     $rs->body = $this->keywords($nBody);
     $rs->pagecurrent = $page;
     if ($rs->pagetotal > 1) {
         $rs->pagebreak = $page - 1 > 1 ? '<a href="' . $this->iurl('show', $_urlArray, $page - 1) . '" class="pagebreak" target="_self">上一页</a> ' : '<a href="' . $this->iurl('show', $_urlArray) . '" class="pagebreak" target="_self">' . $this->language('page:prev') . '</a> ';
         for ($i = 1; $i <= $rs->pagetotal; $i++) {
             $cls = $i == $page ? "pagebreaksel" : "pagebreak";
             $rs->pagebreak .= $i == 1 ? '<a href="' . $this->iurl('show', $_urlArray) . '" class="' . $cls . '" target="_self">' . $i . '</a>' : '<a href="' . $this->iurl('show', $_urlArray, $i) . '" class="' . $cls . '" target="_self">' . $i . '</a>';
         }
         $np = $rs->pagetotal - $page > 0 ? $page + 1 : $page;
         $rs->pagebreak .= '<a href="' . $this->iurl('show', $_urlArray, $np) . '" class="pagebreak" target="_self">' . $this->language('page:next') . '</a>';
     }
     $rs->page = array('total' => $rs->pagetotal, 'current' => $rs->pagecurrent, 'break' => $rs->pagebreak);
     if ($rs->tags) {
         $tagarray = explode(',', $rs->tags);
         if (count($tagarray) > 1) {
             foreach ($tagarray as $tk => $tag) {
                 if ($this->chkTagVisible($tag)) {
                     $rs->tag[$tk]['name'] = $tag;
                     $rs->tag[$tk]['url'] = $this->config['url'] . '/tag.php?t=' . rawurlencode($tag);
                     $rs->taglink .= '<a href="' . $rs->tag[$tk]['url'] . '" class="tag" target="_self">' . $rs->tagname[$tk]['name'] . '</a> ';
                 }
             }
         } else {
             if ($this->chkTagVisible($tagarray[0])) {
                 $rs->tag[0]['name'] = $tagarray[0];
                 $rs->tag[0]['url'] = $this->config['url'] . '/tag.php?t=' . rawurlencode($tagarray[0]);
                 $rs->taglink = '<a href="' . $this->config['url'] . '/tag.php?t=' . $rs->tag[0]['url'] . '" class="tag" target="_self">' . $tagarray[0] . '</a>';
             }
         }
     }
     if ($rs->related) {
         $relatedArray = explode("~#~", $rs->related);
         if ($relatedArray) {
             foreach ($relatedArray as $idtitle) {
                 list($reid, $retitle) = explode("#|\$", $idtitle);
                 $reid && $retitle && ($rel[] = $reid);
             }
         }
         if ($rel) {
             $rs->rel = implode(',', $rel);
             $this->assign('rel', $rs->rel);
         }
     }
     $prers = $this->db->getRow("SELECT * FROM `#iCMS@__article` WHERE `id` < '{$rs->id}' AND `cid`='{$rs->cid}' AND `visible`='1' order by id DESC Limit 1");
     $rs->prev = $prers ? '<a href="' . $this->iurl('show', array('id' => $prers->id, 'cid' => $prers->cid, 'link' => $prers->customlink, 'url' => $prers->url, 'dir' => $rs->catalogdir, 'domain' => $catalog[$rs->cid]['domain'], 'pubdate' => $prers->pubdate)) . '" class="prev" target="_self">' . $prers->title . '</a>' : $this->language('show:first');
     $nextrs = $this->db->getRow("SELECT * FROM `#iCMS@__article` WHERE `id` > '{$rs->id}'  and `cid`='{$rs->cid}' AND `visible`='1' order by id ASC Limit 1");
     $rs->next = $nextrs ? '<a href="' . $this->iurl('show', array('id' => $nextrs->id, 'cid' => $nextrs->cid, 'link' => $nextrs->customlink, 'url' => $nextrs->url, 'dir' => $rs->catalogdir, 'domain' => $catalog[$rs->cid]['domain'], 'pubdate' => $nextrs->pubdate)) . '" class="next" target="_self">' . $nextrs->title . '</a>' : $this->language('show:last');
     $this->mode != 'CreateHtml' && $this->db->query("UPDATE `#iCMS@__article` SET hits=hits+1 WHERE `id` ='{$rs->id}' LIMIT 1");
     $rs->link = "<a href='{$rs->url}'>{$rs->title}</a>";
     $this->result = $rs;
     $this->assign(array('id' => $rs->id, 'pic' => $rs->pic, 'url' => $rs->url, 'link' => $rs->link, 'title' => $rs->title, 'keywords' => $rs->keywords, 'description' => $rs->description, 'source' => $rs->source, 'author' => $rs->author, 'userid' => $rs->userid, 'postype' => $rs->postype, 'pubdate' => $rs->pubdate, 'subtitle' => $rs->subtitle, 'body' => $rs->body, 'pagetotal' => $rs->pagetotal, 'pagecurrent' => $rs->pagecurrent, 'pagebreak' => $rs->pagebreak, 'hits' => $rs->hits, 'digg' => $rs->digg, 'comments' => $rs->comments, 'tag' => $rs->tag, 'taglink' => $rs->taglink, 'prev' => $rs->prev, 'next' => $rs->next));
     $this->assign('show', (array) $rs);
     //3.1 所有内容
     if ($tpl) {
         $tpl = empty($rs->tpl) ? $catalog[$rs->cid]['tpl_contents'] : $rs->tpl;
         return $this->iPrint($tpl, 'show');
     }
 }
Exemplo n.º 23
0
                    redirect("文章更新完毕!", 'admincp.php?do=html&operation=article');
                }
            } elseif ($starttime) {
                $s = strtotime($starttime);
                $e = empty($endtime) ? time() + 86400 : strtotime($endtime);
                $rs = $DreamCMS->db->get_results("SELECT id FROM #DC@__article WHERE `pubdate`>='{$s}' and `pubdate`<='{$e}' and `visible`='1'");
                empty($totle) && ($totle = count($rs));
                $tloop = ceil($totle / $speed);
                if ($loop <= $tloop) {
                    $max = $i + $speed > $totle ? $totle : $i + $speed;
                    for ($j = $i; $j < $max; $j++) {
                        MakeArticleHtm($rs[$j]['id']);
                        echo "文章ID:" . $rs[$j]['id'] . "生成…<span style='color:green;'>√</span><br />";
                        flush();
                    }
                    _header('admincp.php?do=html&operation=create&action=article&starttime=' . $starttime . '&endtime=' . $endtime . '&totle=' . $totle . '&loop=' . ($loop + 1) . '&i=' . $j . $QUERY_STRING);
                } else {
                    redirect("文章更新完毕!", 'admincp.php?do=html&operation=article');
                }
            } else {
                alert("请选择方式");
            }
        }
        break;
}
function _redirect($T1, $T2, $U1, $U2)
{
    global $QUERY_STRING;
    if (isset($_GET['all'])) {
        redirect($T2 . ',' . $T1 . "开始.....", 'admincp.php?do=html&operation=' . $U1 . $QUERY_STRING);
    } else {
Exemplo n.º 24
0
<?php

require_once 'config.php';
if (!WS_ACCESS) {
    die(_header() . _noauth() . _footer());
}
$html = _header();
$html .= _menu();
$html .= _global_index();
switch ($_GET['p']) {
    case 'zayav':
        switch (@$_GET['d']) {
            case 'info':
                $html .= zayav_info();
                break;
            default:
                $html .= zayav(_hashFilter('zayav'));
        }
        break;
}
$html .= _footer();
die($html);
Exemplo n.º 25
0
<?php

require_once 'inc.config.php';
logincheck();
if (isset($_POST['journal'])) {
    db_update('planets', array('journal' => trim($_POST['journal'])), 'id = ' . PLANET_ID);
    Go();
}
_header();
?>
<div class="header">Personal Journal</div>

<br />

<form method="post" action="">
<textarea name="journal" rows="20" style="width:100%;"><?php 
echo htmlspecialchars($g_arrUser['journal']);
?>
</textarea><br />
<br />
<input type="submit" value="SAVE" style="width:40%">
</form>

<br />

<?php 
_footer();
Exemplo n.º 26
0
    }
}
$tmp_arr = explode('/', $path);
foreach ($tmp_arr as $key => $value) {
    if (trim($value) == '') {
        unset($tmp_arr[$key]);
    }
}
$tmp_arr = array_values($tmp_arr);
if (isset($tmp_arr[0])) {
    $func = "\\Workerman\\Modules\\{$tmp_arr[0]}";
    if (isset($tmp_arr[1])) {
        $func .= '_' . $tmp_arr[1];
        unset($tmp_arr[1]);
    }
    unset($tmp_arr[0]);
} else {
    $func = "\\Workerman\\Modules\\home";
}
$func = str_replace('-', '_', $func);
if (!function_exists($func)) {
    foreach (glob(NET_ROOT . "/Modules/*") as $php_file) {
        require_once $php_file;
    }
}
if (!function_exists($func)) {
    _header("HTTP/1.0 404 Not Found", true, 404);
    echo "<html><head><title>404 Not Found</title></head><body><h3>404 Not Found</h3></body></html>";
    //return _header('Location: /'.(!empty($_GET) ? '?'.http_build_query($_GET) : ''));
}
call_user_func_array($func, $tmp_arr);
Exemplo n.º 27
0
include_once "includes/headfoot.php";
initSession();
if (!($_SESSION['loggedinUserPerms'] & VIEW_ZONES)) {
    die('You do not have permission to view this page!');
}
$dbTrackHandler = connectDb();
// Query All Zones
$zonesQuery = $dbTrackHandler->query('SELECT * FROM zones WHERE `parent_id`=0;');
foreach ($zonesQuery as $entry) {
    $thisZone['id'] = $entry['id'];
    $thisZone['name'] = $entry['region_name'];
    $zones[] = $thisZone;
}
$totalComputers = $dbTrackHandler->query('SELECT count(*) FROM computers;')->fetch(PDO::FETCH_NUM);
$offlineComputers = $dbTrackHandler->query('SELECT count(*) FROM computers WHERE laststatus=' . AVAIBILITY_TYPE_OFFLINE . ';')->fetch(PDO::FETCH_NUM);
echo _header("System Overview");
?>
		<div id="yui-main">
				<div class="yui-b">
			
				<h2>System Overview</h2>
				<h2>Sites</h2>
					<ul>
<?php 
foreach ($zones as $thisZone) {
    echo "\t\t\t\t" . '<li><a href="viewregion.php?id=' . $thisZone['id'] . '">' . $thisZone['name'] . '</a></li>';
}
?>
					</ul>

				
Exemplo n.º 28
0
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . 'include/cheader.inc.php';
$inajax ? aheader() : _header(lang('membergetpwd'), 'curbox');
$forward = empty($forward) ? M_REFERER : $forward;
$forwardstr = 'forward=' . rawurlencode($forward);
empty($action) && ($action = '');
if ($action == 'getpwd' && !empty($mid) && !empty($id)) {
    $cmember = $db->fetch_one("SELECT m.mid,m.mname,m.email,s.confirmstr FROM {$tblprefix}members m,{$tblprefix}members_sub s WHERE m.mid='{$mid}' AND s.mid=m.mid");
    if (!$cmember || !$cmember['confirmstr']) {
        mcmessage('invalidoperate');
    }
    list($dateline, $deal, $confirmid) = explode("\t", $cmember['confirmstr']);
    if ($dateline < $timestamp - 86400 * 3 || $deal != 1 || $confirmid != $id) {
        mcmessage('invalidoperate');
    }
    if (!submitcheck('bgetpwd')) {
        tabheader(lang('memberpwdsetting'), 'getpwd', "?action=getpwd&mid={$mid}&id={$id}", 2, 0, 1);
        trbasic(lang('membercname'), '', $cmember['mname'], '');
        trbasic(lang('inputnewpwd'), 'npassword', '', 'password');
        trbasic(lang('renewpwd'), 'npassword2', '', 'password');
        $submitstr = '';
        $submitstr .= makesubmitstr('npassword', 1, 0, 3, 15);
        $submitstr .= makesubmitstr('npassword2', 1, 0, 3, 15);
        $submitstr .= tr_regcode('register');
        tabfooter('bgetpwd');
        check_submit_func($submitstr);
    } else {
        if (!regcode_pass('register', empty($regcode) ? '' : trim($regcode))) {
            mcmessage('safecodeerr');
Exemplo n.º 29
0
 function Show($argv, $page = 1, $makehtml = 0)
 {
     //zhaoyanmin $makehtml=0 自己加的,防止更新静态页和添加静态页有跳转地址时跳转
     global $_catalog;
     $sql = $this->linkmodeSQL('a.id', 'a.customlink', $argv);
     //		$rs=$this->db->get_row("SELECT * FROM `#DC@__article` WHERE {$sql} AND `visible`='1'");
     //		$rst=$this->db->get_row("SELECT subtitle,body FROM `#DC@__articledata` WHERE aid='{$rs->id}'");
     $rs = $this->db->get_row("SELECT a.*,d.subtitle,d.body FROM #DC@__article as a ,#DC@__articledata AS d WHERE {$sql} AND a.id = d.aid AND a.visible ='1'");
     $zymrs = $this->db->get_row("SELECT a.*,d.subtitle,d.body FROM #DC@__article as a ,#DC@__articledata AS d WHERE {$sql} AND a.id = d.aid AND a.visible ='1'", ARRAY_A);
     //zhaoyanmin
     //if($_catalog[$rs->cid]['ishidden'])return false;		//zhaoyanmin去掉,以免隐藏的栏目不能更新文章
     //if($rs->url){_header($rs->url);return;}  //原
     //zhaoyanmin start  防止更新静态页和添加静态页有跳转地址时跳转
     if ($makehtml == 0) {
         if ($rs->url) {
             _header($rs->url);
             return;
         }
     }
     //zhaoyanmin end
     empty($rs) && $this->error('error:page');
     $rs->catalogdir = $_catalog[$rs->cid]['dir'];
     $this->result = $rs;
     $this->jumptohtml($this->config['htmdir'] . $rs->filename);
     $this->get['id'] = $rs->id;
     $this->get['title'] = $rs->title;
     if ($this->config['linkmode'] == 'id') {
         $this->_List($rs->cid, false);
     } elseif ($this->config['linkmode'] == 'title') {
         $this->_List($rs->catalogdir, false);
     }
     if ($this->config['ishtm']) {
         //if($this->ishtml_z){	//静态		//zhaoyanmin 新动静态判断
         $rs->hits = "<script src=\"{$this->dir}action.php?do=hits&id={$rs->id}&view=yes\" language=\"javascript\"></script>";
         $rs->digg = "<script src=\"{$this->dir}action.php?do=digg&action=show&id={$rs->id}\" language=\"javascript\"></script>";
         $rs->comments = "<script src=\"{$this->dir}action.php?do=comment&id={$rs->id}\" language=\"javascript\"></script>";
     }
     $this->assign('id', $rs->id);
     $this->assign('pic', $rs->pic);
     $this->assign('filename', $rs->filename);
     $this->assign('title', $rs->title);
     //标题
     $this->assign('keywords', $rs->keywords);
     //关键字
     $this->assign('description', $rs->description);
     //简介
     $this->assign('source', $rs->source);
     //出处
     $this->assign('author', $rs->author);
     //作 者
     $this->assign('pubdate', $rs->pubdate);
     $this->assign('subtitle', $rs->subtitle);
     //标题
     //zhaoyanmin start
     if ($zymrs && is_array($zymrs)) {
         foreach ($zymrs as $key => $val) {
             $this->assign("{$key}", $val);
         }
     }
     //查询此文章所含其它副表
     $catalog = $this->db->get_row("SELECT m.`table` FROM `#DC@__catalog` AS c,`#DC@__model` AS m WHERE c.`id`='" . $rs->cid . "' AND c.`modelid`=m.`modelid` limit 1", ARRAY_A);
     $table = $catalog['table'];
     if ($table) {
         $otherdata = $this->db->get_row("SELECT * FROM `#DC@__" . $table . "` WHERE `aid`='" . $rs->id . "' limit 1", ARRAY_A);
         if ($otherdata && is_array($otherdata)) {
             foreach ($otherdata as $key => $val) {
                 $this->assign("{$key}", $val);
             }
         }
     }
     //zhaoyanmin end
     //$body	=explode('<div style="page-break-after: always"><span style="display: none">&nbsp;</span></div>',$rs->body);
     $body = explode('<div style="page-break-after: always;"><span style="DISPLAY:none">&nbsp;</span></div>', $rs->body);
     //zhaoyanmin 内容分页
     $total = count($body);
     $this->keywords($body[intval($page - 1)]);
     $this->assign('body', $body[intval($page - 1)]);
     //内容
     if ($total > 1) {
         $CLArray = array('id' => $rs->id, 'link' => $rs->customlink, 'dir' => $rs->catalogdir, 'pubdate' => $rs->pubdate);
         $pagebreak = $page - 1 > 1 ? '<a href="' . $this->_url('show', $CLArray, $page - 1) . '" class="pagebreak" target="_self">上一页</a> ' : '<a href="' . $this->_url('show', $CLArray) . '" class="pagebreak" target="_self">' . $this->language('page:prev') . '</a> ';
         for ($i = 1; $i <= $total; $i++) {
             $cls = $i == $page ? "pagebreaksel" : "pagebreak";
             $pagebreak .= $i == 1 ? '<a href="' . $this->_url('show', $CLArray) . '" class="' . $cls . '" target="_self">' . $i . '</a>' : '<a href="' . $this->_url('show', $CLArray, $i) . '" class="' . $cls . '" target="_self">' . $i . '</a>';
         }
         $np = $total - $page > 0 ? $page + 1 : $page;
         $pagebreak .= '<a href="' . $this->_url('show', $CLArray, $np) . '" class="pagebreak" target="_self">' . $this->language('page:next') . '</a>';
     }
     $this->assign('current', $page);
     $this->assign('pagebreak', $pagebreak);
     $this->assign('hits', $rs->hits);
     //点击数
     $this->assign('digg', $rs->digg);
     //点击数
     $this->assign('comments', $rs->comments);
     //回复数
     if ($rs->tags) {
         $tagarray = explode(' ', $rs->tags);
         if (count($tagarray) > 1) {
             foreach ($tagarray as $tag) {
                 $this->chkTagVisible($tag) && ($tags .= '<a href="' . $this->dir . 'tag.php?t=' . rawurlencode($tag) . '" class="tag" target="_self">' . $tag . '</a> ');
             }
         } else {
             $this->chkTagVisible($tagarray[0]) && ($tags = '<a href="' . $this->dir . 'tag.php?t=' . rawurlencode($tagarray[0]) . '" class="tag" target="_self">' . $tagarray[0] . '</a>');
         }
     }
     $this->assign('tags', $tags);
     $prers = $this->db->get_row("SELECT * FROM `#DC@__article` WHERE `id` < '{$rs->id}' AND `cid`='{$rs->cid}' AND `visible`='1' order by id DESC Limit 1");
     $opn['prev'] = $prers ? '<a href="' . $this->_url('show', array('id' => $prers->id, 'link' => $prers->customlink, 'url' => $prers->url, 'dir' => $_catalog[$prers->cid]['dir'], 'pubdate' => $prers->pubdate)) . '" class="prev" target="_self">' . $prers->title . '</a>' : $this->language('show:first');
     $nextrs = $this->db->get_row("SELECT * FROM `#DC@__article` WHERE `id` > '{$rs->id}'  and `cid`='{$rs->cid}' AND `visible`='1' order by id ASC Limit 1");
     $opn['next'] = $nextrs ? '<a href="' . $this->_url('show', array('id' => $nextrs->id, 'link' => $nextrs->customlink, 'url' => $nextrs->url, 'dir' => $_catalog[$nextrs->cid]['dir'], 'pubdate' => $nextrs->pubdate)) . '" class="next" target="_self">' . $nextrs->title . '</a>' : $this->language('show:last');
     $this->assign('show', $opn);
     //上一篇下一篇
     $this->mode != 'CreateHtml' && $this->db->query("UPDATE `#DC@__article` SET hits=hits+1 WHERE `id` ='{$rs->id}' LIMIT 1");
     return $this->DCPrint($_catalog[$rs->cid]['tpl_contents'], 'show');
 }
Exemplo n.º 30
0
 function share()
 {
     global $_G;
     $type = $_GET[type];
     if ($_GET[id] || $_GET[aid]) {
         $aid = $_GET[id] ? intval($_GET[id]) : intval($_GET[aid]);
         $goods = D(array('and' => 'and aid = ' . $aid));
         if ($goods[aid] > 0) {
             $share = get_share($goods);
         }
         $desc = '分享商品-' . $goods[title] . '-' . $type . '-aid=' . $aid;
         $share_type = 'share_goods';
     } else {
         $share = get_share($goods);
         $desc = '分享站点';
         $share_type = 'share_web';
     }
     if (isset($share[$type]) && $share[$type]) {
         $url = $share[$type];
         if ($_G[uid]) {
             $count = getcount('sign', " uid = " . $_G[uid] . " AND `desc`='" . $desc . "' AND type = '" . $share_type . "'");
             $is_add = false;
             if ($count == 0) {
                 $is_add = true;
             }
             $today = dmktime(dgmdate(TIMESTAMP, 'd'));
             $count_day = getcount('sign', " uid = " . $_G[uid] . " AND type = '" . $share_type . "' AND dateline >=" . $today);
             if ($share_type == 'web' || $share_type == 'share_web') {
                 if ($count_day > $_G[setting][share_web_num]) {
                     $is_add = false;
                 }
             } elseif ($share_type == 'share_goods') {
                 if ($count_day > $_G[setting][share_goods_num]) {
                     $is_add = false;
                 }
             }
             if ($is_add) {
                 $jf = $_G[setting][share_goods];
                 $add_jf = $_G['member']['jf'] + $jf;
                 $sid = insert_sign(array('desc' => $desc, 'type' => 'share_goods', 'org_jf' => $add_jf, 'jf' => $jf));
                 if ($sid) {
                     update_member(array('jf' => $_G[member][jf] + $jf), $_G[uid]);
                 }
             }
         }
     } else {
         $url = $share['weibo'];
     }
     _header("Location:" . $url);
 }