Browse Source

價審流程

main
Cheng 1 year ago
parent
commit
392852f3d6
  1. 2
      wms/cont/sign_list.php
  2. 79
      wms/crm/crmm01-index.php
  3. 2
      wms/crm/crmm02-index.php
  4. 1493
      wms/mkt/pricereview-check.php
  5. 590
      wms/mkt/pricereview-index.php
  6. 2
      wms/mkt/pricereview_renovate-index.php
  7. 194
      wms/mkt/specsurvey-index.php
  8. 194
      wms/mkt/specsurvey_renovate-index.php

2
wms/cont/sign_list.php

@ -41,7 +41,7 @@ $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);
if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id =="M0189") $where = ""; if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $where = "";
// 電梯廠牌 // 電梯廠牌
$elevator_brand_arr = []; $elevator_brand_arr = [];

79
wms/crm/crmm01-index.php

@ -41,8 +41,8 @@ $where .= " and salesman_name like '$salesman'";
$sql_cmd = sql_myself($user_id, "salesman"); $sql_cmd = sql_myself($user_id, "salesman");
// max,許紓晴,林慧珊,鄭伊岑 // max,許紓晴,林慧珊,鄭伊岑
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0107" || $user_id == "M0193" || $user_id == "M0149" || $user_id =="M0189") $sql_cmd = ""; if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0107" || $user_id == "M0193" || $user_id == "M0149" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = "";
if (!empty($sql_cmd)) $where .= " and ".str_replace("where", "", $sql_cmd); if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd);
/* /*
$checkAll = ['p0044', 'M0007']; $checkAll = ['p0044', 'M0007'];
if (!in_array($user_id, $checkAll)) { if (!in_array($user_id, $checkAll)) {
@ -69,38 +69,45 @@ linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,
$data = mysqli_query($link, $sql); $data = mysqli_query($link, $sql);
?> ?>
<style> <style>
#table_index2 { #table_index2 {
table-layout:fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
#table_index2_filter{
float:right; #table_index2_filter {
} float: right;
#table_index2_paginate{ }
float:right;
} #table_index2_paginate {
div.dataTables_scrollHead table.dataTable { float: right;
margin-bottom: 0 !important; }
border-bottom-width: 0;
} div.dataTables_scrollHead table.dataTable {
div.dataTables_scrollBody table.dataTable { margin-bottom: 0 !important;
border-top-width: 0; border-bottom-width: 0;
} }
/*
div.dataTables_scrollBody table.dataTable {
border-top-width: 0;
}
/*
.col-sm-12 { .col-sm-12 {
width: auto; width: auto;
} }
*/ */
</style> </style>
<script> <script>
$(function () { $(function() {
$('#table_index2').DataTable({ $('#table_index2').DataTable({
"scrollX": true, "scrollX": true,
"pageLength": 10, "pageLength": 10,
order: [[13, 'desc']] order: [
[13, 'desc']
]
});
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋";
}); });
document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋";
});
</script> </script>
<?php <?php
@ -131,20 +138,20 @@ if ($data) :
<tbody> <tbody>
<tr> <tr>
<th style='width:50px'>卷號</th> <th style='width:50px'>卷號</th>
<td><input type="text" class='form-control' name='vol_no' value='<?=(!empty($value))?$value:"";?>' ></td> <td><input type="text" class='form-control' name='vol_no' value='<?= (!empty($value)) ? $value : ""; ?>'></td>
<th>營業員</th> <th>營業員</th>
<td><input type="text" class='form-control' name='salesman' value='<?=$salesman=='%'?'':$salesman ?>' ></td> <td><input type="text" class='form-control' name='salesman' value='<?= $salesman == '%' ? '' : $salesman ?>'></td>
<th>下單地區</th> <th>下單地區</th>
<td><input type="text" class='form-control' name='address' value='<?=$address=='%'?'':$address ?>' ></td> <td><input type="text" class='form-control' name='address' value='<?= $address == '%' ? '' : $address ?>'></td>
<th>聯係人姓名</th> <th>聯係人姓名</th>
<td><input type="text" class='form-control' name='linkman' value='<?=$lm_name=='%'?'':$lm_name?>' ></td> <td><input type="text" class='form-control' name='linkman' value='<?= $lm_name == '%' ? '' : $lm_name ?>'></td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="8" style='text-align:center'> <td colspan="8" style='text-align:center'>
<input type='hidden' name='token' value='<?= $token ?>'/> <input type='hidden' name='token' value='<?= $token ?>' />
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-info btn-sm">查詢</button> <button type="submit" style='text-align:center; margin:0 auto' class="btn btn-info btn-sm">查詢</button>
<a href="crmm03-edit.php?token=<?= $token ?>" class="btn btn-info btn-sm">新增</a> <a href="crmm03-edit.php?token=<?= $token ?>" class="btn btn-info btn-sm">新增</a>
</td> </td>
@ -181,7 +188,7 @@ if ($data) :
<td> <td>
<?php <?php
$status = $pricereview_url = $fname = ""; $status = $pricereview_url = $fname = "";
$db_query = "select status from pricereview_main where contractno = '".$row['vol_no']."' order by id desc limit 1"; $db_query = "select status from pricereview_main where contractno = '" . $row['vol_no'] . "' order by id desc limit 1";
$res_p = mysqli_query($link, $db_query); $res_p = mysqli_query($link, $db_query);
if ($row_p = mysqli_fetch_row($res_p)) $status = $row_p[0]; if ($row_p = mysqli_fetch_row($res_p)) $status = $row_p[0];
mysqli_free_result($res_p); mysqli_free_result($res_p);
@ -202,9 +209,9 @@ if ($data) :
<?php <?php
if (!empty($pricereview_url)) { if (!empty($pricereview_url)) {
?> ?>
<a href="<?= $pricereview_url ?>?vol_no=<?php echo $row['vol_no']; ?>&function_name=<?php echo $fname; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" style="margin-top:3px;"> <a href="<?= $pricereview_url ?>?vol_no=<?php echo $row['vol_no']; ?>&function_name=<?php echo $fname; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" style="margin-top:3px;">
填價審單 填價審單
</a> </a>
<?php <?php
} }
?> ?>

2
wms/crm/crmm02-index.php

@ -42,7 +42,7 @@ $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" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $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,salesman,f_return_content('customer_source',source ) source, $sql = "SELECT vol_no,customer,manager,salesman,f_return_content('customer_source',source ) source,

1493
wms/mkt/pricereview-check.php

File diff suppressed because it is too large

590
wms/mkt/pricereview-index.php

@ -12,93 +12,106 @@ $data = array();
$sql_cmd = sql_myself($user_id, "pricereview_main .creater"); $sql_cmd = sql_myself($user_id, "pricereview_main .creater");
$sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
// M0024許伃廷,M0107許紓晴權限全開 // M0024許伃廷,M0107許紓晴權限全開
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0189" ) { if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") {
$sql_cmd = "where create_at >= '2023-01-01 00:00:00'"; $sql_cmd = "where create_at >= '2023-01-01 00:00:00'";
$sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
} }
if ($user_id == "M0060" ) { if ($user_id == "M0060") {
$sql_cmd = "where creater in (select accountid from account where (department_id like '3%' or department_id like '5%'))"; $sql_cmd = "where creater in (select accountid from account where (department_id like '3%' or department_id like '5%'))";
$sql = "select pricereview_main.*,contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where creater in (select accountid from account where (department_id like '3%' or department_id like '5%')) and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; $sql = "select pricereview_main.*,contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where creater in (select accountid from account where (department_id like '3%' or department_id like '5%')) and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
} }
if (empty($sql_cmd)) $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; if (empty($sql_cmd)) $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
else $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on contract_new_apply.mid = pricereview_main.id $sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; else $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on contract_new_apply.mid = pricereview_main.id $sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id";
$data = mysqli_query($link,$sql);
$para = "function_name=pricereview&".$token_link; $data = mysqli_query($link, $sql);
$para = "function_name=pricereview&" . $token_link;
?> ?>
<style> <style>
#table_index2 { #table_index2 {
table-layout:fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
#table_index2_filter{
float:right; #table_index2_filter {
} float: right;
#table_index2_paginate{ }
float:right;
} #table_index2_paginate {
div.dataTables_scrollHead table.dataTable { float: right;
margin-bottom: 0 !important; }
border-bottom-width: 0;
} div.dataTables_scrollHead table.dataTable {
div.dataTables_scrollBody table.dataTable { margin-bottom: 0 !important;
border-top-width: 0; border-bottom-width: 0;
} }
/*
div.dataTables_scrollBody table.dataTable {
border-top-width: 0;
}
/*
.col-sm-12 { .col-sm-12 {
width: auto; width: auto;
} }
*/ */
img { img {
width:125px; width: 125px;
} }
.width_style_1 { .width_style_1 {
width:125px; width: 125px;
} }
label { label {
display: inline-flex; display: inline-flex;
margin-bottom: .5rem; margin-bottom: .5rem;
margin-top: .5rem; margin-top: .5rem;
} }
div a:hover {
text-decoration:none; div a:hover {
} text-decoration: none;
.btn-sm { }
font-size:14px;
margin: 2px 0; .btn-sm {
line-height: 90%; font-size: 14px;
} margin: 2px 0;
.glyphicon-ok, .glyphicon-ban-circle { line-height: 90%;
font-size:130%; }
}
.btn-secondary { .glyphicon-ok,
color: #fff; .glyphicon-ban-circle {
background-color: #6c757d; font-size: 130%;
border-color: #6c757d; }
}
.btn-secondary:hover { .btn-secondary {
color: #fff; color: #fff;
background-color: #5a6268; background-color: #6c757d;
border-color: #545b62; border-color: #6c757d;
} }
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
</style> </style>
<script> <script>
$(function () { $(function() {
$('#table_index2').DataTable({ $('#table_index2').DataTable({
"scrollX": true, "scrollX": true,
"pageLength": 50 "pageLength": 50
});
/*
var api = $('#table_index').dataTable().api();
//var order = api.order();
//console.log(order);
api
.order([0, "desc"])
.draw();
*/
}); });
/*
var api = $('#table_index').dataTable().api();
//var order = api.order();
//console.log(order);
api
.order([0, "desc"])
.draw();
*/
});
</script> </script>
<!--改由有望客戶入口 <!--改由有望客戶入口
<p> <p>
@ -108,7 +121,7 @@ $(function () {
</p> </p>
--> -->
<?php <?php
if ($data): if ($data) :
/* /*
if($_SERVER["REQUEST_METHOD"] == "POST"){ if($_SERVER["REQUEST_METHOD"] == "POST"){
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){ if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){
@ -119,52 +132,52 @@ if ($data):
} }
*/ */
?> ?>
<link rel="stylesheet" href="common.css"> <link rel="stylesheet" href="common.css">
<div style="overflow-x:auto; white-space:nowrap;"> <div style="overflow-x:auto; white-space:nowrap;">
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr> <tr>
<th>項次</th> <th>項次</th>
<th>卷號</th> <th>卷號</th>
<th>營業員</th> <th>營業員</th>
<th>客戶名稱</th> <th>客戶名稱</th>
<th>案件名稱</th> <th>案件名稱</th>
<th>牌價總額</th> <th>牌價總額</th>
<th>售價總額</th> <th>售價總額</th>
<th>價率</th> <th>價率</th>
<th>預定成交日</th> <th>預定成交日</th>
<th>預定交期</th> <th>預定交期</th>
<th>建檔人</th> <th>建檔人</th>
<th>建檔時間</th> <th>建檔時間</th>
<th>功能</th> <th>功能</th>
<th>區經理</th> <th>區經理</th>
<th>業務承辦人</th> <th>業務承辦人</th>
<th>業務部協理</th> <th>業務部協理</th>
<th>總經理</th> <th>總經理</th>
<th>狀態</th> <th>狀態</th>
<th>合約書申請</th> <th>合約書申請</th>
<!--<th>修改</th>--> <!--<th>修改</th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach($data as $data) : foreach ($data as $data) :
$sign1 = $sign2 = $sign3 = $sign4 = ""; $sign1 = $sign2 = $sign3 = $sign4 = "";
$oneself = ($data["creater"]==$user_id) ? 1 : 0; // 是否為營業員本人 $oneself = ($data["creater"] == $user_id) ? 1 : 0; // 是否為營業員本人
// 簽核狀況 // 簽核狀況
$db_query = "select sign1, sign2, sign3, sign4 from pricereview_sign where mid = '".$data["id"]."'"; $db_query = "select sign1, sign2, sign3, sign4 from pricereview_sign where mid = '" . $data["id"] . "'";
$res_s = mysqli_query($link ,$db_query); $res_s = mysqli_query($link, $db_query);
if ($row_s = mysqli_fetch_row($res_s)) { if ($row_s = mysqli_fetch_row($res_s)) {
list($sign1, $sign2, $sign3, $sign4) = $row_s; list($sign1, $sign2, $sign3, $sign4) = $row_s;
// 下一位簽核人員:$sign_nt, 目前簽核進度:$sign_st // 下一位簽核人員:$sign_nt, 目前簽核進度:$sign_st
$ss_arr = sign_status([$sign1, $sign2, $sign3, $sign4]); $ss_arr = sign_status([$sign1, $sign2, $sign3, $sign4]);
//print_r($ss_arr); //print_r($ss_arr);
/* /*
$sign1_nos = 0; $sign1_nos = 0;
$sign_nt_arr = []; $sign_nt_arr = [];
$sign1_arr = explode("<##>", $sign1); $sign1_arr = explode("<##>", $sign1);
@ -204,64 +217,65 @@ if ($data):
$sign_nt = ""; $sign_nt = "";
} }
*/ */
}
mysqli_free_result($res_s);
?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['person']; ?></td>
<td><?php echo $data['company']; ?></td>
<td><?php echo $data['case_name']; ?></td>
<td><?php echo number_format($data['price_lowest']); ?></td>
<td><?php echo number_format($data['price_total']); ?></td>
<td><?php echo $data['price_rate']; ?>%</td>
<td><?php echo $data['predeal_date']; ?></td>
<td><?php echo $data['facilitok_date']; ?></td>
<td><?php echo $accountname_arr[$data['creater']]; ?></td>
<td><?php echo $data['create_at']; ?></td>
<td>
<?php
//if ($oneself && !($data["status"] == "YY" || $data["status"] == "YN")) { // 自己可以進行規調
if ($oneself) {
if ($data["status"] == "Y1") {
?>
<a href="pricereview-edit.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-primary btn-sm">修改</a>
<a href="pricereview-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-secondary btn-sm" onClick="return confirm('Are you sure you want to delete?')">刪除</a>
<?php
} elseif ($data["status"] == "YS") {
?>
<a href="specsurvey-create.php?mid=<?=$data['id'];?>&function_name=specsurvey&token=<?=$token;?>" class="btn btn-danger btn-sm">填規調</a>
<?php
} }
} mysqli_free_result($res_s);
?> ?>
<a href="pricereview-check.php?id=<?php echo $data['id']."&".$para; ?>" class="btn btn-warning btn-sm">檢視</a> <tr>
<?php <td><?php echo $data['id']; ?></td>
if ($user_id=="M0023") { <td><?php echo $data['contractno']; ?></td>
?> <td><?php echo $data['person']; ?></td>
<a href="specsurvey-create.php?mid=<?=$data['id'];?>&function_name=specsurvey&token=<?=$token;?>" class="btn btn-danger btn-sm">填規調</a> <td><?php echo $data['company']; ?></td>
<?php <td><?php echo $data['case_name']; ?></td>
} <td><?php echo number_format($data['price_lowest']); ?></td>
?> <td><?php echo number_format($data['price_total']); ?></td>
</td> <td><?php echo $data['price_rate']; ?>%</td>
<td> <td><?php echo $data['predeal_date']; ?></td>
<?php <td><?php echo $data['facilitok_date']; ?></td>
$str = $uperson = $ustatus = $udtte = ""; <td><?php echo $accountname_arr[$data['creater']]; ?></td>
if (!empty($sign1)) list($uperson, $ustatus, $udtte) = explode(",", $sign1); <td><?php echo $data['create_at']; ?></td>
if ($ustatus) { <td>
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>"; <?php
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>"; //if ($oneself && !($data["status"] == "YY" || $data["status"] == "YN")) { // 自己可以進行規調
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte; if ($oneself) {
} else { if ($data["status"] == "Y1") {
if ($ss_arr["sign_st"]==1 && in_array($user_id, $ss_arr["sign_nt"]) && $data["status"]=="YS") { ?>
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; <a href="pricereview-edit.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-primary btn-sm">修改</a>
$str = "待簽核"; <a href="pricereview-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-secondary btn-sm" onClick="return confirm('Are you sure you want to delete?')">刪除</a>
$str = "<a href=\"pricereview-check.php?st=1&id=".$data["id"]."&".$para."\" class=\"btn btn-primary btn-sm\">".$str."</a>"; <?php
} else $str = "--"; } elseif ($data["status"] == "YS") {
} ?>
echo $str; <a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
/* <?php
}
}
?>
<a href="pricereview-check.php?id=<?php echo $data['id'] . "&" . $para; ?>" class="btn btn-warning btn-sm">檢視</a>
<?php
if ($user_id == "M0023") {
?>
<a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
<?php
}
?>
</td>
<td>
<?php
$str = $uperson = $ustatus = $udtte = "";
if (!empty($sign1)) list($uperson, $ustatus, $udtte) = explode(",", $sign1);
// echo $sign1;
if ($ustatus) {
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
} else {
if ($ss_arr["sign_st"] == 1 && in_array($user_id, $ss_arr["sign_nt"]) && $data["status"] == "YS") {
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "待簽核";
$str = "<a href=\"pricereview-check.php?st=1&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
} else $str = "--";
}
echo $str;
/*
if ($sign_st==1 && $sign_nt==$user_id) { if ($sign_st==1 && $sign_nt==$user_id) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "<a href=\"pricereview-check.php?st=1&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>"; $str = "<a href=\"pricereview-check.php?st=1&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
@ -273,7 +287,7 @@ if ($user_id=="M0023") {
} else $str = "--"; } else $str = "--";
*/ */
/* /*
if ($data["checker_1_result"] == "Y") { if ($data["checker_1_result"] == "Y") {
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>"; $str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
} elseif ($data["checker_1_result"] == "N") { } elseif ($data["checker_1_result"] == "N") {
@ -291,35 +305,35 @@ if ($user_id=="M0023") {
} }
else $str = "--"; else $str = "--";
}*/ }*/
//echo $str; //echo $str;
?> ?>
</td> </td>
<td> <td>
<?php <?php
$str = $uperson = $ustatus = $udtte = ""; $str = $uperson = $ustatus = $udtte = "";
if (!empty($sign2)) { if (!empty($sign2)) {
$sign2_arr = explode("<##>", $sign2); $sign2_arr = explode("<##>", $sign2);
foreach ($sign2_arr as $v) { foreach ($sign2_arr as $v) {
list($uperson, $ustatus, $udtte) = explode(",", $v); list($uperson, $ustatus, $udtte) = explode(",", $v);
if ($ustatus == "Y" || $ustatus == "N") { if ($ustatus == "Y" || $ustatus == "N") {
break; break;
} }
} }
} }
if ($ustatus) { if ($ustatus) {
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>"; if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>"; elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte; $str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
} else { } else {
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 2) && (in_array($user_id, $ss_arr["sign_nt"]))) { if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 2) && (in_array($user_id, $ss_arr["sign_nt"]))) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "待簽核"; $str = "待簽核";
$str = "<a href=\"pricereview-check.php?st=2&id=".$data["id"]."&".$para."\" class=\"btn btn-primary btn-sm\">".$str."</a>"; $str = "<a href=\"pricereview-check.php?st=2&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
} else $str = "--"; } else $str = "--";
} }
echo $str; echo $str;
/* /*
if ($sign_st==2 && $sign_nt==$user_id) { if ($sign_st==2 && $sign_nt==$user_id) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "<a href=\"pricereview-check.php?st=2&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>"; $str = "<a href=\"pricereview-check.php?st=2&id=".$data["id"]."&".$para."\" class=\"btn btn-info btn-sm\">".$str."</a>";
@ -331,7 +345,7 @@ if ($user_id=="M0023") {
} else $str = "--"; } else $str = "--";
*/ */
/* /*
if ($data["checker_2_result"] == "Y") { if ($data["checker_2_result"] == "Y") {
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>"; $str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
} elseif ($data["checker_2_result"] == "N") { } elseif ($data["checker_2_result"] == "N") {
@ -350,26 +364,26 @@ if ($user_id=="M0023") {
else $str = "--"; else $str = "--";
} }
*/ */
//echo $str; //echo $str;
?> ?>
</td> </td>
<td> <td>
<?php <?php
$str = $uperson = $ustatus = $udtte = ""; $str = $uperson = $ustatus = $udtte = "";
if (!empty($sign3)) list($uperson, $ustatus, $udtte) = explode(",", $sign3); if (!empty($sign3)) list($uperson, $ustatus, $udtte) = explode(",", $sign3);
if ($ustatus) { if ($ustatus) {
if ($ustatus == "Y" || $ustatus == "YY") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>"; if ($ustatus == "Y" || $ustatus == "YY") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>"; elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte; $str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
} else { } else {
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 3) && (in_array($user_id, $ss_arr["sign_nt"]))) { if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 3) && (in_array($user_id, $ss_arr["sign_nt"]))) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "待簽核"; $str = "待簽核";
$str = "<a href=\"pricereview-check.php?st=3&id=".$data["id"]."&".$para."\" class=\"btn btn-primary btn-sm\">".$str."</a>"; $str = "<a href=\"pricereview-check.php?st=3&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
} else $str = "--"; } else $str = "--";
} }
echo $str; echo $str;
/* /*
$str = ""; $str = "";
if ($sign_st==3 && $sign_nt==$user_id) { if ($sign_st==3 && $sign_nt==$user_id) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
@ -377,7 +391,7 @@ if ($user_id=="M0023") {
} else $str = "--"; } else $str = "--";
*/ */
/* /*
if ($data["checker_3_result"] == "Y") { if ($data["checker_3_result"] == "Y") {
$str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>"; $str = "<span class=\"glyphicon glyphicon-ok\" title=\"通過\"></span>";
} elseif ($data["checker_3_result"] == "N") { } elseif ($data["checker_3_result"] == "N") {
@ -396,79 +410,81 @@ if ($user_id=="M0023") {
else $str = "--"; else $str = "--";
} }
*/ */
//echo $str; //echo $str;
?> ?>
</td> </td>
<td> <td>
<?php <?php
$str = $uperson = $ustatus = $udtte = ""; $str = $uperson = $ustatus = $udtte = "";
if (!empty($sign4)) list($uperson, $ustatus, $udtte) = explode(",", $sign4); if (!empty($sign4)) list($uperson, $ustatus, $udtte) = explode(",", $sign4);
if ($ustatus) { if ($ustatus) {
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>"; if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>"; elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
$str .= "<br>".$accountname_arr[$uperson]."<br>".$udtte; $str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
} else { } else {
if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 4) && (in_array($user_id, $ss_arr["sign_nt"]))) { if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 4) && (in_array($user_id, $ss_arr["sign_nt"]))) {
$str = "<span class=\"glyphicon glyphicon-user\"></span>"; $str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "待簽核"; $str = "待簽核";
$str = "<a href=\"pricereview-check.php?st=4&id=".$data["id"]."&".$para."\" class=\"btn btn-primary btn-sm\">".$str."</a>"; $str = "<a href=\"pricereview-check.php?st=4&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
} else $str = "--"; } else $str = "--";
} }
echo $str; echo $str;
?> ?>
</td> </td>
<td><?php echo $status_arr[$data["status"]]; ?></td> <td><?php echo $status_arr[$data["status"]]; ?></td>
<!--<td> <!--<td>
<p> <p>
<a href="pricereview-edit.php?id=<?php echo $data['id']."&".$para; ?>" class="btn btn-info btn-sm"> <a href="pricereview-edit.php?id=<?php echo $data['id'] . "&" . $para; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
</p> </p>
</td>--> </td>-->
<style> <style>
.applybtn{ .applybtn {
color:#fff; color: #fff;
background-color: #1484c4; background-color: #1484c4;
display: block; display: block;
border-radius: 4px; border-radius: 4px;
padding: 4px 2px; padding: 4px 2px;
font-size: 13px; font-size: 13px;
} }
.applybtn:hover{
background-color: #1494f9; .applybtn:hover {
color:#fff; background-color: #1494f9;
} color: #fff;
</style> }
<td> </style>
<?php if(($data['status'] == 'YY' && $oneself) || $user_id == "M0174"): ?> <td>
<a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>"> <?php if (($data['status'] == 'YY' && $oneself) || $user_id == "M0174") : ?>
<?php if($data['applystatus'] <1){ <a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">
echo "申請"; <?php if ($data['applystatus'] < 1) {
}else{ echo "申請";
echo "檢視"; } else {
} ?> echo "檢視";
</a><br> } ?>
<?php endif; ?> </a><br>
<?php endif; ?>
<?php if($data['status'] == 'YY' && ($user_id == "M0060" || $user_id == "M0107" || $user_id == "M0174") && $data['applystatus'] == 1): ?>
<a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">待簽核</a><br> <?php if ($data['status'] == 'YY' && ($user_id == "M0060" || $user_id == "M0107" || $user_id == "M0174") && $data['applystatus'] == 1) : ?>
<?php endif; ?> <a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">待簽核</a><br>
<?php if($data['status'] != 'YY' ): ?> <?php endif; ?>
<span style="font-size:13px;font-weight:600">--</span> <?php if ($data['status'] != 'YY') : ?>
<?php endif; ?> <span style="font-size:13px;font-weight:600">--</span>
<!-- 工號M0107、M0174有所有權限 --> <?php endif; ?>
<?php if(($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174"): ?> <!-- 工號M0107、M0174有所有權限 -->
<a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para?>">下載</a> <?php if (($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174") : ?>
<?php endif; ?> <a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載</a>
</td> <?php endif; ?>
</tr> </td>
<?php endforeach; ?> </tr>
</tbody> <?php endforeach; ?>
</table> </tbody>
</div> </table>
</div>
<?php <?php
else:
else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;

2
wms/mkt/pricereview_renovate-index.php

@ -11,7 +11,7 @@ $data = array();
// sql語法存在變數中 // sql語法存在變數中
$sql_cmd = sql_myself($user_id); $sql_cmd = sql_myself($user_id);
// M0024許伃廷,M0107許紓晴,M0012李盈瑩權限全開 // M0024許伃廷,M0107許紓晴,M0012李盈瑩權限全開
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189") { if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") {
$sql_cmd = "where create_at >= '2023-01-01 00:00:00'"; $sql_cmd = "where create_at >= '2023-01-01 00:00:00'";
} }
if ($user_id == "M0008") { if ($user_id == "M0008") {

194
wms/mkt/specsurvey-index.php

@ -5,7 +5,7 @@ include "../header.php";
$data = array(); $data = array();
// sql語法存在變數中 // sql語法存在變數中
$sql_cmd = sql_myself($user_id, "s.creater"); $sql_cmd = sql_myself($user_id, "s.creater");
if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = ""; if ($user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = "";
$sql2 = (empty($sql_cmd)) ? "where" : "and"; $sql2 = (empty($sql_cmd)) ? "where" : "and";
$sql2 .= " s.mid = p.id and p.ekind = '新梯' "; $sql2 .= " s.mid = p.id and p.ekind = '新梯' ";
$sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)"; $sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)";
@ -24,7 +24,7 @@ $class_arr = [1 => "新梯", 2 => "舊改M1", 3 => "舊改M2", 4 => "舊改M3",
</p> </p>
--> -->
<?php <?php
if ($data): if ($data) :
/* /*
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){ if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){
@ -35,112 +35,120 @@ if ($data):
} }
*/ */
?> ?>
<style> <style>
table { table {
table-layout:fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
td {
word-wrap:break-word; td {
} word-wrap: break-word;
img { }
width:125px;
} img {
.width_style_1 { width: 125px;
width:125px; }
}
table{ .width_style_1 {
width:100%; width: 125px;
} }
#table_index_filter{
float:right; table {
} width: 100%;
#table_index_paginate{ }
float:right;
} #table_index_filter {
label { float: right;
display: inline-flex; }
margin-bottom: .5rem;
margin-top: .5rem; #table_index_paginate {
} float: right;
.btn-sm { }
font-size:14px;
margin: 2px 0; label {
line-height: 90%; display: inline-flex;
} margin-bottom: .5rem;
</style> margin-top: .5rem;
<script> }
$(function () {
var api = $('#table_index').dataTable().api(); .btn-sm {
api font-size: 14px;
.order([0, "desc"]) margin: 2px 0;
.draw(); line-height: 90%;
}); }
</script> </style>
<div style="overflow-x:auto;"> <script>
<table id="table_index" class="table table-striped table-bordered" style="width:100%"> $(function() {
<thead> var api = $('#table_index').dataTable().api();
<tr> api
<th>項次</th> .order([0, "desc"])
<th>日期版號</th> .draw();
<th>卷號</th> });
<th>客戶名稱</th> </script>
<th>預定交期</th> <div style="overflow-x:auto;">
<th style="width:10%">規格</th> <table id="table_index" class="table table-striped table-bordered" style="width:100%">
<th>號機</th> <thead>
<!--<th>機種</th> <tr>
<th>項次</th>
<th>日期版號</th>
<th>卷號</th>
<th>客戶名稱</th>
<th>預定交期</th>
<th style="width:10%">規格</th>
<th>號機</th>
<!--<th>機種</th>
<th>載重</th> <th>載重</th>
<th>人乘</th> <th>人乘</th>
<th>停數</th> <th>停數</th>
<th>速度</th>--> <th>速度</th>-->
<th>用途</th> <th>用途</th>
<th>類型</th> <th>類型</th>
<th>修改者</th> <th>修改者</th>
<th>修改時間</th> <th>修改時間</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach ($data as $data) : foreach ($data as $data) :
$sql2 = "select item_spec from pricereview_item where mid = '".$data["mid"]."' and item_no = '".$data["pr_item_id"]."'"; $sql2 = "select item_spec from pricereview_item where mid = '" . $data["mid"] . "' and item_no = '" . $data["pr_item_id"] . "'";
$res2 = mysqli_query($link, $sql2); $res2 = mysqli_query($link, $sql2);
$row = mysqli_fetch_row($res2); $row = mysqli_fetch_row($res2);
$item_spec = $row[0]; $item_spec = $row[0];
mysqli_free_result($res2); mysqli_free_result($res2);
?> ?>
<tr> <tr>
<td><?php echo $data['id']; ?></td> <td><?php echo $data['id']; ?></td>
<td><?php echo $data['version']; ?></td> <td><?php echo $data['version']; ?></td>
<td><?php echo $data['contractno']; ?></td> <td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['company']; ?></td> <td><?php echo $data['company']; ?></td>
<td><?php echo $data['facilitok_date']; ?></td> <td><?php echo $data['facilitok_date']; ?></td>
<td><?php echo $item_spec; ?></td> <td><?php echo $item_spec; ?></td>
<td><?php echo $data['serial']; ?></td> <td><?php echo $data['serial']; ?></td>
<!--<td><?php echo $data['rtype']; ?></td> <!--<td><?php echo $data['rtype']; ?></td>
<td><?php echo $data['weight']; ?></td> <td><?php echo $data['weight']; ?></td>
<td><?php echo $data['numberofpassenger']; ?></td> <td><?php echo $data['numberofpassenger']; ?></td>
<td><?php echo $data['numberofstop']; ?></td> <td><?php echo $data['numberofstop']; ?></td>
<td><?php echo $data['speed']; ?></td>--> <td><?php echo $data['speed']; ?></td>-->
<td><?php echo $usefor_arr[$data['usefor']]; ?></td> <td><?php echo $usefor_arr[$data['usefor']]; ?></td>
<td><?php echo $class_arr[$data['class']]; ?></td> <td><?php echo $class_arr[$data['class']]; ?></td>
<td><?php echo $data['creater']; ?></td> <td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td> <td><?php echo $data['create_at']; ?></td>
<td><a href="specsurvey-view.php?pa=<?php echo $data['mid'].",".$data['pr_item_id'],",".$data['version'].",".$data['sub_item_id']; ?>&function=specsurvey&<?php echo $token_link; ?>" class="btn btn-warning btn-sm">檢視</a></td> <td><a href="specsurvey-view.php?pa=<?php echo $data['mid'] . "," . $data['pr_item_id'], "," . $data['version'] . "," . $data['sub_item_id']; ?>&function=specsurvey&<?php echo $token_link; ?>" class="btn btn-warning btn-sm">檢視</a></td>
<!--<td> <!--<td>
<p> <p>
<a href="specsurvey-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')"> <a href="specsurvey-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
<span class="glyphicon glyphicon-remove"></span> <span class="glyphicon glyphicon-remove"></span>
</a> </a>
</p> </p>
</td>--> </td>-->
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<?php <?php
else: else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;

194
wms/mkt/specsurvey_renovate-index.php

@ -5,7 +5,7 @@ include "../header.php";
$data = array(); $data = array();
// sql語法存在變數中 // sql語法存在變數中
$sql_cmd = sql_myself($user_id, "s.creater"); $sql_cmd = sql_myself($user_id, "s.creater");
if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = ""; if ($user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = "";
$sql2 = (empty($sql_cmd)) ? "where" : "and"; $sql2 = (empty($sql_cmd)) ? "where" : "and";
$sql2 .= " s.mid = p.id and p.ekind = '汰改' "; $sql2 .= " s.mid = p.id and p.ekind = '汰改' ";
$sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)"; $sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)";
@ -24,7 +24,7 @@ $class_arr = [1 => "新梯", 2 => "舊改M1", 3 => "舊改M2", 4 => "舊改M3",
</p> </p>
--> -->
<?php <?php
if ($data): if ($data) :
/* /*
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){ if(empty($_POST["name"]) && empty($_POST["email"]) && empty($_POST["website"])){
@ -35,112 +35,120 @@ if ($data):
} }
*/ */
?> ?>
<style> <style>
table { table {
table-layout:fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
td {
word-wrap:break-word; td {
} word-wrap: break-word;
img { }
width:125px;
} img {
.width_style_1 { width: 125px;
width:125px; }
}
table{ .width_style_1 {
width:100%; width: 125px;
} }
#table_index_filter{
float:right; table {
} width: 100%;
#table_index_paginate{ }
float:right;
} #table_index_filter {
label { float: right;
display: inline-flex; }
margin-bottom: .5rem;
margin-top: .5rem; #table_index_paginate {
} float: right;
.btn-sm { }
font-size:14px;
margin: 2px 0; label {
line-height: 90%; display: inline-flex;
} margin-bottom: .5rem;
</style> margin-top: .5rem;
<script> }
$(function () {
var api = $('#table_index').dataTable().api(); .btn-sm {
api font-size: 14px;
.order([0, "desc"]) margin: 2px 0;
.draw(); line-height: 90%;
}); }
</script> </style>
<div style="overflow-x:auto;"> <script>
<table id="table_index" class="table table-striped table-bordered" style="width:100%"> $(function() {
<thead> var api = $('#table_index').dataTable().api();
<tr> api
<th>項次</th> .order([0, "desc"])
<th>日期版號</th> .draw();
<th>卷號</th> });
<th>客戶名稱</th> </script>
<th>預定交期</th> <div style="overflow-x:auto;">
<th style="width:10%">規格</th> <table id="table_index" class="table table-striped table-bordered" style="width:100%">
<th>號機</th> <thead>
<!--<th>機種</th> <tr>
<th>項次</th>
<th>日期版號</th>
<th>卷號</th>
<th>客戶名稱</th>
<th>預定交期</th>
<th style="width:10%">規格</th>
<th>號機</th>
<!--<th>機種</th>
<th>載重</th> <th>載重</th>
<th>人乘</th> <th>人乘</th>
<th>停數</th> <th>停數</th>
<th>速度</th>--> <th>速度</th>-->
<th>用途</th> <th>用途</th>
<th>類型</th> <th>類型</th>
<th>修改者</th> <th>修改者</th>
<th>修改時間</th> <th>修改時間</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach ($data as $data) : foreach ($data as $data) :
$sql2 = "select item_spec from pricereview_item where mid = '".$data["mid"]."' and item_no = '".$data["pr_item_id"]."'"; $sql2 = "select item_spec from pricereview_item where mid = '" . $data["mid"] . "' and item_no = '" . $data["pr_item_id"] . "'";
$res2 = mysqli_query($link, $sql2); $res2 = mysqli_query($link, $sql2);
$row = mysqli_fetch_row($res2); $row = mysqli_fetch_row($res2);
$item_spec = $row[0]; $item_spec = $row[0];
mysqli_free_result($res2); mysqli_free_result($res2);
?> ?>
<tr> <tr>
<td><?php echo $data['id']; ?></td> <td><?php echo $data['id']; ?></td>
<td><?php echo $data['version']; ?></td> <td><?php echo $data['version']; ?></td>
<td><?php echo $data['contractno']; ?></td> <td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['company']; ?></td> <td><?php echo $data['company']; ?></td>
<td><?php echo $data['facilitok_date']; ?></td> <td><?php echo $data['facilitok_date']; ?></td>
<td><?php echo $item_spec; ?></td> <td><?php echo $item_spec; ?></td>
<td><?php echo $data['serial']; ?></td> <td><?php echo $data['serial']; ?></td>
<!--<td><?php echo $data['rtype']; ?></td> <!--<td><?php echo $data['rtype']; ?></td>
<td><?php echo $data['weight']; ?></td> <td><?php echo $data['weight']; ?></td>
<td><?php echo $data['numberofpassenger']; ?></td> <td><?php echo $data['numberofpassenger']; ?></td>
<td><?php echo $data['numberofstop']; ?></td> <td><?php echo $data['numberofstop']; ?></td>
<td><?php echo $data['speed']; ?></td>--> <td><?php echo $data['speed']; ?></td>-->
<td><?php echo $usefor_arr[$data['usefor']]; ?></td> <td><?php echo $usefor_arr[$data['usefor']]; ?></td>
<td><?php echo $class_arr[$data['class']]; ?></td> <td><?php echo $class_arr[$data['class']]; ?></td>
<td><?php echo $data['creater']; ?></td> <td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_at']; ?></td> <td><?php echo $data['create_at']; ?></td>
<td><a href="specsurvey_renovate-view.php?pa=<?php echo $data['mid'].",".$data['pr_item_id'],",".$data['version'].",".$data['sub_item_id']; ?>&function=specsurvey_renovate&<?php echo $token_link; ?>" class="btn btn-warning btn-sm">檢視</a></td> <td><a href="specsurvey_renovate-view.php?pa=<?php echo $data['mid'] . "," . $data['pr_item_id'], "," . $data['version'] . "," . $data['sub_item_id']; ?>&function=specsurvey_renovate&<?php echo $token_link; ?>" class="btn btn-warning btn-sm">檢視</a></td>
<!--<td> <!--<td>
<p> <p>
<a href="specsurvey-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')"> <a href="specsurvey-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info btn-sm" onClick="return confirm('Are you sure you want to delete?')">
<span class="glyphicon glyphicon-remove"></span> <span class="glyphicon glyphicon-remove"></span>
</a> </a>
</p> </p>
</td>--> </td>-->
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<?php <?php
else: else :
echo "<h2>There is no record!</h2>"; echo "<h2>There is no record!</h2>";
endif; endif;

Loading…
Cancel
Save