Browse Source

新增測試帳號

main
10994015 1 year ago
parent
commit
623d0dcbf7
  1. 2
      wms/cont/sign_list.php
  2. 1
      wms/contract/api/postContractNewApplyData.php
  3. 21
      wms/contract/contract-new-apply.php
  4. 2
      wms/crm/crmm01-index.php
  5. 2
      wms/crm/crmm02-index.php
  6. 17
      wms/header.php
  7. 4
      wms/mkt/pricereview-index.php
  8. 2
      wms/mkt/pricereview_renovate-index.php
  9. 2
      wms/mkt/specsurvey-index.php
  10. 2
      wms/mkt/specsurvey_renovate-index.php
  11. 6
      wms/sign/list.php

2
wms/cont/sign_list.php

@ -41,7 +41,7 @@ $res = mysqli_query($link, $sql);
$row = mysqli_fetch_row($res);
$user_department_id = $row[0];
mysqli_free_result($res);
if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006") $where = "";
if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id =="M0189") $where = "";
// 電梯廠牌
$elevator_brand_arr = [];

1
wms/contract/api/postContractNewApplyData.php

@ -8,7 +8,6 @@ if($_SERVER['REQUEST_METHOD'] != 'POST'){
}
//暫存、送審
if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 0 || $_POST['status'] == 1) ){
if($_POST['regulations'] < 10){
header("HTTP/1.1 500 傳送失敗!!試車時間不得低於10天");
exit;

21
wms/contract/contract-new-apply.php

@ -9,7 +9,10 @@ if(!(isset($_GET['id']) && !empty($_GET['id']))){
}
$id = $_GET["id"];
$sql_str = "SELECT contract_new_apply.*, account.name as review_person_name FROM contract_new_apply LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid WHERE contract_new_apply.mid = :mid";
$sql_str = "SELECT contract_new_apply.*, account.name as review_person_name
FROM contract_new_apply
LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid
WHERE contract_new_apply.mid = :mid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid',$id);
$stmt->execute();
@ -46,11 +49,9 @@ if(empty($contract_new_apply)){
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
$total_items = 0;
print_r($items);
foreach($items as $item){
$total_items += $item['item_qty'];
}
echo $total_items ;
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
@ -80,7 +81,6 @@ if(empty($contract_new_apply)){
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($items);
$price_a = 0;
$price_b = 0;
foreach($pays as $pay){
@ -91,6 +91,12 @@ if(empty($contract_new_apply)){
}
}
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contract_id', $id);
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($files);
}
$secondPayDeadline = $contract['secondPayDeadline'] ?? 0;
$status = isset($contract['status']) ? $contract['status'] : -1;
@ -450,7 +456,12 @@ $person = $contract['person'];
<tr>
<td colspan="4">附件上傳</td>
<td colspan="4">
<?php if($status < 1): ?>
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
<?php endif; ?>
<?php foreach($files as $file): ?>
<a href="./images/contracts_new_files/<?php echo $file['file_name']; ?>" download ?><?php echo $file['file_name']; ?></a>
<?php endforeach; ?>
</td>
</tr>
</tbody>
@ -518,7 +529,7 @@ $person = $contract['person'];
</tbody>
</table>
<button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn" >回前頁</button>
<?php if(($isFirst == 1 && $person == $user_id) || ($isFirst==0 && $status == 0 && $person == $user_id) ): ?>
<?php if(($isFirst == 1 && ($person == $user_id || $user_id == "M0174")) || ($isFirst==0 && $status == 0 && ($person == $user_id || $user_id == "M0174"))): ?>
<button x-show="true" x-on:click="submit()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>送審</span>

2
wms/crm/crmm01-index.php

@ -41,7 +41,7 @@ $where .= " and salesman_name like '$salesman'";
$sql_cmd = sql_myself($user_id, "salesman");
// max,許紓晴,林慧珊,鄭伊岑
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0107" || $user_id == "M0193" || $user_id == "M0149") $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") $sql_cmd = "";
if (!empty($sql_cmd)) $where .= " and ".str_replace("where", "", $sql_cmd);
/*
$checkAll = ['p0044', 'M0007'];

2
wms/crm/crmm02-index.php

@ -42,7 +42,7 @@ $where .= " and salesman like '$salesman'";
$lm_name = empty($_GET['linkman']) ? "%" : $_GET['linkman'];
$where .= " and linkman like '$lm_name'";
$sql_cmd = sql_myself($user_id, "salesman");
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149") $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);
$sql = "SELECT vol_no,customer,manager,f_return_content('customer_source',source ) source,

17
wms/header.php

@ -38,18 +38,21 @@ if (isset($_REQUEST["function_name"])) {
/**
* 連線T8 MSSQL
*/
try {
$conn = new PDO("sqlsrv:Server=erp.masada.com.tw;Database=T8MASADA", "masada", "ztPmPP!HRoV6SL3E");
if ($conn) {
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if(false){
try {
$conn = new PDO("sqlsrv:Server=erp.masada.com.tw;Database=T8MASADA", "masada", "ztPmPP!HRoV6SL3E");
if ($conn) {
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
} catch (PDOException $e) {
//echo "fail";
//echo $e->getMessage();
}
} catch (PDOException $e) {
//echo "fail";
//echo $e->getMessage();
}
/*****************************
* global:
* $token

4
wms/mkt/pricereview-index.php

@ -12,7 +12,7 @@ $data = array();
$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";
// M0024許伃廷,M0107許紓晴權限全開
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0174" ) {
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0189" ) {
$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";
}
@ -443,7 +443,7 @@ if ($user_id=="M0023") {
<td>
<?php if(($data['status'] == 'YY' && $oneself) || $user_id == "M0174"): ?>
<a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">
<?php if($data['applystatus'] <=1){
<?php if($data['applystatus'] <1){
echo "申請";
}else{
echo "檢視";

2
wms/mkt/pricereview_renovate-index.php

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

2
wms/mkt/specsurvey-index.php

@ -5,7 +5,7 @@ include "../header.php";
$data = array();
// sql語法存在變數中
$sql_cmd = sql_myself($user_id, "s.creater");
if ($user_id == "M0060" || $user_id == "M0023") $sql_cmd = "";
if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = "";
$sql2 = (empty($sql_cmd)) ? "where" : "and";
$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)";

2
wms/mkt/specsurvey_renovate-index.php

@ -5,7 +5,7 @@ include "../header.php";
$data = array();
// sql語法存在變數中
$sql_cmd = sql_myself($user_id, "s.creater");
if ($user_id == "M0060" || $user_id == "M0023") $sql_cmd = "";
if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = "";
$sql2 = (empty($sql_cmd)) ? "where" : "and";
$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)";

6
wms/sign/list.php

@ -223,7 +223,7 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
@ -232,13 +232,13 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
$facilityno = $w_data['facilityno'];
$contractno = $w_data['contractno'];
?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
作番大日程-合約號:<?= $contractno ?> 作番號:<?= $facilityno ?>
</a>
<?php
} else {
?>
<a target="_blank" href="<?= $data['path'] . "?form_key=" . $data['form_key'] . "&token=$token" ?>">
<a target="_blank" href="<?= $data['path'] . "?fromsign=1&form_key=" . $data['form_key'] . "&token=$token" ?>">
<?= $data['form_key']; ?>
</a>
<?php

Loading…
Cancel
Save