Ejemplo n.º 1
0
function allmember_class()
{
    global $allow_order, $rsort, $grade;
    $get = MooGetGPC('clear', 'integer', 'G');
    $total = 0;
    $page_links = '';
    $sort_arr = $member_list = array();
    $currenturl = "index.php?action=allmember&h=class";
    $currenturl1 = "index.php?action=allmember&h=class&clear=1";
    //$condition = array();
    //$condition['uid']=$condition['username']=$condition['nickname']=$condition['telphone']=$condition['sid'] = '';
    $sql_where = 'where 1';
    //获得参数
    /* $effect_grade=MooGetGPC('effect_grade','integer','G');
    	
    	
    	
    	$isControl=MooGetGPC('isControl','string','G');
    	$isForcast=MooGetGPC('isForcast','string','G');
    	
       
    	
    	$keyword=MooGetGPC('keyword','string','G');
    	$endTime=MooGetGPC('end','string','G');
    	$startTime=MooGetGPC('start','string','G'); */
    //获取查询条件及语句
    $where = get_search_condition('');
    //if(!empty($keyword)) $where = $where." AND m.sid = $keyword";
    $query_builder = get_query_builder($where, $allow_order, '', '', 'regdate', 'desc', $rsort);
    $where = $sql_where . $query_builder['where'];
    $sql_sort = $query_builder['sort'];
    $sort_arr = $query_builder['sort_arr'];
    $rsort_arr = $query_builder['rsort_arr'];
    $kefu_list = get_kefulist();
    //分类会员
    if ($get == 1) {
        $page_per = 20;
        $page = get_page();
        $limit = 20;
        $total = get_allmember_count($where);
        $page_total = max(1, ceil($total / $limit));
        $page = min($page, $page_total);
        $offset = ($page - 1) * $limit;
        //$offset = 0;//enky add
        $member_list = get_member_list($where, $sql_sort, "limit {$offset},{$page_per}");
        //来源
        if ($member_list) {
            foreach ($member_list as $key => $user) {
                if (preg_match_all("/(wf=\\w+)&?|(st=\\w+)&?/i", $user['source'], $matches)) {
                    $member_list[$key]['source'] = $matches[1][0] . "<br />" . $matches[2][1];
                }
            }
        }
        // echo $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
        $currenturl = "index.php?action=allmember&h=class";
        //$currenturl1 = "index.php?action=allmember&h=class&clear=1";
        $currenturl1 = "index.php?action=allmember&h=class&clear=1&effect_grade={$effect_grade}&keyword={$keyword}&end={$endTime}&start={$startTime}";
        $page_links = multipage($total, $page_per, $page, $currenturl1);
        $age_arr = array();
        for ($i = 18; $i < 100; $i++) {
            $age_arr[] = $i;
        }
        //获取本次查询条件
        $condition = get_condition($where);
    }
    $title = '分类会员列表';
    require_once adminTemplate('allmember_general');
}
<?php

require_once '../../config.php';
require_once '../../db_functions.php';
require_once '../../db_queries.php';
$patient = format($_POST['name']);
$condition_id = $_POST['condition'];
$doctor_id = $_POST['doctor'];
if (mysql_query("CALL add_patient('{$patient}', {$condition_id}, {$doctor_id})")) {
    header('Location: ../confirmation/patient_created.php?name=' . $_POST['name'] . '&condition=' . get_condition($_POST['condition']) . '&doctor=' . get_doctor_name($_POST['doctor']));
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}
<?php

include_once '/../includes/hw_function.php';
if (get_status() == '1') {
    $status = 'Armed';
} else {
    $status = 'Disarmed';
}
if (get_condition() == '1') {
    $condition = 'Unlocked';
} else {
    $condition = 'Locked';
}
?>
<ul class="list-inline">
	<li><strong>Condition : <?php 
echo $condition;
?>
</strong></li>
	<li><strong>|</strong></li>
	<li><strong>Status : <?php 
echo $status;
?>
</strong></li>
	<li><strong>|</strong></li>
	<li><strong>Password Attemps : <?php 
echo get_attempts();
?>
</strong></li>
</ul>
<?php

require_once '../../config.php';
require_once '../../db_functions.php';
require_once '../../db_queries.php';
$patient_id = $_POST['patient'];
$condition_id = $_POST['condition'];
if (insert_HasCondition($patient_id, $condition_id) == TRUE) {
    header('Location: ../confirmation/patient_condition_added.php?patient=' . get_patient($patient_id) . '&condition=' . get_condition($condition_id));
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}