Exemplo n.º 1
0
$l_obj = new Logs();
if (function_exists("m__" . $_GET['m'])) {
    call_user_func("m__" . $_GET['m']);
}
$time_end = helper::getmicrotime();
//主程序执行时间,如果要包含模板的输出时间,则可以调用该静态时间方法单独计算
$page['data_fill_time'] = $time_end - $time_start;
//执行时间
/**
 * 模板载入选择
 *     模板页面为PHP+HTML混合编写,如果模板页面中也有区块函数,模板函数以 tpl__ 为前缀
 */
//判断终端,然后选择需要的模板
$template = "pc";
//自动判断是否为手机端,不是都到pc端
$template = helper::from_mobile() ? 'wap' : 'pc';
$tpl_filename = str_replace('\\', '', str_replace(dirname(__FILE__), '', __FILE__));
$tpl_filename = str_replace('/', '', $tpl_filename);
require dirname(__FILE__) . '/' . $template . '/tpl_' . $tpl_filename;
function m__login()
{
    global $a_obj, $l_obj;
    $post = $_POST;
    if (empty($post['aname'])) {
        die('{"code":"100","msg":"用户名不能为空"}');
    }
    if (empty($post['apass'])) {
        die('{"code":"100","msg":"密码不能为空"}');
    }
    //验证码验证
    $code = md5(strtoupper($post['code']));
Exemplo n.º 2
0
/**
 * 自动表单
 *
 * @param  $form 表单数组
 */
function form_auto($form, $title)
{
    $type = $form['form_type'];
    $name = $form['field'];
    $form_value = $form['form_value'];
    $html = '';
    if ($type == 'text') {
        // 文本框
        $html .= '<input placeholder="' . $title . '" type="text" class="ipt" id="' . $name . '" name="' . $name . '" value="' . $form_value . '">';
    }
    if ($type == 'textarea') {
        // 多行文本框
        $html .= '<textarea placeholder="' . $title . '" class="ipt" style="height:50px;" id="' . $name . '" name="' . $name . '">' . $form_value . '</textarea>';
    }
    if ($type == 'checkbox') {
        // 复选框
        $fv = explode('|', $form_value);
        foreach ($fv as $a) {
            $html .= '&nbsp;&nbsp;&nbsp;&nbsp;<label><input class="sel_more_' . $name . '" type="checkbox" value="' . $a . '" id="' . $name . '" name="' . $name . '">&nbsp;&nbsp;' . $a . '</label>';
        }
    }
    if ($type == 'radio') {
        // 单选框
        $fv = explode('|', $form_value);
        foreach ($fv as $a) {
            $html .= '&nbsp;&nbsp;&nbsp;&nbsp;<label><input type="radio" value="' . $a . '" id="' . $name . '" name="' . $name . '">&nbsp;&nbsp;' . $a . '</label>';
        }
    }
    if ($type == 'select') {
        // 下拉框
        $fv = explode('|', $form_value);
        $html .= '<select id="' . $name . '" name="' . $name . '">';
        foreach ($fv as $a) {
            $html .= '<option value="' . $a . '">' . $a . '</option>';
        }
        $html .= '</select>';
    }
    if ($type == 'date') {
        // 日期选择
        // $html .='<div style="position:absolute;">';
        $html .= '<input placeholder="' . $title . '" type="text" class="ipt" id="' . $name . '" name="' . $name . '" value=""  onclick="new Calendar().show(this);">';
        // $html .='</div>';
    }
    if ($type == 'editor') {
        // 编辑框
        if (helper::from_mobile()) {
            $html .= '<textarea placeholder="' . $title . '" class="ipt" style="height:50px;" id="' . $name . '" name="' . $name . '">' . $form_value . '</textarea>';
        } else {
            $html .= '<div style="position:relative;margin-top:10px;">';
            $html .= '<span class="upbtn_box" id="upbtn_box_' . $name . '"><script>C.ckeditor.init("#upbtn_box_' . $name . '","' . $name . '");</script></span>';
            $html .= '<textarea placeholder="' . $title . '" id="' . $name . '" name="' . $name . '" style="display:none;"></textarea>';
            $html .= '<script type="text/javascript">';
            $html .= 'if(CKEDITOR.instances["' . $name . '"]){CKEDITOR.remove(CKEDITOR.instances["' . $name . '"]);}  var ' . $name . ' = CKEDITOR.replace( "' . $name . '",{height:100,width:720,skin:"v2",menu_subMenuDelay:0,toolbar : ckeditor_toolbar});';
            $html .= '</script>';
            $html .= '</div>';
        }
    }
    if ($type == 'upload') {
        // 上传框
        $html .= '<div style="float:left;margin-right:10px;"><input type="text" class="ipt" id="' . $name . '" name="' . $name . '" value=""></div>';
        $html .= '<div style="float:left;" id="box_' . $name . '"><script>C.create_upload_iframe(\'{"inner_box":"#box_' . $name . '","func":"callback_upload_thumb","vid":"' . $name . '","thumb":{"width":"300","height":"300"},"water":1}\');</script></div>';
        $html .= '<div style="float:left;margin-left:10px;"><span id="thumb_' . $name . '"></span></div>';
    }
    return $html;
}
Exemplo n.º 3
0
function assign_tpl_admin($tpl, $dir = '')
{
    $template = helper::from_mobile() ? 'wap' : 'pc';
    $tpl_file = ROOT_PATH . '/' . ADMIN_PATH . '/' . $template . '/tpl_' . $tpl;
    if ($dir != '') {
        $tpl_file = ROOT_PATH . '/' . ADMIN_PATH . '/' . $dir . '/tpl_' . $tpl;
    }
    if (!file_exists($tpl_file)) {
        $template = 'pc';
        $tpl_file = ROOT_PATH . '/' . ADMIN_PATH . '/' . $template . '/tpl_' . $tpl;
        //die($tmeplate);
    }
    return array($template, $tpl_file);
}
Exemplo n.º 4
0
$plugins_path = str_replace('\\', '/', $plugins_path);
$plugins_path = substr($plugins_path, strpos($plugins_path, 'plugins/'), strlen($plugins_path));
$p = isset($_GET['p']) ? $_GET['p'] : 1;
//分页页码
if (!is_numeric($p)) {
    $p = 1;
}
//页面动作 model 分支选择,动作函数写在文件末尾,全部以前缀 m__ 开头
$_GET['m'] = isset($_GET['m']) ? $_GET['m'] : 'login';
if (function_exists("m__" . $_GET['m'])) {
    call_user_func("m__" . $_GET['m']);
}
//组合模板文件夹路径,默认为PC模板
$from_template = 'pc';
$from_mobile = TEMPLATE;
if (WAP_OPEN == '1' && helper::from_mobile()) {
    //自动识别为手机浏览器,使用WAP模板
    $from_template = 'wap';
}
if (WAP_URL != '' && 'http://' . $_SERVER['HTTP_HOST'] == WAP_URL) {
    // WAP独立域名浏览
    $from_template = 'wap';
}
if (substr($_SERVER['HTTP_HOST'], 0, 2) == 'm.') {
    // 手机客户端
    $from_template = 'm';
}
$tpl = isset($_GET['tpl']) ? $_GET['tpl'] : 'index';
if ($tpl == 'index') {
    if (isset($_SESSION['uid']) && isset($_SESSION['uname'])) {
        act_msg("index.php?tpl=ucenter", "你已经是登陆状态");
Exemplo n.º 5
0
                }
            }catch(e){alert(e.message+data);}
        });
    }catch(e){alert(e.message);}
}
</script>
<?php 
    if (!isset($msg_show_opacty) || $msg_show_opacty == 1) {
        ?>
<div id="gov_message" style="display:none"><?php 
    }
    ?>
	<form method="post" action="" id="form_gov_message">
		<table class="tb3">
		<?php 
    if (isset($msg_show_opacty) && $msg_show_opacty == 0 && helper::from_mobile()) {
        show_extern_html_wap($rs['list'][0]['extern_id'], array('nick_name', 'phone', 'content', 'qq', 'gender'));
        echo '<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="save_message();" id="subtn" class="but" href="javascript:void(0);">给我留言</a></td></tr>';
    } else {
        show_extern_html($rs['list'][0]['extern_id'], array('nick_name', 'phone', 'content', 'qq', 'gender'));
        echo '<tr><td></td><td><a onclick="save_message();" id="subtn" class="but" href="javascript:void(0);">给我留言</a></td></tr>';
    }
    ?>
        
		</table>
	</form>
<?php 
    if (!isset($msg_show_opacty) || $msg_show_opacty == 1) {
        ?>
</div><?php 
    }