You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

307 lines
39 KiB

<?php
include('../header.php');
require_once('../contract-repair/conn.php');
require_once("./other/maintenance_contract_bonus_v2_1.php");
$create_id = $user_id;
$create_at = date('Y-m-d H:i:s');
// echo $create_id;
$examination_array = [
#錯誤版本
["1.0", "new", "one", 0.8, 4000, 333, "2014-07-01", "M0001", "M0002", "M0003"],
#新簽約
#月繳(monthly)
["2.1", "new", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "new", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "new", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "new", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "new", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#免保轉有費(free_to_charge)
#月繳(monthly)
["2.1", "free_to_charge", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "free_to_charge", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#續簽約(原價或僅契約金額異動)(renew_priceissue)
#月繳(monthly)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "renew_priceissue", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"] #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
];
$bonus_json = [];
$count = 0;
foreach ($examination_array as $key => $value) {
$bonus_verson = $value[0];
$maintain_type = $value[1];
$paykind = $value[2];
$elevator_list_price = $value[3]; //標準價格 / 月
$fee_per_st = $value[4]; //牌價 / 月
$commission_fee = $value[5]; //服務費 / 年
$receivable_date_due = $value[6]; // 應收時間
$sal = $value[7]; // 銷售人員
$mang = $value[8]; //經理
$controct_mang = $value[9];
$contract_no = 'TEST0' . $key;
$contract_type = 3;
$facility_no = 'TEST' . $key;
$status = 1;
$results = maintenance_contract_bonus_v2_1(
$bonus_verson,
$maintain_type,
$paykind,
$elevator_list_price,
$fee_per_st,
$commission_fee,
$receivable_date_due,
$sal,
$mang,
$controct_mang
);
if ($results['result_status'] == 'error') {
} else {
array_push($bonus_json, [
'maintain_type' => $maintain_type,
'total' => $elevator_list_price,
'fee_per_st' => $fee_per_st,
'commission_fee' => $commission_fee,
'paykind' => $paykind,
'receivable_date_due' => $receivable_date_due,
]);
// foreach ($bonus_json as $json) {
// $a = json_encode($json);
// }
foreach ($results['bonus_array'] as $i => $result) {
// echo '<pre>';
// print_r($result);
// echo '</pre>';
$bonus_type = $result['bonus_type'];
$pay_day = $result['pay_day_due'];
$amount = $result['bonus_amount'];
$receiver = $result['bonus_receiver'];
$discount = $result['discount'];
foreach ($bonus_json as $json) {
$json['discount'] = "$discount";
$a = json_encode($json);
}
// echo '<pre>';
// print_r($a);
// echo '</pre>';
// exit();
$sql = "INSERT INTO bonus
(bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,pay_day,status,bonus_json,create_id,create_at) VALUES
($bonus_type,'$bonus_verson','$contract_no',$contract_type,'$facility_no',$amount,'$receiver','$pay_day',$status,'$a','$create_id','$create_at')";
$stmt = $conn->prepare($sql);
$stmt->execute();
$count++;
echo '<pre>';
print_r($count . '-- > Success');
echo '</pre>';
// exit;
}
}
// $sql = "INSERT INTO bonus
// (bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,pay_day,status,bonus_json,create_id,create_at) VALUES
// ($bonus_type,'$bonus_verson','$contract_no',$contract_type,'$facility_no',$amount,'$receiver','$pay_day',$status,'$bonus_json','$create_id','$create_at')";
// echo '<pre>';
// print_r($sql);
// echo '</pre>';
// if ($key == 2) {
// exit;
// }
}