6 changed files with 491 additions and 419 deletions
@ -0,0 +1,42 @@ |
|||||
|
<?php |
||||
|
$envFile = __DIR__ . '/.env'; // .env 文件的路径 |
||||
|
|
||||
|
if (file_exists($envFile)) { |
||||
|
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
||||
|
if ($lines !== false) { |
||||
|
foreach ($lines as $line) { |
||||
|
list($key, $value) = explode('=', $line, 2); |
||||
|
$key = trim($key); |
||||
|
$value = trim($value); |
||||
|
// 设置环境变量 |
||||
|
putenv("$key=$value"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱 |
||||
|
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號 |
||||
|
$db_password = getenv('DB_PASSWORD'); //登入密碼 |
||||
|
$db_name = getenv('DB_DATABASE'); //使用的資料庫 |
||||
|
$db_charset = 'utf8'; //設定字元編碼 |
||||
|
|
||||
|
//建立PDO的指定工作 |
||||
|
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset"; |
||||
|
|
||||
|
try { |
||||
|
//使用PDO連接到MySQL資料庫,建立PDO物件 |
||||
|
$conn = new PDO($dsn, $db_username, $db_password); |
||||
|
|
||||
|
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException) |
||||
|
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定 |
||||
|
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊 |
||||
|
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯 |
||||
|
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。 |
||||
|
//設定主動以警告的形式報錯 |
||||
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
||||
|
//如果連接錯誤,將抛出一個PDOException異常對象 |
||||
|
} catch (PDOException $e) { |
||||
|
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 |
||||
|
die("ERROR!!!: " . $e->getMessage()); |
||||
|
} |
||||
|
|
||||
|
//$conn = null; //關閉資料庫的連線 |
@ -1,180 +1,196 @@ |
|||||
<?php |
<?php |
||||
require_once "../header.php"; |
require_once "../header.php"; |
||||
// 載入db.php來連結資料庫 |
// 載入db.php來連結資料庫 |
||||
|
|
||||
#錶 |
#錶 |
||||
$table = 'hope_contract_customer'; |
$table = 'hope_contract_customer'; |
||||
#可編輯的列 |
#可編輯的列 |
||||
$editableColumn = [ |
$editableColumn = [ |
||||
'vol_no' => "卷號", |
'vol_no' => "卷號", |
||||
'customer_no' => "客戶編號", |
'customer_no' => "客戶編號", |
||||
'customer' => "客戶名稱", |
'customer' => "客戶名稱", |
||||
'manager' => "負責人", |
'manager' => "負責人", |
||||
'source' => "客戶來源", |
'source' => "客戶來源", |
||||
'linkman' => "聯係人", |
'linkman' => "聯係人", |
||||
'lm_tel' => "手機", |
'lm_tel' => "手機", |
||||
'salesman' => "營業員", |
'salesman' => "營業員", |
||||
'num' => "数量", |
'num' => "数量", |
||||
'pre_order_date' => "預定成交日", |
'pre_order_date' => "預定成交日", |
||||
'status' => "有望客戶狀態", |
'status' => "有望客戶狀態", |
||||
'next_visit_date' => "下次拜訪時間", |
'next_visit_date' => "下次拜訪時間", |
||||
'brand' => "廠牌", |
'brand' => "廠牌", |
||||
'quote_date' => "報價日期", |
'quote_date' => "報價日期", |
||||
'created_at' => "建立時間", |
'created_at' => "建立時間", |
||||
|
|
||||
]; |
]; |
||||
|
|
||||
// 可瀏覽全部資料的部門 |
// 可瀏覽全部資料的部門 |
||||
$depart_arr = ["501"]; |
$depart_arr = ["501"]; |
||||
$sql = "SELECT department_id FROM account WHERE accountid = '$user_id'"; |
$sql = "SELECT department_id FROM account WHERE accountid = '$user_id'"; |
||||
$res = mysqli_query($link, $sql); |
$res = mysqli_query($link, $sql); |
||||
$row = mysqli_fetch_row($res); |
$row = mysqli_fetch_row($res); |
||||
$user_department_id = $row[0]; |
$user_department_id = $row[0]; |
||||
mysqli_free_result($res); |
mysqli_free_result($res); |
||||
|
|
||||
// 設置一個空陣列來放資料 |
// 設置一個空陣列來放資料 |
||||
$data = array(); |
$data = array(); |
||||
// sql語法存在變數中 |
// sql語法存在變數中 |
||||
$vol_no = empty($_GET['vol_no']) ? "%" : $_GET['vol_no']; |
$vol_no = empty($_GET['vol_no']) ? "%" : $_GET['vol_no']; |
||||
$where = " and vol_no like '$vol_no'"; |
$where = " and vol_no like '$vol_no'"; |
||||
$salesman = empty($_GET['salesman']) ? "%" : $_GET['salesman']; |
$salesman = empty($_GET['salesman']) ? "%" : $_GET['salesman']; |
||||
$where .= " and salesman like '$salesman'"; |
$where .= " and salesman like '$salesman'"; |
||||
$lm_name = empty($_GET['linkman']) ? "%" : $_GET['linkman']; |
$lm_name = empty($_GET['linkman']) ? "%" : $_GET['linkman']; |
||||
$where .= " and linkman like '$lm_name'"; |
$where .= " and linkman like '$lm_name'"; |
||||
$sql_cmd = sql_myself($user_id, "salesman"); |
$sql_cmd = sql_myself($user_id, "salesman"); |
||||
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149" || $user_id =="M0189") $sql_cmd = ""; // M0060:Max,鄭伊岑 |
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149" || $user_id == "M0189") $sql_cmd = ""; // M0060:Max,鄭伊岑 |
||||
if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd); |
if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd); |
||||
|
|
||||
$sql = "SELECT vol_no,customer,manager,f_return_content('customer_source',source ) source, |
$sql = "SELECT vol_no,customer,manager,salesman,f_return_content('customer_source',source ) source, |
||||
linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date, |
linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date, |
||||
f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand , |
f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand , |
||||
date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no"; |
date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no"; |
||||
|
|
||||
$data = mysqli_query($link, $sql); |
$data = mysqli_query($link, $sql); |
||||
|
|
||||
// echo '<pre>'; |
// echo '<pre>'; |
||||
// print_r($sql); |
// print_r($sql); |
||||
// echo '</pre>'; |
// echo '</pre>'; |
||||
?> |
|
||||
<style> |
// echo '<pre>'; |
||||
#table_index2 { |
// print_r($data); |
||||
table-layout: fixed; |
// echo '</pre>'; |
||||
/*width: 100%;*/ |
|
||||
display: inline-block; |
// $sql = "SELECT * FROM hope_contract_customer WHERE 1=1 $where"; |
||||
} |
// $result = mysqli_query($link, $sql); |
||||
|
// echo '<pre>'; |
||||
.col-sm-12 { |
// print_r($result); |
||||
width: auto; |
// echo '</pre>'; |
||||
} |
// echo $data['salesman']; |
||||
|
?> |
||||
.pagination { |
<style> |
||||
margin: 0; |
#table_index2 { |
||||
} |
table-layout: fixed; |
||||
</style> |
/*width: 100%;*/ |
||||
<script> |
display: inline-block; |
||||
$(function() { |
} |
||||
$('#table_index2').DataTable({ |
|
||||
order: [ |
.col-sm-12 { |
||||
[14, 'desc'] |
width: auto; |
||||
] |
} |
||||
}); |
|
||||
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋"; |
.pagination { |
||||
}); |
margin: 0; |
||||
</script> |
} |
||||
<?php |
</style> |
||||
|
<script> |
||||
if ($data) : |
$(function() { |
||||
|
$('#table_index2').DataTable({ |
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
order: [ |
||||
if (empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])) { |
[14, 'desc'] |
||||
echo "<p class='error'>Please fill up the required field!</p>"; |
] |
||||
} else { |
}); |
||||
header("Location:repair-index.php"); |
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋"; |
||||
} |
}); |
||||
} |
</script> |
||||
|
<?php |
||||
?> |
|
||||
<link rel="stylesheet" href="common.css"> |
if ($data) : |
||||
|
|
||||
<div style="overflow-x:auto; white-space:nowrap;"> |
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||
<form method='get' action='#'> |
if (empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])) { |
||||
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'> |
echo "<p class='error'>Please fill up the required field!</p>"; |
||||
<thead> |
} else { |
||||
<tr> |
header("Location:repair-index.php"); |
||||
<td colspan="8"> |
} |
||||
<h3 style='text-align:center'>有望客戶(契約)資料維護</h3> |
} |
||||
</td> |
|
||||
</tr> |
?> |
||||
|
<link rel="stylesheet" href="common.css"> |
||||
</thead> |
|
||||
<tbody> |
<div style="overflow-x:auto; white-space:nowrap;"> |
||||
<tr> |
<form method='get' action='#'> |
||||
<th style='width:50px'>卷號</th> |
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'> |
||||
<td><input type="text" class='form-control' name='vol_no'></td> |
<thead> |
||||
<th>營業員</th> |
<tr> |
||||
<td><input type="text" class='form-control' name='salesman'></td> |
<td colspan="8"> |
||||
<th>下單地區</th> |
<h3 style='text-align:center'>有望客戶(契約)資料維護</h3> |
||||
<td><input type="text" class='form-control' name='order_province'></td> |
</td> |
||||
<th>聯係人姓名</th> |
</tr> |
||||
<td><input type="text" class='form-control' name='lm_name'></td> |
|
||||
<input type="hidden" name="token" value='<?= $_GET['token'] ?>'> |
</thead> |
||||
</tr> |
<tbody> |
||||
</tbody> |
<tr> |
||||
<tfoot> |
<th style='width:50px'>卷號</th> |
||||
<tr> |
<td><input type="text" class='form-control' name='vol_no'></td> |
||||
<td colspan="8" style='text-align:center'> |
<th>營業員</th> |
||||
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-info btn-sm">查詢</button> |
<td><input type="text" class='form-control' name='salesman'></td> |
||||
<a href="crmm06-edit.php?<?= $token_link ?>" class="btn btn-info btn-sm">新增</a> |
<th>下單地區</th> |
||||
</td> |
<td><input type="text" class='form-control' name='order_province'></td> |
||||
</tr> |
<th>聯係人姓名</th> |
||||
</tfoot> |
<td><input type="text" class='form-control' name='lm_name'></td> |
||||
</table> |
<input type="hidden" name="token" value='<?= $_GET['token'] ?>'> |
||||
<table id="table_index" class="table table-striped table-bordered"> |
</tr> |
||||
<thead> |
</tbody> |
||||
<?php |
<tfoot> |
||||
echo "<tr>"; |
<tr> |
||||
foreach ($editableColumn as $key => $val) { |
<td colspan="8" style='text-align:center'> |
||||
echo "<th>$val</th>"; |
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-info btn-sm">查詢</button> |
||||
} |
<a href="crmm06-edit.php?<?= $token_link ?>" class="btn btn-info btn-sm">新增</a> |
||||
echo "<th>編輯</th>"; |
</td> |
||||
// echo "<th>刪除</th>"; |
</tr> |
||||
echo "</tr>"; |
</tfoot> |
||||
?> |
</table> |
||||
</thead> |
<table id="table_index" class="table table-striped table-bordered"> |
||||
<tbody> |
<thead> |
||||
<?php foreach ($data as $row) : ?> |
<?php |
||||
<tr> |
echo "<tr>"; |
||||
<?php |
foreach ($editableColumn as $key => $val) { |
||||
foreach ($editableColumn as $key => $val) { |
echo "<th>$val</th>"; |
||||
echo "<td>" . (!empty($row[$key]) ? $row[$key] : '') . "</td>"; |
} |
||||
} |
echo "<th>編輯</th>"; |
||||
?> |
// echo "<th>刪除</th>"; |
||||
<td> |
echo "</tr>"; |
||||
<p> |
?> |
||||
<a href="crmm05-edit.php?function_name=customer&<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm"> |
</thead> |
||||
<span class="glyphicon glyphicon-pencil"></span> |
<tbody> |
||||
</a> |
<?php foreach ($data as $row) : ?> |
||||
|
|
||||
<a href="../cont/apply_form.php?<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm"> |
<tr> |
||||
轉價審 |
<?php |
||||
</a> |
foreach ($editableColumn as $key => $val) { |
||||
</p> |
// echo '<pre>'; |
||||
</td> |
// print_r($row['salesman']); |
||||
</tr> |
// echo '</pre>'; |
||||
<?php endforeach; ?> |
echo "<td>" . (!empty($row[$key]) ? $row[$key] : '') . "</td>"; |
||||
</tbody> |
} |
||||
</table> |
?> |
||||
</div> |
<td> |
||||
|
<p> |
||||
<?php |
<a href="crmm05-edit.php?function_name=customer&<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm"> |
||||
|
<span class="glyphicon glyphicon-pencil"></span> |
||||
else : |
</a> |
||||
echo "<h2>There is no record!</h2>"; |
<?php if ($user_name === $row['salesman']) : ?> |
||||
endif; |
<a href="../cont/apply_form.php?<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm"> |
||||
|
轉價審 |
||||
#代錶結束連線 |
</a> |
||||
mysqli_close($link); |
<?php endif ?> |
||||
|
</p> |
||||
include "../footer.php"; |
</td> |
||||
|
</tr> |
||||
|
<?php endforeach; ?> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
<?php |
||||
|
|
||||
|
else : |
||||
|
echo "<h2>There is no record!</h2>"; |
||||
|
endif; |
||||
|
|
||||
|
#代錶結束連線 |
||||
|
mysqli_close($link); |
||||
|
|
||||
|
include "../footer.php"; |
||||
|
|
||||
?> |
?> |
@ -1,224 +1,228 @@ |
|||||
<?php |
<?php |
||||
error_reporting(E_ALL); |
error_reporting(E_ALL); |
||||
ini_set("display_errors", "On"); |
ini_set("display_errors", "On"); |
||||
|
require_once '../header_nomenu.php'; |
||||
require_once './FormHelper.php'; |
|
||||
require_once './wf_common.php'; |
require_once './FormHelper.php'; |
||||
|
require_once './wf_common.php'; |
||||
|
|
||||
//錶單數據 |
|
||||
#客戶錶 |
//錶單數據 |
||||
#1.電梯品牌選項 |
#客戶錶 |
||||
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by convert(content using gbk) asc "; |
#1.電梯品牌選項 |
||||
$elevator_brand_opt = DB::result($sql); |
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by convert(content using gbk) asc "; |
||||
#2.客戶來源 |
$elevator_brand_opt = DB::result($sql); |
||||
$sql = "select code_name value ,content label from code where field_name='customer_source'"; |
#2.客戶來源 |
||||
$customer_source_opt = DB::result($sql); |
$sql = "select code_name value ,content label from code where field_name='customer_source'"; |
||||
#3.電梯類型 |
$customer_source_opt = DB::result($sql); |
||||
$sql = "select code_name value ,content label from code where field_name='elevator_kind'"; |
#3.電梯類型 |
||||
$elevator_kind_opt = DB::result($sql); |
$sql = "select code_name value ,content label from code where field_name='elevator_kind'"; |
||||
#4.營業員 |
$elevator_kind_opt = DB::result($sql); |
||||
$sql = "select employee_no value ,name label from employee where depart_no in ('511','512','513','514')"; |
#4.營業員 |
||||
$salesman_opt = DB::result($sql); |
$sql = "select employee_no value ,name label from employee where depart_no in ('511','512','513','514')"; |
||||
#5.有望客戶狀態 |
$salesman_opt = DB::result($sql); |
||||
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'"; |
#5.有望客戶狀態 |
||||
$hope_customer_status_opt = DB::result($sql); |
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'"; |
||||
#6.是否改造 |
$hope_customer_status_opt = DB::result($sql); |
||||
$is_renovation_opt = [ |
#6.是否改造 |
||||
['label' => '是', 'value' => 'Y'], |
$is_renovation_opt = [ |
||||
['label' => '否', 'value' => 'N'], |
['label' => '是', 'value' => 'Y'], |
||||
|
['label' => '否', 'value' => 'N'], |
||||
]; |
|
||||
#7.开门方式 |
]; |
||||
$sql = "select code_name value ,content label from code where field_name='open_kind'"; |
#7.开门方式 |
||||
$open_kind_opt = DB::result($sql); |
$sql = "select code_name value ,content label from code where field_name='open_kind'"; |
||||
#生成新梯卷号 |
$open_kind_opt = DB::result($sql); |
||||
$vol_no = get_sequnece_no('qy_vol_no', date('ym')); |
#生成新梯卷号 |
||||
|
$vol_no = get_sequnece_no('qy_vol_no', date('ym')); |
||||
#抓取有望客戶資料 |
|
||||
$table_hope_contract_customer = 'hope_contract_customer'; |
#抓取有望客戶資料 |
||||
|
$table_hope_contract_customer = 'hope_contract_customer'; |
||||
$hope_contract_customer_column = [ |
|
||||
'vol_no' => ['label' => "卷號(B)", "tag" => 'text', 'attr' => ['required','readonly', "value" => "$vol_no", 'class' => 'form-control form-control-sm']], |
$hope_contract_customer_column = [ |
||||
//'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]], |
'vol_no' => ['label' => "卷號(B)", "tag" => 'text', 'attr' => ['required', 'readonly', "value" => "$vol_no", 'class' => 'form-control form-control-sm']], |
||||
'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], |
//'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]], |
||||
'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], |
||||
'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $customer_source_opt], |
'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
//'linkman' => ['label' => "聯係人", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], |
'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $customer_source_opt], |
||||
'lm_tel' => ['label' => "手機", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
//'linkman' => ['label' => "聯係人", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], |
||||
'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt], |
'lm_tel' => ['label' => "手機", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
'num' => ['label' => "数量", "tag" => 'number', 'attr' => ['min=1','class' => 'form-control form-control-sm']], |
'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ["value" => "$user_id", 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt], |
||||
'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], |
'num' => ['label' => "数量", "tag" => 'number', 'attr' => ['min=1', 'class' => 'form-control form-control-sm']], |
||||
// 'case_name' => ['label' => "现场名称", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], |
'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], |
||||
'floors' => ['label' => '樓層', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
// 'case_name' => ['label' => "现场名称", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], |
||||
'persons' => ['label' => '人乘', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
'floors' => ['label' => '樓層', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
'speed' => ['label' => '速度', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
'persons' => ['label' => '人乘', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
'completed_date' => ['label' => '竣工(民國年)', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
'speed' => ['label' => '速度', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], |
'completed_date' => ['label' => '竣工(民國年)', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], |
||||
'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt], |
'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], |
||||
'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], |
'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt], |
||||
// 'brand' => ['label' => "廠牌", "tag" => 'select', 'attr' => ['required', 'class' => ' form-control form-control-sm '], 'options' => $elevator_brand_opt], |
'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], |
||||
'quote_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], |
||||
// 'is_renovation' => ['label' => "是否汰改", "tag" => 'select', 'attr' => ['required','class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt], |
'quote_date' => ['label' => "報價日期", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], |
||||
|
// 'is_renovation' => ['label' => "是否汰改", "tag" => 'select', 'attr' => ['required','class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt], |
||||
]; |
|
||||
|
]; |
||||
|
$data = [ |
||||
$where = " and vol_no='$vol_no'"; |
'salesman' => $user_id |
||||
|
]; |
||||
$sql = " SELECT vol_no,customer,manager,source, |
|
||||
linkman,lm_tel,salesman,num,address,floors,persons,speed,completed_date, |
$where = " and vol_no='$vol_no'"; |
||||
date_format(pre_order_date,'%Y-%m-%d') pre_order_date, |
|
||||
status, date_format(next_visit_date,'%Y-%m-%d') next_visit_date ,brand , |
$sql = " SELECT vol_no,customer,manager,source, |
||||
date_format(quote_date,'%Y-%m-%d') quote_date ,is_renovation FROM $table_hope_contract_customer where 1=1 $where "; |
linkman,lm_tel,salesman,num,address,floors,persons,speed,completed_date, |
||||
$hope_contract_customer = DB::result($sql); |
date_format(pre_order_date,'%Y-%m-%d') pre_order_date, |
||||
|
status, date_format(next_visit_date,'%Y-%m-%d') next_visit_date ,brand , |
||||
|
date_format(quote_date,'%Y-%m-%d') quote_date ,is_renovation FROM $table_hope_contract_customer where 1=1 $where "; |
||||
|
$hope_contract_customer = DB::result($sql); |
||||
function base_url($url) |
|
||||
{ |
|
||||
return "https://www.masada.com.tw/static/" . $url; |
|
||||
} |
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; |
function get_sequnece_no($seq_name = '', $p_yyyymm = '') |
||||
#當前年月 |
{ |
||||
|
|
||||
//echo "select yyyymm from sequence where seq_name='$seq_name' "; |
if (empty($p_yyyymm) || empty($seq_name)) return null; |
||||
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 yyyymm from sequence where seq_name='$seq_name' "; |
||||
} |
list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' "); |
||||
// echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no "; |
if ($p_yyyymm != $yyyymm) { |
||||
list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "); |
DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' "); |
||||
// echo "SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "; |
} |
||||
|
// echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no "; |
||||
return $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 "; |
||||
?> |
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
return $seq_no; |
||||
<html> |
} |
||||
|
?> |
||||
<head> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" /> |
<html> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
||||
<title>有望客戶新增</title> |
<head> |
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" /> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" /> |
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" /> |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" /> |
<title>有望客戶新增</title> |
||||
<script type="text/javascript" src="<?php echo base_url('js/jquery3.7.js'); ?>"></script> |
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" /> |
||||
<script type="text/javascript" src="<?php echo base_url('js/selectpage.min.js'); ?>"></script> |
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" /> |
||||
<script type="text/javascript" src="<?php echo base_url('js/jquery.cleditor.min.js'); ?>"></script> |
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" /> |
||||
<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/jquery3.7.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/selectpage.min.js'); ?>"></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/jquery.cleditor.min.js'); ?>"></script> |
||||
<script type="text/javascript" src="<?php echo base_url('js/flow_chart.js?' . rand(10, 100)); ?>"></script> |
<script type="text/javascript" src="<?php echo base_url('bootstrap4/js/bootstrap.min.js'); ?>"></script> |
||||
<script src="<?php echo base_url('js/validate/jquery.validate.min.js?' . rand(10, 100)); ?>"></script> |
<script type="text/javascript" src="<?php echo base_url('js/layui.js?' . rand(10, 100)); ?>"></script> |
||||
<script src="<?php echo base_url('js/validate/messages_zh_TW.js?' . rand(10, 100)); ?>"></script> |
<script type="text/javascript" src="<?php echo base_url('js/wf_property.js?') . rand(10, 100); ?>"></script> |
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/form.css?') . rand(10, 100);; ?>" /> |
<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 type="text/javascript"> |
<script src="<?php echo base_url('js/validate/messages_zh_TW.js?' . rand(10, 100)); ?>"></script> |
||||
$(document).ready(function() { |
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/form.css?') . rand(10, 100);; ?>" /> |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
// $('#cmecTbody').append(cmecRow); |
$(document).ready(function() { |
||||
$('.sp_element_box').attr("disabled", true); |
|
||||
$("#assign_opinion").cleditor({ |
|
||||
height: 100, // height not including margins, borders or padding |
// $('#cmecTbody').append(cmecRow); |
||||
controls: // controls to add to the toolbar |
$('.sp_element_box').attr("disabled", true); |
||||
"bold italic underline strikethrough subscript superscript | font size " + |
$("#assign_opinion").cleditor({ |
||||
"style | color highlight removeformat | bullets numbering | outdent " + |
height: 100, // height not including margins, borders or padding |
||||
"indent | alignleft center alignright justify | undo redo | " |
controls: // controls to add to the toolbar |
||||
}); |
"bold italic underline strikethrough subscript superscript | font size " + |
||||
|
"style | color highlight removeformat | bullets numbering | outdent " + |
||||
$("#form").validate(); |
"indent | alignleft center alignright justify | undo redo | " |
||||
|
}); |
||||
}); |
|
||||
</script> |
$("#form").validate(); |
||||
|
|
||||
</head> |
}); |
||||
|
</script> |
||||
<body> |
|
||||
<div id="toolbarmenu"> |
</head> |
||||
<ul class="nav nav-tabs" role="tablist" id="tablist"> |
|
||||
<li class=" nav-item "> |
<body> |
||||
<a href="#tabassign" aria-controls="tabassign" role="tab" class=" active nav-link" data-toggle="tab">申请單</a> |
<div id="toolbarmenu"> |
||||
</li> |
<ul class="nav nav-tabs" role="tablist" id="tablist"> |
||||
</ul> |
<li class=" nav-item "> |
||||
</div> |
<a href="#tabassign" aria-controls="tabassign" role="tab" class=" active nav-link" data-toggle="tab">申请單</a> |
||||
<div class="tab-content "> |
</li> |
||||
<div class="tab-pane active assign_content " id="tabassign"> |
</ul> |
||||
<form action="crmm06_submit.php" id='form' method="post" style='width:98%;margin:0 auto'> |
</div> |
||||
<!-- hidden域 --> |
<div class="tab-content "> |
||||
<input type='hidden' name='vol_no' value='<?= $vol_no ?>'> |
<div class="tab-pane active assign_content " id="tabassign"> |
||||
<input type='hidden' name='token' value='<?= $_GET['token'] ?>' /> |
<form action="crmm06_submit.php" id='form' method="post" style='width:98%;margin:0 auto'> |
||||
|
<!-- hidden域 --> |
||||
<!--錶單start--> |
<input type='hidden' name='vol_no' value='<?= $vol_no ?>'> |
||||
<div class=" form container-fluid pt-5"> |
<input type='hidden' name='token' value='<?= $_GET['token'] ?>' /> |
||||
<div class="row form_head "> |
|
||||
<div class=" col-12 form_head_title "> |
<!--錶單start--> |
||||
<h4> 有望客戶(契约)</h4> |
<div class=" form container-fluid pt-5"> |
||||
</div> |
<div class="row form_head "> |
||||
</div> |
<div class=" col-12 form_head_title "> |
||||
|
<h4> 有望客戶(契约)</h4> |
||||
<div class="row " style='padding-top:30px;'> |
</div> |
||||
<div class=" col-lg-12 form_row_header "> |
</div> |
||||
<b>有望客戶資料</b> |
|
||||
</div> |
<div class="row " style='padding-top:30px;'> |
||||
</div> |
<div class=" col-lg-12 form_row_header "> |
||||
|
<b>有望客戶資料</b> |
||||
<?php |
</div> |
||||
//一行顯示三列 |
</div> |
||||
$i = 0; |
|
||||
echo " <div class='row '>"; |
<?php |
||||
foreach ($hope_contract_customer_column as $key => $val) { |
//一行顯示三列 |
||||
$j = (($i++) % 4); |
$i = 0; |
||||
$fieldVal = empty($hope_contract_customer) ? "" : $hope_contract_customer[0][$key]; |
echo " <div class='row '>"; |
||||
|
foreach ($hope_contract_customer_column as $key => $val) { |
||||
$_input = $val['tag'] == 'select' ? |
$j = (($i++) % 4); |
||||
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) |
$fieldVal = (empty($data) or !array_key_exists($key, $data)) ? "" : $data[$key]; |
||||
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); |
// $fieldVal = empty($hope_contract_customer) ? "" : $hope_contract_customer[0][$key]; |
||||
if ($i != 1 && $j == 0) { |
|
||||
echo " |
$_input = $val['tag'] == 'select' ? |
||||
</div> |
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) |
||||
<div class='row'> |
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); |
||||
"; |
if ($i != 1 && $j == 0) { |
||||
} |
echo " |
||||
echo " <div class='col-1 form_field_title'> |
</div> |
||||
" . $val['label'] . " |
<div class='row'> |
||||
</div> |
"; |
||||
<div class=' col-2 form_field_content ' > |
} |
||||
$_input |
echo " <div class='col-1 form_field_title'> |
||||
</div> |
" . $val['label'] . " |
||||
"; |
</div> |
||||
} |
<div class=' col-2 form_field_content ' > |
||||
echo "</div>"; |
$_input |
||||
|
</div> |
||||
?> |
"; |
||||
|
} |
||||
<div id="assign_area " class="row "> |
echo "</div>"; |
||||
<div class="col-12 form_row_header "> |
|
||||
<b>洽商進度</b> |
?> |
||||
</div> |
|
||||
<div class="col-12 " style="padding:0"> |
<div id="assign_area " class="row "> |
||||
|
<div class="col-12 form_row_header "> |
||||
<textarea class='form-control textarea' id="progress_status" name="progress_status" value='' rows='6'></textarea> |
<b>洽商進度</b> |
||||
</div> |
</div> |
||||
</div> |
<div class="col-12 " style="padding:0"> |
||||
|
|
||||
|
<textarea class='form-control textarea' id="progress_status" name="progress_status" value='' rows='6'></textarea> |
||||
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button> |
</div> |
||||
</div> |
</div> |
||||
|
|
||||
</form> |
|
||||
|
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button> |
||||
</div> |
</div> |
||||
|
|
||||
|
</form> |
||||
|
|
||||
</div> |
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
</body> |
</body> |
Loading…
Reference in new issue