8 require_once(dirname(__FILE__) .
'/../../lib/View.php');
9 require_once(dirname(__FILE__) .
'/../../lib/Controller.php');
10 require_once(dirname(__FILE__) .
'/BasicInfoModel.php');
12 define(
'PAGER_RPP', 10);
27 if ($_SESSION[
'minfo'][
'role'] !=
'root') {
28 $this->viewName =
'basic_info_err';
35 $this->view =
new View();
37 $this->param[
'base'] = dirname(__FILE__);
39 if (empty($this->param[
'act'])) {
42 switch ($this->param[
'act']) {
43 case 'edit': $this->
_edit();
break;
44 case 'remember': $this->
_remember();
break;
45 case 'search': $this->
_search();
break;
46 case 'check': $this->
_check();
break;
47 case 'regist': $this->
_regist();
break;
48 default: $this->
_list();
break;
55 $this->viewName =
'basic_info_list';
60 'pager' => [
'page' => 1,
'rpp' =>
PAGER_RPP],
63 $this->dat[
'list'] = $this->model->getList($this->dat[
'cnd']);
64 $this->dat[
'member'] = $this->model->getMemberList($this->dat[
'list'][
'rec']);
66 $_SESSION[
'basic_info_list_cnd'] = $this->dat[
'cnd'];
71 $this->viewName =
'basic_info_list';
74 'cnd_name' => $this->param[
'cnd_name'],
75 'cnd_year' => $this->param[
'cnd_year'],
76 'pager' => [
'page' => $this->param[
'page_curr'],
'rpp' =>
PAGER_RPP],
79 $this->dat[
'list'] = $this->model->getList($this->dat[
'cnd']);
80 $this->dat[
'member'] = $this->model->getMemberList($this->dat[
'list'][
'rec']);
82 $_SESSION[
'basic_info_list_cnd'] = $this->dat[
'cnd'];
87 $this->viewName =
'basic_info_list';
88 $this->dat[
'cnd'] = $_SESSION[
'basic_info_list_cnd'];
89 $this->dat[
'list'] = $this->model->getList($this->dat[
'cnd']);
90 $this->dat[
'member'] = $this->model->getMemberList($this->dat[
'list'][
'rec']);
95 $this->viewName =
'basic_info_edit';
96 $this->dat = $this->model->getData($this->param[
'bid']);
97 $this->mem = $this->model->getMember();
103 $name = $this->param[
'name'];
104 $disp_name = $this->param[
'disp_name'];
105 $term_year = $this->param[
'term_year'] + 0;
106 $term_begin = $this->param[
'term_begin'];
107 $term_end = $this->param[
'term_end'];
113 if (empty($disp_name)) {
114 $err[] =
'表示名称は必須です。';
117 if (empty($term_year)) {
120 if ($term_year <
YEARS[0] ||
YEARS[1] < $term_year) {
125 if (empty($term_begin)) {
128 if (!$this->
chkYmd($term_begin)) {
133 if (empty($term_end)) {
136 if (!$this->
chkYmd($term_end)) {
142 $this->rest = json_encode([
'sts' =>
'OK']);
144 $this->rest = json_encode([
'sts' =>
'NG',
'err' => $err]);
150 $err = $this->model->regist($this->param);
153 $this->rest = json_encode([
'sts' =>
'NG',
'err' => $err]);
157 $this->rest = json_encode([
'sts' =>
'OK']);