_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('familyphoto/calendar'); } /*---------------------------------------------------------- カレンダー表示 ----------------------------------------------------------*/ function executeCalendar () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $calendar = $this->_getCalendar(); $calendar_list = $this->_getCalendarList(); $this->calendar = $calendar; $this->calendar_list = $calendar_list; return $this->render('familyphoto/calendar'); } /*---------------------------------------------------------- 入力表示 ----------------------------------------------------------*/ function executeInput () { $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $options = $this->_getOptions(); $options_list = array(); $options_value = array(); $options_output = array(); foreach ($options as $key => $val) { $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']) . '円'; if (in_array($val['seq'], $this->option)) { if ($val['seq'] == 190) { $price += $val['price'] * $this->hula_friend; } else { $price += $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(); $spas_list[0] = 'エステなし'; foreach ($spas as $val) { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; } $this->spas = $spas; $this->spas_list = $spas_list; $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('familyphoto/calendar'); } return $this->render('familyphoto/input'); } /*---------------------------------------------------------- お支払選択表示 ----------------------------------------------------------*/ function executePayment () { $excluding_tax = array();//20170825 $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $price = $plans['price']; //$price = $plans['price_shimei']; $excluding_tax['price'] = $plans['price']; //20170825 $options = $this->_getOptions(); //$options_list = array(); //foreach ($options as $val) { // if ($val['seq'] == 190) { // $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . $this->hula_friend . '人 ' . number_format($val['price'] * $this->hula_friend) . '円'; // } else { // $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; // } // if (in_array($val['seq'], $this->option)) { // if ($val['seq'] == 190) { // $price += $val['price'] * $this->hula_friend; // } else { // $price += $val['price']; // } // } //} //$this->options = $options; //$this->options_list = $options_list; $options_list = array(); $options_value = array(); $options_output = array(); foreach ($options as $key => $val) { $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']) . '円'; if (in_array($val['seq'], $this->option)) { if ($val['seq'] == 190) { $price += $val['price'] * $this->hula_friend; $excluding_tax['option'][$val['seq']] = $val['price'] * $this->hula_friend;//20170825 } else { $price += $val['price']; $excluding_tax['option'][$val['seq']] = $val['price'];//20170825 } } 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(); $spas_list[0] = 'エステなし'; foreach ($spas as $val) { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; $excluding_tax['spa'] = $val['price'];//20170825 } } $this->spas = $spas; $this->spas_list = $spas_list; $including_tax = $this->_taxCalculation($excluding_tax);//20170901 $this->price = $price; //$this->price = $including_tax;//20170825 $this->including_tax = $including_tax;//20170901 $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('familyphoto/calendar'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('familyphoto/input'); } return $this->render('familyphoto/payment'); } /*---------------------------------------------------------- 確認表示 ----------------------------------------------------------*/ function executeConfirm () { $excluding_tax = array();//20170824 $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $price = $plans['price']; //$price = $plans['price_shimei']; $excluding_tax['price'] = $plans['price']; //20170824 $options = $this->_getOptions(); //$options_list = array(); //$options_list2 = array(); //foreach ($options as $val) { // if ($val['seq'] == 190) { // $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . $this->hula_friend . '人 ' . number_format($val['price'] * $this->hula_friend) . '円'; // $options_list2[$val['seq']] = $val['name'] . ' ' . $this->hula_friend . '人 ' . number_format($val['price'] * $this->hula_friend) . '円'; // } 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)) { // if ($val['seq'] == 190) { // $price += $val['price'] * $this->hula_friend; // } else { // $price += $val['price']; // } // } //} //$this->options = $options; //$this->options_list = $options_list; //$this->options_list2 = $options_list2; $options_list = array(); $options_list2 = array(); //20170825 $options_value = array(); $options_output = array(); foreach ($options as $key => $val) { $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; $options_list2[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円';//20170825 $options_value[$val['category']][$val['image']][] = $val['seq']; $options_output[$val['category']][$val['image']][] = $val['name'] . ' ' . number_format($val['price']) . '円'; if (in_array($val['seq'], $this->option)) { if ($val['seq'] == 190) { $price += $val['price'] * $this->hula_friend; $excluding_tax['option'][$val['seq']] = $val['price'] * $this->hula_friend;//20170824 } else { $price += $val['price']; $excluding_tax['option'][$val['seq']] = $val['price'];//20170824 } } foreach ($val as $key2 => $val2) { $this->options[$key][$key2] = $val2; } } $this->options_list = $options_list; $this->options_list2 = $options_list2; //20170825 $this->options_value = $options_value; $this->options_output = $options_output; $spas = $this->_getSpas(); $spas_list = array(); $spas_list[0] = 'エステなし'; foreach ($spas as $val) { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; $excluding_tax['spa'] = $val['price'];//20170824 } } $this->spas = $spas; $this->spas_list = $spas_list; $including_tax = $this->_taxCalculation($excluding_tax);//20170901 $this->price = $price; //$this->price = $including_tax;//20170824 $this->including_tax = $including_tax;//20170901 $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('familyphoto/calendar'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('familyphoto/input'); } $_error = $this->_checkPayment(); if ($_error) { $this->errors = $_error; return $this->render('familyphoto/payment'); } return $this->render('familyphoto/confirm'); } /*---------------------------------------------------------- 登録処理 ----------------------------------------------------------*/ function executeRegist () { $excluding_tax = array();//20170818 $price = 0; $plans = $this->_getPlan(); if (!$plans) { $this->errors['message'] = '各プランのお申込みボタンよりお申込みしてください。'; return $this->render('familyphoto/error'); } $this->plans = $plans; $price = $plans['price']; $excluding_tax['price'] = $plans['price']; //20170819 //$price = $plans['price_shimei']; $schedule = $plans['schedule']; $options = $this->_getOptions(); //$options_list = array(); //$options_list2 = array(); //$option_schedule = array(); //foreach ($options as $val) { // if ($val['seq'] == 190) { // $options_list[$val['category']][$val['seq']] = $val['name'] . ' ' . $this->hula_friend . '人 ' . number_format($val['price'] * $this->hula_friend) . '円'; // $options_list2[$val['seq']] = $val['name'] . ' ' . $this->hula_friend . '人 ' . number_format($val['price'] * $this->hula_friend) . '円'; // } 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)) { // if ($val['seq'] == 190) { // $price += $val['price'] * $this->hula_friend; // } else { // $price += $val['price']; // } // if (!empty($val['schedule'])) { // $option_schedule[] = $val['schedule']; // } // } //} //$this->options = $options; //$this->options_list = $options_list; $options_list = array(); $options_value = array(); $options_output = array(); foreach ($options as $key => $val) { $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']) . '円'; if (in_array($val['seq'], $this->option)) { if ($val['seq'] == 190) { $price += $val['price'] * $this->hula_friend; $excluding_tax['option'][$val['seq']] = $val['price'] * $this->hula_friend;//20170819 } else { $price += $val['price']; $excluding_tax['option'][$val['seq']] = $val['price'];//20170819 } } 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(); $spas_list[0] = 'エステなし'; foreach ($spas as $val) { $spas_list[$val['seq']] = $val['name'] . ' ' . number_format($val['price']) . '円'; if ($val['seq'] == $this->spa) { $price += $val['price']; $excluding_tax['spa'] = $val['price'];//20170819 } } $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('familyphoto/calendar'); } $_error = $this->_checkInput(); if ($_error) { $this->errors = $_error; return $this->render('familyphoto/input'); } $_error = $this->_checkPayment(); if ($_error) { $this->errors = $_error; return $this->render('familyphoto/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 = implode(',', $this->option); $option_str = ''; foreach ($this->option as $val) { $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]; } } $type = $this->plans['type']; $pay = $GLOBALS['PAYMENT'][$this->pay]; if ($this->pay == 1) { $pay_str = "三菱東京UFJ銀行 横浜駅前支店 (普)0687671\n株式会社エクシオジャパン ロイヤルカイラ\n(お振込み手数料はお客様ご負担となります)\n"; $pay_str .= "本日より3日以内のお支払いをお願いいたします。"; } $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 . "/application/beach_meeting.php"; $way = empty($this->siteid) ? 0 : $this->siteid; // エージェント $agent_id = empty($this->agid) ? '' : $this->agid; // 支払期日 $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; } } $including_tax = $this->_taxCalculation($excluding_tax);//20170901 $price = $including_tax; $other = ""; $this->db->autoCommit(false); $sql = ''; $param = array( $name1, $name2, $roman1, $roman2, $this->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 . in_array(190, $this->option) ? ("\n" . 'お友達追加' . $this->hula_friend . '人') : '', $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, $hotel_type, $send_status, $pick_status, $hiresend_status, $hirepick_status, ); $sql .= ' INSERT INTO reserves '; $sql .= ' ( '; $sql .= ' name1, name2, roman1, roman2, 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, hotel_type, '; $sql .= ' send_status, pick_status, hiresend_status, hirepick_status '; $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('familyphoto/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(); $subject = '【Royal Kaila】ビーチフォトお申込みありがとうございます'; 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; } if ($this->pay == 2) { $pay_str = "クレジットカードでのお支払いの詳細はこちらをご確認ください。\n"; $pay_str .= "https://www.exeojapan.com/ssl/royalkaila/application/beach_payment.php?id=" . md5($reserves_seq) . "\n"; $pay_str .= "本日より3日以内のお支払いをお願いいたします。"; } $fp = fopen(BEACH_MAIL_TEMPLATE_FPH, "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, $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("%%SPA_STR%%", $spa_str, $x); $x = ereg_replace("%%PLAN%%", $plans['name'], $x); $x = ereg_replace("%%PRICE%%", number_format($price) . '円', $x); $x = ereg_replace("%%ID%%", $reserves_seq, $x); $x = ereg_replace("%%URL%%", $url, $x); $x = ereg_replace("%%OTHER%%", $other, $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:" . ORDER_MAIL, "-f " . ORDER_MAIL); } mb_send_mail(ORDER_MAIL, $subject, $msg, "From:" . $this->mail, "-f " . ORDER_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('shinkai@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); // mb_send_mail('shimazu@exeo-japan.jp', $subject, $msg, "From:" . ADMIM_MAIL, "-f " . ADMIM_MAIL); $this->redirectTo('finish'); } // --------------------------------------------- // 完了 // --------------------------------------------- function executeFinish () { return $this->render('familyphoto/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 _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; /* $param = array($this->plan); $sql = "SELECT * FROM plans "; $sql .= " WHERE seq = ? "; $sql .= " AND type = 1; "; $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; /* $param = array(); $sql = "SELECT * FROM options "; $sql .= " WHERE ('" . $this->plan . "' = ANY(string_to_array(plan_seq,',')) "; if (in_array($this->plan, array(1, 2, 38))) { $sql .= " OR seq IN (62, 63)) "; } else { $sql .= " ) "; } $sql .= " ORDER BY 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; /* $param = array(); $sql = "SELECT * FROM spas "; $sql .= " WHERE '" . $this->plan . "' = ANY(string_to_array(plan_seq,',')) "; $sql .= " ORDER BY 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; } // 201806まで公開とする $ym = date('Ym'); if ($ym <= '201806') { $_e = (2018 * 12) + 6; $_s = ($year * 12) + $month; $max = $_e - $_s + 1; } for ($i = 0; $i < $max; $i++) { $_time = mktime(0, 0, 0, ($month + $i), 1, $year); $calendar_list[$i]['str'] = date('Y年n月', $_time); $calendar_list[$i]['param'] = '&p=' . $i; } return $calendar_list; } // --------------------------------------------- // カレンダー取得 // --------------------------------------------- function _getCalendar () { // 初期値設定 $calendar = array(); $waku = 16; $min = 30 * 60; $hour = 9 * 60 * 60 ; $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']); // プランに設定された予約可能時間 $times = explode(',', $this->plans['times']); // サロンメイク・ホテルメイクどちらのカレンダーか $calendar_type = $this->plans['calendar']; // 埋まっているスケジュール取得 $param = array($start, $end, $calendar_type); $sql = "SELECT reserve_date FROM calendars "; $sql .= " WHERE reserve_date >= ? "; $sql .= " AND reserve_date < ? "; $sql .= " AND type = ? "; $sql .= " ORDER BY reserve_date; "; $_reserve_date = $this->db->getAll($sql, $param); $reserve_date = array(); foreach ($_reserve_date as $val) { $reserve_date[] = strtotime($val['reserve_date']); } unset($_reserve_date); $ng_ymd1 = array(5,8,7,3,1,5,4,2,6,8,6,2,5,7,9,8,9,7,2,3,5,6,7,8,1,2,4,5,2,3,4,6,8,6,7,3,4,2,8,6,3,4,5,5,4,3,8,1,7,3,5); $ng_ymd2 = array(2,4,5,8,4,2,6,7,3,5,4,7,1,2,7,2,3,4,4,5,7,2,5,2,6,5,2,3,5,7,8,9,4,2,3,5,6,5,4,2,8,1,8,3,2,4,6,5,3,5,1); $ng_ymd3 = array(3,5,1,6,8,9,2,5,2,7,3,3,3,5,4,3,5,3,7,6,1,3,4,3,2,4,3,1,7,2,3,4,2,1,9,8,3,7,6,1,2,8,6,7,5,6,7,2,4,6,7); $ng_ymd4 = array(0,0,9,5,0,0,5,0,0,0,2,0,0,0,0,0,8,0,3,0,0,0,0,5,0,0,6,0,0,0,0,0,0,0,0,2,5,6,0,0,0,0,0,0,0,0,0,0,5,0,0); $ng_ymd = array("36000","37800","39600","41400","46800","48600","50400","52200","54000","55800"); $ng_year = date('Y'); $ng_month = date('m'); $ng_day = date('d'); $ng_start_unixtime = mktime( 0,0,0,$ng_month,$ng_day,$ng_year); $reserve_ng_date = array(); for($ngidx=0; $ngidx < 31; $ngidx++){ $ngary_idx = $ngidx + $month ; $reserve_ng_date[] = $ng_start_unixtime + $ng_ymd[$ng_ymd1[$ngary_idx]]; $reserve_ng_date[] = $ng_start_unixtime + $ng_ymd[$ng_ymd2[$ngary_idx]]; $reserve_ng_date[] = $ng_start_unixtime + $ng_ymd[$ng_ymd3[$ngary_idx]]; if($ng_ymd4[$ngary_idx] >= 1){ $reserve_ng_date[] = $ng_start_unixtime + $ng_ymd[$ng_ymd4[$ngary_idx]]; } $ng_start_unixtime = $ng_start_unixtime + 86400 ; } // 定休日取得(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'] = 'holiday'; $_ary['status'] = 0; } else if (in_array($date, $holiday)) { // 定休日:指定された日付 $_ary['class'] = 'holiday'; $_ary['status'] = 0; } else if (($month == 7) && ($date == 4)) { // 定休日:独立記念日 $_ary['class'] = 'holiday'; $_ary['status'] = 0; } else if (($month == 12) && ($date == 25)) { // 定休日:クリスマス $_ary['class'] = 'holiday'; $_ary['status'] = 0; } else if (($month == 1) && ($date == 1)) { // 定休日:お正月 $_ary['class'] = 'holiday'; $_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; // オンライン予約不可 for ($i = 0; $i < $waku; $i++) { $_hour_time = $_time + $hour + $min * $i; $_hour = date('G:i', $_hour_time); $_ary['time'][$_hour] = 1; if (!in_array($_hour, $times)) { // プラン指定の時間外 $_ary['time'][$_hour] = 0; } else { foreach ($reserve_date as $val) { if ($val == $_hour_time) { // 時間が埋まっている $_ary['time'][$_hour] = 0; } } foreach ($reserve_ng_date as $val) { if ($val == $_hour_time) { // 時間が埋まっている $_ary['time'][$_hour] = 0; } } } } } else { // 通常のカレンダー表示 $_ary['status'] = 1; // オンライン予約可 for ($i = 0; $i < $waku; $i++) { $_hour_time = $_time + $hour + $min * $i; $_hour = date('G:i', $_hour_time); $_ary['time'][$_hour] = 1; $_ary['query'][$_hour] = '&hope_date=' . date('Y-m-d', $_hour_time) . '&hope_time=' . $_hour; if (!in_array($_hour, $times)) { // プラン指定の時間外 $_ary['time'][$_hour] = 0; } else { foreach ($reserve_date as $val) { if ($val == $_hour_time) { // 時間が埋まっている $_ary['time'][$_hour] = 0; } } foreach ($reserve_ng_date as $val) { if ($val == $_hour_time) { // 時間が埋まっている $_ary['time'][$_hour] = 0; } } } } } } $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', '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', 'hope_date', 'hope_time', 'plan', 'option', 'spa', 'spa_time', 'spa_num', 'siteid', 'agid', 'bouquet1', 'bouquet2', 'bouquet3', 'pregnancy', 'companion_adult', 'companion_child', 'bring', 'birthday1', 'birthday2', 'hula_friend', ); 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 ($_SESSION['plan'] == 2) { // $_SESSION['plan'] = 38; // } $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->cameraman = array( // 'name' => 'familyphoto', // 's_name' => 'familyphoto', // ); } /*---------------------------------------------------------- 税込計算 2017-09-01 ----------------------------------------------------------*/ function _taxCalculation($excluding_tax){ $including_tax = ""; foreach ($excluding_tax as $val){ if (is_array($val)){ foreach ($val as $val2){ $including_tax += taxInclude($val2); } } else { $including_tax += taxInclude($val); } } return $including_tax; } } $controller = new BeachController(); $controller->process(); exit;