}
            } else {
                $result['failedNum'] += 1;
                $result['message'][] = $record['username'] . ' : 重复创建账号';
            }
        }
    } else {
        $result['state'] = 'failed';
        $result['message'] = $excel->getError();
    }
    echo json_encode($result);
} else {
    if ($type == 'exportExcelModel') {
        $model = array(array('学号', '姓名', '性别(F表示女,M表示男)', '身份(S表示学生,T表示老师)'));
        $excel = new Excel();
        $excel->exportExcel($model, "账号表模板");
    }
}
// $result = array(
//     'state' => 'success',
//     'context' => 'success'
// );
// echo json_encode($result);
// if(Input::exists('post')){
//     if (Input::get('token')){
// 	    if ($_POST['submitreg'] == "createAccount")
// 	    {
// 	        $validate = new Validate();
// 	        $validation = $validate-> check($_POST,array(
// 	            'userreg' => array(
// 	                'name' =>'username' ,           //in the table