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.
524 lines
28 KiB
524 lines
28 KiB
<?php
|
|
error_reporting(E_ALL);
|
|
ini_set("display_errors", "On");
|
|
require_once '../header_nomenu.php';
|
|
|
|
require_once './FormHelper.php';
|
|
require_once './wf_common.php';
|
|
//echo $user_id;
|
|
//錶單數據
|
|
#客戶錶
|
|
#1.電梯品牌選項
|
|
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by convert(content using gbk) asc ";
|
|
$elevator_brand_opt = DB::result($sql);
|
|
#2.客戶來源
|
|
$sql = "select code_name value ,content label from code where field_name='customer_source'";
|
|
$customer_source_opt = DB::result($sql);
|
|
#3.電梯類型
|
|
$sql = "select code_name value ,content label from code where field_name='elevator_kind'";
|
|
$elevator_kind_opt = DB::result($sql);
|
|
#4.營業員
|
|
$sql = "select employee_no value ,name label from employee where depart_no in ('320','311','312','313','314','511','512','513','514')";
|
|
$salesman_opt = DB::result($sql);
|
|
#5.有望客戶狀態
|
|
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'";
|
|
$hope_customer_status_opt = DB::result($sql);
|
|
|
|
#6.是否汰改
|
|
$is_renovation_opt = ["N"=>"新梯(M)", "Y"=>"汰改(T)"];
|
|
/*
|
|
['label' => '是', 'value' => 'Y'],
|
|
['label' => '否', 'value' => 'N'],
|
|
*/
|
|
|
|
#7.開門方式
|
|
$sql = "select code_name value ,content label from code where field_name='open_kind' and content not in ('2PCO', '3S', '2SL', '2SR')";
|
|
$open_kind_opt = DB::result($sql);
|
|
#8.機種
|
|
$sql = "select code_name value ,content label from code where field_name='fp_kind' order by create_at";
|
|
$fp_kind_opt = DB::result($sql);
|
|
#9.人乘/載重
|
|
$sql = "select code_name value ,content label from code where field_name='person_weight' order by remark";
|
|
$person_opt = DB::result($sql);
|
|
#10.速度
|
|
$sql = "select code_name value ,content label from code where field_name='speed_range' order by remark";
|
|
$speed_opt = DB::result($sql);
|
|
#卷號
|
|
$vol_no = "";
|
|
#抓取有望客戶資料
|
|
|
|
$hope_elevator_customer_column = [
|
|
'is_renovation' => ['label' => "產品屬性", "tag" => 'radio', 'attr' => ['required', 'class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt],
|
|
'vol_no' => ['label' => "卷號", "tag" => 'text', 'attr' => ['required', 'readonly=true ', "value" => "$vol_no", 'class' => 'form-control form-control-sm']],
|
|
//'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]],
|
|
'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
|
|
'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $customer_source_opt],
|
|
'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
// 'company' => ['label' => "公司名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
|
|
'case_name' => ['label' => "案件名稱", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
|
|
//統編/身份證字號
|
|
'uscc' => ['label' => "統編/身份證", "tag" => 'text', 'attr' => [ 'class' => 'form-control form-control-sm']],
|
|
|
|
'linkman' => ['label' => "業主方聯係人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'lm_tel' => ['label' => "市話/手機", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
|
|
'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ["value" => "$user_id", 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt],
|
|
'num' => ['label' => "台數", "tag" => 'digits', 'attr' => ['min=1', 'digits', 'class' => 'form-control form-control-sm']],
|
|
'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt],
|
|
//'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
// 'brand' => ['label' => "廠牌", "tag" => 'select', 'attr' => ['required', 'class' => ' form-control form-control-sm '], 'options' => $elevator_brand_opt],
|
|
//'quote_date' => ['label' => "報價日期", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
|
|
// 'postgress_remark' => ['label' => "洽商進度","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]]
|
|
|
|
];
|
|
$data = [
|
|
'salesman' => $user_id
|
|
];
|
|
|
|
#電梯規格錶
|
|
$table_hope_project_elevator_spec = 'hope_project_elevator_spec';
|
|
$hope_project_elevator_spec_columm = [
|
|
'specifications' => ['label' => "規格", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'specifications[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt],
|
|
'person' => ['label' => "人乘/載重", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'person[]', 'class' => 'form-control form-control-sm'],'options' => $person_opt],
|
|
//'weight' => ['label' => "載重(KG)", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'gt=0', 'min=0', 'class' => 'form-control form-control-sm']],
|
|
'stop' => ['label' => "停數", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'min=1', 'class' => 'form-control form-control-sm']],
|
|
'open' => ['label' => "開門方式", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'open[]', 'class' => 'form-control form-control-sm'], 'options' => $open_kind_opt],
|
|
'speed' => ['label' => "速度(m/min)", "tag" => 'select', 'attr' => ['name' => 'speed[]', 'class' => 'form-control form-control-sm'],'options' => $speed_opt],
|
|
'spec_num' => ['label' => "數量", "tag" => 'digits', 'attr' => ['name' => 'spec_num[]', 'min=1', 'class' => 'form-control form-control-sm']],
|
|
'spec_price' => ['label' => "單價", "tag" => 'number', 'attr' => ['name' => 'spec_price[]', 'min=0', 'class' => 'form-control form-control-sm']],
|
|
|
|
];
|
|
|
|
|
|
|
|
$i = 0;
|
|
$cmecRow = " <tr>";
|
|
foreach ($hope_project_elevator_spec_columm as $key => $val) {
|
|
$fieldVal = "";
|
|
$_input = $val['tag'] == 'select' ?
|
|
FormHelper::select('', $val['options'], $fieldVal, $val['attr'])
|
|
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
|
|
// : "<input type='" . $val['tag'] . "' class=' form-control form-control-sm' " . $val['attr'] . " value='" . $fieldVal . "' name='${key}[]' id='$key' placeholder='請輸入'>";
|
|
$cmecRow .= "<td colspan='" . (empty($val['attr']['colspan']) ? '' : $val['attr']['colspan']) . "' ><div class=' col-12' > $_input</td>";
|
|
}
|
|
$cmecRow .= "<td><button onClick='delCmecRow(this)' type='button' class='btn btn-link btn-md'>刪除</button></td>";
|
|
|
|
#電梯Option
|
|
$table_option_price = 'hope_elevator_option_price';
|
|
$option_price_column = [
|
|
'id' => ['label' => "序號", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 1, 'name' => 'id[]', 'class' => 'form-control form-control-sm']],
|
|
'spec' => ['label' => "規格.仕樣", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm']],
|
|
'memo' => ['label' => "備註", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 7, 'name' => 'memo[]', 'class' => 'form-control form-control-sm']],
|
|
'optional' => ['label' => "配置", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 1, 'name' => 'optional[]', 'class' => 'form-control form-control-sm']],
|
|
'unit' => ['label' => "單位", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 1, 'name' => 'unit[]', 'class' => 'form-control form-control-sm']],
|
|
'price' => ['label' => "價格", "tag" => 'text', 'attr' => ['readonly', 'colspan' => 1, 'name' => 'price[]', 'class' => 'form-control form-control-sm']],
|
|
|
|
];
|
|
|
|
$hpeoRow = " <tr>";
|
|
foreach ($option_price_column as $key => $val) {
|
|
$fieldVal = "";
|
|
$_input = $val['tag'] == 'select' ?
|
|
FormHelper::select('', $val['options'], $fieldVal, $val['attr'])
|
|
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
|
|
// : "<input type='" . $val['tag'] . "' class=' form-control form-control-sm' " . $val['attr'] . " value='" . $fieldVal . "' name='${key}[]' id='$key' placeholder='請輸入'>";
|
|
$hpeoRow .= "<td colspan='" . (empty($val['attr']['colspan']) ? '' : $val['attr']['colspan']) . "' ><div class=' col-12' > $_input</td>";
|
|
}
|
|
$hpeoRow .= "<td><button onClick='delHpeoRow(this)' type='button' class='btn btn-link btn-md'>刪除</button></td>";
|
|
|
|
|
|
//linkman,
|
|
$sql = " SELECT id,spec,memo,case when optional then '1-選配' when 2 then '2-標配' end optional ,unit,price FROM option_price ";
|
|
$option_price = DB::result($sql);
|
|
|
|
|
|
|
|
|
|
|
|
function base_url($url)
|
|
{
|
|
return "https://www.masada.com.tw/static/" . $url;
|
|
}
|
|
#生成卷號
|
|
function get_sequnece_no($seq_name = '', $p_yyyymm = '')
|
|
{
|
|
|
|
if (empty($p_yyyymm) || empty($seq_name)) return null;
|
|
#當前年月
|
|
|
|
//echo "select yyyymm from sequence where seq_name='$seq_name' ";
|
|
list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' ");
|
|
if ($p_yyyymm != $yyyymm) {
|
|
DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' ");
|
|
}
|
|
// echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no ";
|
|
list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no ");
|
|
// echo "SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no ";
|
|
|
|
return $seq_no;
|
|
}
|
|
|
|
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>有望客戶新增</title>
|
|
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" />
|
|
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" />
|
|
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" />
|
|
<script type="text/javascript" src="<?php echo base_url('js/jquery3.7.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/selectpage.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/jquery.cleditor.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('bootstrap4/js/bootstrap.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/layui.js?' . rand(10, 100)); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/wf_property.js?') . rand(10, 100); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/flow_chart.js?' . rand(10, 100)); ?>"></script>
|
|
<script src="<?php echo base_url('js/validate/jquery.validate.min.js?' . rand(10, 100)); ?>"></script>
|
|
<script src="<?php echo base_url('js/validate/messages_zh_TW.js?' . rand(10, 100)); ?>"></script>
|
|
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/form.css?') . rand(10, 100);; ?>" />
|
|
<style>
|
|
label {
|
|
margin-right:10px;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("input[name=is_renovation]").click(function(){
|
|
if ($(this).val() == "Y") {
|
|
var volNo = "<?php echo get_sequnece_no('rt_vol_no', date('ym')); ?>";
|
|
} else if ($(this).val() == "N") {
|
|
var volNo = "<?php echo get_sequnece_no('xt_vol_no', date('ym')); ?>";
|
|
}
|
|
$("#vol_no").val(volNo);
|
|
});
|
|
var cmecRow = "<?= str_replace('"', '\'', $cmecRow) ?>";
|
|
var hpeoRow = "<?= str_replace('"', '\'', $hpeoRow) ?>";
|
|
|
|
|
|
// $('#cmecTbody').append(cmecRow);
|
|
$('.sp_element_box').attr("disabled", true);
|
|
$("#assign_opinion").cleditor({
|
|
height: 100, // height not including margins, borders or padding
|
|
controls: // controls to add to the toolbar
|
|
"bold italic underline strikethrough subscript superscript | font size " +
|
|
"style | color highlight removeformat | bullets numbering | outdent " +
|
|
"indent | alignleft center alignright justify | undo redo | "
|
|
});
|
|
$.validator.addMethod('gt', function(value, element, param) {
|
|
return value > param;
|
|
}, $.validator.format("輸入值必須大於0"));
|
|
|
|
$('#cmecTbody').on('click', 'input[name^=spec_num]', function(){
|
|
$(this).unbind().keyup(function(){
|
|
$(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
|
|
sumNum();
|
|
});
|
|
});
|
|
|
|
$("#form").validate();
|
|
});
|
|
sumNum = function() {
|
|
var numAll = 0;
|
|
$("input[name^=spec_num]").each(function(){
|
|
numAll += Number($(this).val().replace(/[,]+/g,""));
|
|
});
|
|
$('#num').val(numAll);
|
|
}
|
|
addCmecRow = function() {
|
|
var cmecRow = "<?= $cmecRow ?>";
|
|
$('#cmecTbody').append(cmecRow);
|
|
}
|
|
delCmecRow = function(btn) {
|
|
$('#num').val($('#num').val() - Number($(btn).closest('tr').find('input[id=spec_num').val()));
|
|
$(btn).parent().parent().remove();
|
|
|
|
}
|
|
addHpeoRow = function() {
|
|
var hpeoRow = "<?= $hpeoRow ?>";
|
|
$('#hpeoTbody').append(hpeoRow);
|
|
}
|
|
delHpeoRow = function(btn) {
|
|
$(btn).parent().parent().remove();
|
|
|
|
}
|
|
selectHpeoRow = function(obj) {
|
|
var id = $(obj).parent().parent().find('td:nth-child(1)>div').text();
|
|
var spec = $(obj).parent().parent().find('td:nth-child(2)>div').text();
|
|
var memo = $(obj).parent().parent().find('td:nth-child(3)>div').text();
|
|
var optional = $(obj).parent().parent().find('td:nth-child(4)>div').text();
|
|
var unit = $(obj).parent().parent().find('td:nth-child(5)>div').text();
|
|
var price = $(obj).parent().parent().find('td:nth-child(6)>div').text();
|
|
|
|
var hpeoRow = "<?= $hpeoRow ?>";
|
|
$('#hpeoTbody').append(hpeoRow);
|
|
//').last()
|
|
var tr = $('#hpeoTbody tr').last();
|
|
$(tr).children('td').each(function(i) {
|
|
$(this).find("input[name^='id']").val(id.trim());
|
|
$(this).find("input[name^='spec']").val(spec.trim());
|
|
$(this).find("input[name^='memo']").val(memo.trim());
|
|
$(this).find("input[name^='optional']").val(optional.trim());
|
|
$(this).find("input[name^='unit']").val(unit.trim());
|
|
$(this).find("input[name^='price']").val(price.trim());
|
|
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div id="toolbarmenu">
|
|
<ul class="nav nav-tabs" role="tablist" id="tablist">
|
|
<li class=" nav-item ">
|
|
<a href="#tabassign" aria-controls="tabassign" role="tab" class=" active nav-link" data-toggle="tab">申請單</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="tab-content ">
|
|
<div class="tab-pane active assign_content " id="tabassign">
|
|
<form action="crmm03_submit.php?token=<?= $_GET['token'] ?>" id='form' method="post" style='width:98%;margin:0 auto'>
|
|
<!-- hidden域 -->
|
|
<input type='hidden' name='token' value='<?= $_GET['token'] ?>' />
|
|
<!--錶單start-->
|
|
<div class=" form container-fluid pt-5">
|
|
<div class="row form_head ">
|
|
<div class=" col-12 form_head_title ">
|
|
<h4> 有望客戶(新梯/汰改)新增</h4>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row " style='padding-top:30px;'>
|
|
<div class=" col-lg-12 form_row_header ">
|
|
<b>有望客戶資料</b>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
//一行顯示三列
|
|
$i = 0;
|
|
echo " <div class='row '>";
|
|
foreach ($hope_elevator_customer_column as $key => $val) {
|
|
$j = (($i++) % 4);
|
|
$fieldVal = (empty($data) or !array_key_exists($key, $data)) ? "" : $data[$key];
|
|
|
|
if ($val['tag'] == 'select') {
|
|
$_input = FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']);
|
|
} elseif ($val['tag'] == 'radio') {
|
|
$_input = FormHelper::collectionRadios("$key", $val['options'],"");
|
|
} else {
|
|
$_input = FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
|
|
}
|
|
/*
|
|
$_input = $val['tag'] == 'select' ?
|
|
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr'])
|
|
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
|
|
*/
|
|
if ($i != 1 && $j == 0) {
|
|
echo "
|
|
</div>
|
|
<div class='row'>
|
|
";
|
|
}
|
|
echo " <div class='col-1 form_field_title'>
|
|
" . $val['label'] . "
|
|
</div>
|
|
<div class=' col-2 form_field_content ' >
|
|
$_input
|
|
</div>
|
|
";
|
|
}
|
|
echo "</div>";
|
|
|
|
?>
|
|
|
|
<div id="assign_area " class="row ">
|
|
<div class="col-12 form_row_header ">
|
|
<b>洽商進度</b>
|
|
</div>
|
|
<div class="col-12 " style="padding:0">
|
|
|
|
<textarea class='form-control textarea' id="progress_status" name="progress_status"
|
|
value='' rows='6'></textarea>
|
|
</div>
|
|
</div>
|
|
<div id="elevator_list_area" class="row ">
|
|
<div class="col-12 form_row_header ">
|
|
<b>電梯規格信息</b>
|
|
</div>
|
|
<table style='margin-top:0px;text-align:center' id='elevator_list'>
|
|
|
|
<thead>
|
|
<tr>
|
|
<td colspan='11' ;><button onClick='addCmecRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
|
|
</tr>
|
|
<tr style='margin-top:0px;text-align:center'>
|
|
<?php
|
|
foreach ($hope_project_elevator_spec_columm as $val) {
|
|
echo FormHelper::tag("th", ['colspan' => empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']], $val['label']);
|
|
}
|
|
echo "<th>操作</th>";
|
|
?>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody id='cmecTbody'>
|
|
<?php
|
|
$cmecRow = "<tr>";
|
|
foreach ($hope_project_elevator_spec_columm as $col => $col_def) {
|
|
|
|
$fieldVal = '';
|
|
$_input = $col_def['tag'] == 'select' ?
|
|
FormHelper::select(
|
|
$col,
|
|
$col_def['options'],
|
|
$fieldVal,
|
|
$col_def['attr']
|
|
)
|
|
: FormHelper::text(
|
|
$col,
|
|
$fieldVal,
|
|
$col_def['attr'],
|
|
$col_def['tag']
|
|
);
|
|
$cmecRow .= "<td colspan='"
|
|
. (empty($col_def['attr']['colspan']) ? '' :
|
|
$col_def['attr']['colspan']) . "' >
|
|
<div class=' col-12'> $_input</td>";
|
|
}
|
|
echo $cmecRow . "<td><button onClick='delCmecRow(this)' type='button' class='btn btn-link btn-md '>刪除</button></td></tr>";
|
|
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
<div id="option_list_area" class="row ">
|
|
<div class="col-12 form_row_header ">
|
|
<b>Option報價</b>
|
|
</div>
|
|
<table style='margin-top:0px;text-align:center' id='option_list'>
|
|
|
|
<thead>
|
|
<tr>
|
|
|
|
<td colspan='14' ;><button class="btn btn-link btn-md" type='button' data-toggle="modal" data-target="#myModal" style='float:right'>+新增</button>
|
|
</td>
|
|
</tr>
|
|
<tr style='margin-top:0px;text-align:center'>
|
|
<?php
|
|
foreach ($option_price_column as $val) {
|
|
echo FormHelper::tag("th", ['colspan' => empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']], $val['label']);
|
|
//echo "<th>" . $val['label'] . "</th>";
|
|
}
|
|
echo "<th>操作</th>";
|
|
?>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody id='hpeoTbody'>
|
|
<?php
|
|
// $cmecRow = "<tr>";
|
|
// foreach ($option_price_column as $col => $col_def) {
|
|
|
|
// $fieldVal = '';
|
|
// $_input = $col_def['tag'] == 'select' ?
|
|
// FormHelper::select(
|
|
// $col,
|
|
// $col_def['options'],
|
|
// $fieldVal,
|
|
// $col_def['attr']
|
|
// )
|
|
// : FormHelper::text(
|
|
// $col,
|
|
// $fieldVal,
|
|
// $col_def['attr'],
|
|
// $col_def['tag']
|
|
// );
|
|
// $cmecRow .= "<td colspan='"
|
|
// . (empty($col_def['attr']['colspan']) ? '' :
|
|
// $col_def['attr']['colspan']) . "' >
|
|
// <div class=' col-12'> $_input</td>";
|
|
// }
|
|
// echo $cmecRow . "<td><button onClick='delHpeoRow(this)' type='button' class='btn btn-link btn-md '>刪除</button></td></tr>";
|
|
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<!-- 按鈕觸發模態框 -->
|
|
<!-- 模態框(Modal) -->
|
|
<div class="modal fade " id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<b>OPTION選擇</b>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<table style='margin-top:0px;text-align:center;font-size:13px' id='option_list_select'>
|
|
|
|
<thead>
|
|
|
|
<tr style='margin-top:0px;text-align:center'>
|
|
<?php
|
|
foreach ($option_price_column as $val) {
|
|
echo FormHelper::tag("th", ['colspan' => empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']], $val['label']);
|
|
//echo "<th>" . $val['label'] . "</th>";
|
|
}
|
|
echo "<th>操作</th>";
|
|
?>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody class='hpeoTbody'>
|
|
<?php
|
|
|
|
foreach ($option_price as $key => $val) {
|
|
$cmecRow = "<tr >";
|
|
foreach ($option_price_column as $col => $col_def) {
|
|
|
|
$fieldVal = empty($val) ? "" : $val[$col];
|
|
$_input = FormHelper::tag(
|
|
'label',
|
|
['colspan' => empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']],
|
|
$fieldVal
|
|
|
|
);
|
|
$cmecRow .= "<td style='text-align:left' colspan='"
|
|
. (empty($col_def['attr']['colspan']) ? '' :
|
|
$col_def['attr']['colspan']) . "' >
|
|
<div class=' col-12' > $_input</td>";
|
|
}
|
|
echo $cmecRow . "<td><button onClick='selectHpeoRow(this)' type='button' class='btn btn-link btn-md '>選中</button></td></tr>";
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">關閉</button>
|
|
</div>
|
|
</div><!-- /.modal-content -->
|
|
</div><!-- /.modal-dialog -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|