8 require_once(dirname(__FILE__) .
'/../../lib/View.php');
9 require_once(dirname(__FILE__) .
'/../../lib/Controller.php');
10 require_once(dirname(__FILE__) .
'/UserEraModel.php');
28 $this->bid = $_SESSION[
'minfo'][
'bid'];
30 $this->view =
new View();
32 $this->param[
'base'] = dirname(__FILE__);
34 $basic = $this->model->getBasicByBid($this->bid);
37 $this->
_error(
'基本情報が見つかりません。');
43 if (empty($this->param[
'act'])) {
46 switch ($this->param[
'act']) {
47 case 'create': $this->
_create();
break;
48 case 'drop': $this->
_drop();
break;
49 case 'edit': $this->
_edit();
break;
50 case 'check': $this->
_check();
break;
51 case 'regist': $this->
_regist();
break;
52 default: $this->
_list();
break;
59 $this->viewName =
'user_era_err';
65 $this->viewName =
'user_era_list';
67 $this->dat[
'list'] = $this->model->getList();
72 $this->viewName =
'user_era_create';
77 $this->viewName =
'user_era_edit';
78 $this->dat = $this->model->getData($this->param[
'id']);
85 $insert = (empty($this->param[
'insert'])) ?
false :
true;
86 $ymd = $this->param[
'ymd'];
87 $era = $this->param[
'era'];
88 $abr = $this->param[
'abr'];
93 if (!$this->
chkYmd($ymd)) {
107 $this->rest = json_encode([
'sts' =>
'OK']);
109 $this->rest = json_encode([
'sts' =>
'NG',
'err' =>
$err]);
115 $insert = (empty($this->param[
'insert'])) ?
false :
true;
118 $err = $this->model->insert($this->param);
120 $err = $this->model->regist($this->param);
124 $this->rest = json_encode([
'sts' =>
'NG',
'err' =>
$err]);
128 $this->rest = json_encode([
'sts' =>
'OK']);
133 $err = $this->model->delete($this->param);
136 $this->rest = json_encode([
'sts' =>
'NG',
'err' =>
$err]);
140 $this->rest = json_encode([
'sts' =>
'OK']);