_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } /*---------------------------------------------------------- カレンダー表示 ----------------------------------------------------------*/ function executeCalendar () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } /*---------------------------------------------------------- 円/ドル選択表示 ----------------------------------------------------------*/ function executeCurrency () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } return $this->render('s/application/beach_currency'); } /*---------------------------------------------------------- 入力表示 ----------------------------------------------------------*/ function executeInput () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } return $this->render('s/application/beach_input'); } /*---------------------------------------------------------- オプション表示 ----------------------------------------------------------*/ function executeOption () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; $options = $this->_getOptions(); $options_list = array(); $options_value = array(); $options_output = array(); foreach ($options as $key => $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_value[$val['category']][$val['image']][] = $val['seq']; $options_output[$val['category']][$val['image']][] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_value[$val['category']][$val['image']][] = $val['seq']; $options_output[$val['category']][$val['image']][] = $val['name'] . ' ' . number_format($val['price']) . '円'; } foreach ($val as $key2 => $val2) { $this->options[$key][$key2] = $val2; } } $this->options_list = $options_list; $this->options_value = $options_value; $this->options_output = $options_output; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } return $this->render('s/application/beach_option'); } /*---------------------------------------------------------- ブーケ表示 ----------------------------------------------------------*/ function executeBouquet1 () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; } } } $this->options = $options; $this->options_list = $options_list; $this->options_list2 = $options_list2; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']] = $val['name']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkOption(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_option'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } if (in_array(8, $this->option)) { return $this->render('s/application/beach_bouquet1'); } else { return $this->render('s/application/beach_payment'); } } /*---------------------------------------------------------- ブーケ表示 ----------------------------------------------------------*/ function executeBouquet2nd () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; } } } $this->options = $options; $this->options_list = $options_list; $this->options_list2 = $options_list2; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']] = $val['name']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } if (in_array(8, $this->option)) { return $this->render('s/application/beach_bouquet2'); } else { return $this->render('s/application/beach_payment'); } } /*---------------------------------------------------------- ブーケ表示 ----------------------------------------------------------*/ function executeBouquet3rd () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; } } } $this->options = $options; $this->options_list = $options_list; $this->options_list2 = $options_list2; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']] = $val['name']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } if (in_array(8, $this->option)) { return $this->render('s/application/beach_bouquet3'); } else { return $this->render('s/application/beach_payment'); } } /*---------------------------------------------------------- お支払選択表示 ----------------------------------------------------------*/ function executePayment () { $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; } } } $this->options = $options; $this->options_list = $options_list; $this->options_list2 = $options_list2; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']] = $val['name']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } return $this->render('s/application/beach_payment'); } /*---------------------------------------------------------- 確認表示 ----------------------------------------------------------*/ function executeConfirm () { $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; } } } $this->options = $options; $this->options_list = $options_list; $this->options_list2 = $options_list2; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']]['name'] = $val['name']; $bouquet_list[$val['seq']]['photo'] = $val['photo']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } $_error = $this->_checkPayment(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_payment'); } return $this->render('s/application/beach_confirm'); } /*---------------------------------------------------------- 登録処理 ----------------------------------------------------------*/ function executeRegist () { $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('s/application/error'); } $this->plans = $plans; if ($this->pay_currency == 2) { $price = $plans['price2']; } else { $price = $plans['price']; } $price += $this->cameraman_list[$this->shimei]['price']; $schedule = $plans['schedule']; $options = $this->_getOptions(); $options_list = array(); $options_list2 = array(); $option_schedule = array(); foreach ($options as $val) { if ($this->pay_currency == 2) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; $options_list2[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if (in_array($val['seq'], $this->option)) { $price += $val['price2']; if (!empty($val['schedule'])) { $option_schedule[] = $val['schedule']; } } } else { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { $price += $val['price']; if (!empty($val['schedule'])) { $option_schedule[] = $val['schedule']; } } } } $this->options = $options; $this->options_list = $options_list; $spas = $this->_getSpas(); $spas_list = array(); foreach ($spas as $val) { if ($this->pay_currency == 2) { $spas_list[$val['seq']] = $val['name'] . ' ' . preg_replace('/^(.*)\.0+$/', '${1}', number_format($val['price2'], 2)) . 'ドル'; if ($val['seq'] == $this->spa) { $price += $val['price2']; } } else { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; } } } if ($this->plu_option == 1) { if ($this->pay_currency == 2) { $price += 325; } else { $price += 39000; } $this->plu_option_str = '日本国内事前試着'; if ($this->pay_currency == 2) { $this->plu_option_str .= ' 325ドル'; } else { $this->plu_option_str .= ' 39,000円'; } $this->plu_option_str .= '
来店希望サロン:' . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= '
来店希望日時:未定'; } else { $this->plu_option_str .= '
来店希望日時:' . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } $spas_list[0] = 'スパ・エステなし'; $this->spas = $spas; $this->spas_list = $spas_list; $this->price = $price; $bouquet = $this->_getBouquet(); foreach ($bouquet as $val) { $bouquet_list[$val['seq']] = $val['name']; } $this->bouquet_list = $bouquet_list; $this->bouquet = $bouquet; $_error = $this->_checkCalendar($this->hope_date, $this->hope_time); if ($_error) { $this->errors['hope_date'] = $_error; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('s/application/beach_calendar'); } if (empty($this->pay_currency)) { $this->errors['pay_currency'] = 'お支払いを希望する通貨を選択してください。'; return $this->render('s/application/beach_currency'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_input'); } $_error = $this->_checkPayment(); if ($_error) { $this->errors = $_error; return $this->render('s/application/beach_payment'); } $name1 = $this->sei1 . ' ' . $this->mei1; $name2 = $this->sei2 . ' ' . $this->mei2; $roman1 = $this->roman_sei1 . ' ' . $this->roman_mei1; $roman2 = $this->roman_sei2 . ' ' . $this->roman_mei2; $kana1 = $this->kana_sei1 . ' ' . $this->kana_mei1; $kana2 = $this->kana_sei2 . ' ' . $this->kana_mei2; $tel = $this->tel1 . '-' . $this->tel2 . '-' . $this->tel3; $zip = $this->zip1 . '-' . $this->zip2; $pref = $GLOBALS['PREF'][$this->pref]; $hawaii_tel = $this->hawaii_tel1 . '-' . $this->hawaii_tel2 . '-' . $this->hawaii_tel3; $arrival = $this->arrival['month'] . '月' . $this->arrival['date'] . '日' . $this->arrival['hour'] . '時'; $returns = $this->returns['month'] . '月' . $this->returns['date'] . '日' . $this->returns['hour'] . '時'; if ($this->size1 === 'o') { $size1 = $this->size1_other; } else { $size1 = $GLOBALS['MAN_SIZE'][$this->size1]; } if ($this->size2 === 'o') { $size2 = $this->size2_other; } else { $size2 = $GLOBALS['WOMAN_SIZE'][$this->size2_num]; } $hope_date = date('Y-m-d H:i:s', strtotime($this->hope_date . ' ' . $this->hope_time)); $option_str = ''; foreach ($this->option as $val) { if (in_array($val, array(179,180,191))) { $option_str .= (($this->kakou == 1) ? '[ナチュラル]' : '[しっかり]') . $options_list2[$val] . ' '; } else { $option_str .= $options_list2[$val] . ' '; } } $option_schedule_str = implode(',', $option_schedule); if (!empty($option_schedule_str)) { $option_schedule_str = $option_schedule_str . ','; } $schedule = str_replace('O,', $option_schedule_str, $schedule); if (in_array(22, $this->option) || in_array(23, $this->option) || in_array(46, $this->option)) { $sql = "SELECT * FROM schedules WHERE seq IN (" . $schedule . ");"; $_schedules = $this->db->getAll($sql, array()); $_schedule = explode(',', $schedule); foreach ($_schedules as $val) { if ($val['waimanalo'] > 0) { foreach ($_schedule as $key2 => $val2) { if ($val2 == $val['seq']) { $_schedule[$key2] = $val['waimanalo']; } } } } $schedule = implode(',', $_schedule); } if (in_array(8, $this->option)) { if (!empty($this->bouquet1)) { $bouquet1_txt = "\nブーケ:" . '第1希望:' . $bouquet_list[$this->bouquet1]; } if (!empty($this->bouquet2)) { $bouquet2_txt = '第2希望:' . $bouquet_list[$this->bouquet2]; } if (!empty($this->bouquet3)) { $bouquet3_txt = '第3希望:' . $bouquet_list[$this->bouquet3]; } } if ($this->plu_option == 1) { $this->option[] = 188; } $option = implode(',', $this->option); $type = $this->plans['type']; $pay = $GLOBALS['PAYMENT'][$this->pay]; $spa = $this->spa; if (empty($this->spa)) { $spa = NULL; } $spa_time = $this->spa_time; if (empty($this->spa_time)) { $spa_time = NULL; } $spa_num = $this->spa_num; if (empty($this->spa_num)) { $spa_num = NULL; } $spa_str = $spas_list[$this->spa]; if ($this->spa) { foreach ($spas as $val) { if ($val['seq'] == $this->spa) { $spa_str = $val['name']; } } $spa_str .= ' ' . $GLOBALS['SPA_TIME'][$this->spa_time]; $spa_str .= ' ' . $GLOBALS['SPA_NUM'][$this->spa_num]; } $url = SSL . "/s/application/beach_meeting.php"; $way = empty($this->siteid) ? 0 : $this->siteid; // エージェント $agent_id = empty($this->agid) ? '' : $this->agid; // 支払期日 if ($this->pay == 2) { $pay_limit = date('Y-m-d', time() + (24 * 60 * 60 * 2)); } else { $pay_limit = date('Y-m-d', time() + (24 * 60 * 60 * 4)); } /* $pay_limit = NULL; if ($type == '1' || $type == '3') { // ビーチフォト、ビーチウェディングの場合、支払期限4日後 $pay_limit = date('Y-m-d', time() + (24 * 60 * 60 * 4)); } */ // ホテルタイプ // null:設定無し, 1:通常送迎有,2:徒歩圏内 $hotel_type = null; $send_status = $pick_status = $hiresend_status = $hirepick_status = null; $_hotel = $this->db->getRow('select * from hotel where (name=? OR name_en=?);', array($this->hotel, $this->hotel)); if ($_hotel) { $hotel_type = $_hotel['type']; if ($hotel_type == '2') { // 手配必要無いためNGステータス $send_status = $pick_status = $hiresend_status = $hirepick_status = 3; } } $this->db->autoCommit(false); $sql = ''; $param = array( $name1, $name2, $roman1, $roman2, $this->mail, $this->groom_mail, $this->bride_mail, $tel, $this->password, $zip, $this->pref, $this->address1, $this->address2, $hawaii_tel, $this->hotel, $arrival, $returns, $size1, $size2, $this->foot1, $this->foot2, $this->message, $this->pay, $hope_date, $option, $type, $spa, $spa_time, $spa_num, $this->plan, 0, $price, $this->height1, $this->height2, $way, $schedule, $kana1, $kana2, (empty($this->bouquet1) ? 0 : $this->bouquet1), (empty($this->bouquet2) ? 0 : $this->bouquet2), (empty($this->bouquet3) ? 0 : $this->bouquet3), (($this->plan == 38) ? 0 : 0), $this->pregnancy, $this->companion_adult, $this->companion_child, $this->bring, date('Y-m-d', $this->birthday1['Time']), date('Y-m-d', $this->birthday2['Time']), $agent_id, $price, $pay_limit, $this->pay_currency, $this->shimei, 1, $hotel_type, $send_status, $pick_status, $hiresend_status, $hirepick_status, $this->kakou, ); $sql .= ' INSERT INTO reserves '; $sql .= ' ( '; $sql .= ' name1, name2, roman1, roman2, mail, groom_mail, bride_mail, '; $sql .= ' tel, password, zip, pref, address1, '; $sql .= ' address2, hawaii_tel, hotel, arrival, returns, '; $sql .= ' size1, size2, foot1, foot2, message, '; $sql .= ' pay, decide_date, option, type, spa, '; $sql .= ' spa_time, spa_num, plan, status, price, '; $sql .= ' height1, height2, way, schedule, created, '; $sql .= ' kana1, kana2, bouquet1, bouquet2, bouquet3, '; $sql .= ' cameraman_agent, pregnancy, companion_adult, companion_child, bring, '; $sql .= ' birthday1, birthday2, agent_id, agent_price, '; $sql .= ' pay_limit, pay_currency, cameraman_shimei, smart, hotel_type, '; $sql .= ' send_status, pick_status, hiresend_status, hirepick_status, photo_kakou '; $sql .= ' ) '; $sql .= ' VALUES (?,?,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,now(), ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?, ?,?,?,?,?, ?,?,?,?,?); '; $result = $this->db->query($sql, $param); if (DB::isError($result)) { print_r($result); $this->db->rollback(); $this->errors['message'] = '登録処理に失敗しました。'; return $this->render('s/application/error'); } $this->db->commit(); $sql = "SELECT currval('reserve_seq_seq') AS seq;"; $_reserves_seq = $this->db->getRow($sql, array()); $reserves_seq = $_reserves_seq['seq']; $this->db->autoCommit(false); $sql = " INSERT INTO calendars "; $sql .= ' ( '; $sql .= ' type, reserve_date, reserve_seq '; $sql .= ' ) '; $sql .= ' VALUES (?,?,?); '; $result = $this->db->query($sql, array($plans['calendar'], $hope_date, $reserves_seq)); $this->db->commit(); // プルメリアサロン if ($this->plu_option == 1) { if ($this->plu_undecide == 1) { $param = array( $reserves_seq, $name1, $kana1, 1, // 性別 $this->mail, $tel, 0, // status ); $sql = 'INSERT INTO plu_reserves '; $sql .= '( '; $sql .= 'reserve_seq, name, kana, sex, mail, '; $sql .= 'tel, status, updated, created '; $sql .= ') '; $sql .= 'VALUES (?,?,?,?,?, ?,?,now(),now()); '; $result = $this->db->query($sql, $param); } else { $start_date = date('Y-m-d H:i:s', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); $end_date = date('Y-m-d H:i:s', (strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time) + (1 * 60 * 60))); $param = array( $reserves_seq, $name1, $kana1, 1, // 性別 $this->mail, $tel, $this->plu_salon, // salon $start_date, // decide_date 0, // status ); $sql = 'INSERT INTO plu_reserves '; $sql .= '( '; $sql .= 'reserve_seq, name, kana, sex, mail, '; $sql .= 'tel, salon, decide_date, status, updated, created '; $sql .= ') '; $sql .= 'VALUES (?,?,?,?,?, ?,?,?,?,now(),now()); '; $result = $this->db->query($sql, $param); $sql = "SELECT currval('plu_reserves_seq_seq') AS seq;"; $_plu_reserves_seq = $this->db->getRow($sql, array()); $plu_reserves_seq = $_plu_reserves_seq['seq']; $param = array( 1, $this->plu_salon, $plu_reserves_seq, $start_date, $end_date, ); $sql = "INSERT INTO plu_salon_calendars "; $sql .= '( '; $sql .= 'status, salon, reserve_seq, start_date, end_date '; $sql .= ') '; $sql .= 'VALUES (?,?,?,?,?); '; $result = $this->db->query($sql, $param); } } $this->db->commit(); $subject = '【Royal Kaila Wedding】ビーチフォトお申込みありがとうございます'; switch ($this->siteid) { case 1 : $subject = '【Photo Wedding Royal Kaila】ビーチフォトお申込みありがとうございます'; break; case 2 : $subject = '【Hawaii Wedding Royal Kaila】ビーチフォトお申込みありがとうございます'; break; case 3 : $subject = '【Hawaii Resort Royal Kaila】ビーチフォトお申込みありがとうございます'; break; case 'location' : $subject = '【Wedding Location Royal Kaila】ビーチフォトお申込みありがとうございます'; break; } $pay_str = "お支払いの詳細はこちらをご確認ください。\n"; $pay_str .= "https://www.exeojapan.com/ssl/royalkaila/s/application/beach_payment.php?id=" . md5($reserves_seq) . "\n"; if ($this->pay == 2) { $pay_str .= "24時間以内のお支払いをお願いいたします。"; } else { $pay_str .= "本日より3日以内のお支払いをお願いいたします。"; } $shimei_str = ''; if ($this->shimei > 0) { $shimei_str = 'カメラマン指名:' . $this->cameraman_list[$this->shimei]['name'] . ' 指名料:'; if ($this->pay_currency == 1) { $shimei_str .= number_format($this->cameraman_list[$this->shimei]['price']) . '円'; } else { $shimei_str .= preg_replace('/^(.*)\.0+$/', '${1}', number_format($this->cameraman_list[$this->shimei]['price'], 2)) . 'ドル'; } } if ($this->plu_option == 1) { $this->plu_option_str = '日本国内事前試着:'; if ($this->pay_currency == 2) { $this->plu_option_str .= '325ドル'; } else { $this->plu_option_str .= '39,000円'; } $this->plu_option_str .= "\n来店希望サロン:" . $GLOBALS['DRESS_SALON'][$this->plu_salon]; if ($this->plu_undecide == 1) { $this->plu_option_str .= "\n来店希望日時:未定"; $this->plu_option_str .= "\n来店希望日が決まりましたら下記URLよりお知らせください。"; $this->plu_option_str .= "\nhttps://www.exeojapan.com/ssl/royalkaila/s/application/dress_salon.php"; $this->plu_option_str .= "\n※試着のご予約可能日は、撮影ご希望日の1週間前までとなります。"; } else { $this->plu_option_str .= "\n来店希望日時:" . date('Y年n月j日 H時〜', strtotime($this->plu_hope_date . ' ' . $this->plu_hope_time)); } } // 新郎様、新婦様メールアドレス $groom_mail_text = ''; if ($this->groom_mail) { $groom_mail_text = "\n新郎様メールアドレス:{$this->groom_mail}"; } $bride_mail_text = ''; if ($this->bride_mail) { $bride_mail_text = "\n新婦様メールアドレス:{$this->bride_mail}"; } $fp = fopen(BEACH_MAIL_TEMPLATE_SM, "r"); $msg = ""; while ($x = fgets($fp)) { $x = ereg_replace("%%NAME1%%", $name1, $x); $x = ereg_replace("%%NAME2%%", $name2, $x); $x = ereg_replace("%%ROMAN1%%", $roman1, $x); $x = ereg_replace("%%ROMAN2%%", $roman2, $x); $x = ereg_replace("%%KANA1%%", $kana1, $x); $x = ereg_replace("%%KANA2%%", $kana2, $x); $x = ereg_replace("%%BIRTHDAY1%%", date('Y年m月d日', $this->birthday1['Time']), $x); $x = ereg_replace("%%BIRTHDAY2%%", date('Y年m月d日', $this->birthday2['Time']), $x); $x = ereg_replace("%%MAIL%%", $this->mail . $groom_mail_text . $bride_mail_text, $x); $x = ereg_replace("%%TEL%%", $tel, $x); $x = ereg_replace("%%PASSWORD%%", $this->password, $x); $x = ereg_replace("%%ZIP%%", $zip, $x); $x = ereg_replace("%%PREF%%", $pref, $x); $x = ereg_replace("%%ADDRESS1%%", $this->address1, $x); $x = ereg_replace("%%ADDRESS2%%", $this->address2, $x); $x = ereg_replace("%%HAWAII_TEL%%", $hawaii_tel, $x); $x = ereg_replace("%%HOTEL%%", $this->hotel, $x); $x = ereg_replace("%%ARRIVAL%%", $arrival, $x); $x = ereg_replace("%%RETURNS%%", $returns, $x); $x = ereg_replace("%%SIZE1%%", $size1, $x); $x = ereg_replace("%%SIZE2%%", $size2, $x); $x = ereg_replace("%%FOOT1%%", $this->foot1, $x); $x = ereg_replace("%%FOOT2%%", $this->foot2, $x); $x = ereg_replace("%%HEIGHT1%%", $this->height1, $x); $x = ereg_replace("%%HEIGHT2%%", $this->height2, $x); $x = ereg_replace("%%MESSAGE%%", $this->message, $x); $x = ereg_replace("%%PAY%%", $pay, $x); $x = ereg_replace("%%PAY_STR%%", $pay_str, $x); $x = ereg_replace("%%HOPE_DATE%%", date('Y年m月d日 H時i分〜', strtotime($hope_date)), $x); $x = ereg_replace("%%OPTION%%", $option_str, $x); $x = ereg_replace("%%BOUQUET%%", $bouquet1_txt . ' ' . $bouquet2_txt . ' ' . $bouquet3_txt, $x); $x = ereg_replace("%%PLUMERIA%%", $this->plu_option_str, $x); $x = ereg_replace("%%SPA_STR%%", $spa_str, $x); $x = ereg_replace("%%PLAN%%", $plans['name'], $x); $x = ereg_replace("%%PRICE%%", preg_replace('/^(.*)\.0+$/', '${1}', number_format($price, 2)) . (($this->pay_currency == 1) ? '円' : 'ドル'), $x); $x = ereg_replace("%%ID%%", $reserves_seq, $x); $x = ereg_replace("%%URL%%", $url, $x); $x = ereg_replace("%%OTHER%%", $shimei_str, $x); $x = ereg_replace("%%PREGNANCY%%", (($this->pregnancy == 0) ? 'いいえ' : '妊娠' . $this->pregnancy . 'ヶ月'), $x); $x = ereg_replace("%%COMPANION_ADULT%%", $this->companion_adult, $x); $x = ereg_replace("%%COMPANION_CHILD%%", $this->companion_child, $x); $x = ereg_replace("%%BRING%%", (($this->bring == 1) ? 'あり' : 'なし'), $x); $msg .= $x; } mb_language("Japanese"); mb_internal_encoding("EUC-JP"); if ($this->mail) { mb_send_mail($this->mail, $subject, $msg, "From:" . ADMIM_MAIL, "-f " . ADMIM_MAIL); } mb_send_mail(ADMIM_MAIL, $subject, $msg, "From:" . $this->mail, "-f " . ADMIM_MAIL); mb_send_mail('takeshiyokohama8940@docomo.ne.jp', $subject, $msg, "From:" . ADMIM_MAIL, "-f " . ADMIM_MAIL); /* mb_send_mail('honda@exeo-japan.jp', $subject, $msg, "From:" . ADMIM_MAIL, "-f " . ADMIM_MAIL); mb_send_mail('nagakubo@exeo-japan.jp', $subject, $msg, "From:" . ADMIM_MAIL, "-f " . ADMIM_MAIL); */ $this->redirectTo('finish'); } // --------------------------------------------- // 完了 // --------------------------------------------- function executeFinish () { return $this->render('s/application/finish'); } // --------------------------------------------- // 日時確認 // --------------------------------------------- function _checkCalendar ($hope_date, $hope_time) { $hope_sec = strtotime($hope_date . ' ' . $hope_time); // プランに設定された予約可能曜日 $weeks = explode(',', $this->plans['weeks']); // プランに設定された予約可能時間 $times = explode(',', $this->plans['times']); // サロンメイク・ホテルメイクどちらのカレンダーか $calendar_type = $this->plans['calendar']; if (!in_array($hope_time, $times)) { return 'ご選択いただいた日時はご予約できません。'; } if (!in_array(date('w', $hope_sec), $weeks)) { return 'ご選択いただいた日時はご予約できません。'; } // 7日前確認 if ($hope_sec < (time() + (24 * 60 * 60 * 7))) { return 'ご選択いただいた日時はご予約できません。'; } $param = array(date('Y-m-d H:i:s', $hope_sec), $calendar_type); $sql = "SELECT reserve_date FROM calendars "; $sql .= " WHERE reserve_date = ? "; $sql .= " AND type = ?; "; $reserve_date = $this->db->getRow($sql, $param); if (!empty($reserve_date)) { return 'ご選択いただいた日時はご予約できません。'; } return NULL; } // --------------------------------------------- // 入力確認 // --------------------------------------------- function _checkInput () { $errors = array(); if (empty($this->sei1) || empty($this->mei1)) { $errors['name1'] = '新郎様氏名を入力してください。'; } if (empty($this->sei2) || empty($this->mei2)) { $errors['name2'] = '新婦様氏名を入力してください。'; } if (empty($this->roman_sei1) || empty($this->roman_mei1)) { $errors['roman1'] = '新郎様ローマ字を入力してください。'; } else if (!preg_match('/^[a-zA-Z]+$/', $this->roman_sei1) || !preg_match('/^[a-zA-Z]+$/', $this->roman_mei1)) { $errors['roman1'] = '新郎様ローマ字は全て半角英字で入力してください。'; } if (empty($this->roman_sei2) || empty($this->roman_mei2)) { $errors['roman2'] = '新婦様ローマ字を入力してください。'; } else if (!preg_match('/^[a-zA-Z]+$/', $this->roman_sei2) || !preg_match('/^[a-zA-Z]+$/', $this->roman_mei2)) { $errors['roman2'] = '新婦様ローマ字は全て半角英字で入力してください。'; } $_kana_sei1 = mb_convert_encoding($this->kana_sei1, "UTF-8", "EUC-JP"); $_kana_mei1 = mb_convert_encoding($this->kana_mei1, "UTF-8", "EUC-JP"); $_kana_sei2 = mb_convert_encoding($this->kana_sei2, "UTF-8", "EUC-JP"); $_kana_mei2 = mb_convert_encoding($this->kana_mei2, "UTF-8", "EUC-JP"); $pattern = mb_convert_encoding('/^[ァ-ヶー]+$/u', "UTF-8", "EUC-JP"); if (empty($this->kana_sei1) || empty($this->kana_mei1)) { $errors['kana1'] = '新郎様フリガナを入力してください。'; } else if (!preg_match($pattern, $_kana_sei1) || !preg_match($pattern, $_kana_mei1)) { $errors['kana1'] = '新郎様フリガナは全て全角カタカナで入力してください。'; } if (empty($this->kana_sei2) || empty($this->kana_mei2)) { $errors['kana2'] = '新婦様フリガナを入力してください。'; } else if (!preg_match($pattern, $_kana_sei2) || !preg_match($pattern, $_kana_mei2)) { $errors['kana2'] = '新婦様フリガナは全て全角カタカナで入力してください。'; } if (!checkdate($this->birthday1['Month'], $this->birthday1['Day'], $this->birthday1['Year'])) { $errors['birthday1'] = '正しい新郎様生年月日を選択してください。'; } if (!checkdate($this->birthday2['Month'], $this->birthday2['Day'], $this->birthday2['Year'])) { $errors['birthday2'] = '正しい新婦様生年月日を選択してください。'; } if (empty($this->mail)) { $errors['mail'] = 'メールアドレスを入力してください。'; } else if (!preg_match('/^[a-zA-Z0-9\.\-\+\_]+@[a-zA-Z0-9\-\_]+\.[a-zA-Z0-9\.\-\+]+$/', $this->mail)) { $errors['mail'] = '正しいメールアドレスを入力してください。'; } else if ($this->mail != $this->mail2) { $errors['mail'] = '確認用メールアドレスと一致しません。'; } if (empty($this->tel1) || empty($this->tel2) || empty($this->tel3)) { $errors['tel'] = 'お電話番号を入力してください。'; } else if (!preg_match('/^[0-9]{2,5}$/', $this->tel1) || !preg_match('/^[0-9]{1,4}$/', $this->tel2) || !preg_match('/^[0-9]{4}$/', $this->tel3)) { $errors['tel'] = '正しいお電話番号を入力してください。'; } if (empty($this->password)) { $errors['password'] = 'パスワードを入力してください。'; } else if (!preg_match('/^[a-zA-Z0-9]+$/', $this->password)) { $errors['password'] = 'パスワードは全て半角英数で入力してください。'; } else if (strlen($this->password) < 4) { $errors['password'] = 'パスワードは4文字以上で入力してください。'; } else if ($this->password != $this->password2) { $errors['mail'] = '確認用パスワードと一致しません。'; } if (empty($this->zip1) || empty($this->zip2)) { $errors['zip'] = '郵便番号を入力してください。'; } else if (!preg_match('/^[0-9]{3}$/', $this->zip1) || !preg_match('/^[0-9]{4}$/', $this->zip2)) { $errors['zip'] = '正しい郵便番号を入力してください。'; } if (empty($this->pref)) { $errors['pref'] = '都道府県を選択してください。'; } if (empty($this->address1)) { $errors['address1'] = '市区町村を入力してください。'; } if (empty($this->address2)) { $errors['address2'] = '番地・ビル名を入力してください。'; } if (!preg_match('/^[0-9]{1,2}$/', $this->arrival['month']) || !preg_match('/^[0-9]{1,2}$/', $this->arrival['date']) || !preg_match('/^[0-9]{1,2}$/', $this->arrival['hour'])) { $errors['arrival'] = '正しいハワイ到着日時を入力してください。'; } if (!preg_match('/^[0-9]{1,2}$/', $this->returns['month']) || !preg_match('/^[0-9]{1,2}$/', $this->returns['date']) || !preg_match('/^[0-9]{1,2}$/', $this->returns['hour'])) { $errors['returns'] = '正しい帰国日時を入力してください。'; } if (!is_numeric($this->size1)) { $errors['size1'] = 'お洋服のサイズ(新郎様)を選択してください。'; } else if (($this->size1 === 'o') && (!$this->size1_other)) { $errors['size1'] = 'お洋服のサイズ(新郎様)のその他が未入力です。'; } if ($this->size2 == 1) { if ($this->size2_num < 5) { $errors['size2'] = 'お洋服のサイズ(新婦様)を選択してください。'; } } else if (($this->size2 === 'o') && (!$this->size2_other)) { $errors['size2'] = 'お洋服のサイズ(新婦様)のその他が未入力です。'; } if (!is_numeric($this->foot1)) { $errors['foot1'] = '靴のサイズ(新郎様)を半角数字で入力してください。'; } if (!is_numeric($this->foot2)) { $errors['foot2'] = '靴のサイズ(新婦様)を半角数字で入力してください。'; } if (!is_numeric($this->height1)) { $errors['height1'] = '身長(新郎様)を半角数字で入力してください。'; } if (!is_numeric($this->height2)) { $errors['height2'] = '身長(新婦様)を半角数字で入力してください。'; } if (!is_numeric($this->pregnancy)) { $errors['pregnancy'] = 'ご妊娠中かどうかを選択してください。'; } if (!is_numeric($this->companion_adult)) { $errors['companion_adult'] = 'ご参列者(大人)の人数を選択してください。'; } if (!is_numeric($this->companion_child)) { $errors['companion_child'] = 'ご参列者(子供)の人数を選択してください。'; } if (!is_numeric($this->bring)) { $errors['bring'] = 'お持込の衣装の有無を選択してください。'; } if ($this->privchk != 1) { $errors['privchk'] = '「お申込みに関する個人情報の取り扱い」に同意してください。'; } return $errors; } // --------------------------------------------- // オプション確認 // --------------------------------------------- function _checkOption () { $errors = array(); if ($this->plu_option == 1) { if ($this->plu_undecide == 1) { } else if (($this->plu_salon > 0) && !empty($this->plu_hope_date) && !empty($this->plu_hope_time)) { } else { $errors['plu_option'] = '日本国内事前試着をご希望の場合は、ご希望のサロンと日時を選択してください。'; } } return $errors; } // --------------------------------------------- // 入金方法確認 // --------------------------------------------- function _checkPayment () { $price = $this->price; if (empty($this->pay)) { $errors['pay'] = '支払方法を選択してください。'; } else if (($price > 150000) && ($this->pay == 2)) { $errors['pay'] = 'この支払方法は選択できません。'; } } // --------------------------------------------- // プラン取得 // --------------------------------------------- function _getPlan () { $hope_date = empty($this->hope_date) ? date('Y-m-d') : $this->hope_date; $param = array($hope_date, $this->plan); $sql = "SELECT "; $sql .= " A.seq,A.name,A.name_eng,T1.price,T1.price2,A.church,A.weeks,A.times,A.schedule,A.type,A.calendar,A.cut "; $sql .= "FROM "; $sql .= " (SELECT "; $sql .= " DISTINCT ON (plan_seq) plan_seq, start_date, price, price2 "; $sql .= " FROM plan_price "; $sql .= " WHERE start_date <= ? "; $sql .= " AND switch IS TRUE "; $sql .= " ORDER BY plan_seq, start_date DESC) T1 "; $sql .= "LEFT JOIN "; $sql .= " plans A "; $sql .= " ON A.seq = T1.plan_seq "; $sql .= "WHERE "; $sql .= " A.seq = ?;"; $plans = $this->db->getRow($sql, $param); return $plans; } // --------------------------------------------- // オプション取得 // --------------------------------------------- function _getOptions () { $param = array($this->hope_date); $sql = "SELECT "; $sql .= " A.seq, A.name,T1.price,T1.price2,A.plan_seq,A.schedule,A.category,A.sort,A.switch,A.cut,A.caption,A.photo,A.image "; $sql .= "FROM "; $sql .= " (SELECT "; $sql .= " DISTINCT ON (option_seq) option_seq, start_date, price, price2 "; $sql .= " FROM option_price "; $sql .= " WHERE start_date <= ? "; $sql .= " AND switch IS TRUE "; $sql .= " ORDER BY option_seq, start_date DESC) T1 "; $sql .= "LEFT JOIN "; $sql .= " options A "; $sql .= " ON A.seq = T1.option_seq "; $sql .= "WHERE "; $sql .= " ('" . $this->plan . "' = ANY(string_to_array(A.plan_seq,',')) "; if (in_array($this->plan, array(1, 2, 38))) { $sql .= " OR A.seq IN (62, 63)) "; } else { $sql .= " ) "; } $sql .= "ORDER BY "; $sql .= " A.category ASC, A.sort ASC;"; $options = $this->db->getAll($sql, $param); return $options; } // --------------------------------------------- // スパ取得 // --------------------------------------------- function _getSpas () { $param = array($this->hope_date); $sql = "SELECT "; $sql .= " A.seq, A.name,T1.price,T1.price2,A.plan_seq,A.schedue,A.sort,A.caption,A.image "; $sql .= "FROM "; $sql .= " (SELECT "; $sql .= " DISTINCT ON (spa_seq) spa_seq, start_date, price, price2 "; $sql .= " FROM spa_price "; $sql .= " WHERE start_date <= ? "; $sql .= " AND switch IS TRUE "; $sql .= " ORDER BY spa_seq, start_date DESC) T1 "; $sql .= "LEFT JOIN "; $sql .= " spas A "; $sql .= " ON A.seq = T1.spa_seq "; $sql .= "WHERE "; $sql .= " '" . $this->plan . "' = ANY(string_to_array(A.plan_seq,',')) "; $sql .= "ORDER BY "; $sql .= " A.sort ASC;"; $spas = $this->db->getAll($sql, $param); return $spas; } // --------------------------------------------- // ブーケ取得 // --------------------------------------------- function _getBouquet () { $param = array(); $sql = "SELECT * FROM bouquet "; $sql .= " WHERE switch IS TRUE "; $sql .= " ORDER BY sort ASC; "; $bouquet = $this->db->getAll($sql, $param); return $bouquet; } // --------------------------------------------- // カレンダーリスト取得 // --------------------------------------------- function _getCalendarList ($max = 9) { $calendar_list = array(); $year = date('Y'); $month = date('n'); if ($year == '2013') { $year = 2014; $month = 1; } for ($i = 0; $i < $max; $i++) { $_time = mktime(0, 0, 0, ($month + $i), 1, $year); if ($i == $this->p) { $calendar_list[$i]['str'] = date('Y年n月', $_time); } else { $calendar_list[$i]['str'] = date('n月', $_time); } $calendar_list[$i]['param'] = '&p=' . $i; } return $calendar_list; } // --------------------------------------------- // カレンダー取得 // --------------------------------------------- function _getCalendar () { // 初期値設定 $calendar = array(); $start_time = mktime(0, 0, 0, (date('n') + $this->p), 1, date('Y')); if (date('Y') === '2013') { $start_time = mktime(0, 0, 0, (1 + $this->p), 1, 2014); } $start = date('Y-m-d H:i:s', $start_time); $end = date('Y-m-d H:i:s', mktime(0, 0, 0, (date('n') + $this->p + 1), 1, date('Y'))); if (date('Y') === '2013') { $end = date('Y-m-d H:i:s', mktime(0, 0, 0, (1 + $this->p + 1), 1, 2014)); } $year = date('Y', $start_time); $month = date('m', $start_time); $firstday = date('w', $start_time); $_lastday = strtotime(date('Y-m-t', $start_time)); $lastday = date('w', $_lastday); // プランに設定された予約可能曜日 $weeks = explode(',', $this->plans['weeks']); // サロンメイク・ホテルメイクどちらのカレンダーか $calendar_type = $this->plans['calendar']; // 定休日取得(01時に登録があれば定休日) $param = array($start, $end, $calendar_type); $sql = "SELECT reserve_date FROM calendars "; $sql .= " WHERE reserve_date >= ? "; $sql .= " AND reserve_date < ? "; $sql .= " AND reserve_date::time = '01:00' "; $sql .= " AND type = ? "; $sql .= " ORDER BY reserve_date; "; $_reserve_date2 = $this->db->getAll($sql, $param); $holiday = array(); foreach ($_reserve_date2 as $val) { $holiday[] = date('j', strtotime($val['reserve_date'])); } unset($_reserve_date2); // 前月日曜日から1日まで $day = 0; while ($day < $firstday) { $_ary = array(); $_ary['date'] = 0; $_ary['class'] = ''; $_ary['status'] = 0; // 時間表示なし if (($day === 0) || ($day === 6)) { $_ary['class'] = 'holiday'; } $calendar[] = $_ary; $day++; } // 1日〜31日までループ for ($date = 1; $date <= 31; $date++) { if (checkdate($month, $date, $year) === TRUE) { $_time = mktime(0, 0, 0, $month, $date, $year); $_week = date('w', $_time); $_ary['date'] = $date; if (!in_array($_week, $weeks)) { // 定休日:プラン指定の曜日外 $_ary['class'] = 'holi'; $_ary['status'] = 0; } else if (in_array($date, $holiday)) { // 定休日:指定された日付 $_ary['class'] = 'holi'; $_ary['status'] = 0; } else if (($month == 7) && ($date == 4)) { // 定休日:独立記念日 $_ary['class'] = 'holi'; $_ary['status'] = 0; } else if (($month == 12) && ($date == 25)) { // 定休日:クリスマス $_ary['class'] = 'holi'; $_ary['status'] = 0; } else if (($month == 1) && ($date == 1)) { // 定休日:お正月 $_ary['class'] = 'holi'; $_ary['status'] = 0; } else if ($_time < time()) { // 受付け終了 $_ary['class'] = 'finish'; $_ary['status'] = 0; } else { $_ary['class'] = ''; if ($_time < (time() + 7 * 24 * 60 * 60)) { // 7日以内(電話予約) $_ary['status'] = 2; // オンライン予約不可 } else { // 通常のカレンダー表示 $_ary['status'] = 1; // オンライン予約可 $_ary['query'] = '?date=' . date('Y-m-d', $_time); } } $calendar[] = $_ary; } } $lastday++; while ($lastday <= 6) { $_ary = array(); $_ary['date'] = 0; $_ary['class'] = ''; $_ary['status'] = 0; if (($lastday === 0) || ($lastday === 6)) { $_ary['class'] = 'holiday'; } $calendar[] = $_ary; $lastday++; } return $calendar; } /*---------------------------------------------------------- 設定フィルター ----------------------------------------------------------*/ function defaultSetBeforeFilter () { parent::defaultSetBeforeFilter(); // 入力値をSESSIONに格納、SESSION値を各項目として代入 $_array = array( 'sei1', 'mei1', 'sei2', 'mei2', 'roman_sei1', 'roman_mei1', 'roman_sei2', 'roman_mei2', 'kana_sei1', 'kana_mei1', 'kana_sei2', 'kana_mei2', 'mail2', 'password2', 'mail', 'groom_mail', 'bride_mail', 'tel1', 'tel2', 'tel3', 'password', 'zip1', 'zip2', 'pref', 'address1', 'address2', 'hawaii_tel1', 'hawaii_tel2', 'hawaii_tel3', 'hotel', 'arrival', 'returns', 'size1', 'size2', 'foot1', 'foot2', 'size1_other', 'size2_other', 'size2_num', 'height1', 'height2', 'message', 'pay', 'privchk', 'shimei', 'hope_date', 'hope_time', 'plan', 'option', 'spa', 'spa_time', 'spa_num', 'siteid', 'agid', 'bouquet1', 'bouquet2', 'bouquet3', 'pregnancy', 'companion_adult', 'companion_child', 'bring', 'birthday1', 'birthday2', 'pay_currency', 'plu_option', 'plu_hope_date', 'plu_hope_time', 'plu_undecide', 'plu_salon', 'kakou', ); foreach ($_GET as $key => $val) { if (!isset($_POST[$key])) { $_POST[$key] = $val; } } foreach ($_array as $val) { if (isset($_POST[$val])) { $_SESSION[$val] = $this->{$val}; } else { if (isset($_SESSION[$val])) { $this->{$val} = $_SESSION[$val]; } } } if (empty($this->p)) { $this->p = 0; } if (empty($this->shimei)) { $this->shimei = 0; } if ($_SESSION['plan'] == 2) { $_SESSION['plan'] = 38; } if (is_numeric($_SESSION['plan'])) { $_start_date = isset($this->hope_date) ? $this->hope_date : date('Y-m-d'); $param = array($_SESSION['plan'], $_start_date); $sql = "SELECT * FROM cameraman_shimei "; $sql .= " WHERE plan_seq = ? "; $sql .= " AND start_date <= ? "; $sql .= " AND switch IS TRUE "; $sql .= " ORDER BY start_date DESC LIMIT 1; "; $_shimei = $this->db->getRow($sql, $param); if ($this->pay_currency != 2) { $_shimei_price = $_shimei['price']; } else { $_shimei_price = $_shimei['price2']; } $this->cameraman_list = array(); $this->cameraman_list[0]['name'] = '指名なし'; $this->cameraman_list[0]['url'] = ''; $this->cameraman_list[0]['price'] = 0; /* $this->cameraman_list[8]['name'] = 'Jun'; $this->cameraman_list[8]['url'] = 'http://www.royalkaila-junno.com/gallery/'; $this->cameraman_list[8]['price'] = $_shimei_price; */ $this->cameraman_list[14]['name'] = 'Yui'; $this->cameraman_list[14]['url'] = 'http://www.royalkaila-yuichiro.com/gallery/'; $this->cameraman_list[14]['price'] = $_shimei_price; /* $this->cameraman_list[17]['name'] = 'Yoko'; $this->cameraman_list[17]['url'] = 'http://www.photographer-yoko.com/gallery/'; $this->cameraman_list[17]['price'] = $_shimei_price; */ $this->cameraman_list[16]['name'] = 'Yumiko'; $this->cameraman_list[16]['url'] = 'http://www.photographer-yumiko.com/gallery/'; $this->cameraman_list[16]['price'] = $_shimei_price; $this->cameraman_list[11]['name'] = 'Kazuya'; $this->cameraman_list[11]['url'] = 'http://www.photographer-memories.com/gallery/beach.html'; $this->cameraman_list[11]['price'] = $_shimei_price; $this->cameraman_list[1]['name'] = 'Mako'; $this->cameraman_list[1]['url'] = 'http://www.photographer-mako.com/gallery/beach.html'; $this->cameraman_list[1]['price'] = $_shimei_price; $this->cameraman_list[7]['name'] = 'Eric'; $this->cameraman_list[7]['url'] = 'http://www.photographer-hawaii.com/gallery/beach_photo.html'; $this->cameraman_list[7]['price'] = $_shimei_price; $this->cameraman_list[13]['name'] = 'Mike Anthony'; $this->cameraman_list[13]['url'] = ''; $this->cameraman_list[13]['price'] = $_shimei_price; /* $this->cameraman_list[4]['name'] = 'Yuri'; $this->cameraman_list[4]['url'] = 'http://www.photographer-wedding.net/gallery/beach.html'; $this->cameraman_list[4]['price'] = $_shimei_price; $this->cameraman_list[3]['name'] = 'David'; $this->cameraman_list[3]['url'] = 'http://www.photographer-marriage.com/gallery/beach_photo.html'; $this->cameraman_list[3]['price'] = $_shimei_price; */ } $this->birthday1['Time'] = '0-0-0'; if (!empty($this->birthday1['Year'])) { $this->birthday1['Time'] = mktime(0, 0, 0, $this->birthday1['Month'], $this->birthday1['Day'], $this->birthday1['Year']); } $this->birthday2['Time'] = '0-0-0'; if (!empty($this->birthday2['Year'])) { $this->birthday2['Time'] = mktime(0, 0, 0, $this->birthday2['Month'], $this->birthday2['Day'], $this->birthday2['Year']); } // ホテルリスト $_hotel_list = $this->db->getAll('select * from hotel ', array()); $this->hotel_list = array(); foreach ($_hotel_list as $key => $val) { $this->hotel_list[] = $val; } // 早朝オプション対象リスト $this->early_list = array(); $this->early_list[] = 1; $this->early_list[] = 2; $this->early_list[] = 4; $this->early_list[] = 38; $this->early_list[] = 96; // プルメリアサロン選択可能日 if (!empty($_SESSION['hope_date']) && !empty($_SESSION['hope_time'])) { $_year = date('Y', (strtotime($_SESSION['hope_date'] . ' ' . $_SESSION['hope_time']) - (8 * 24 * 60 * 60))); $_month = date('n', (strtotime($_SESSION['hope_date'] . ' ' . $_SESSION['hope_time']) - (8 * 24 * 60 * 60))) - 1; $_day = date('j', (strtotime($_SESSION['hope_date'] . ' ' . $_SESSION['hope_time']) - (8 * 24 * 60 * 60))); $this->plu_maxdate = $_year . ', ' . $_month . ', ' . $_day; } else { $this->plu_maxdate = date('Y, m, d'); } // プログラム名 $this->program_name = 'beach.php'; $this->program_time = 'beach_time.php'; } } $controller = new BeachController(); $controller->process(); exit;