require_once '../system/mdao/Class_mp_promise_operation_history.php';
require_once '../system/mdao/Class_mp_promise.php';
require_once '../system/mdao/Class_mp_specialist.php';
require_once '../system/mdao/Class_mp_payment.php';
require_once '../system/mdao/Class_mp_account.php';
require_once '../system/mdao/Class_mp_corporate_tantou.php';
require_once '../system/mdao/Class_mp_spec_traffic_fee.php';
require_once '../system/smtpsend.class.php';
$promise_dao = new Class_mp_promise();
$promise_spec_dao = new Class_mp_promise_spec();
$operation_history_dao = new Class_mp_promise_operation_history($promise_spec_dao->get_db());
$spec_dao = new Class_mp_specialist();
$payment_dao = new Class_mp_payment();
$account_dao = new Class_mp_account();
$corporate_tantou_dao = new Class_mp_corporate_tantou();
$spec_traffic_dao = new Class_mp_spec_traffic_fee();
$smtp_dao = new smtpclass();
if (isset($_GET['id']) && !empty($_GET['id'])) {
    if (isset($_GET['spec_id']) && $_GET['spec_id'] != '') {
        // get spec_id
        $tra_spec_id = $_GET['spec_id'];
        // get spec_traffic data
        $sql = "select * from mp_spec_traffic_fee where spec_id = '{$tra_spec_id}'";
        $spec_traffic_data = $spec_traffic_dao->get_rows($sql);
        $traffic_name = array();
        $traffic_fee = array();
        $traffic_memo = array();
        foreach ($spec_traffic_data as $k => $v) {
            $traffic_name_arr[] = $v['traffic_name'];
            $traffic_fee[] = $v['traffic_fee'];
            $traffic_memo[] = $v['traffic_memo'];
<?php

require_once '../system/smarty.inc';
require_once '../system/Class_DB.php';
require_once '../system/prego_m.php';
require_once '../system/login.inc.php';
require_once '../system/mdao/Class_mp_specialist.php';
require_once '../system/mdao/Class_mp_spec_traffic_fee.php';
require_once '../system/mdao/Class_mp_spec_profile.php';
require_once '../system/mdao/Class_mp_spec_fee.php';
require_once '../system/mdao/Class_mp_account.php';
require_once '../system/mdao/Class_mp_pro.php';
$specialist_dao = new Class_mp_specialist();
$traffic_fee_dao = new Class_mp_spec_traffic_fee();
$spec_profile_dao = new Class_mp_spec_profile();
$spec_fee_dao = new Class_mp_spec_fee();
$account_dao = new Class_mp_account();
$pro_dao = new Class_mp_pro();
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    $phase = 'input';
    if ($auth == '3') {
        $account_id = $_SESSION['PREGO_ADMIN']['STAFF_SEQ'];
        $account_data = $account_dao->get($account_id);
        $id = $account_data['other_id'];
    } elseif ($auth == '1') {
        if (isset($_GET['id']) && $_GET['id'] != '') {
            $id = $_GET['id'];
            $account_data = $account_dao->getByOtherid($id, 3);
        }
    }
    $smarty->assign('account_name', $account_data['user_name']);
 }
 //郵便番号判定
 $err_mes['post_code'] = $err->zipcode_check($forms['region'] . "-" . $forms['branch']);
 //電話番号判定
 $err_mes['tel'] = $err->tel_check($forms['area_code'] . "-" . $forms['office_number'] . "-" . $forms['called_number']);
 //携帯電話番号判定
 $err_mes['phone'] = $err->tel_check($forms['cell1'] . '-' . $forms['cell2'] . '-' . $forms['cell3']);
 //FAX番号判定
 $err_mes['fax'] = $err->fax_check($forms['fax1'] . '-' . $forms['fax2'] . '-' . $forms['fax3']);
 //年月日判定
 if (!empty($forms['birthday_year']) && !empty($forms['birthday_month']) && !empty($forms['birthday_day'])) {
     $err_mes['birthday'] = $err->ymd_check($forms['birthday_year'] . '/' . $forms['birthday_month'] . '/' . $forms['birthday_day']);
 }
 // check traffic_fee items
 $index = 0;
 $traffic_fee_dao = new Class_mp_spec_traffic_fee($specialist_dao->get_db());
 $traffic_chk = $traffic_fee_dao->get_checks();
 if ($forms['mutirow']) {
     foreach ($forms['mutirow'] as $k => $v) {
         $err_mes['traffic_name'][$index] = $err->check($v['traffic_name'], $traffic_chk['traffic_name']);
         $err_mes['traffic_fee'][$index] = $err->check($v['traffic_fee'], $traffic_chk['traffic_fee']);
         $err_mes['traffic_memo'][$index] = $err->check($v['traffic_memo'], $traffic_chk['traffic_memo']);
         $index = $index + 1;
     }
 }
 // check spec_fee items
 $index_fee = 0;
 $spec_fee_dao = new Class_mp_spec_fee($specialist_dao->get_db());
 $spec_fee_chk = $spec_fee_dao->get_checks();
 if ($forms['mutirow_fee']) {
     foreach ($forms['mutirow_fee'] as $k => $v) {