Browse Source

Merge branch 'main' into gary

# Conflicts:
#	wms/T8_Authorization_from_bpm.php
#	wms/mkt/pricereview-record-update.php
gary
gary_chen\gary_chen 1 year ago
parent
commit
f545f8ac36
  1. 3245
      d d
  2. 72
      static/flow/cont/con01.json
  3. 132
      wms/T8_APItest.php
  4. 21
      wms/T8_Authorization.php
  5. 7
      wms/T8_Authorization_from_bpm.php
  6. 30
      wms/account-receivable-excel.php
  7. BIN
      wms/account-receivable-facility.xlsx
  8. 1142
      wms/account-receivable-index-ing.php
  9. 695
      wms/account-receivable-index.php
  10. 2218
      wms/account-receivable-renovate-index.php
  11. 334
      wms/account-receivable-test.php
  12. BIN
      wms/account-receivable-test.xlsx
  13. 27595
      wms/account_receivable_sql_file.sql
  14. BIN
      wms/assemble_warehouse.xlsx
  15. 2
      wms/cont/MSCalculator.php
  16. 21
      wms/cont/apply_form.php
  17. 370
      wms/cont/sign_list.php
  18. 13
      wms/contract-repair/api/bpmAPI.php
  19. 55
      wms/contract-repair/insertFacility.php
  20. 25
      wms/contract-repair/vendor/autoload.php
  21. 579
      wms/contract-repair/vendor/composer/ClassLoader.php
  22. 359
      wms/contract-repair/vendor/composer/InstalledVersions.php
  23. 21
      wms/contract-repair/vendor/composer/LICENSE
  24. 24
      wms/contract-repair/vendor/composer/autoload_classmap.php
  25. 10
      wms/contract-repair/vendor/composer/autoload_files.php
  26. 10
      wms/contract-repair/vendor/composer/autoload_namespaces.php
  27. 17
      wms/contract-repair/vendor/composer/autoload_psr4.php
  28. 50
      wms/contract-repair/vendor/composer/autoload_real.php
  29. 113
      wms/contract-repair/vendor/composer/autoload_static.php
  30. 673
      wms/contract-repair/vendor/composer/installed.json
  31. 113
      wms/contract-repair/vendor/composer/installed.php
  32. 30
      wms/contract-repair/vendor/composer/platform_check.php
  33. 9
      wms/contract-repair/vendor/ezyang/htmlpurifier/CREDITS
  34. 504
      wms/contract-repair/vendor/ezyang/htmlpurifier/LICENSE
  35. 29
      wms/contract-repair/vendor/ezyang/htmlpurifier/README.md
  36. 1
      wms/contract-repair/vendor/ezyang/htmlpurifier/VERSION
  37. 45
      wms/contract-repair/vendor/ezyang/htmlpurifier/composer.json
  38. 11
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php
  39. 14
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload-legacy.php
  40. 25
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php
  41. 4
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
  42. 25
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php
  43. 235
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
  44. 30
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php
  45. 11
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php
  46. 297
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
  47. 229
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
  48. 71
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php
  49. 148
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php
  50. 144
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php
  51. 136
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
  52. 34
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
  53. 113
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php
  54. 157
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
  55. 56
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php
  56. 161
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php
  57. 48
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php
  58. 44
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
  59. 77
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php
  60. 176
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php
  61. 217
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
  62. 32
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php
  63. 56
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
  64. 77
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php
  65. 112
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
  66. 71
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
  67. 90
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php
  68. 54
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php
  69. 46
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
  70. 77
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php
  71. 44
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php
  72. 73
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php
  73. 48
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
  74. 48
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php
  75. 51
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php
  76. 16
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php
  77. 38
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
  78. 113
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php
  79. 56
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php
  80. 72
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
  81. 60
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
  82. 70
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
  83. 76
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php
  84. 91
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php
  85. 86
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php
  86. 53
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php
  87. 21
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php
  88. 111
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php
  89. 20
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php
  90. 29
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
  91. 142
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
  92. 45
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php
  93. 89
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
  94. 60
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php
  95. 28
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php
  96. 27
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
  97. 28
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php
  98. 47
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php
  99. 26
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php
  100. 68
      wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php

3245
d d

File diff suppressed because it is too large

72
static/flow/cont/con01.json

@ -1 +1,71 @@
{"flowName":"保养合约价格审核","systemId":"con","flowId":"con01","version":"","selectedNode":"start_node_1684033305000","saveUrl":"https://www.masada.com.tw/fds/index.php/DesignFlow/acceptJsonToSave/","publishUrl":"","drawID":"draw","flowList":{"start_node_1684033305000":{"nodeName":"申请","nodeId":"start_node_1684033305000","creator":"P0044","desc":"申请单位签核","nodeType":"start_node","targetId":["end_node_1684033370000"],"sourceId":[],"targetAnchor":[],"connector":[],"blockTop":"218.8625030517578px","blockLeft":"718.6625366210938px","endPoints":["RightMiddle"],"flowCode":"A","assignClass":"X","assignClassMethod":"function test($flow_context, $form)\n{\n\n $discount = empty($form['discount']) ? '' : $form['discount'];\n\n if ($discount >= '90') return 'C';\n if ($discount >= 80 and $discount < 90) return 'C';\n if ($discount >= 60 and $discount < 80) return 'D';\n if ($discount < 60) return 'F';\n return 'C';\n}","assigner":"","htmlDiv":"<div class=\"node drag_node ui-draggable\" id=\"start_node\">\n <img src=\"images/start_node.png\" alt=\"\">\n <p>开始</p>\n </div>","allowAssign":"true","allowPassTo":"true","backOption":"B1"},"end_node_1684033370000":{"nodeName":"结案节点","nodeId":"end_node_1684033370000","creator":" ","desc":"结案节点","nodeType":"end_node","targetId":[],"sourceId":["start_node_1684033305000"],"targetAnchor":[],"connector":[],"blockTop":"409.26251220703125px","blockLeft":"903.6625366210938px","endPoints":["TopCenter"],"flowCode":"Z","assignClass":"A","assigner":"F4-结案:|","htmlDiv":"<div class=\"node drag_node ui-draggable\" id=\"end_node\">\n <img src=\"images/end_node.png\" alt=\"\">\n <p>结案</p>\n </div>"}},"flowConnector":[{"ConnectionId":"con_5","PageSourceId":"start_node_1684033305000","PageTargetId":"end_node_1684033370000","SourceText":"","TargetText":"","SourceAnchor":"RightMiddle","TargetAnchor":"TopCenter"}]}
{
"flowName": "保养合约价格审核",
"systemId": "con",
"flowId": "con01",
"version": "",
"selectedNode": "start_node_1684033305000",
"saveUrl": "https://www.masada.com.tw/fds/index.php/DesignFlow/acceptJsonToSave/",
"publishUrl": "",
"drawID": "draw",
"flowList": {
"start_node_1684033305000": {
"nodeName": "申请",
"nodeId": "start_node_1684033305000",
"creator": "P0044",
"desc": "申请单位签核",
"nodeType": "start_node",
"targetId": [
"end_node_1684033370000"
],
"sourceId": [],
"targetAnchor": [],
"connector": [],
"blockTop": "218.8625030517578px",
"blockLeft": "718.6625366210938px",
"endPoints": [
"RightMiddle"
],
"flowCode": "A",
"assignClass": "X",
"assignClassMethod": "function test($flow_context, $form)\n{\n\n $discount = empty($form['discount']) ? '' : $form['discount'];\n\n if ($discount >= '90') return 'C';\n if ($discount >= 80 and $discount < 90) return 'C';\n if ($discount >= 60 and $discount < 80) return 'D';\n if ($discount < 60) return 'F';\n return 'C';\n}",
"assigner": "",
"htmlDiv": "<div class=\"node drag_node ui-draggable\" id=\"start_node\">\n <img src=\"images/start_node.png\" alt=\"\">\n <p>开始</p>\n </div>",
"allowAssign": "true",
"allowPassTo": "true",
"backOption": "B1"
},
"end_node_1684033370000": {
"nodeName": "结案节点",
"nodeId": "end_node_1684033370000",
"creator": " ",
"desc": "结案节点",
"nodeType": "end_node",
"targetId": [],
"sourceId": [
"start_node_1684033305000"
],
"targetAnchor": [],
"connector": [],
"blockTop": "409.26251220703125px",
"blockLeft": "903.6625366210938px",
"endPoints": [
"TopCenter"
],
"flowCode": "Z",
"assignClass": "A",
"assigner": "F4-结案:|",
"htmlDiv": "<div class=\"node drag_node ui-draggable\" id=\"end_node\">\n <img src=\"images/end_node.png\" alt=\"\">\n <p>结案</p>\n </div>"
}
},
"flowConnector": [
{
"ConnectionId": "con_5",
"PageSourceId": "start_node_1684033305000",
"PageTargetId": "end_node_1684033370000",
"SourceText": "",
"TargetText": "",
"SourceAnchor": "RightMiddle",
"TargetAnchor": "TopCenter"
}
]
}

132
wms/T8_APItest.php

@ -1,72 +1,74 @@
<?php
include "T8_Authorization.php";
echo "ii";
echo "收入申請單";
?>
<script>
get_Auth();
window.addEventListener('message', function(event) {
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
// if (event.origin === "https://masada.com.tw" && (typeof event.data === "string")) {
var validation = event.data;
console.log("event");
console.log(validation);
let validation = get_Auth();
// window.addEventListener('message', function(event) {
// console.log('123')
// if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
// if (event.origin === "https://masada.com.tw" && (typeof event.data === "string")) {
console.log(validation)
// var validation = event.data;
// console.log("event");
// console.log(validation);
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
headerParam = {
CHI_Authorization: `${validation}`,
};
var body = [{
"name": "salIncomeApplyMaster",
"rows": [{
"BillNo": "B23100061",
"BillDate": 20231220,
"OrgId": "1000",
"FOrgId": "1000",
"TypeId": "RAS",
"BpOrgId": "1000",
"BizPartnerId": "B23100061",
"CurrId": "TWD",
"CurrOAmount": 1,
"CurrLAmount": 1,
"PersonId": "M0065",
"DtOrgId": "1000",
"DueToId": "B23100061",
"TaxId": "ST005",
"CompId": "1001"
}]
},
{
"name": "salIncomeApplyDetail",
"rows": [{
"BillNo": "B23100061",
"IncomeId": "A40004",
"TaxId": "ST005",
"RowCode": 1,
"ItemType": "1",
"SPrice": 10000,
"SQuantity": 0,
"FromSourceTag": 0,
"FromBillNo": ""
}]
}
];
var json = JSON.stringify(body);
obj = {
type: 'POST',
// url: `${corsurl}${apiurl}`,
url: `${apiurl}`,
dataType: 'json',
headers: headerParam,
data: json,
// dataType: "json",
success: function(res) {
console.log(res.Status);
console.log(res.ErrorMsg);
console.log(res.Data);
}
};
jQuery.ajax(obj);
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
headerParam = {
CHI_Authorization: `${validation}`,
};
var body = [{
"name": "salIncomeApplyMaster",
"rows": [{
"BillNo": "B23100061",
"BillDate": 20231220,
"OrgId": "1000",
"FOrgId": "1000",
"TypeId": "RAS",
"BpOrgId": "1000",
"BizPartnerId": "B23100061",
"CurrId": "TWD",
"CurrOAmount": 1,
"CurrLAmount": 1,
"PersonId": "M0065",
"DtOrgId": "1000",
"DueToId": "B23100061",
"TaxId": "ST005",
"CompId": "1001"
}]
},
{
"name": "salIncomeApplyDetail",
"rows": [{
"BillNo": "B23100061",
"IncomeId": "A40003",
"TaxId": "ST005",
"RowCode": 12,
"ItemType": "1",
"SPrice": 10000,
"SQuantity": 1,
"FromSourceTag": 0,
"FromBillNo": ""
}]
}
})
];
var json = JSON.stringify(body);
obj = {
type: 'POST',
// url: `${corsurl}${apiurl}`,
url: `${apiurl}`,
dataType: 'json',
headers: headerParam,
data: json,
// dataType: "json",
success: function(res) {
console.log(res.Status);
console.log(res.ErrorMsg);
console.log(res.Data);
}
};
jQuery.ajax(obj);
// }
// })
</script>

21
wms/T8_Authorization.php

@ -1,21 +1,23 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<?php
$now = gmdate("YmdHis");
$data = 'admin.' . $now;
$currentTime = time();
$twoMinutesLater = $currentTime - (2 * 60);
$now = gmdate("YmdHis", $twoMinutesLater);
$data = 'M0000.' . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
?>
<script>
function get_Auth() {
var api_key = 'B2D6395D2883E26C';
var api_key = '964C834F7BF2BB70';
var validation = "";
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
// var apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth'
headerParam = {
UserId: 'admin',
Pwd: 'chi',
UserId: 'M0000',
Pwd: 'M012290493119',
TimestampUTC: <?= $now ?>,
Sign: '<?= $sign ?>'
};
@ -27,12 +29,15 @@ $sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
headers: headerParam,
success: function(res) {
validation = res.Data['CHI_Authorization'];
console.log("validation:", validation);
window.parent.postMessage(validation, 'http://localhost:3000');
console.log(validation);
// console.log(res);
// console.log()
// window.parent.postMessage(validation,'http://localhost:3000');
// window.parent.postMessage(validation,'https://masada.com.tw');
return validation;
}
};
jQuery.ajax(obj);
// return jQuery.ajax(obj);
}
</script>

7
wms/T8_Authorization_from_bpm.php

@ -10,6 +10,8 @@ echo $validation = get_Auth($user_id, $user_password);
function get_Auth($user_id = "M0000", $user_password = "M012290493119")
{
$currentTime = time();
$twoMinutesLater = $currentTime - (2 * 60);
// $now = gmdate("YmdHis");
$now = gmdate("YmdHis", strtotime("-2 minutes"));
@ -35,8 +37,9 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerParam);
$response = curl_exec($ch);
echo $response;
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
echo '123Curl error: ' . curl_error($ch);
} else {
$result = json_decode($response, true);
if ($result['Status'] == 'Success')
@ -47,3 +50,5 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
curl_close($ch);
}
// $data = [];
// get_Auth();

30
wms/account-receivable-excel.php

@ -15,15 +15,15 @@ $sheet = $spreadsheet->getActiveSheet();
// file_put_contents('account-receivable.txt', json_encode($Bill));
if ($type == 'facility') {
$colomnHeader = [
'作番號', '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金名稱', '訂金合約金額', '訂金應收日期', '訂金目前應收金額', '訂金已收金額', '訂金催收金額', '訂金催收次數',
'二次款名稱', '二次款合約金額', '二次款應收日期', '二次款目前應收金額', '二次款已收金額', '二次款催收金額', '二次款催收次數',
'貨抵工地款名稱', '貨抵工地款合約金額', '貨抵工地款應收日期', '貨抵工地款目前應收金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款名稱', '安裝款合約金額', '安裝款應收日期', '安裝款目前應收金額', '安裝款已收金額', '安裝款催收金額', '安裝款催收次數',
'試車款名稱', '試車款合約金額', '試車款應收日期', '試車款目前應收金額', '試車款已收金額', '試車款催收金額', '試車款催收次數',
'官檢款名稱', '官檢款合約金額', '官檢款應收日期', '官檢款目前應收金額', '官檢款已收金額', '官檢款催收金額', '官檢款催收次數',
'交車款名稱', '交車款合約金額', '交車款應收日期', '交車款目前應收金額', '交車款已收金額', '交車款催收金額', '交車款催收次數',
'尾款名稱', '尾款金額', '尾款應收日期', '尾款應收金額', '尾款已收金額', '尾款催收金額', '尾款催收次數',
'T8單據日期','作番號', '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金名稱', '訂金合約金額', '訂金應收日期', '訂金目前應收金額','訂金已開金額','訂金未開金額', '訂金已收金額', '訂金催收金額', '訂金催收次數',
'二次款名稱', '二次款合約金額', '二次款應收日期', '二次款目前應收金額','二次款已開金額','二次款未開金額', '二次款已收金額', '二次款催收金額', '二次款催收次數',
'貨抵工地款名稱', '貨抵工地款合約金額', '貨抵工地款應收日期', '貨抵工地款目前應收金額','貨抵工地款已開金額','貨抵工地款未開金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款名稱', '安裝款合約金額', '安裝款應收日期', '安裝款目前應收金額','安裝款已開金額','安裝款未開金額', '安裝款已收金額', '安裝款催收金額', '安裝款催收次數',
'試車款名稱', '試車款合約金額', '試車款應收日期', '試車款目前應收金額','試車款已開金額','試車款未開金額', '試車款已收金額', '試車款催收金額', '試車款催收次數',
'官檢款名稱', '官檢款合約金額', '官檢款應收日期', '官檢款目前應收金額','官檢款已開金額','官檢款未開金額', '官檢款已收金額', '官檢款催收金額', '官檢款催收次數',
'交車款名稱', '交車款合約金額', '交車款應收日期', '交車款目前應收金額','交車款已開金額','交車款未開金額', '交車款已收金額', '交車款催收金額', '交車款催收次數',
'尾款名稱', '尾款金額', '尾款應收日期', '尾款應收金額','尾款已開金額','尾款未開金額', '尾款已收金額', '尾款催收金額', '尾款催收次數',
'作番狀態', '合約-設備金額','合約-安裝金額','作番合約總金額', '作番總應收金額'
];
$sheet->fromArray($colomnHeader, NULL, 'A1');
@ -34,7 +34,7 @@ if ($type == 'facility') {
$column = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ',
'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP','BQ','BR'
'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP','BQ','BR','BK'
];
foreach ($column as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
@ -47,7 +47,7 @@ if ($type == 'facility') {
$writer->save($excelFileName);
} else {
$colomnHeader = [
'合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'T8單據日期','合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金', '訂金目前應收', '訂金已開票金額','訂金未開票金額', '訂金已收金額', '訂金催收金額', '訂金最大催收次數', '訂金最小催收次數',
'二次款', '二次款目前應收', '二次款已開票金額','二次款未開票金額', '二次款已收金額', '二次款催收金額', '二次款最大催收次數', '二次款最小催收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地款已開票金額','貨抵工地款未開票金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款最大催收次數', '貨抵工地款最小催收次數',
@ -67,12 +67,12 @@ if ($type == 'facility') {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ',
'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP', 'BQ', 'BR', 'BS', 'BT', 'BU', 'BV', 'BW', 'BX', 'BY', 'BZ',
'CA','CB','CC'
'CA','CB','CC','CD'
];
foreach ($column as $col) {
if ($col == 'CB') {
$sheet->getColumnDimension('CB')->setWidth(40);
$sheet->getStyle('CB')->getAlignment()->setWrapText(true);
if ($col == 'CC') {
$sheet->getColumnDimension('CC')->setWidth(40);
$sheet->getStyle('CC')->getAlignment()->setWrapText(true);
} else {
$sheet->getColumnDimension($col)->setAutoSize(true);
}

BIN
wms/account-receivable-facility.xlsx

Binary file not shown.

1142
wms/account-receivable-index-ing.php

File diff suppressed because it is too large

695
wms/account-receivable-index.php

@ -1,4 +1,7 @@
<?php
use Illuminate\Support\Arr;
include "header.php";
$sum_facility = 0;
@ -42,7 +45,7 @@ ON a.BillNo=c.BillNo
WHERE DATALENGTH(c.OrderBillNo) >0";
//T8 銷售訂單 階段收款計畫
$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId,
$sql_contract = "SELECT a.BillNo,s.BillDate, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId,
c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo
LEFT JOIN comBusinessPartner AS c ON s.BizPartnerId=c.BizPartnerId
@ -95,9 +98,11 @@ ON d.department_id = tmp2.department_id ";
// 期初收款資訊
$sql_opening = "
SELECT * FROM account_received ";
// 設定權限:看到自己的/下屬的,資訊處跟財會處可以看全部的
if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) {
if ((in_array($user_id, array('M0060', 'M0175'))) || (in_array(accountidToDepartId($user_id), array('220', '210')))) {
$sql .= " ORDER BY contractno";
$sql_contract_budget .= "ORDER BY BillNo, CU_MaterialId";
} else {
$sql_contract .= "AND (s.PersonId = '$user_id'";
// $sql_received .= " AND (PersonId = '$user_id'";
$sql_opening .= " OR person_id = '$user_id'";
@ -111,7 +116,7 @@ if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) {
// $sql_received .= " OR PersonId IN $column_str)";
$sql_opening .= " OR person_id IN $column_str)";
$sql .= " OR salesid IN $column_str ORDER BY contractno";
$sql_contract_budget .= " OR PersonId IN $column_str ORDER BY BillNo, CU_MaterialId)";
$sql_contract_budget .= " OR PersonId IN $column_str )ORDER BY BillNo, CU_MaterialId";
} else {
$sql_contract .= ")";
// $sql_received .= ")";
@ -119,9 +124,6 @@ if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) {
$sql .= " ORDER BY contractno";
$sql_contract_budget .= ")";
};
} else {
$sql .= " ORDER BY contractno";
$sql_contract_budget .= "ORDER BY BillNo, CU_MaterialId";
}
$contract = $conn->query($sql_contract);
@ -141,6 +143,8 @@ foreach ($contract_budget_data as $cont) {
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] += $cont['OAmountWithTax'];
} else {
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] = $cont['OAmountWithTax'];
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['A40001'] = 0;
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['A40008'] = 0;
};
if (isset($contract_budget[$cont['BillNo']][$cont['MaterialId']])) {
$contract_budget[$cont['BillNo']][$cont['MaterialId']] += $cont['OAmountWithTax'];
@ -184,6 +188,7 @@ foreach ($contract as $cont) {
} else {
$BillNo = $cont['BillNo'];
};
$BillDate = $cont['BillDate'];
$PayStage = $cont['PayStage'];
$PlanPayDate = $cont['PlanPayDate'];
$PayAmount = $cont['PlanPayAmt'];
@ -195,12 +200,13 @@ foreach ($contract as $cont) {
//['tryrun'] 0 試車款名 1試車金額 2 試車收款日期 ['check'] 0 官檢款名 1 官檢金額 2 官檢收款日期 ['delivery'] 0 交車款名 1 交車金額 2 交車收款日期 ['final'] 0 尾款名 1 尾款金額 2 尾款收款日期
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
if (!(isset($arrayData[$BillNo]))) {
// 0 部門id 1 部門名稱 2 經理名稱 3 營業員id 4 營業員名稱 5 客戶名稱 6 抬頭 7 統編 8 通訊地址
// 0 部門id 1 部門名稱 2 經理名稱 3 營業員id 4 營業員名稱 5 客戶名稱 6 抬頭 7 統編 8 通訊地址 9 T8單據日期
$arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
$arrayData[$BillNo][5] = $partnerName;
$arrayData[$BillNo][6] = $EnterpriseName;
$arrayData[$BillNo][7] = $TaxNo;
$arrayData[$BillNo][8] = $ContactAddress;
$arrayData[$BillNo][9] = $BillDate;
$arrayData[$BillNo]['total_budget'] = 0;
$arrayData[$BillNo]['invoice'] = array();
$arrayData[$BillNo]['received_budget'] = 0;
@ -212,7 +218,7 @@ foreach ($contract as $cont) {
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['sign_num'] = $arrayData[$BillNo]['receivable_budget'] = 0;
$arrayData[$BillNo]['total_list'] = $arrayData[$BillNo]['sign_list'] = $arrayData[$BillNo]['second_list'] = $arrayData[$BillNo]['arrive_list'] = $arrayData[$BillNo]['install_list'] = $arrayData[$BillNo]['tryrun_list'] = $arrayData[$BillNo]['check_list'] = $arrayData[$BillNo]['delivery_list'] = $arrayData[$BillNo]['final_list'] = [];
}
if (stristr($PayStage, '二次款') || (stristr($PayStage, '出貨前') && $PayStage != "寶佳出貨前30天") || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) {
if (stristr($PayStage, '二次款') || (stristr($PayStage, '出貨前') && $PayStage != "寶佳出貨前30天") || stristr($PayStage, '簽約後') || stristr($PayStage, '訂金支付後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) {
$arrayData[$BillNo]['second'][0] = $PayStage;
$arrayData[$BillNo]['second'][1] = $PayAmount;
$arrayData[$BillNo]['second'][2] = $PlanPayDate;
@ -300,8 +306,8 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']][4] = $wip['name'];
$arrayData[$wip['contractno']][10] = $wip['contractno'];
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['A40001'] = $contract_budget[$wip['contractno']]['A40001'];
$arrayData[$wip['contractno']]['A40008'] = $contract_budget[$wip['contractno']]['A40008'];
$arrayData[$wip['contractno']]['A40001'] = (isset($contract_budget[$wip['contractno']]['A40001']) && !is_null($contract_budget[$wip['contractno']]['A40001'])) ? $contract_budget[$wip['contractno']]['A40001'] : 0;
$arrayData[$wip['contractno']]['A40008'] = (isset($contract_budget[$wip['contractno']]['A40008']) && !is_null($contract_budget[$wip['contractno']]['A40008'])) ? $contract_budget[$wip['contractno']]['A40008'] : 0;
// [合約號]['facility'][作番號]['no']
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno'];
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = "";
@ -896,19 +902,21 @@ foreach ($arrayData as &$value) {
}
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
// 計算每台作番金額與各階段應收金額
foreach ($value['facility'] as &$val) {
foreach ($contractstage as $stage) {
if (isset($value[$stage][0]) && !empty($value[$stage][0])) {
$val[$stage][0] = $value[$stage][0];
if (isset($contract_budget[$value[10]]['total']) && isset($contract_budget[$value[10]][$val['no']]['total'])) {
$ratio = $contract_budget[$value[10]][$val['no']]['total'] / $contract_budget[$value[10]]['total'];
} else {
$ratio = 0;
if (isset($value['facility'])) {
foreach ($value['facility'] as &$val) {
foreach ($contractstage as $stage) {
if (isset($value[$stage][0]) && !empty($value[$stage][0])) {
$val[$stage][0] = $value[$stage][0];
if (isset($contract_budget[$value[10]]['total']) && isset($contract_budget[$value[10]][$val['no']]['total'])) {
$ratio = $contract_budget[$value[10]][$val['no']]['total'] / $contract_budget[$value[10]]['total'];
} else {
$ratio = 0;
}
$val[$stage][1] = $value[$stage][1] * $ratio;
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1];
$val['total_budget'] += $val[$stage][1];
$val['receivable_budget'] += $val[$stage][3];
}
$val[$stage][1] = $value[$stage][1] * $ratio;
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1];
$val['total_budget'] += $val[$stage][1];
$val['receivable_budget'] += $val[$stage][3];
}
}
}
@ -986,22 +994,90 @@ foreach ($received_array as $received) {
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 4 已收金額 5 催收金額 6 已開發票金額 7 未開發票金額 min 最早應收月份 max 最晚應收月份
foreach ($arrayData as $key => &$data) {
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
//作番
$facilities = array();
if (isset($data['facility'])) {
foreach ($data['facility'] as $fakey => $val) {
array_push($facilities, $fakey);
}
}
$tmp_data = $data['received_budget'];
$tmp_invoice = $data['invoice_budget'];
if ($data['sign'][3] > 0) {
//------------------------------------------------------------------------------------------------------------------------------------
if (isset($data['sign'][3]) && $data['sign'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['sign'][3]) >= 0) {
$data['sign'][4] = $data['sign'][3];
$tmp_data -= $data['sign'][3];
$tmp_facility_received = $data['sign'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['sign'][3]) && $data['facility'][$this_facility]['sign'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['sign'][3]) {
$data['facility'][$this_facility]['sign'][4] = $data['facility'][$this_facility]['sign'][3];
$data['facility'][$this_facility]['sign'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['sign'][3];
}else{
$data['facility'][$this_facility]['sign'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['sign'][5] =$data['facility'][$this_facility]['sign'][3] -$data['facility'][$this_facility]['sign'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['sign'][4] = 0;
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3];
}
}else{
$data['facility'][$this_facility]['sign'][4] = 0;
$data['facility'][$this_facility]['sign'][5] = 0;
}
if($data['facility'][$this_facility]['sign'][5] == 0){
$data['facility'][$this_facility]['sign'][6] =0;
}
}
} else {
$data['sign'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['sign'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['sign'][3]) && $data['facility'][$this_facility]['sign'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['sign'][3]) {
$data['facility'][$this_facility]['sign'][4] = $data['facility'][$this_facility]['sign'][3];
$data['facility'][$this_facility]['sign'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['sign'][3];
}else{
$data['facility'][$this_facility]['sign'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['sign'][5] =$data['facility'][$this_facility]['sign'][3] -$data['facility'][$this_facility]['sign'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['sign'][4] = 0;
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3];
}
}else{
$data['facility'][$this_facility]['sign'][4] = 0;
$data['facility'][$this_facility]['sign'][5] = 0;
}
if($data['facility'][$this_facility]['sign'][5] == 0){
$data['facility'][$this_facility]['sign'][6] =0;
}
}
}
$data['sign'][5] = $data['sign'][3] - $data['sign'][4];
} else {
$data['sign'][4] = 0;
$data['sign'][5] = $data['sign'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['sign'][4] = 0;
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3];
if($data['facility'][$this_facility]['sign'][5] == 0){
$data['facility'][$this_facility]['sign'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['sign'][3]) >= 0) {
@ -1022,19 +1098,81 @@ foreach ($arrayData as $key => &$data) {
$data['sign'][6] = 0;
$data['sign'][7] = 0;
}
if ($data['second'][3] > 0) {
if (isset($data['second'][3]) && $data['second'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['second'][3]) >= 0) {
$data['second'][4] = $data['second'][3];
$tmp_data -= $data['second'][3];
$tmp_facility_received = $data['second'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['second'][3]) && $data['facility'][$this_facility]['second'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['second'][3]) {
$data['facility'][$this_facility]['second'][4] = $data['facility'][$this_facility]['second'][3];
$data['facility'][$this_facility]['second'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['second'][3];
}else{
$data['facility'][$this_facility]['second'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['second'][5] =$data['facility'][$this_facility]['second'][3] -$data['facility'][$this_facility]['second'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['second'][4] = 0;
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3];
}
}else{
$data['facility'][$this_facility]['second'][4] = 0;
$data['facility'][$this_facility]['second'][5] = 0;
$data['facility'][$this_facility]['second'][6] = 0;
}
if($data['facility'][$this_facility]['second'][5] == 0){
$data['facility'][$this_facility]['second'][6] =0;
}
}
} else {
$data['second'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['second'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['second'][3]) && $data['facility'][$this_facility]['second'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['second'][3]) {
$data['facility'][$this_facility]['second'][4] = $data['facility'][$this_facility]['second'][3];
$data['facility'][$this_facility]['second'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['second'][3];
}else{
$data['facility'][$this_facility]['second'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['second'][5] =$data['facility'][$this_facility]['second'][3] -$data['facility'][$this_facility]['second'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['second'][4] = 0;
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3];
}
}else{
$data['facility'][$this_facility]['second'][4] = 0;
$data['facility'][$this_facility]['second'][5] = 0;
$data['facility'][$this_facility]['second'][6] = 0;
}
if($data['facility'][$this_facility]['second'][5] == 0){
$data['facility'][$this_facility]['second'][6] =0;
}
}
}
$data['second'][5] = $data['second'][3] - $data['second'][4];
} else {
$data['second'][4] = 0;
$data['second'][5] = $data['second'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['second'][4] = 0;
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3];
if($data['facility'][$this_facility]['second'][5] == 0){
$data['facility'][$this_facility]['second'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['second'][3]) >= 0) {
@ -1056,20 +1194,81 @@ foreach ($arrayData as $key => &$data) {
$data['second'][7] = 0;
}
if ($data['arrive'][3] > 0) {
if (isset($data['arrive'][3]) && $data['arrive'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['arrive'][1]) >= 0) {
$data['arrive'][4] = $data['arrive'][3];
$tmp_data -= $data['arrive'][3];
$tmp_facility_received = $data['arrive'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['arrive'][3]) && $data['facility'][$this_facility]['arrive'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['arrive'][3]) {
$data['facility'][$this_facility]['arrive'][4] = $data['facility'][$this_facility]['arrive'][3];
$data['facility'][$this_facility]['arrive'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['arrive'][3];
}else{
$data['facility'][$this_facility]['arrive'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['arrive'][5] =$data['facility'][$this_facility]['arrive'][3] -$data['facility'][$this_facility]['arrive'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['arrive'][4] = 0;
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3];
}
}else{
$data['facility'][$this_facility]['arrive'][4] = 0;
$data['facility'][$this_facility]['arrive'][5] = 0;
$data['facility'][$this_facility]['arrive'][6] = 0;
}
if($data['facility'][$this_facility]['arrive'][5] == 0){
$data['facility'][$this_facility]['arrive'][6] =0;
}
}
} else {
$data['arrive'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['arrive'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['arrive'][3]) && $data['facility'][$this_facility]['arrive'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['arrive'][3]) {
$data['facility'][$this_facility]['arrive'][4] = $data['facility'][$this_facility]['arrive'][3];
$data['facility'][$this_facility]['arrive'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['arrive'][3];
}else{
$data['facility'][$this_facility]['arrive'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['arrive'][5] =$data['facility'][$this_facility]['arrive'][3] -$data['facility'][$this_facility]['arrive'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['arrive'][4] = 0;
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3];
}
}else{
$data['facility'][$this_facility]['arrive'][4] = 0;
$data['facility'][$this_facility]['arrive'][5] = 0;
$data['facility'][$this_facility]['arrive'][6] = 0;
}
if($data['facility'][$this_facility]['arrive'][5] == 0){
$data['facility'][$this_facility]['arrive'][6] =0;
}
}
}
$data['arrive'][5] = $data['arrive'][3] - $data['arrive'][4];
} else {
$data['arrive'][4] = 0;
$data['arrive'][5] = $data['arrive'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['arrive'][4] = 0;
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3];
if($data['facility'][$this_facility]['arrive'][5] == 0){
$data['facility'][$this_facility]['arrive'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['arrive'][3]) >= 0) {
@ -1091,20 +1290,81 @@ foreach ($arrayData as $key => &$data) {
$data['arrive'][7] = 0;
}
if ($data['install'][3] > 0) {
if (isset($data['install'][3]) && $data['install'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['install'][1]) >= 0) {
$data['install'][4] = $data['install'][3];
$tmp_data -= $data['install'][3];
$tmp_facility_received = $data['install'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['install'][3]) && $data['facility'][$this_facility]['install'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['install'][3]) {
$data['facility'][$this_facility]['install'][4] = $data['facility'][$this_facility]['install'][3];
$data['facility'][$this_facility]['install'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['install'][3];
}else{
$data['facility'][$this_facility]['install'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['install'][5] =$data['facility'][$this_facility]['install'][3] -$data['facility'][$this_facility]['install'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['install'][4] = 0;
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3];
}
}else{
$data['facility'][$this_facility]['install'][4] = 0;
$data['facility'][$this_facility]['install'][5] = 0;
$data['facility'][$this_facility]['install'][6] = 0;
}
if($data['facility'][$this_facility]['install'][5] == 0){
$data['facility'][$this_facility]['install'][6] =0;
}
}
} else {
$data['install'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['install'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['install'][3]) && $data['facility'][$this_facility]['install'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['install'][3]) {
$data['facility'][$this_facility]['install'][4] = $data['facility'][$this_facility]['install'][3];
$data['facility'][$this_facility]['install'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['install'][3];
}else{
$data['facility'][$this_facility]['install'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['install'][5] =$data['facility'][$this_facility]['install'][3] -$data['facility'][$this_facility]['install'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['install'][4] = 0;
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3];
}
}else{
$data['facility'][$this_facility]['install'][4] = 0;
$data['facility'][$this_facility]['install'][5] = 0;
$data['facility'][$this_facility]['install'][6] = 0;
}
if($data['facility'][$this_facility]['install'][5] == 0){
$data['facility'][$this_facility]['install'][6] =0;
}
}
}
$data['install'][5] = $data['install'][3] - $data['install'][4];
} else {
$data['install'][4] = 0;
$data['install'][5] = $data['install'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['install'][4] = 0;
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3];
if($data['facility'][$this_facility]['install'][5] == 0){
$data['facility'][$this_facility]['install'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['install'][3]) >= 0) {
@ -1127,19 +1387,80 @@ foreach ($arrayData as $key => &$data) {
}
if ($data['tryrun'][3] > 0) {
if (isset($data['tryrun'][3]) && $data['tryrun'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['tryrun'][1]) >= 0) {
$data['tryrun'][4] = $data['tryrun'][3];
$tmp_data -= $data['tryrun'][3];
$tmp_facility_received = $data['tryrun'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['tryrun'][3]) && $data['facility'][$this_facility]['tryrun'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['tryrun'][3]) {
$data['facility'][$this_facility]['tryrun'][4] = $data['facility'][$this_facility]['tryrun'][3];
$data['facility'][$this_facility]['tryrun'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['tryrun'][3];
}else{
$data['facility'][$this_facility]['tryrun'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['tryrun'][5] =$data['facility'][$this_facility]['tryrun'][3] -$data['facility'][$this_facility]['tryrun'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['tryrun'][4] = 0;
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3];
}
}else{
$data['facility'][$this_facility]['tryrun'][4] = 0;
$data['facility'][$this_facility]['tryrun'][5] = 0;
$data['facility'][$this_facility]['tryrun'][6] = 0;
}
if($data['facility'][$this_facility]['tryrun'][5] == 0){
$data['facility'][$this_facility]['tryrun'][6] =0;
}
}
} else {
$data['tryrun'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['tryrun'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['tryrun'][3]) && $data['facility'][$this_facility]['tryrun'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['tryrun'][3]) {
$data['facility'][$this_facility]['tryrun'][4] = $data['facility'][$this_facility]['tryrun'][3];
$data['facility'][$this_facility]['tryrun'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['tryrun'][3];
}else{
$data['facility'][$this_facility]['tryrun'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['tryrun'][5] =$data['facility'][$this_facility]['tryrun'][3] -$data['facility'][$this_facility]['tryrun'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['tryrun'][4] = 0;
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3];
}
}else{
$data['facility'][$this_facility]['tryrun'][4] = 0;
$data['facility'][$this_facility]['tryrun'][5] = 0;
$data['facility'][$this_facility]['tryrun'][6] = 0;
}
if($data['facility'][$this_facility]['tryrun'][5] == 0){
$data['facility'][$this_facility]['tryrun'][6] =0;
}
}
}
$data['tryrun'][5] = $data['tryrun'][3] - $data['tryrun'][4];
} else {
$data['tryrun'][4] = 0;
$data['tryrun'][5] = $data['tryrun'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['tryrun'][4] = 0;
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3];
if($data['facility'][$this_facility]['tryrun'][5] == 0){
$data['facility'][$this_facility]['tryrun'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['tryrun'][3]) >= 0) {
@ -1161,19 +1482,80 @@ foreach ($arrayData as $key => &$data) {
$data['tryrun'][7] = 0;
}
if ($data['check'][3] > 0) {
if (isset($data['check'][3]) && $data['check'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['check'][1]) >= 0) {
$data['check'][4] = $data['check'][3];
$tmp_data -= $data['check'][3];
$tmp_facility_received = $data['check'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['check'][3]) && $data['facility'][$this_facility]['check'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['check'][3]) {
$data['facility'][$this_facility]['check'][4] = $data['facility'][$this_facility]['check'][3];
$data['facility'][$this_facility]['check'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['check'][3];
}else{
$data['facility'][$this_facility]['check'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['check'][5] =$data['facility'][$this_facility]['check'][3] -$data['facility'][$this_facility]['check'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['check'][4] = 0;
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3];
}
}else{
$data['facility'][$this_facility]['check'][4] = 0;
$data['facility'][$this_facility]['check'][5] = 0;
$data['facility'][$this_facility]['check'][6] = 0;
}
if($data['facility'][$this_facility]['check'][5] == 0){
$data['facility'][$this_facility]['check'][6] =0;
}
}
} else {
$data['check'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['check'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['check'][3]) && $data['facility'][$this_facility]['check'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['check'][3]) {
$data['facility'][$this_facility]['check'][4] = $data['facility'][$this_facility]['check'][3];
$data['facility'][$this_facility]['check'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['check'][3];
}else{
$data['facility'][$this_facility]['check'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['check'][5] =$data['facility'][$this_facility]['check'][3] -$data['facility'][$this_facility]['check'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['check'][4] = 0;
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3];
}
}else{
$data['facility'][$this_facility]['check'][4] = 0;
$data['facility'][$this_facility]['check'][5] = 0;
$data['facility'][$this_facility]['check'][6] = 0;
}
if($data['facility'][$this_facility]['check'][5] == 0){
$data['facility'][$this_facility]['check'][6] =0;
}
}
}
$data['check'][5] = $data['check'][3] - $data['check'][4];
} else {
$data['check'][4] = 0;
$data['check'][5] = $data['check'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['check'][4] = 0;
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3];
if($data['facility'][$this_facility]['check'][5] == 0){
$data['facility'][$this_facility]['check'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['check'][3]) >= 0) {
@ -1194,19 +1576,80 @@ foreach ($arrayData as $key => &$data) {
$data['check'][6] = 0;
$data['check'][7] = 0;
}
if ($data['delivery'][3] > 0) {
if (isset($data['delivery'][3]) && $data['delivery'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['delivery'][1]) >= 0) {
$data['delivery'][4] = $data['delivery'][3];
$tmp_data -= $data['delivery'][3];
$tmp_facility_received = $data['delivery'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['delivery'][3]) && $data['facility'][$this_facility]['delivery'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['delivery'][3]) {
$data['facility'][$this_facility]['delivery'][4] = $data['facility'][$this_facility]['delivery'][3];
$data['facility'][$this_facility]['delivery'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['delivery'][3];
}else{
$data['facility'][$this_facility]['delivery'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['delivery'][5] =$data['facility'][$this_facility]['delivery'][3] -$data['facility'][$this_facility]['delivery'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['delivery'][4] = 0;
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3];
}
}else{
$data['facility'][$this_facility]['delivery'][4] = 0;
$data['facility'][$this_facility]['delivery'][5] = 0;
$data['facility'][$this_facility]['delivery'][6] = 0;
}
if($data['facility'][$this_facility]['delivery'][5] == 0){
$data['facility'][$this_facility]['delivery'][6] =0;
}
}
} else {
$data['delivery'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['delivery'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['delivery'][3]) && $data['facility'][$this_facility]['delivery'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['delivery'][3]) {
$data['facility'][$this_facility]['delivery'][4] = $data['facility'][$this_facility]['delivery'][3];
$data['facility'][$this_facility]['delivery'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['delivery'][3];
}else{
$data['facility'][$this_facility]['delivery'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['delivery'][5] =$data['facility'][$this_facility]['delivery'][3] -$data['facility'][$this_facility]['delivery'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['delivery'][4] = 0;
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3];
}
}else{
$data['facility'][$this_facility]['delivery'][4] = 0;
$data['facility'][$this_facility]['delivery'][5] = 0;
$data['facility'][$this_facility]['delivery'][6] = 0;
}
if($data['facility'][$this_facility]['delivery'][5] == 0){
$data['facility'][$this_facility]['delivery'][6] =0;
}
}
}
$data['delivery'][5] = $data['delivery'][3] - $data['delivery'][4];
} else {
$data['delivery'][4] = 0;
$data['delivery'][5] = $data['delivery'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['delivery'][4] = 0;
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3];
if($data['facility'][$this_facility]['sign'][5] == 0){
$data['facility'][$this_facility]['sign'][6] =0;
}
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['delivery'][3]) >= 0) {
@ -1228,19 +1671,80 @@ foreach ($arrayData as $key => &$data) {
$data['delivery'][7] = 0;
}
if ($data['final'][3] > 0) {
if (isset($data['final'][3]) && $data['final'][3] > 0) {
if ($tmp_data > 0) {
if (($tmp_data - $data['final'][1]) >= 0) {
$data['final'][4] = $data['final'][3];
$tmp_data -= $data['final'][3];
$tmp_facility_received = $data['final'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['final'][3]) && $data['facility'][$this_facility]['final'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['final'][3]) {
$data['facility'][$this_facility]['final'][4] = $data['facility'][$this_facility]['final'][3];
$data['facility'][$this_facility]['final'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['final'][3];
}else{
$data['facility'][$this_facility]['final'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['final'][5] =$data['facility'][$this_facility]['final'][3] -$data['facility'][$this_facility]['final'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['final'][4] = 0;
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3];
}
}else{
$data['facility'][$this_facility]['final'][4] = 0;
$data['facility'][$this_facility]['final'][5] = 0;
$data['facility'][$this_facility]['final'][6] = 0;
}
if($data['facility'][$this_facility]['final'][5] == 0){
$data['facility'][$this_facility]['final'][6] =0;
}
}
} else {
$data['final'][4] = $tmp_data;
$tmp_data = 0;
$tmp_facility_received = $data['final'][4];
foreach ($facilities as $this_facility) {
if (isset($data['facility'][$this_facility]['final'][3]) && $data['facility'][$this_facility]['final'][3] > 0) {
if ($tmp_facility_received > 0) {
if ($tmp_facility_received >= $data['facility'][$this_facility]['final'][3]) {
$data['facility'][$this_facility]['final'][4] = $data['facility'][$this_facility]['final'][3];
$data['facility'][$this_facility]['final'][5] = 0;
$tmp_facility_received -= $data['facility'][$this_facility]['final'][3];
}else{
$data['facility'][$this_facility]['final'][4] = $tmp_facility_received;
$data['facility'][$this_facility]['final'][5] =$data['facility'][$this_facility]['final'][3] -$data['facility'][$this_facility]['final'][4];
$tmp_facility_received = 0;
}
}else{
$data['facility'][$this_facility]['final'][4] = 0;
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3];
}
}else{
$data['facility'][$this_facility]['final'][4] = 0;
$data['facility'][$this_facility]['final'][5] = 0;
$data['facility'][$this_facility]['final'][6] = 0;
}
if($data['facility'][$this_facility]['final'][5] == 0){
$data['facility'][$this_facility]['final'][6] =0;
}
}
}
$data['final'][5] = $data['final'][3] - $data['final'][4];
} else {
$data['final'][4] = 0;
$data['final'][5] = $data['final'][3];
foreach($facilities as $this_facility){
$data['facility'][$this_facility]['final'][4] = 0;
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3];
}
if($data['facility'][$this_facility]['final'][5] == 0){
$data['facility'][$this_facility]['final'][6] =0;
}
}
if ($tmp_invoice > 0) {
if (($tmp_invoice - $data['final'][3]) >= 0) {
@ -1263,6 +1767,7 @@ foreach ($arrayData as $key => &$data) {
}
}
//產生excel的array
$excel_aray = array();
$boga_array = array();
@ -1271,8 +1776,8 @@ $facility_array = array();
$facility_boga_array = array();
$facility_exclude_boga_array = array();
foreach ($arrayData as $key => $value) {
$sum_A40001 += $value['A40001'];
$sum_A40008 += $value['A40008'];
$sum_A40001 += isset($value['A40001']) ? $value['A40001'] : 0;
$sum_A40008 += isset($value['A40008']) ? $value['A40008'] : 0;
$sum_total_budget += $value['total_budget'];
$sum_facility += $value['total_facility_num'];
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
@ -1283,17 +1788,20 @@ foreach ($arrayData as $key => $value) {
$value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0;
$value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0;
$value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0;
$value[9] = (isset($value[9])) ? Date('Ymd', strtotime($value[9])) : 0;
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) {
$value[$i]['max'] = (empty($value[$i]['max']) || is_null($value[$i]['max'])) ? 0 : $value[$i]['max'];
$value[$i]['min'] = (empty($value[$i]['min']) || is_null($value[$i]['min'])) ? 0 : $value[$i]['min'];
$value[$i][4] = (isset($value[$i][4])) ? $value[$i][4] : 0;
$value[$i][5] = (isset($value[$i][5])) ? $value[$i][5] : 0;
$value['A40001'] = (isset($value['A40001'])) ? $value['A40001'] : 0;
$value['A40008'] = (isset($value['A40008'])) ? $value['A40008'] : 0;
};
if ($value['sign'][0] == "寶佳出貨前30天") {
if (isset($value['sign'][0]) && $value['sign'][0] == "寶佳出貨前30天") {
$boga_array[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'],
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'],
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'],
@ -1306,7 +1814,7 @@ foreach ($arrayData as $key => $value) {
];
} else {
$exclude_boga_array[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'],
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'],
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'],
@ -1320,7 +1828,7 @@ foreach ($arrayData as $key => $value) {
}
$excel_aray[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'],
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'],
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'],
@ -1334,54 +1842,56 @@ foreach ($arrayData as $key => $value) {
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
foreach ($value['facility'] as $valkey => $val) {
foreach ($contractstage as $stage) {
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0];
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1];
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2];
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3];
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4];
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5];
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6];
}
$facility_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6],
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6],
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6],
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6],
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6],
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6],
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6],
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6],
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget']))
];
if ($value['sign'][0] == "寶佳出貨前30天") {
$facility_boga_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6],
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6],
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6],
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6],
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6],
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6],
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6],
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6],
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget']))
];
} else {
$facility_exclude_boga_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6],
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6],
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6],
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6],
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6],
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6],
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6],
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6],
if (isset($value['facility'])) {
foreach ($value['facility'] as $valkey => $val) {
foreach ($contractstage as $stage) {
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0];
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1];
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2];
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3];
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4];
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5];
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6];
}
$facility_array[$valkey] = [
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])),
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])),
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])),
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])),
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])),
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])),
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])),
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])),
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget']))
];
if ($value['sign'][0] == "寶佳出貨前30天") {
$facility_boga_array[$valkey] = [
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])),
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])),
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])),
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])),
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])),
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])),
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])),
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])),
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget']))
];
} else {
$facility_exclude_boga_array[$valkey] = [
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])),
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])),
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])),
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])),
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])),
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])),
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])),
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])),
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget']))
];
}
}
}
}
@ -1727,21 +2237,4 @@ include "./footer.php";
}));
}
function sendData(BillNo) {
var BillData = <?= $data ?>;
var Bill = BillData[BillNo];
var form = document.createElement("form");
form.method = 'POST';
form.action = "account-receivable-check.php?<?= $token_link ?>";
var input = document.createElement("input");
input.type = "hidden";
input.name = "Bill";
input.value = JSON.stringify(Bill);
form.appendChild(input);
document.body.appendChild(form);
form.submit();
}
</script>

2218
wms/account-receivable-renovate-index.php

File diff suppressed because it is too large

334
wms/account-receivable-test.php

@ -44,9 +44,339 @@ include './header.php';
// }
// 找出已工收的作番 但沒在T8銷售訂單上出現的作番
$material_array = "('2MH00028', '3MH00123', '2MH00026', '3MW00067', '3MH00124', '3MH00121',
'3MH00122', '2MW00027', '3MH00297', '2MW00001', '3MH00111', '3MW00190',
'3MW00118', '3MH00093', '3MH00002', '3MW00024', '3MH00130', '3MH00196',
'3MW00119', '3MH00205', '3MH00259', '3MW00159', '3MW00243', '3MH00351',
'3MH00352', '2MX00015', '3MH00353', '3MH00298', '3MH00113', '3MH00036',
'3MH00206', '3MH00179', '3MH00180', '3MH00181', '3MW00350', '3MH00053',
'3MH00054', '3MH00178', '3MH00296', '2MH00047', '3MW00114', '3MH00282',
'2MH00048', '3MH00609', '3MH00148', '3MH00354', '3MX00021', '3MW00210',
'3MH00184', '3MH00185', '3MH00283', '3MW00209', '3MH00182', '3MH00183',
'3MH00189', '3MH00512', '3MH00355', '3MH00286', '3MH00511', '2MX00008',
'2MX00014', '3MH00244', '3MH00555', '3MH00450', '3MW00211', '3MH00177',
'2MX00009', '2MX00012', '3MW00139', '3MH00540', '3MH00504', '3MH00360',
'3MH00301', '3MX00020', '2MX00013')";
$material_array2 = array(
'2MH00028', '3MH00123', '2MH00026', '3MW00067', '3MH00124', '3MH00121',
'3MH00122', '2MW00027', '3MH00297', '2MW00001', '3MH00111', '3MW00190',
'3MW00118', '3MH00093', '3MH00002', '3MW00024', '3MH00130', '3MH00196',
'3MW00119', '3MH00205', '3MH00259', '3MW00159', '3MW00243', '3MH00351',
'3MH00352', '2MX00015', '3MH00353', '3MH00298', '3MH00113', '3MH00036',
'3MH00206', '3MH00179', '3MH00180', '3MH00181', '3MW00350', '3MH00053',
'3MH00054', '3MH00178', '3MH00296', '2MH00047', '3MW00114', '3MH00282',
'2MH00048', '3MH00609', '3MH00148', '3MH00354', '3MX00021', '3MW00210',
'3MH00184', '3MH00185', '3MH00283', '3MW00209', '3MH00182', '3MH00183',
'3MH00189', '3MH00512', '3MH00355', '3MH00286', '3MH00511', '2MX00008',
'2MX00014', '3MH00244', '3MH00555', '3MH00450', '3MW00211', '3MH00177',
'2MX00009', '2MX00012', '3MW00139', '3MH00540', '3MH00504', '3MH00360',
'3MH00301', '3MX00020', '2MX00013'
);
//找出已工收 在採購單上有的作番
// $sql_purBill = "SELECT * FROM purBillOrderDetail WHERE MaterialId IN ('2MH00028P','3MH00123P','2MH00026P','3MW00067P','3MH00124P','3MH00121P','3MH00122P','2MW00027P','3MH00297P','2MW00001P','3MH00111P','3MW00190P','3MW00118P','3MH00093P','3MH00002P','3MW00024P','3MH00130P','3MH00196P','3MW00119P','3MH00205P','3MH00259P','3MW00159P','3MW00243P','3MH00351P','3MH00352P','2MX00015P','3MH00353P','3MH00298P','3MH00113P','3MH00036P','3MH00206P','3MH00179P','3MH00180P','3MH00181P','3MW00350P','3MH00053P','3MH00054P','3MH00178P','3MH00296P','2MH00047P','3MW00114P','3MH00282P','2MH00048P','3MH00609P','3MH00148P','3MH00354P','3MX00021P','3MW00210P','3MH00184P','3MH00185P','3MH00283P','3MW00209P','3MH00182P','3MH00183P','3MH00189P','3MH00512P','3MH00355P','3MH00286P','3MH00511P','2MX00008P','2MX00014P','3MH00244P','3MH00555P','3MH00450P','3MW00211P','3MH00177P','2MX00009P','2MX00012P','3MW00139P','3MH00540P','3MH00504P','3MH00360P','3MH00301P','3MX00020P','2MX00013P')";
// $purBill = $conn->query($sql_purBill);
// $query_purBill = $conn->query($sql_purBill);
// foreach ($query_purBill as $row) {
// echo substr($row['MaterialId'],0,-1) . ";" . $row['BillNo'] . "<br>";
// }
// $find_array = array();
// $sql_Bill = "SELECT * FROM salSalesOrderDetail
// WHERE MaterialId
// IN $material_array";
// $query = $conn->query($sql_Bill);
// foreach ($query as $row) {
// echo $row['MaterialId'] . ",";
// if (($key = array_search($row['MaterialId'], $material_array2)) !== false) {
// unset($material_array2[$key]);
// }
// }
// echo "<br><br>";
// foreach ($material_array2 as $material) {
// echo $material . ",";
// }
//-------------------------沒有3MH00540--------------------------------------------
//找已工收 已發貨的作番
// $sql_out_warehouse = "SELECT B.MaterialId FROM stkWareHouseIn AS A LEFT JOIN stkWareHouseInDetail AS B ON A.BillNo=B.BillNo WHERE A.IOProperty = 0 AND B.MaterialId IN $material_array";
// $query_out_warehouse = $conn->query($sql_out_warehouse);
// foreach ($query_out_warehouse as $row) {
// echo $row['MaterialId'] . "<br>";
// }
// 已工收 有庫存的作番
// $sql_in_warehouse = "SELECT MaterialId, Quantity FROM stkWareHouseAccountDetail WHERE MaterialId IN $material_array AND Quantity >0";
// $query_in_warehouse = $conn->query($sql_in_warehouse);
// foreach ($query_in_warehouse as $row) {
// echo $row['MaterialId'].", ".$row['Quantity'] . "<br>";
// if (($key = array_search($row['MaterialId'], $material_array2)) !== false) {
// unset($material_array2[$key]);
// }
// }
// echo "<br><br>";
// foreach ($material_array2 as $material) {
// echo $material . "<br>";
// }
//已工收 有組裝單
// $sql_assemble = "SELECT * FROM stkAssyMast WHERE MaterialId IN $material_array";
// $query_assemble = $conn->query($sql_assemble);
// foreach ($query_assemble as $row) {
// echo $row['MaterialId'] . "<br>";
// }
//已工收 P有庫存
// $sql_p_in_warehouse = "SELECT MaterialId, Quantity FROM stkWareHouseAccountDetail WHERE MaterialId IN
// ('2MH00028P','3MH00123P','2MH00026P','3MW00067P','3MH00124P','3MH00121P','3MH00122P',
// '2MW00027P','3MH00297P','2MW00001P','3MH00111P','3MW00190P','3MW00118P','3MH00093P',
// '3MH00002P','3MW00024P','3MH00130P','3MH00196P','3MW00119P','3MH00205P','3MH00259P',
// '3MW00159P','3MW00243P','3MH00351P','3MH00352P','2MX00015P','3MH00353P','3MH00298P',
// '3MH00113P','3MH00036P','3MH00206P','3MH00179P','3MH00180P','3MH00181P','3MW00350P',
// '3MH00053P','3MH00054P','3MH00178P','3MH00296P','2MH00047P','3MW00114P','3MH00282P',
// '2MH00048P','3MH00609P','3MH00148P','3MH00354P','3MX00021P','3MW00210P','3MH00184P',
// '3MH00185P','3MH00283P','3MW00209P','3MH00182P','3MH00183P','3MH00189P','3MH00512P',
// '3MH00355P','3MH00286P','3MH00511P','2MX00008P','2MX00014P','3MH00244P','3MH00555P',
// '3MH00450P','3MW00211P','3MH00177P','2MX00009P','2MX00012P','3MW00139P','3MH00540P',
// '3MH00504P','3MH00360P','3MH00301P','3MX00020P','2MX00013P') AND Quantity >0";
// $query_p_in_warehouse = $conn->query($sql_p_in_warehouse);
// foreach ($query_p_in_warehouse as $row) {
// echo substr($row['MaterialId'],0,-1). "<br>";
// }
//------------------------------------------------------------------------------------------------------------------------------
$finished_array = array('2MH00028', '3MH00123', '2MH00026', '3MW00067', '3MH00124', '3MH00121', '3MH00122', '2MW00027', '3MH00297');
$finished = "('2MH00028','3MH00123','2MH00026','3MW00067','3MH00124','3MH00121','3MH00122','2MW00027','3MH00297')";
//有向普來特富下單的作番
// $sql_all = "SELECT `contractno`,`facilityno`,`custom` FROM `wipwholestatus`
// WHERE (prattford_order_date IS NOT NULL)
// AND facilityno NOT IN ('2MH00028','3MH00123','2MH00026','3MW00067','3MH00124','3MH00121','3MH00122','2MW00027','3MH00297')
// AND contract_type='A'";
// $query_all = mysqli_query($link, $sql_all);
// $facilities = mysqli_fetch_all($query_all, MYSQLI_ASSOC);
// foreach ($facilities as $key => $value) {
// // echo $value['contractno'] . ";" . $value['facilityno']. ";" . $value['custom'] . "<br>";
// echo $value['contractno'] ."<br>";
// }
$all = "('2MW00001','2MW00002','2MW00003','2MW00004','2MW00005','2MX00006','2MX00007','2MX00008','2MX00009','2MX00010','2MX00011','2MX00012','2MX00013','2MX00014','2MX00015',
'2MX00016','2MX00017','2MX00018','2MX00019','2MX00020','2MX00021','2MX00022','2MX00023','2MX00024','2MX00025','2MW00038','2MX00044','2MH00046','2MH00047','2MH00048','3MH00002',
'3MX00003','3MX00004','3MX00005','3MX00006','3MX00007','3MX00008','3MX00009','3MX00010','3MX00011','3MX00012','3MX00013','3MX00014','3MX00015','3MX00016','3MX00017','3MX00018',
'3MX00019','3MX00020','3MX00021','3MX00022','3MH00023','3MW00024','3MH00025','3MX00026','3MH00027','3MH00028','3MH00029','3MH00030','3MH00031','3MH00032','3MH00033','3MH00034',
'3MH00035','3MH00036','3MX00037','3MF00038','3MH00039','3MH00040','3MH00041','3MH00042','3MH00043','3MH00044','3MH00045','3MH00046','3MH00047','3MX00048','3MH00049','3MW00050',
'3MW00051','3MW00052','3MH00053','3MX00924','3MH00054','3MH00055','3MH00056','3MH00057','3MH00058','3MH00059','3MH00060','3MH00061','3MH00062','3MH00063','3MH00064','3MX00065',
'3MH00066','3MX00068','3MX00069','3MX00070','3MX00071','3MX00072','3MX00073','3MX00074','3MX00075','3MH00076','3MH00077','3MX00078','3MX00079','3MX00080','3MX00081','3MX00082',
'3MX00083','3MX00084','3MX00085','3MX00086','3MX00087','3MX00088','3MX00089','3MX00090','3MX00091','3MX00092','3MH00093','3MH00094','3MH00095','3MH00096','3MH00097','3MH00098',
'3MH00099','3MH00100','3MH00101','3MH00102','3MH00103','3MH00104','3MH00105','3MH00106','3MH00107','3MW00108','3MX00109','3MW00110','3MH00111','3MH00112','3MH00113','3MW00114',
'3MH00115','3MH00116','3MW00117','3MW00118','3MW00119','3MH00120','3MH00125','3MH00126','3MH00127','3MW00128','3MW00129','3MH00130','3MH00131','3MX00132','3MX00133','3MX00134',
'3MX00135','3MX00136','3MX00137','3MX00138','3MW00139','3MX00141','3MX00142','3MX00144','3MX00147','3MX00140','3MX00143','3MX00145','3MX00146','3MH00148','3MH00149','3MH00150',
'3MH00151','3MH00152','3MH00153','3MW00154','3MW00155','3MH00156','3MH00157','3MH00158','3MW00159','3MW00160','3MW00161','3MW00162','3MW00163','3MW00164','3MW00165','3MW00166',
'3MW00167','3MW00168','3MW00169','3MW00170','3MW00171','3MH00172','3MH00173','3MH00174','3MH00175','3MX00176','3MH00177','3MH00178','3MH00179','3MH00180','3MH00181','3MH00182',
'3MH00183','3MH00184','3MH00185','3MH00186','3MH00187','3MH00188','3MH00189','3MW00190','3MX00191','3MX00192','3MX00193','3MH00194','3MH00195','3MH00196','3MH00197','3MW00198',
'3MW00199','3MW00200','3MX00201','3MH00202','3MX00203','3MX00204','3MH00205','3MH00206','3MH00207','3MH00208','3MW00209','3MW00210','3MW00211','3MW00212','3MW00213','3MW00214',
'3MW00215','3MH00216','3MW00217','3MX00218','3MX00219','3MX00220','3MX00221','3MX00222','3MX00223','3MX00224','3MX00225','3MX00226','3MX00227','3MX00228','3MX00229','3MX00230',
'3MX00231','3MX00232','3MX00233','3MX00234','3MX00235','3MX00236','3MX00237','3MX00238','3MX00239','3MX00240','3MX00241','3MH00242','3MW00243','3MH00244','3MH00245','3MH00246',
'3MH00247','3MW00248','3MW00249','3MH00250','3MH00251','3MH00252','3MW00253','3MP00254','3MH00255','3MW00256','3MX00257','3MW00258','3MH00259','3MW00260','3MW00261','3MH00262',
'3MH00263','3MH00264','3MH00265','3MH00281','3MH00280','3MW00279','3MW00278','3MW00277','3MW00276','3MW00275','3MW00274','3MH00273','3MH00272','3MH00271','3MH00270','3MH00268',
'3MH00269','3MH00266','3MW00267','3MH00282','3MH00283','3MH00284','3MH00285','3MH00286','3MX00287','3MX00288','3MX00289','3MX00290','3MX00291','3MW00292','3MH00293','3MH00294',
'3MX00295','3MH00296','3MH00298','3MH00299','3MW00300','3MH00301','3MH00302','3MH00303','3MH00304','3MH00305','3MH00306','3MH00307','3MH00308','3MH00309','3MX00310','3MW00311',
'3MH00312','3MH00313','3MX00314','3MX00324','3MX00325','3MX00334','3MX00335','3MX00315','3MX00318','3MX00319','3MX00322','3MX00326','3MX00329','3MX00331','3MX00332','3MX00316',
'3MX00317','3MX00320','3MX00321','3MX00327','3MX00328','3MX00330','3MX00333','3MW00323','3MW00336','3MH00337','3MH00338','3MH00339','3MH00340','3MH00341','3MH00342','3MH00343',
'3MH00344','3MH00345','3MH00346','3MH00347','3MH00348','3MH00349','3MW00350','3MH00351','3MH00352','3MH00353','3MH00354','3MH00355','3MH00356','3MH00357','3MH00358','3MH00359',
'3MH00360','3MH00361','3MH00362','3MH00363','3MH00364','3MH00365','3MH00366','3MH00367','3MH00368','3MW00369','3MP00370','3MH00371','3MX00372','3MX00373','3MX00374','3MX00375',
'3MW00376','3MH00377','3MH00378','3MH00379','3MH00380','3MH00381','3MH00382','3MH00383','3MH00384','3MH00385','3MH00386','3MH00387','3MH00388','3MH00389','3MH00393','3MH00394',
'3MH00395','3MH00396','3MH00397','3MH00398','3MH00399','3MH00400','3MH00401','3MH00402','3MH00403','3MX00404','3MX00405','3MX00406','3MH00407','3MH00408','3MH00409','3MH00410',
'3MH00411','3MH00412','3MW00413','3MW00414','3MW00415','3MH00416','3MH00417','3MH00418','3MW00419','3MH00420','3MH00421','3MH00422','3MH00423','3MH00424','3MH00425','3MH00426',
'3MH00427','3MH00428','3MH00429','3MX00430','3MX00431','3MX00432','3MX00433','3MX00434','3MX00435','3MX00436','3MX00437','3MX00438','3MX00439','3MX00440','3MX00441','3MX00442',
'3MX00443','3MX00444','3MH00445','3MX00448','3MH00449','3MH00450','3MW00451','3MX00452','3MW00453','3MH00454','3MH00455','3MH00456','3MH00457','3MH00458','3MH00459','3MH00460',
'3MH00461','3MH00462','3MH00463','3MH00464','3MH00465','3MH00466','3MH00467','3MH00468','3MH00469','3MH00470','3MH00471','3MH00472','3MH00473','3MH00474','3MH00475','3MH00476',
'3MH00477','3MH00478','3MH00479','3MH00480','3MH00481','3MH00482','3MX00483','3MH00484','3MH00485','3MH00486','3MX00487','3MX00488','3MW00489','3MW00490','3MH00491','3MH00492',
'3MH00493','3MH00494','3MH00495','3MH00496','3MH00497','3MH00498','3MH00499','3MW00500','3MX00501','3MX00502','3MH00503','3MH00554','3MH00540','3MX00551','3MX00552','3MH00504',
'3MW00505','3MW00506','3MH00507','3MH00508','3MW00509','3MX00510','3MH00511','3MH00512','3MH00513','3MW00514','3MW00515','3MH00516','3MH00517','3MH00518','3MH00519','3MH00520',
'3MH00521','3MH00522','3MH00523','3MH00524','3MH00525','3MH00526','3MH00527','3MH00528','3MH00529','3MH00530','3MH00531','3MH00532','3MX00533','3MH00534','3MH00535','3MX00536',
'3MX00537','3MH00538','3MH00539','3MW00824','3MH00541','3MW00542','3MX00543','3MH00544','3MH00545','3MH00546','3MH00547','3MX00548','3MX00559','3MH00550','3MH00555','3MH00557',
'3MH00556','3MX00549','3MW00558','3MH00560','3MH00561','3MH00562','3MH00563','3MH00564','3MH00565','3MH00566','3MH00567','3MH00568','3MH00569','3MH00570','3MH00571','3MH00572',
'3MH00573','3MH00574','3MH00575','3MH00576','3MH00577','3MH00578','3MW00579','3MW00580','3MH00581','3MH00582','3MH00583','3MH00584','3MH00585','3MH00586','3MH00587','3MH00588',
'3MH00589','3MH00590','3MH00591','3MH00592','3MH00593','3MH00594','3MX00595','3MH00596','3MX00597','3MX00598','3MX00599','3MX00600','3MX00601','3MX00602','3MX00604','3MX00603',
'3MX00605','3MX00606','3MX00607','3MX00608','3MH00609','3MH00610','3MH00611','3MW00613','3MW00612','3MX00614','3MX00615','3MW00616','3MH00617','3MH00618','3MX00619','3MH00620',
'3MH00621','3MH00622','3MH00623','3MH00624','3MH00625','3MH00626','3MH00627','3MX00628','3MX00629','3MX00630','3MX00631','3MX00632','3MX00633','3MX00634','3MX00635','3MX00636',
'3MX00637','3MX00638','3MH00639','3MH00640','3MH00641','3MH00642','3MH00643','3MH00644','3MH00645','3MH00646','3MH00647','3MH00648','3MH00649','3MH00650','3MH00651','3MH00652',
'3MH00653','3MH00654','3MH00655','3MH00656','3MH00657','3MH00658','3MH00659','3MH00660','3MW00695','3MH00661','3MW00662','3MX00663','3MX00664','3MX00665','3MX00666','3MX00667',
'3MX00668','3MX00669','3MX00670','3MX00671','3MX00672','3MX00673','3MX00674','3MX00675','3MX00676','3MX00677','3MX00678','3MX00679','3MX00680','3MH00681','3MH00682','3MH00683',
'3MH00684','3MH00685','3MH00686','3MH00687','3MH00688','3MH00689','3MH00690','3MW00691','3MW00692','3MH00693','3MW00694','3MW00697','3MW00698','3MW00699','3MW00696','3MW00702',
'3MW00703','3MH00704','3MH00705','3MH00706','3MH00707','3MH00708','3MH00709','3MH00710','3MH00711','3MH00712','3MH00713','3MH00714','3MH00715','3MH00716','3MH00717','3MH00718',
'3MH00719','3MH00720','3MH00721','3MH00722','3MH00723','3MH00724','3MH00725','3MH00726','3MH00727','3MH00728','3MX00729','3MX00730','3MX00731','3MX00732','3MH00733','3MH00734',
'3MH00735','3MH00736','3MH00737','3MW00739','3MX00770','3MX00771','3MX00446','3MX00447','3MH00772','3MX00740','3MX00741','3MX00742','3MX00743','3MX00744','3MX00745','3MX00746',
'3MX00747','3MX00748','3MX00749','3MH00738','3MH00768','3MX00775','3MH00774','3MP00773','3MH00779','3MH00777','3MH00778','3MH00793','3MH00794','3MH00795','3MH00796','3MH00790',
'3MH00791','3MH00789','3MX00776','3MH00797','3MH00787','3MH00792','3MW00805','3MW00806','3MH00807','3MH00808','3MX00809','3MX00810','3MX00811','3MX00812','3MH00813','3MH00864',
'3MW00863','3MH00813','3MH00814','3MX00815','3MW00818','3MW00819','3MW00821','3MW00822','3MW00823','3MW00825','3MW00826','3MW00827','3MW00828','3MW00829','3MW00830','3MW00820',
'3MW00831','3MH00817','3MH00816','3MX00758','3MX00760','3MX00759','3MX00761','3MH00832','3MW00841','3MW00842','3MW00843','3MW00844','3MH00833','3MH00834','3MH00835','3MH00836',
'3MH00837','3MH00838','3MH00839','3MH00840','3MW00845','3MW00846','3MW00847','3MH00848','3MH00849','3MH00850','3MH00851','3MH00852','3MH00853','3MH00854','3MW00855','3MW00856',
'3MW00857','3MW00858','3MX00859','3MX00860','3MX00750','3MX00752','3MX00754','3MX00757','3MX00751','3MX00753','3MX00755','3MX00756','3MX00766','3MX00767','3MW00788','3MP00865',
'3MH00866','3MH00867','3MH00868','3MH00869','3MH00870','3MH00871','3MH00872','3MH00873','3MX00874','3MX00875','3MX00876','3MX00877','3MX00762','3MX00765','3MX00763','3MX00764',
'3MX00861','3MX00862','3MX00878','3MH00879','3MH00880','3MH00881','3MH00882','3MH00926','3MH00874','3MH00875','3MH00876','3MH00877','3MH00878','3MH00883','3MH00884','3MW00886',
'3MX00919','3MX00920','3MX00921','3MX00922','3MX00915','3MX00916','3MX00917','3MX00918','3MX00911','3MX00912','3MX00913','3MX00914','3MX00905','3MX00906','3MX00907','3MX00908',
'3MX00909','3MX00910','3MX00903','3MX00904','3MX00897','3MX00900','3MX00901','3MX00898','3MX00899','3MX00902','3MX00893','3MX00894','3MX00895','3MX00896','3MX00887','3MX00888',
'3MX00889','3MX00890','3MX00891','3MX00892','3MH00885','3MH00923','3MW00925','3MW00927','3MH00928','3MH00929','3MH00930','3MH00931','3MH00932','3MH00933','3MX00934','3MX00935',
'3MP00936','3MP00937','3MH00938','3MW00939','3MW00940','3MH00941','3MH00942','3MH00943','3MH00944','3MH00945','3MH00946','3MH00947','3MH00948','3MH00949','3MH00950','3MH00951',
'3MH00952','3MH00953','3MH00954','3MH00955','3MH00956','3MH00957','3MW00958','3MW00959','3MW00960','3MQ00961','3MH00962','3MW00963','3MH00964','3MW00965','3MP00966','3MH00967',
'3MX00968','3MX00969','3MH00970','3MH00970','3MH00971','3MH00972','3MH00973','3MH00974','3MH00975','3MH00976','3MH00977','3MH00978','3MX00979','3MX00980','3MX00983','3MX00984',
'3MX00981','3MX00982','3MX00985','3MX00986','3MX00987','3MX00988','3MX00989','3MX00990','3MX00991','3MX00992','3MX00993','3MX00994','3MX00995','3MX00996','3MX00999','3MX01000',
'3MX01003','3MX01005','3MX01006','3MX00997','3MX00998','3MX01001','3MX01002','3MX01004','3MX01007','3MX01008','3MX01011','3MX01012','3MX01015','3MX01016','3MX01009','3MX01010',
'3MX01013','3MX01014','3MX01017','3MH01018','3MH01019','3MH01020','3MQ01021','3MP01022','3MH01023','3MX01024','3MX01025','3MX01026','3MX01027','3MW01028','3MH01029','3MH01030',
'3MH01031','3MP01032','3MH01033','3MH01034','3MW01035','3MP01036','3MX01037','3MX01038','3MX01039','3MX01040','3MX01041','3MX01042','3MH01043','3MH01044','3MH01045','3MH01046',
'3MH01047','3MH01048','3MX00775','3MX00776')";
$P_all = "
('2MW00001P','2MW00002P','2MW00003P','2MW00004P','2MW00005P','2MX00006P','2MX00007P','2MX00008P','2MX00009P','2MX00010P','2MX00011P','2MX00012P','2MX00013P','2MX00014P','2MX00015P',
'2MX00016P','2MX00017P','2MX00018P','2MX00019P','2MX00020P','2MX00021P','2MX00022P','2MX00023P','2MX00024P','2MX00025P','2MW00038P','2MX00044P','2MH00046P','2MH00047P','2MH00048P',
'3MH00002P','3MX00003P','3MX00004P','3MX00005P','3MX00006P','3MX00007P','3MX00008P','3MX00009P','3MX00010P','3MX00011P','3MX00012P','3MX00013P','3MX00014P','3MX00015P','3MX00016P',
'3MX00017P','3MX00018P','3MX00019P','3MX00020P','3MX00021P','3MX00022P','3MH00023P','3MW00024P','3MH00025P','3MX00026P','3MH00027P','3MH00028P','3MH00029P','3MH00030P','3MH00031P',
'3MH00032P','3MH00033P','3MH00034P','3MH00035P','3MH00036P','3MX00037P','3MF00038P','3MH00039P','3MH00040P','3MH00041P','3MH00042P','3MH00043P','3MH00044P','3MH00045P','3MH00046P',
'3MH00047P','3MX00048P','3MH00049P','3MW00050P','3MW00051P','3MW00052P','3MH00053P','3MX00924P','3MH00054P','3MH00055P','3MH00056P','3MH00057P','3MH00058P','3MH00059P','3MH00060P',
'3MH00061P','3MH00062P','3MH00063P','3MH00064P','3MX00065P','3MH00066P','3MX00068P','3MX00069P','3MX00070P','3MX00071P','3MX00072P','3MX00073P','3MX00074P','3MX00075P','3MH00076P',
'3MH00077P','3MX00078P','3MX00079P','3MX00080P','3MX00081P','3MX00082P','3MX00083P','3MX00084P','3MX00085P','3MX00086P','3MX00087P','3MX00088P','3MX00089P','3MX00090P','3MX00091P',
'3MX00092P','3MH00093P','3MH00094P','3MH00095P','3MH00096P','3MH00097P','3MH00098P','3MH00099P','3MH00100P','3MH00101P','3MH00102P','3MH00103P','3MH00104P','3MH00105P','3MH00106P',
'3MH00107P','3MW00108P','3MX00109P','3MW00110P','3MH00111P','3MH00112P','3MH00113P','3MW00114P','3MH00115P','3MH00116P','3MW00117P','3MW00118P','3MW00119P','3MH00120P','3MH00125P',
'3MH00126P','3MH00127P','3MW00128P','3MW00129P','3MH00130P','3MH00131P','3MX00132P','3MX00133P','3MX00134P','3MX00135P','3MX00136P','3MX00137P','3MX00138P','3MW00139P','3MX00141P',
'3MX00142P','3MX00144P','3MX00147P','3MX00140P','3MX00143P','3MX00145P','3MX00146P','3MH00148P','3MH00149P','3MH00150P','3MH00151P','3MH00152P','3MH00153P','3MW00154P','3MW00155P',
'3MH00156P','3MH00157P','3MH00158P','3MW00159P','3MW00160P','3MW00161P','3MW00162P','3MW00163P','3MW00164P','3MW00165P','3MW00166P','3MW00167P','3MW00168P','3MW00169P','3MW00170P',
'3MW00171P','3MH00172P','3MH00173P','3MH00174P','3MH00175P','3MX00176P','3MH00177P','3MH00178P','3MH00179P','3MH00180P','3MH00181P','3MH00182P','3MH00183P','3MH00184P','3MH00185P',
'3MH00186P','3MH00187P','3MH00188P','3MH00189P','3MW00190P','3MX00191P','3MX00192P','3MX00193P','3MH00194P','3MH00195P','3MH00196P','3MH00197P','3MW00198P','3MW00199P','3MW00200P',
'3MX00201P','3MH00202P','3MX00203P','3MX00204P','3MH00205P','3MH00206P','3MH00207P','3MH00208P','3MW00209P','3MW00210P','3MW00211P','3MW00212P','3MW00213P','3MW00214P','3MW00215P',
'3MH00216P','3MW00217P','3MX00218P','3MX00219P','3MX00220P','3MX00221P','3MX00222P','3MX00223P','3MX00224P','3MX00225P','3MX00226P','3MX00227P','3MX00228P','3MX00229P','3MX00230P',
'3MX00231P','3MX00232P','3MX00233P','3MX00234P','3MX00235P','3MX00236P','3MX00237P','3MX00238P','3MX00239P','3MX00240P','3MX00241P','3MH00242P','3MW00243P','3MH00244P','3MH00245P',
'3MH00246P','3MH00247P','3MW00248P','3MW00249P','3MH00250P','3MH00251P','3MH00252P','3MW00253P','3MP00254P','3MH00255P','3MW00256P','3MX00257P','3MW00258P','3MH00259P','3MW00260P',
'3MW00261P','3MH00262P','3MH00263P','3MH00264P','3MH00265P','3MH00281P','3MH00280P','3MW00279P','3MW00278P','3MW00277P','3MW00276P','3MW00275P','3MW00274P','3MH00273P','3MH00272P',
'3MH00271P','3MH00270P','3MH00268P','3MH00269P','3MH00266P','3MW00267P','3MH00282P','3MH00283P','3MH00284P','3MH00285P','3MH00286P','3MX00287P','3MX00288P','3MX00289P','3MX00290P',
'3MX00291P','3MW00292P','3MH00293P','3MH00294P','3MX00295P','3MH00296P','3MH00298P','3MH00299P','3MW00300P','3MH00301P','3MH00302P','3MH00303P','3MH00304P','3MH00305P','3MH00306P',
'3MH00307P','3MH00308P','3MH00309P','3MX00310P','3MW00311P','3MH00312P','3MH00313P','3MX00314P','3MX00324P','3MX00325P','3MX00334P','3MX00335P','3MX00315P','3MX00318P','3MX00319P',
'3MX00322P','3MX00326P','3MX00329P','3MX00331P','3MX00332P','3MX00316P','3MX00317P','3MX00320P','3MX00321P','3MX00327P','3MX00328P','3MX00330P','3MX00333P','3MW00323P','3MW00336P',
'3MH00337P','3MH00338P','3MH00339P','3MH00340P','3MH00341P','3MH00342P','3MH00343P','3MH00344P','3MH00345P','3MH00346P','3MH00347P','3MH00348P','3MH00349P','3MW00350P','3MH00351P',
'3MH00352P','3MH00353P','3MH00354P','3MH00355P','3MH00356P','3MH00357P','3MH00358P','3MH00359P','3MH00360P','3MH00361P','3MH00362P','3MH00363P','3MH00364P','3MH00365P','3MH00366P',
'3MH00367P','3MH00368P','3MW00369P','3MP00370P','3MH00371P','3MX00372P','3MX00373P','3MX00374P','3MX00375P','3MW00376P','3MH00377P','3MH00378P','3MH00379P','3MH00380P','3MH00381P',
'3MH00382P','3MH00383P','3MH00384P','3MH00385P','3MH00386P','3MH00387P','3MH00388P','3MH00389P','3MH00393P','3MH00394P','3MH00395P','3MH00396P','3MH00397P','3MH00398P','3MH00399P',
'3MH00400P','3MH00401P','3MH00402P','3MH00403P','3MX00404P','3MX00405P','3MX00406P','3MH00407P','3MH00408P','3MH00409P','3MH00410P','3MH00411P','3MH00412P','3MW00413P','3MW00414P',
'3MW00415P','3MH00416P','3MH00417P','3MH00418P','3MW00419P','3MH00420P','3MH00421P','3MH00422P','3MH00423P','3MH00424P','3MH00425P','3MH00426P','3MH00427P','3MH00428P','3MH00429P',
'3MX00430P','3MX00431P','3MX00432P','3MX00433P','3MX00434P','3MX00435P','3MX00436P','3MX00437P','3MX00438P','3MX00439P','3MX00440P','3MX00441P','3MX00442P','3MX00443P','3MX00444P',
'3MH00445P','3MX00448P','3MH00449P','3MH00450P','3MW00451P','3MX00452P','3MW00453P','3MH00454P','3MH00455P','3MH00456P','3MH00457P','3MH00458P','3MH00459P','3MH00460P','3MH00461P',
'3MH00462P','3MH00463P','3MH00464P','3MH00465P','3MH00466P','3MH00467P','3MH00468P','3MH00469P','3MH00470P','3MH00471P','3MH00472P','3MH00473P','3MH00474P','3MH00475P','3MH00476P',
'3MH00477P','3MH00478P','3MH00479P','3MH00480P','3MH00481P','3MH00482P','3MX00483P','3MH00484P','3MH00485P','3MH00486P','3MX00487P','3MX00488P','3MW00489P','3MW00490P','3MH00491P',
'3MH00492P','3MH00493P','3MH00494P','3MH00495P','3MH00496P','3MH00497P','3MH00498P','3MH00499P','3MW00500P','3MX00501P','3MX00502P','3MH00503P','3MH00554P','3MH00540P','3MX00551P',
'3MX00552P','3MH00504P','3MW00505P','3MW00506P','3MH00507P','3MH00508P','3MW00509P','3MX00510P','3MH00511P','3MH00512P','3MH00513P','3MW00514P','3MW00515P','3MH00516P','3MH00517P',
'3MH00518P','3MH00519P','3MH00520P','3MH00521P','3MH00522P','3MH00523P','3MH00524P','3MH00525P','3MH00526P','3MH00527P','3MH00528P','3MH00529P','3MH00530P','3MH00531P','3MH00532P',
'3MX00533P','3MH00534P','3MH00535P','3MX00536P','3MX00537P','3MH00538P','3MH00539P','3MW00824P','3MH00541P','3MW00542P','3MX00543P','3MH00544P','3MH00545P','3MH00546P','3MH00547P',
'3MX00548P','3MX00559P','3MH00550P','3MH00555P','3MH00557P','3MH00556P','3MX00549P','3MW00558P','3MH00560P','3MH00561P','3MH00562P','3MH00563P','3MH00564P','3MH00565P','3MH00566P',
'3MH00567P','3MH00568P','3MH00569P','3MH00570P','3MH00571P','3MH00572P','3MH00573P','3MH00574P','3MH00575P','3MH00576P','3MH00577P','3MH00578P','3MW00579P','3MW00580P','3MH00581P',
'3MH00582P','3MH00583P','3MH00584P','3MH00585P','3MH00586P','3MH00587P','3MH00588P','3MH00589P','3MH00590P','3MH00591P','3MH00592P','3MH00593P','3MH00594P','3MX00595P','3MH00596P',
'3MX00597P','3MX00598P','3MX00599P','3MX00600P','3MX00601P','3MX00602P','3MX00604P','3MX00603P','3MX00605P','3MX00606P','3MX00607P','3MX00608P','3MH00609P','3MH00610P','3MH00611P',
'3MW00613P','3MW00612P','3MX00614P','3MX00615P','3MW00616P','3MH00617P','3MH00618P','3MX00619P','3MH00620P','3MH00621P','3MH00622P','3MH00623P','3MH00624P','3MH00625P','3MH00626P',
'3MH00627P','3MX00628P','3MX00629P','3MX00630P','3MX00631P','3MX00632P','3MX00633P','3MX00634P','3MX00635P','3MX00636P','3MX00637P','3MX00638P','3MH00639P','3MH00640P','3MH00641P',
'3MH00642P','3MH00643P','3MH00644P','3MH00645P','3MH00646P','3MH00647P','3MH00648P','3MH00649P','3MH00650P','3MH00651P','3MH00652P','3MH00653P','3MH00654P','3MH00655P','3MH00656P',
'3MH00657P','3MH00658P','3MH00659P','3MH00660P','3MW00695P','3MH00661P','3MW00662P','3MX00663P','3MX00664P','3MX00665P','3MX00666P','3MX00667P','3MX00668P','3MX00669P','3MX00670P',
'3MX00671P','3MX00672P','3MX00673P','3MX00674P','3MX00675P','3MX00676P','3MX00677P','3MX00678P','3MX00679P','3MX00680P','3MH00681P','3MH00682P','3MH00683P','3MH00684P','3MH00685P',
'3MH00686P','3MH00687P','3MH00688P','3MH00689P','3MH00690P','3MW00691P','3MW00692P','3MH00693P','3MW00694P','3MW00697P','3MW00698P','3MW00699P','3MW00696P','3MW00702P','3MW00703P',
'3MH00704P','3MH00705P','3MH00706P','3MH00707P','3MH00708P','3MH00709P','3MH00710P','3MH00711P','3MH00712P','3MH00713P','3MH00714P','3MH00715P','3MH00716P','3MH00717P','3MH00718P',
'3MH00719P','3MH00720P','3MH00721P','3MH00722P','3MH00723P','3MH00724P','3MH00725P','3MH00726P','3MH00727P','3MH00728P','3MX00729P','3MX00730P','3MX00731P','3MX00732P','3MH00733P',
'3MH00734P','3MH00735P','3MH00736P','3MH00737P','3MW00739P','3MX00770P','3MX00771P','3MX00446P','3MX00447P','3MH00772P','3MX00740P','3MX00741P','3MX00742P','3MX00743P','3MX00744P',
'3MX00745P','3MX00746P','3MX00747P','3MX00748P','3MX00749P','3MH00738P','3MH00768P','3MX00775P','3MH00774P','3MP00773P','3MH00779P','3MH00777P','3MH00778P','3MH00793P','3MH00794P',
'3MH00795P','3MH00796P','3MH00790P','3MH00791P','3MH00789P','3MX00776P','3MH00797P','3MH00787P','3MH00792P','3MW00805P','3MW00806P','3MH00807P','3MH00808P','3MX00809P','3MX00810P',
'3MX00811P','3MX00812P','3MH00813P','3MH00864P','3MW00863P','3MH00813P','3MH00814P','3MX00815P','3MW00818P','3MW00819P','3MW00821P','3MW00822P','3MW00823P','3MW00825P','3MW00826P',
'3MW00827P','3MW00828P','3MW00829P','3MW00830P','3MW00820P','3MW00831P','3MH00817P','3MH00816P','3MX00758P','3MX00760P','3MX00759P','3MX00761P','3MH00832P','3MW00841P','3MW00842P',
'3MW00843P','3MW00844P','3MH00833P','3MH00834P','3MH00835P','3MH00836P','3MH00837P','3MH00838P','3MH00839P','3MH00840P','3MW00845P','3MW00846P','3MW00847P','3MH00848P','3MH00849P',
'3MH00850P','3MH00851P','3MH00852P','3MH00853P','3MH00854P','3MW00855P','3MW00856P','3MW00857P','3MW00858P','3MX00859P','3MX00860P','3MX00750P','3MX00752P','3MX00754P','3MX00757P',
'3MX00751P','3MX00753P','3MX00755P','3MX00756P','3MX00766P','3MX00767P','3MW00788P','3MP00865P','3MH00866P','3MH00867P','3MH00868P','3MH00869P','3MH00870P','3MH00871P','3MH00872P',
'3MH00873P','3MX00874P','3MX00875P','3MX00876P','3MX00877P','3MX00762P','3MX00765P','3MX00763P','3MX00764P','3MX00861P','3MX00862P','3MX00878P','3MH00879P','3MH00880P','3MH00881P',
'3MH00882P','3MH00926P','3MH00874P','3MH00875P','3MH00876P','3MH00877P','3MH00878P','3MH00883P','3MH00884P','3MW00886P','3MX00919P','3MX00920P','3MX00921P','3MX00922P','3MX00915P',
'3MX00916P','3MX00917P','3MX00918P','3MX00911P','3MX00912P','3MX00913P','3MX00914P','3MX00905P','3MX00906P','3MX00907P','3MX00908P','3MX00909P','3MX00910P','3MX00903P','3MX00904P',
'3MX00897P','3MX00900P','3MX00901P','3MX00898P','3MX00899P','3MX00902P','3MX00893P','3MX00894P','3MX00895P','3MX00896P','3MX00887P','3MX00888P','3MX00889P','3MX00890P','3MX00891P',
'3MX00892P','3MH00885P','3MH00923P','3MW00925P','3MW00927P','3MH00928P','3MH00929P','3MH00930P','3MH00931P','3MH00932P','3MH00933P','3MX00934P','3MX00935P','3MP00936P','3MP00937P',
'3MH00938P','3MW00939P','3MW00940P','3MH00941P','3MH00942P','3MH00943P','3MH00944P','3MH00945P','3MH00946P','3MH00947P','3MH00948P','3MH00949P','3MH00950P','3MH00951P','3MH00952P',
'3MH00953P','3MH00954P','3MH00955P','3MH00956P','3MH00957P','3MW00958P','3MW00959P','3MW00960P','3MQ00961P','3MH00962P','3MW00963P','3MH00964P','3MW00965P','3MP00966P','3MH00967P',
'3MX00968P','3MX00969P','3MH00970P','3MH00970P','3MH00971P','3MH00972P','3MH00973P','3MH00974P','3MH00975P','3MH00976P','3MH00977P','3MH00978P','3MX00979P','3MX00980P','3MX00983P',
'3MX00984P','3MX00981P','3MX00982P','3MX00985P','3MX00986P','3MX00987P','3MX00988P','3MX00989P','3MX00990P','3MX00991P','3MX00992P','3MX00993P','3MX00994P','3MX00995P','3MX00996P',
'3MX00999P','3MX01000P','3MX01003P','3MX01005P','3MX01006P','3MX00997P','3MX00998P','3MX01001P','3MX01002P','3MX01004P','3MX01007P','3MX01008P','3MX01011P','3MX01012P','3MX01015P',
'3MX01016P','3MX01009P','3MX01010P','3MX01013P','3MX01014P','3MX01017P','3MH01018P','3MH01019P','3MH01020P','3MQ01021P','3MP01022P','3MH01023P','3MX01024P','3MX01025P','3MX01026P',
'3MX01027P','3MW01028P','3MH01029P','3MH01030P','3MH01031P','3MP01032P','3MH01033P','3MH01034P','3MW01035P','3MP01036P','3MX01037P','3MX01038P','3MX01039P','3MX01040P','3MX01041P',
'3MX01042P','3MH01043P','3MH01044P','3MH01045P','3MH01046P','3MH01047P','3MH01048P','3MX00775P','3MX00776P')
";
//已發貨
// $sql_out_warehouse = "SELECT B.MaterialId FROM stkWareHouseIn AS A
// LEFT JOIN stkWareHouseInDetail AS B ON A.BillNo=B.BillNo
// WHERE A.IOProperty = 0
// AND B.MaterialId IN $all
// AND B.ItemType =0";
// $query_out_warehouse = $conn->query($sql_out_warehouse);
// foreach ($query_out_warehouse as $row) {
// echo $row['MaterialId'] . "<br>";
// }
//有庫存與多少
// $sql_in_warehouse = "SELECT MaterialId, Quantity FROM stkWareHouseAccountDetail WHERE MaterialId IN $all AND Quantity >0";
// $query_in_warehouse = $conn->query($sql_in_warehouse);
// foreach ($query_in_warehouse as $row) {
// echo $row['MaterialId'] . ", " . $row['Quantity'] . "<br>";
// }
//有無組裝申請單
// $sql_assemble = "SELECT * FROM stkAssyMast WHERE MaterialId IN $all";
// $query_assemble = $conn->query($sql_assemble);
// foreach ($query_assemble as $row) {
// echo $row['MaterialId'].";" .$row['BillNo']. "<br>";
// }
//p 有庫存
// $sql_p_in_warehouse = "SELECT MaterialId, Quantity FROM stkWareHouseAccountDetail WHERE MaterialId IN $P_all AND Quantity >0";
// $query_p_in_warehouse = $conn->query($sql_p_in_warehouse);
// foreach ($query_p_in_warehouse as $row) {
// echo substr($row['MaterialId'],0,-1).";".$row['Quantity']."<br>";
// }
//P 收貨單號
// $sql_reveive = "SELECT BillNo, MaterialId, ReceivingSQty FROM purReceivingOrderDetail WHERE MaterialId IN $P_all";
// $query_reveive = $conn->query($sql_reveive);
// foreach ($query_reveive as $row) {
// echo substr($row['MaterialId'],0,-1) . ";".$row['BillNo'] .";". $row['ReceivingSQty'] . "<br>";
// }
// P 採購單號
// $sql_purBill = "SELECT * FROM purBillOrderDetail WHERE MaterialId IN $P_all";
// $query_purBill = $conn->query($sql_purBill);
// foreach ($query_purBill as $row) {
// echo substr($row['MaterialId'],0,-1) . ";" . $row['BillNo'] . "<br>";
// }
//貨抵工地的作番
// $sql_arrive = "SELECT `contractno`,`facilityno`,`real_arrival_date` FROM `wipwholestatus`
// WHERE (real_arrival_date IS NOT NULL) AND (real_arrival_date !='')
// AND facilityno IN $all
// AND contract_type='A'";
// $query_arrive = mysqli_query($link, $sql_arrive);
// foreach ($query_arrive as $key => $value) {
// echo $value['facilityno']. ";" . $value['real_arrival_date'] . "<br>";
// }
//實際到貨日期
// $sql_arrive = "SELECT `contractno`,`facilityno`,`actual_tofactory_date` FROM `wipwholestatus`
// WHERE (actual_tofactory_date IS NOT NULL) AND (actual_tofactory_date !='')
// AND facilityno IN $all
// AND contract_type='A'";
// $query_arrive = mysqli_query($link, $sql_arrive);
// foreach ($query_arrive as $key => $value) {
// echo $value['facilityno']. ";" . $value['actual_tofactory_date'] . "<br>";
// }
//找T8銷售訂單 所有設備跟安裝款的平均價格
$sql_paystage = "SELECT A.PayStage, A.BillNo FROM salOrderStagePay AS A
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo WHERE s.ModeId = 'T' AND (s.CurrentState=2 OR s.CurrentState=4)";
$query_paystage = $conn->query($sql_paystage);
foreach($query_paystage as $key => $value) {
echo $value['PayStage'] .";".$value['BillNo']. "<br>";
}

BIN
wms/account-receivable-test.xlsx

Binary file not shown.

27595
wms/account_receivable_sql_file.sql

File diff suppressed because it is too large

BIN
wms/assemble_warehouse.xlsx

Binary file not shown.

2
wms/cont/MSCalculator.php

@ -33,7 +33,7 @@ class MSCalculator
$maintain_times = $item['maintain_times'];
$sql_get_price = "
select
SELECT
elevator_type,
base_price,
floors_price,

21
wms/cont/apply_form.php

@ -244,14 +244,17 @@ if ($result['department_id'] == '511') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '512') {
$managerid = 'M0137';
$managername = '劉永德';
$managerid = 'M0054';
$managername = '陳志文';
} else if ($result['department_id'] == '513') {
$managerid = 'M0086';
$managername = '李烘銘';
} else if ($result['department_id'] == '514') {
$managerid = 'M0033';
$managername = '吳育宗';
} else if ($user_id == 'TEST01') {
$managerid = 'TEST04';
$managername = '區經理';
}
if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' || $result['department_id'] == 'M0033') {
@ -277,9 +280,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
<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>
<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); ?>" />
<script type="text/javascript">
window.param = {
@ -385,7 +386,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
$('#reg_del').val(regDelStr);
});
});
addRow = function() {
const addRow = function() {
if ($('#maintain_kind').val() == "") {
alert("請選擇保養方式!");
$('#maintain_kind').eq(0).focus();
@ -480,7 +481,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
});
}
delRow = function(btn) {
const delRow = function(btn) {
if ($(btn).attr('name') == 'btn1') {
//console.log($(btn).parent().parent().prev('tr').find('input[id=register_code]').val());
regDelStr += $(btn).parent().parent().find('input[id=register_code]').val() + ",";
@ -492,7 +493,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
}
$(btn).parent().parent().remove();
}
setStandPrice = function(p, obj) {
const setStandPrice = function(p, obj) {
$.ajax({
url: '../cont/t.php',
data: p,
@ -528,7 +529,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
});
}
addNewBrand = function() {
const addNewBrand = function() {
var new_brand = $("#new_brand").val();
if (new_brand != '') {
p = {
@ -659,7 +660,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
</td>
</tr>
<tr>
<td colspan='18' ;><button onClick='addRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
<td colspan='18'><button onClick='addRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
</tr>
<!-- <tr style='margin-top:0px;text-align:center'> -->
<?php

370
wms/cont/sign_list.php

@ -3,34 +3,77 @@ require_once "../header.php";
// 載入db.php來連結資料庫
$table = 'con_maintance_examine_apply';
$para = "function_name=pricereview&" . $token_link;
// 待我簽核進入
if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) {
$system_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['system_id'] : @$_POST['system_id'];
$where_system_id = " and a.system_id like '" . $system_id . "%'";
$flow_id = $_SERVER['REQUEST_METHOD'] == 'GET' ? @$_GET['flow_id'] : @$_POST['flow_id'];
$where_flow_id = " and b.flow_id like '" . $flow_id . "%'";
$sql_get = "SELECT d.form_id,c.form_key, a.system_id,b.flow_id ,a.system_name,c.current_assigner,
concat(c.current_assigner ,'-',f_return_name(c.current_assigner)) current_assigner_name ,
flow_name,c.update_date ,c.create_date,b.path,d.flow_code FROM system_main a,flow_main b ,subflow
c,flow d
WHERE a.system_id=b.system_id
AND b.flow_id=d.flow_id
AND c.current_assigner='$user_id'
AND d.flow_id=b.flow_id
AND c.form_key=d.form_key
$where_system_id
$where_flow_id
";
// echo '<pre>';
// print_r($sql_get);
// echo '</pre>';
$result = mysqli_query($link, $sql_get);
if ($result == false) {
die(mysqli_error($link));
}
$res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC);
$status_arr = ["Y1" => "暫存", "YS" => "簽核中", "YY" => "結案同意", "YN" => "結案不同意"];
#可編輯的列
// $editableColumn = [
// 'apply_key' => [
// 'label' => "評審單號", "value" => "", "tag" => 'text',
// 'attr' => [
// 'readonly=true ',
// 'class' => 'form-control form-control-sm'
// ]
// ],
// 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']],
// 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
// 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
// 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
// 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
// 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
// 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
// //'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt],
foreach ($res_get as $key => $data) {
// 結案隱藏
if ($data['flow_code'] !== 'Z') {
$test = $data['form_key'];
// $sql = "SELECT mid FROM pricereview_sign WHERE id = $test";
// $result = mysqli_fetch_all(mysqli_query($link, $sql), MYSQLI_ASSOC);
// echo '<pre>';
// print_r($result);
// echo '</pre>';
$id[] = $test;
}
}
$inClause = implode(',', $id);
}
// ];
#可編輯的列
$editableColumn = [
'apply_key' => [
'label' => "評審單號", "value" => "", "tag" => 'text',
'attr' => [
'readonly=true ',
'class' => 'form-control form-control-sm'
]
],
'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']],
'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
//'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt],
];
// 設置一個空陣列來放資料
$data = array();
@ -45,7 +88,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" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "M0225") $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 = [];
@ -55,32 +98,49 @@ while ($row = mysqli_fetch_row($res)) {
$elevator_brand_arr[$row[0]] = $row[1];
}
mysqli_free_result($res);
$sql = "SELECT
apply_key,
vol_no,
address,
case_name,
brand ,
num ,
salesman as salesman_id,
f_return_name(salesman) salesman,
f_return_content('maintain_kind',maintain_kind ) maintain_kind,
date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date,
date_format(contract_end_date,'%Y/%m/%d') contract_end_date ,
f_return_content('contract_kind',contract_kind ) contract_kind,
platform_company,
platforom_company_tel,
form_key,
status,
f_return_content('payment_kind',payment_kind ) payment_kind FROM $table
where 1=1 $where ORDER BY vol_no";
if (!empty($res_get)) {
$sql = "SELECT
apply_key,
vol_no,
address,
case_name,
brand ,
num ,
f_return_name(salesman) salesman,
f_return_content('maintain_kind',maintain_kind ) maintain_kind,
date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date,
date_format(contract_end_date,'%Y/%m/%d') contract_end_date ,
f_return_content('contract_kind',contract_kind ) contract_kind,
platform_company,
platforom_company_tel,
form_key,
f_return_content('payment_kind',payment_kind ) payment_kind FROM $table WHERE form_key IN ($inClause) ";
} else {
$sql = "SELECT
apply_key,
vol_no,
address,
case_name,
brand ,
num ,
f_return_name(salesman) salesman,
f_return_content('maintain_kind',maintain_kind ) maintain_kind,
date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date,
date_format(contract_end_date,'%Y/%m/%d') contract_end_date ,
f_return_content('contract_kind',contract_kind ) contract_kind,
platform_company,
platforom_company_tel,
form_key,
f_return_content('payment_kind',payment_kind ) payment_kind FROM $table
where 1=1 $where ORDER BY vol_no";
}
// echo $sql;
$data = mysqli_query($link, $sql);
// echo '<pre>';
// print_r($sql);
// print_r($data);
// echo '</pre>';
?>
<?php
@ -96,175 +156,59 @@ if ($data) :
}
?>
<!-- <link rel="stylesheet" href="common.css"> -->
<style>
#table_index2 {
table-layout: fixed;
width: 100%;
}
#table_index2_filter {
float: right;
}
#table_index2_paginate {
float: right;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
border-bottom-width: 0;
}
div.dataTables_scrollBody table.dataTable {
border-top-width: 0;
}
/*
.col-sm-12 {
width: auto;
}
*/
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
div a:hover {
text-decoration: none;
}
.btn-sm {
font-size: 14px;
margin: 2px 0;
line-height: 90%;
}
.glyphicon-ok,
.glyphicon-ban-circle {
font-size: 130%;
}
.btn-secondary {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
<link rel="stylesheet" href="common.css">
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
.applybtn {
color: #fff;
background-color: #1484c4;
display: block;
border-radius: 4px;
padding: 4px 2px;
font-size: 13px;
<div style="overflow-x:auto;">
<form method='get' action='#'>
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'>
<thead>
<tr>
<td colspan="8">
<h3 style='text-align:center'>(契約)價審單查詢</h3>
</td>
</tr>
}
</thead>
</table>
<table id="table_index" class="table table-striped table-bordered" style="width:98%">
<thead>
<?php
echo "<tr>";
foreach ($editableColumn as $key => $val) {
echo "<th>" . $val['label'] . "</th>";
}
echo "<th>是否結案</th>";
// echo "<th>刪除</th>";
echo "</tr>";
?>
</thead>
<tbody>
<?php foreach ($data as $row) : ?>
<tr>
<?php
foreach ($editableColumn as $key => $val) {
if ($key == 'apply_key') {
echo "<td> <a href='query_form.php?apply_key=$row[$key]&token=" . $_GET['token'] . "'>" . $row[$key] . "</td>";
} elseif ($key == 'brand') {
echo "<td>" . (!empty($row[$key]) ? $elevator_brand_arr[$row[$key]] : "") . "</td>";
} else {
echo "<td>" . $row[$key] . "</td>";
}
}
//list($signer)=DB::fields(");
//echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ."
list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'"));
.applybtn:hover {
background-color: #1494f9;
color: #fff;
}
</style>
<script>
$(function() {
$('#table_index2').DataTable({
"scrollX": true,
"pageLength": 50
});
/*
var api = $('#table_index').dataTable().api();
//var order = api.order();
//console.log(order);
api
.order([0, "desc"])
.draw();
*/
});
</script>
<link rel="stylesheet" href="../crm/common.css">
echo "<td>" . (empty($signer) ? "結案" : "N") . "</td>";
<div style="overflow-x:auto; white-space:nowrap;">
<table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead>
<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>
</tr>
</thead>
<tbody>
<?php foreach ($data as $row) :
$oneself = ($row['salesman'] == $user_id) ? 1 : 0;
?>
<tr>
<td><a href="query_form.php?apply_key=<?= $row['apply_key'] ?>&token=<?= $_GET['token'] ?>"><?= $row['apply_key'] ?></a></td>
<td><?php echo $row['vol_no'] ?></td>
<td><?php echo $row['address'] ?></td>
<td><?php echo $row['case_name'] ?></td>
<td><?php echo $row['brand'] ?></td>
<td><?php echo $row['num'] ?></td>
<td><?php echo $row['salesman'] ?></td>
<td><?php echo $row['maintain_kindd'] ?></td>
<td><?php echo $row['contract_begin_date'] ?></td>
<td><?php echo $row['contract_end_date'] ?></td>
<td><?php echo $row['contract_kind'] ?></td>
<td><?php echo $row['platform_company'] ?></td>
<td><?php echo $row['platforom_company_tel'] ?></td>
?>
<?php list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); ?>
<td><?php echo empty($signer) ? '結案' : 'N' ?></td>
<td>
<a class="applybtn" href="../contract-repair/contract_maintance.php?apply_key=<?php echo $row['apply_key'] . '&' . $para; ?>">
<?php if (($row['status'] == 'YY' && $oneself)) {
echo '申請';
} else {
echo '檢視';
} ?>
</a>
<?php if ($row['status'] == 'YY' && ($user_id == "M0060" || $user_id == "M0107" || $user_id == "M0174" || $user_id == 'M0225') && $row['applystatus'] == 1) : ?>
<a class="applybtn" href="../contract-repaire/contract_maintance.php?id=<?php echo $row['id'] . '&' . $para; ?>">待簽核</a><br>
<?php endif; ?>
<?php if ($row['status'] != 'Y1') : ?>
<span style="font-size:13px;font-weight:600">--</span>
<?php endif; ?>
<?php if (($row['status'] === 'YY' && $row['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<a class="applybtn" href="../contract-repair/contract-download.php?apply_key=<?php echo $row['apply_key'] . '&' . $para ?>">下載</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php

13
wms/contract-repair/api/bpmAPI.php

@ -0,0 +1,13 @@
<?php
require_once("../conn.php");
$sql = "SELECT * FROM account WHERE accountid = 'M0225'";
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r(json_encode($result));
// echo '</pre>';
return json_encode($result);

55
wms/contract-repair/insertFacility.php

@ -0,0 +1,55 @@
<?php
require('./conn.php');
require 'vendor/autoload.php';
ini_set('data.timezone', 'Asia/Taipei');
use PhpOffice\PhpSpreadsheet\IOFactory;
$filePath = './facility/facility.xlsx';
try {
$spreadsheet = IOFactory::load($filePath);
} catch (\PhpOffice\PhpSpreadsheet\Reader\Exception $e) {
die('Error loading file:' . $e->getMessage());
}
$sheet = $spreadsheet->getActiveSheet();
$create_at = date("Y-m-d H:i:s");
$sql = "INSERT INTO facility_price (kind,model,seat,numberofstop,speed,price,price_mi,status,create_dt) VALUES(:kind,:model,:seat,:numberofstop,:speed,:price,:price_mi,:status,:create_dt)";
// 遍歷表中的每一行
foreach ($sheet->getRowIterator() as $key => $row) {
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(false);
foreach ($cellIterator as $idx => $value) {
if ($value !== null) {
if ($idx == 'A') {
$model = $value->getValue();
if ($model != '規格') {
// 字串分離
$model_arr = explode('-', $model);
// 抓出樓層
$speed = explode('*', $model_arr[1]);
for ($i = 7; $i <= 30; $i++) {
$speed[1] = $i;
$speed_arr[] = $speed;
}
for ($i = 6; $i >= 2; $i--) {
$speed[1] = $i;
$speed_arr[] = $speed;
}
}
}
if ($idx == 'B') {
$price = $value->getValue();
if ($price !== '標準價') {
$price = $price * 10000;
}
}
if ($idx == 'C') {
}
}
}
}

25
wms/contract-repair/vendor/autoload.php

@ -0,0 +1,25 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitb1a92901072bcf21e948dd2e6e6b9766::getLoader();

579
wms/contract-repair/vendor/composer/ClassLoader.php

@ -0,0 +1,579 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

359
wms/contract-repair/vendor/composer/InstalledVersions.php

@ -0,0 +1,359 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}
}

21
wms/contract-repair/vendor/composer/LICENSE

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

24
wms/contract-repair/vendor/composer/autoload_classmap.php

@ -0,0 +1,24 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Datamatrix' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
'TCPDF' => $vendorDir . '/tecnickcom/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
'TCPDFBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
'TCPDF_COLORS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
'TCPDF_FILTERS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
'TCPDF_FONTS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
'TCPDF_FONT_DATA' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
'TCPDF_IMAGES' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_images.php',
'TCPDF_IMPORT' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_import.php',
'TCPDF_PARSER' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_parser.php',
'TCPDF_STATIC' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_static.php',
);

10
wms/contract-repair/vendor/composer/autoload_files.php

@ -0,0 +1,10 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
);

10
wms/contract-repair/vendor/composer/autoload_namespaces.php

@ -0,0 +1,10 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
);

17
wms/contract-repair/vendor/composer/autoload_psr4.php

@ -0,0 +1,17 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
'Lo2330\\Contract\\' => array($baseDir . '/src'),
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
);

50
wms/contract-repair/vendor/composer/autoload_real.php

@ -0,0 +1,50 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitb1a92901072bcf21e948dd2e6e6b9766
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInitb1a92901072bcf21e948dd2e6e6b9766', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitb1a92901072bcf21e948dd2e6e6b9766', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}

113
wms/contract-repair/vendor/composer/autoload_static.php

@ -0,0 +1,113 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766
{
public static $files = array (
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
);
public static $prefixLengthsPsr4 = array (
'Z' =>
array (
'ZipStream\\' => 10,
),
'P' =>
array (
'Psr\\SimpleCache\\' => 16,
'Psr\\Http\\Message\\' => 17,
'Psr\\Http\\Client\\' => 16,
'PhpOffice\\PhpSpreadsheet\\' => 25,
),
'M' =>
array (
'Matrix\\' => 7,
),
'L' =>
array (
'Lo2330\\Contract\\' => 16,
),
'C' =>
array (
'Complex\\' => 8,
),
);
public static $prefixDirsPsr4 = array (
'ZipStream\\' =>
array (
0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-message/src',
1 => __DIR__ . '/..' . '/psr/http-factory/src',
),
'Psr\\Http\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-client/src',
),
'PhpOffice\\PhpSpreadsheet\\' =>
array (
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
),
'Matrix\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
),
'Lo2330\\Contract\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
'Complex\\' =>
array (
0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
),
);
public static $prefixesPsr0 = array (
'H' =>
array (
'HTMLPurifier' =>
array (
0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
),
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Datamatrix' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
'TCPDF' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf.php',
'TCPDF2DBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
'TCPDFBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
'TCPDF_COLORS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
'TCPDF_FILTERS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
'TCPDF_FONTS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
'TCPDF_FONT_DATA' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
'TCPDF_IMAGES' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_images.php',
'TCPDF_IMPORT' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_import.php',
'TCPDF_PARSER' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_parser.php',
'TCPDF_STATIC' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_static.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::$prefixesPsr0;
$loader->classMap = ComposerStaticInitb1a92901072bcf21e948dd2e6e6b9766::$classMap;
}, null, ClassLoader::class);
}
}

673
wms/contract-repair/vendor/composer/installed.json

@ -0,0 +1,673 @@
{
"packages": [
{
"name": "ezyang/htmlpurifier",
"version": "v4.17.0",
"version_normalized": "4.17.0.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c",
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"time": "2023-11-17T15:01:25+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0"
},
"install-path": "../ezyang/htmlpurifier"
},
{
"name": "maennchen/zipstream-php",
"version": "3.1.0",
"version_normalized": "3.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.1"
},
"require-dev": {
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^10.0",
"vimeo/psalm": "^5.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
"psr/http-message": "^2.0"
},
"time": "2023-06-21T14:59:35+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
},
{
"url": "https://opencollective.com/zipstream",
"type": "open_collective"
}
],
"install-path": "../maennchen/zipstream-php"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"version_normalized": "3.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"time": "2022-12-06T16:21:08+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"install-path": "../markbaker/complex"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"version_normalized": "3.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"time": "2022-12-02T22:17:43+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"install-path": "../markbaker/matrix"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0",
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1 || ^3.0",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": "^7.4 || ^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"time": "2023-06-14T22:48:31+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0"
},
"install-path": "../phpoffice/phpspreadsheet"
},
{
"name": "psr/http-client",
"version": "1.0.3",
"version_normalized": "1.0.3.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0 || ^2.0"
},
"time": "2023-09-23T14:17:50+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
"homepage": "https://github.com/php-fig/http-client",
"keywords": [
"http",
"http-client",
"psr",
"psr-18"
],
"support": {
"source": "https://github.com/php-fig/http-client"
},
"install-path": "../psr/http-client"
},
{
"name": "psr/http-factory",
"version": "1.0.2",
"version_normalized": "1.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "e616d01114759c4c489f93b099585439f795fe35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
"reference": "e616d01114759c4c489f93b099585439f795fe35",
"shasum": ""
},
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0 || ^2.0"
},
"time": "2023-04-10T20:10:41+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
},
"install-path": "../psr/http-factory"
},
{
"name": "psr/http-message",
"version": "2.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"time": "2023-04-04T09:54:51+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"install-path": "../psr/http-message"
},
{
"name": "psr/simple-cache",
"version": "3.0.0",
"version_normalized": "3.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"time": "2021-10-29T13:26:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"support": {
"source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
},
"install-path": "../psr/simple-cache"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.6.5",
"version_normalized": "6.6.5.0",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/5fce932fcee4371865314ab7f6c0d85423c5c7ce",
"reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2023-09-06T15:09:26+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"support": {
"issues": "https://github.com/tecnickcom/TCPDF/issues",
"source": "https://github.com/tecnickcom/TCPDF/tree/6.6.5"
},
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project",
"type": "custom"
}
],
"install-path": "../tecnickcom/tcpdf"
}
],
"dev": true,
"dev-package-names": []
}

113
wms/contract-repair/vendor/composer/installed.php

@ -0,0 +1,113 @@
<?php return array(
'root' => array(
'name' => 'lo2330/contract',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '2ccb0f743f7d057dcf2554b72d1ab1e3880821c2',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'ezyang/htmlpurifier' => array(
'pretty_version' => 'v4.17.0',
'version' => '4.17.0.0',
'reference' => 'bbc513d79acf6691fa9cf10f192c90dd2957f18c',
'type' => 'library',
'install_path' => __DIR__ . '/../ezyang/htmlpurifier',
'aliases' => array(),
'dev_requirement' => false,
),
'lo2330/contract' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '2ccb0f743f7d057dcf2554b72d1ab1e3880821c2',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'maennchen/zipstream-php' => array(
'pretty_version' => '3.1.0',
'version' => '3.1.0.0',
'reference' => 'b8174494eda667f7d13876b4a7bfef0f62a7c0d1',
'type' => 'library',
'install_path' => __DIR__ . '/../maennchen/zipstream-php',
'aliases' => array(),
'dev_requirement' => false,
),
'markbaker/complex' => array(
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/complex',
'aliases' => array(),
'dev_requirement' => false,
),
'markbaker/matrix' => array(
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
'reference' => '728434227fe21be27ff6d86621a1b13107a2562c',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/matrix',
'aliases' => array(),
'dev_requirement' => false,
),
'phpoffice/phpspreadsheet' => array(
'pretty_version' => '1.29.0',
'version' => '1.29.0.0',
'reference' => 'fde2ccf55eaef7e86021ff1acce26479160a0fa0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-client' => array(
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-factory' => array(
'pretty_version' => '1.0.2',
'version' => '1.0.2.0',
'reference' => 'e616d01114759c4c489f93b099585439f795fe35',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/http-message' => array(
'pretty_version' => '2.0',
'version' => '2.0.0.0',
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
'dev_requirement' => false,
),
'psr/simple-cache' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/simple-cache',
'aliases' => array(),
'dev_requirement' => false,
),
'tecnickcom/tcpdf' => array(
'pretty_version' => '6.6.5',
'version' => '6.6.5.0',
'reference' => '5fce932fcee4371865314ab7f6c0d85423c5c7ce',
'type' => 'library',
'install_path' => __DIR__ . '/../tecnickcom/tcpdf',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

30
wms/contract-repair/vendor/composer/platform_check.php

@ -0,0 +1,30 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 80100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}
if (PHP_INT_SIZE !== 8) {
$issues[] = 'Your Composer dependencies require a 64-bit build of PHP.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

9
wms/contract-repair/vendor/ezyang/htmlpurifier/CREDITS

@ -0,0 +1,9 @@
CREDITS
Almost everything written by Edward Z. Yang (Ambush Commander). Lots of thanks
to the DevNetwork Community for their help (see docs/ref-devnetwork.html for
more details), Feyd especially (namely IPv6 and optimization). Thanks to RSnake
for letting me package his fantastic XSS cheatsheet for a smoketest.
vim: et sw=4 sts=4

504
wms/contract-repair/vendor/ezyang/htmlpurifier/LICENSE

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
vim: et sw=4 sts=4

29
wms/contract-repair/vendor/ezyang/htmlpurifier/README.md

@ -0,0 +1,29 @@
HTML Purifier [![Build Status](https://github.com/ezyang/htmlpurifier/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/ezyang/htmlpurifier/actions/workflows/ci.yml)
=============
HTML Purifier is an HTML filtering solution that uses a unique combination
of robust whitelists and aggressive parsing to ensure that not only are
XSS attacks thwarted, but the resulting HTML is standards compliant.
HTML Purifier is oriented towards richly formatted documents from
untrusted sources that require CSS and a full tag-set. This library can
be configured to accept a more restrictive set of tags, but it won't be
as efficient as more bare-bones parsers. It will, however, do the job
right, which may be more important.
Places to go:
* See INSTALL for a quick installation guide
* See docs/ for developer-oriented documentation, code examples and
an in-depth installation guide.
* See WYSIWYG for information on editors like TinyMCE and FCKeditor
HTML Purifier can be found on the web at: [http://htmlpurifier.org/](http://htmlpurifier.org/)
## Installation
Package available on [Composer](https://packagist.org/packages/ezyang/htmlpurifier).
If you're using Composer to manage dependencies, you can use
$ composer require ezyang/htmlpurifier

1
wms/contract-repair/vendor/ezyang/htmlpurifier/VERSION

@ -0,0 +1 @@
4.17.0

45
wms/contract-repair/vendor/ezyang/htmlpurifier/composer.json

@ -0,0 +1,45 @@
{
"name": "ezyang/htmlpurifier",
"description": "Standards compliant HTML filter written in PHP",
"type": "library",
"keywords": ["html"],
"homepage": "http://htmlpurifier.org/",
"license": "LGPL-2.1-or-later",
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"autoload": {
"psr-0": { "HTMLPurifier": "library/" },
"files": ["library/HTMLPurifier.composer.php"],
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-tidy": "Used for pretty-printing HTML"
},
"config": {
"sort-packages": true
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ezyang/simpletest.git",
"no-api": true
}
]
}

11
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php

@ -0,0 +1,11 @@
<?php
/**
* This is a stub include that automatically configures the include path.
*/
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() );
require_once 'HTMLPurifier/Bootstrap.php';
require_once 'HTMLPurifier.autoload.php';
// vim: et sw=4 sts=4

14
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload-legacy.php

@ -0,0 +1,14 @@
<?php
/**
* @file
* Legacy autoloader for systems lacking spl_autoload_register
*
*/
spl_autoload_register(function($class)
{
return HTMLPurifier_Bootstrap::autoload($class);
});
// vim: et sw=4 sts=4

25
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php

@ -0,0 +1,25 @@
<?php
/**
* @file
* Convenience file that registers autoload handler for HTML Purifier.
* It also does some sanity checks.
*/
if (function_exists('spl_autoload_register') && function_exists('spl_autoload_unregister')) {
// We need unregister for our pre-registering functionality
HTMLPurifier_Bootstrap::registerAutoload();
if (function_exists('__autoload')) {
// Be polite and ensure that userland autoload gets retained
spl_autoload_register('__autoload');
}
} elseif (!function_exists('__autoload')) {
require dirname(__FILE__) . '/HTMLPurifier.autoload-legacy.php';
}
// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.zend_ze1_compatibility_modeRemoved
if (ini_get('zend.ze1_compatibility_mode')) {
trigger_error("HTML Purifier is not compatible with zend.ze1_compatibility_mode; please turn it off", E_USER_ERROR);
}
// vim: et sw=4 sts=4

4
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php

@ -0,0 +1,4 @@
<?php
if (!defined('HTMLPURIFIER_PREFIX')) {
define('HTMLPURIFIER_PREFIX', dirname(__FILE__));
}

25
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php

@ -0,0 +1,25 @@
<?php
/**
* @file
* Defines a function wrapper for HTML Purifier for quick use.
* @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
*/
/**
* Purify HTML.
* @param string $html String HTML to purify
* @param mixed $config Configuration to use, can be any value accepted by
* HTMLPurifier_Config::create()
* @return string
*/
function HTMLPurifier($html, $config = null)
{
static $purifier = false;
if (!$purifier) {
$purifier = new HTMLPurifier();
}
return $purifier->purify($html, $config);
}
// vim: et sw=4 sts=4

235
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php

@ -0,0 +1,235 @@
<?php
/**
* @file
* This file was auto-generated by generate-includes.php and includes all of
* the core files required by HTML Purifier. Use this if performance is a
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
* FILE, changes will be overwritten the next time the script is run.
*
* @version 4.17.0
*
* @warning
* You must *not* include any other HTML Purifier files before this file,
* because 'require' not 'require_once' is used.
*
* @warning
* This file requires that the include path contains the HTML Purifier
* library directory; this is not auto-set.
*/
require 'HTMLPurifier.php';
require 'HTMLPurifier/Arborize.php';
require 'HTMLPurifier/AttrCollections.php';
require 'HTMLPurifier/AttrDef.php';
require 'HTMLPurifier/AttrTransform.php';
require 'HTMLPurifier/AttrTypes.php';
require 'HTMLPurifier/AttrValidator.php';
require 'HTMLPurifier/Bootstrap.php';
require 'HTMLPurifier/Definition.php';
require 'HTMLPurifier/CSSDefinition.php';
require 'HTMLPurifier/ChildDef.php';
require 'HTMLPurifier/Config.php';
require 'HTMLPurifier/ConfigSchema.php';
require 'HTMLPurifier/ContentSets.php';
require 'HTMLPurifier/Context.php';
require 'HTMLPurifier/DefinitionCache.php';
require 'HTMLPurifier/DefinitionCacheFactory.php';
require 'HTMLPurifier/Doctype.php';
require 'HTMLPurifier/DoctypeRegistry.php';
require 'HTMLPurifier/ElementDef.php';
require 'HTMLPurifier/Encoder.php';
require 'HTMLPurifier/EntityLookup.php';
require 'HTMLPurifier/EntityParser.php';
require 'HTMLPurifier/ErrorCollector.php';
require 'HTMLPurifier/ErrorStruct.php';
require 'HTMLPurifier/Exception.php';
require 'HTMLPurifier/Filter.php';
require 'HTMLPurifier/Generator.php';
require 'HTMLPurifier/HTMLDefinition.php';
require 'HTMLPurifier/HTMLModule.php';
require 'HTMLPurifier/HTMLModuleManager.php';
require 'HTMLPurifier/IDAccumulator.php';
require 'HTMLPurifier/Injector.php';
require 'HTMLPurifier/Language.php';
require 'HTMLPurifier/LanguageFactory.php';
require 'HTMLPurifier/Length.php';
require 'HTMLPurifier/Lexer.php';
require 'HTMLPurifier/Node.php';
require 'HTMLPurifier/PercentEncoder.php';
require 'HTMLPurifier/PropertyList.php';
require 'HTMLPurifier/PropertyListIterator.php';
require 'HTMLPurifier/Queue.php';
require 'HTMLPurifier/Strategy.php';
require 'HTMLPurifier/StringHash.php';
require 'HTMLPurifier/StringHashParser.php';
require 'HTMLPurifier/TagTransform.php';
require 'HTMLPurifier/Token.php';
require 'HTMLPurifier/TokenFactory.php';
require 'HTMLPurifier/URI.php';
require 'HTMLPurifier/URIDefinition.php';
require 'HTMLPurifier/URIFilter.php';
require 'HTMLPurifier/URIParser.php';
require 'HTMLPurifier/URIScheme.php';
require 'HTMLPurifier/URISchemeRegistry.php';
require 'HTMLPurifier/UnitConverter.php';
require 'HTMLPurifier/VarParser.php';
require 'HTMLPurifier/VarParserException.php';
require 'HTMLPurifier/Zipper.php';
require 'HTMLPurifier/AttrDef/CSS.php';
require 'HTMLPurifier/AttrDef/Clone.php';
require 'HTMLPurifier/AttrDef/Enum.php';
require 'HTMLPurifier/AttrDef/Integer.php';
require 'HTMLPurifier/AttrDef/Lang.php';
require 'HTMLPurifier/AttrDef/Switch.php';
require 'HTMLPurifier/AttrDef/Text.php';
require 'HTMLPurifier/AttrDef/URI.php';
require 'HTMLPurifier/AttrDef/CSS/Number.php';
require 'HTMLPurifier/AttrDef/CSS/AlphaValue.php';
require 'HTMLPurifier/AttrDef/CSS/Background.php';
require 'HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
require 'HTMLPurifier/AttrDef/CSS/Border.php';
require 'HTMLPurifier/AttrDef/CSS/Color.php';
require 'HTMLPurifier/AttrDef/CSS/Composite.php';
require 'HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
require 'HTMLPurifier/AttrDef/CSS/Filter.php';
require 'HTMLPurifier/AttrDef/CSS/Font.php';
require 'HTMLPurifier/AttrDef/CSS/FontFamily.php';
require 'HTMLPurifier/AttrDef/CSS/Ident.php';
require 'HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
require 'HTMLPurifier/AttrDef/CSS/Length.php';
require 'HTMLPurifier/AttrDef/CSS/ListStyle.php';
require 'HTMLPurifier/AttrDef/CSS/Multiple.php';
require 'HTMLPurifier/AttrDef/CSS/Percentage.php';
require 'HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require 'HTMLPurifier/AttrDef/CSS/URI.php';
require 'HTMLPurifier/AttrDef/HTML/Bool.php';
require 'HTMLPurifier/AttrDef/HTML/Nmtokens.php';
require 'HTMLPurifier/AttrDef/HTML/Class.php';
require 'HTMLPurifier/AttrDef/HTML/Color.php';
require 'HTMLPurifier/AttrDef/HTML/ContentEditable.php';
require 'HTMLPurifier/AttrDef/HTML/FrameTarget.php';
require 'HTMLPurifier/AttrDef/HTML/ID.php';
require 'HTMLPurifier/AttrDef/HTML/Pixels.php';
require 'HTMLPurifier/AttrDef/HTML/Length.php';
require 'HTMLPurifier/AttrDef/HTML/LinkTypes.php';
require 'HTMLPurifier/AttrDef/HTML/MultiLength.php';
require 'HTMLPurifier/AttrDef/URI/Email.php';
require 'HTMLPurifier/AttrDef/URI/Host.php';
require 'HTMLPurifier/AttrDef/URI/IPv4.php';
require 'HTMLPurifier/AttrDef/URI/IPv6.php';
require 'HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
require 'HTMLPurifier/AttrTransform/Background.php';
require 'HTMLPurifier/AttrTransform/BdoDir.php';
require 'HTMLPurifier/AttrTransform/BgColor.php';
require 'HTMLPurifier/AttrTransform/BoolToCSS.php';
require 'HTMLPurifier/AttrTransform/Border.php';
require 'HTMLPurifier/AttrTransform/EnumToCSS.php';
require 'HTMLPurifier/AttrTransform/ImgRequired.php';
require 'HTMLPurifier/AttrTransform/ImgSpace.php';
require 'HTMLPurifier/AttrTransform/Input.php';
require 'HTMLPurifier/AttrTransform/Lang.php';
require 'HTMLPurifier/AttrTransform/Length.php';
require 'HTMLPurifier/AttrTransform/Name.php';
require 'HTMLPurifier/AttrTransform/NameSync.php';
require 'HTMLPurifier/AttrTransform/Nofollow.php';
require 'HTMLPurifier/AttrTransform/SafeEmbed.php';
require 'HTMLPurifier/AttrTransform/SafeObject.php';
require 'HTMLPurifier/AttrTransform/SafeParam.php';
require 'HTMLPurifier/AttrTransform/ScriptRequired.php';
require 'HTMLPurifier/AttrTransform/TargetBlank.php';
require 'HTMLPurifier/AttrTransform/TargetNoopener.php';
require 'HTMLPurifier/AttrTransform/TargetNoreferrer.php';
require 'HTMLPurifier/AttrTransform/Textarea.php';
require 'HTMLPurifier/ChildDef/Chameleon.php';
require 'HTMLPurifier/ChildDef/Custom.php';
require 'HTMLPurifier/ChildDef/Empty.php';
require 'HTMLPurifier/ChildDef/List.php';
require 'HTMLPurifier/ChildDef/Required.php';
require 'HTMLPurifier/ChildDef/Optional.php';
require 'HTMLPurifier/ChildDef/StrictBlockquote.php';
require 'HTMLPurifier/ChildDef/Table.php';
require 'HTMLPurifier/DefinitionCache/Decorator.php';
require 'HTMLPurifier/DefinitionCache/Null.php';
require 'HTMLPurifier/DefinitionCache/Serializer.php';
require 'HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
require 'HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require 'HTMLPurifier/HTMLModule/Bdo.php';
require 'HTMLPurifier/HTMLModule/CommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Edit.php';
require 'HTMLPurifier/HTMLModule/Forms.php';
require 'HTMLPurifier/HTMLModule/Hypertext.php';
require 'HTMLPurifier/HTMLModule/Iframe.php';
require 'HTMLPurifier/HTMLModule/Image.php';
require 'HTMLPurifier/HTMLModule/Legacy.php';
require 'HTMLPurifier/HTMLModule/List.php';
require 'HTMLPurifier/HTMLModule/Name.php';
require 'HTMLPurifier/HTMLModule/Nofollow.php';
require 'HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Object.php';
require 'HTMLPurifier/HTMLModule/Presentation.php';
require 'HTMLPurifier/HTMLModule/Proprietary.php';
require 'HTMLPurifier/HTMLModule/Ruby.php';
require 'HTMLPurifier/HTMLModule/SafeEmbed.php';
require 'HTMLPurifier/HTMLModule/SafeObject.php';
require 'HTMLPurifier/HTMLModule/SafeScripting.php';
require 'HTMLPurifier/HTMLModule/Scripting.php';
require 'HTMLPurifier/HTMLModule/StyleAttribute.php';
require 'HTMLPurifier/HTMLModule/Tables.php';
require 'HTMLPurifier/HTMLModule/Target.php';
require 'HTMLPurifier/HTMLModule/TargetBlank.php';
require 'HTMLPurifier/HTMLModule/TargetNoopener.php';
require 'HTMLPurifier/HTMLModule/TargetNoreferrer.php';
require 'HTMLPurifier/HTMLModule/Text.php';
require 'HTMLPurifier/HTMLModule/Tidy.php';
require 'HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Tidy/Name.php';
require 'HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
require 'HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
require 'HTMLPurifier/HTMLModule/Tidy/Strict.php';
require 'HTMLPurifier/HTMLModule/Tidy/Transitional.php';
require 'HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require 'HTMLPurifier/Injector/AutoParagraph.php';
require 'HTMLPurifier/Injector/DisplayLinkURI.php';
require 'HTMLPurifier/Injector/Linkify.php';
require 'HTMLPurifier/Injector/PurifierLinkify.php';
require 'HTMLPurifier/Injector/RemoveEmpty.php';
require 'HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';
require 'HTMLPurifier/Injector/SafeObject.php';
require 'HTMLPurifier/Lexer/DOMLex.php';
require 'HTMLPurifier/Lexer/DirectLex.php';
require 'HTMLPurifier/Node/Comment.php';
require 'HTMLPurifier/Node/Element.php';
require 'HTMLPurifier/Node/Text.php';
require 'HTMLPurifier/Strategy/Composite.php';
require 'HTMLPurifier/Strategy/Core.php';
require 'HTMLPurifier/Strategy/FixNesting.php';
require 'HTMLPurifier/Strategy/MakeWellFormed.php';
require 'HTMLPurifier/Strategy/RemoveForeignElements.php';
require 'HTMLPurifier/Strategy/ValidateAttributes.php';
require 'HTMLPurifier/TagTransform/Font.php';
require 'HTMLPurifier/TagTransform/Simple.php';
require 'HTMLPurifier/Token/Comment.php';
require 'HTMLPurifier/Token/Tag.php';
require 'HTMLPurifier/Token/Empty.php';
require 'HTMLPurifier/Token/End.php';
require 'HTMLPurifier/Token/Start.php';
require 'HTMLPurifier/Token/Text.php';
require 'HTMLPurifier/URIFilter/DisableExternal.php';
require 'HTMLPurifier/URIFilter/DisableExternalResources.php';
require 'HTMLPurifier/URIFilter/DisableResources.php';
require 'HTMLPurifier/URIFilter/HostBlacklist.php';
require 'HTMLPurifier/URIFilter/MakeAbsolute.php';
require 'HTMLPurifier/URIFilter/Munge.php';
require 'HTMLPurifier/URIFilter/SafeIframe.php';
require 'HTMLPurifier/URIScheme/data.php';
require 'HTMLPurifier/URIScheme/file.php';
require 'HTMLPurifier/URIScheme/ftp.php';
require 'HTMLPurifier/URIScheme/http.php';
require 'HTMLPurifier/URIScheme/https.php';
require 'HTMLPurifier/URIScheme/mailto.php';
require 'HTMLPurifier/URIScheme/news.php';
require 'HTMLPurifier/URIScheme/nntp.php';
require 'HTMLPurifier/URIScheme/tel.php';
require 'HTMLPurifier/VarParser/Flexible.php';
require 'HTMLPurifier/VarParser/Native.php';

30
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php

@ -0,0 +1,30 @@
<?php
/**
* @file
* Emulation layer for code that used kses(), substituting in HTML Purifier.
*/
require_once dirname(__FILE__) . '/HTMLPurifier.auto.php';
function kses($string, $allowed_html, $allowed_protocols = null)
{
$config = HTMLPurifier_Config::createDefault();
$allowed_elements = array();
$allowed_attributes = array();
foreach ($allowed_html as $element => $attributes) {
$allowed_elements[$element] = true;
foreach ($attributes as $attribute => $x) {
$allowed_attributes["$element.$attribute"] = true;
}
}
$config->set('HTML.AllowedElements', $allowed_elements);
$config->set('HTML.AllowedAttributes', $allowed_attributes);
if ($allowed_protocols !== null) {
$config->set('URI.AllowedSchemes', $allowed_protocols);
}
$purifier = new HTMLPurifier($config);
return $purifier->purify($string);
}
// vim: et sw=4 sts=4

11
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php

@ -0,0 +1,11 @@
<?php
/**
* @file
* Convenience stub file that adds HTML Purifier's library file to the path
* without any other side-effects.
*/
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() );
// vim: et sw=4 sts=4

297
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php

@ -0,0 +1,297 @@
<?php
/*! @mainpage
*
* HTML Purifier is an HTML filter that will take an arbitrary snippet of
* HTML and rigorously test, validate and filter it into a version that
* is safe for output onto webpages. It achieves this by:
*
* -# Lexing (parsing into tokens) the document,
* -# Executing various strategies on the tokens:
* -# Removing all elements not in the whitelist,
* -# Making the tokens well-formed,
* -# Fixing the nesting of the nodes, and
* -# Validating attributes of the nodes; and
* -# Generating HTML from the purified tokens.
*
* However, most users will only need to interface with the HTMLPurifier
* and HTMLPurifier_Config.
*/
/*
HTML Purifier 4.17.0 - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Facade that coordinates HTML Purifier's subsystems in order to purify HTML.
*
* @note There are several points in which configuration can be specified
* for HTML Purifier. The precedence of these (from lowest to
* highest) is as follows:
* -# Instance: new HTMLPurifier($config)
* -# Invocation: purify($html, $config)
* These configurations are entirely independent of each other and
* are *not* merged (this behavior may change in the future).
*
* @todo We need an easier way to inject strategies using the configuration
* object.
*/
class HTMLPurifier
{
/**
* Version of HTML Purifier.
* @type string
*/
public $version = '4.17.0';
/**
* Constant with version of HTML Purifier.
*/
const VERSION = '4.17.0';
/**
* Global configuration object.
* @type HTMLPurifier_Config
*/
public $config;
/**
* Array of extra filter objects to run on HTML,
* for backwards compatibility.
* @type HTMLPurifier_Filter[]
*/
private $filters = array();
/**
* Single instance of HTML Purifier.
* @type HTMLPurifier
*/
private static $instance;
/**
* @type HTMLPurifier_Strategy_Core
*/
protected $strategy;
/**
* @type HTMLPurifier_Generator
*/
protected $generator;
/**
* Resultant context of last run purification.
* Is an array of contexts if the last called method was purifyArray().
* @type HTMLPurifier_Context
*/
public $context;
/**
* Initializes the purifier.
*
* @param HTMLPurifier_Config|mixed $config Optional HTMLPurifier_Config object
* for all instances of the purifier, if omitted, a default
* configuration is supplied (which can be overridden on a
* per-use basis).
* The parameter can also be any type that
* HTMLPurifier_Config::create() supports.
*/
public function __construct($config = null)
{
$this->config = HTMLPurifier_Config::create($config);
$this->strategy = new HTMLPurifier_Strategy_Core();
}
/**
* Adds a filter to process the output. First come first serve
*
* @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object
*/
public function addFilter($filter)
{
trigger_error(
'HTMLPurifier->addFilter() is deprecated, use configuration directives' .
' in the Filter namespace or Filter.Custom',
E_USER_WARNING
);
$this->filters[] = $filter;
}
/**
* Filters an HTML snippet/document to be XSS-free and standards-compliant.
*
* @param string $html String of HTML to purify
* @param HTMLPurifier_Config $config Config object for this operation,
* if omitted, defaults to the config object specified during this
* object's construction. The parameter can also be any type
* that HTMLPurifier_Config::create() supports.
*
* @return string Purified HTML
*/
public function purify($html, $config = null)
{
// :TODO: make the config merge in, instead of replace
$config = $config ? HTMLPurifier_Config::create($config) : $this->config;
// implementation is partially environment dependant, partially
// configuration dependant
$lexer = HTMLPurifier_Lexer::create($config);
$context = new HTMLPurifier_Context();
// setup HTML generator
$this->generator = new HTMLPurifier_Generator($config, $context);
$context->register('Generator', $this->generator);
// set up global context variables
if ($config->get('Core.CollectErrors')) {
// may get moved out if other facilities use it
$language_factory = HTMLPurifier_LanguageFactory::instance();
$language = $language_factory->create($config, $context);
$context->register('Locale', $language);
$error_collector = new HTMLPurifier_ErrorCollector($context);
$context->register('ErrorCollector', $error_collector);
}
// setup id_accumulator context, necessary due to the fact that
// AttrValidator can be called from many places
$id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context);
$context->register('IDAccumulator', $id_accumulator);
$html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context);
// setup filters
$filter_flags = $config->getBatch('Filter');
$custom_filters = $filter_flags['Custom'];
unset($filter_flags['Custom']);
$filters = array();
foreach ($filter_flags as $filter => $flag) {
if (!$flag) {
continue;
}
if (strpos($filter, '.') !== false) {
continue;
}
$class = "HTMLPurifier_Filter_$filter";
$filters[] = new $class;
}
foreach ($custom_filters as $filter) {
// maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat
$filters[] = $filter;
}
$filters = array_merge($filters, $this->filters);
// maybe prepare(), but later
for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) {
$html = $filters[$i]->preFilter($html, $config, $context);
}
// purified HTML
$html =
$this->generator->generateFromTokens(
// list of tokens
$this->strategy->execute(
// list of un-purified tokens
$lexer->tokenizeHTML(
// un-purified HTML
$html,
$config,
$context
),
$config,
$context
)
);
for ($i = $filter_size - 1; $i >= 0; $i--) {
$html = $filters[$i]->postFilter($html, $config, $context);
}
$html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context);
$this->context =& $context;
return $html;
}
/**
* Filters an array of HTML snippets
*
* @param string[] $array_of_html Array of html snippets
* @param HTMLPurifier_Config $config Optional config object for this operation.
* See HTMLPurifier::purify() for more details.
*
* @return string[] Array of purified HTML
*/
public function purifyArray($array_of_html, $config = null)
{
$context_array = array();
$array = array();
foreach($array_of_html as $key=>$value){
if (is_array($value)) {
$array[$key] = $this->purifyArray($value, $config);
} else {
$array[$key] = $this->purify($value, $config);
}
$context_array[$key] = $this->context;
}
$this->context = $context_array;
return $array;
}
/**
* Singleton for enforcing just one HTML Purifier in your system
*
* @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
* HTMLPurifier instance to overload singleton with,
* or HTMLPurifier_Config instance to configure the
* generated version with.
*
* @return HTMLPurifier
*/
public static function instance($prototype = null)
{
if (!self::$instance || $prototype) {
if ($prototype instanceof HTMLPurifier) {
self::$instance = $prototype;
} elseif ($prototype) {
self::$instance = new HTMLPurifier($prototype);
} else {
self::$instance = new HTMLPurifier();
}
}
return self::$instance;
}
/**
* Singleton for enforcing just one HTML Purifier in your system
*
* @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
* HTMLPurifier instance to overload singleton with,
* or HTMLPurifier_Config instance to configure the
* generated version with.
*
* @return HTMLPurifier
* @note Backwards compatibility, see instance()
*/
public static function getInstance($prototype = null)
{
return HTMLPurifier::instance($prototype);
}
}
// vim: et sw=4 sts=4

229
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php

@ -0,0 +1,229 @@
<?php
/**
* @file
* This file was auto-generated by generate-includes.php and includes all of
* the core files required by HTML Purifier. This is a convenience stub that
* includes all files using dirname(__FILE__) and require_once. PLEASE DO NOT
* EDIT THIS FILE, changes will be overwritten the next time the script is run.
*
* Changes to include_path are not necessary.
*/
$__dir = dirname(__FILE__);
require_once $__dir . '/HTMLPurifier.php';
require_once $__dir . '/HTMLPurifier/Arborize.php';
require_once $__dir . '/HTMLPurifier/AttrCollections.php';
require_once $__dir . '/HTMLPurifier/AttrDef.php';
require_once $__dir . '/HTMLPurifier/AttrTransform.php';
require_once $__dir . '/HTMLPurifier/AttrTypes.php';
require_once $__dir . '/HTMLPurifier/AttrValidator.php';
require_once $__dir . '/HTMLPurifier/Bootstrap.php';
require_once $__dir . '/HTMLPurifier/Definition.php';
require_once $__dir . '/HTMLPurifier/CSSDefinition.php';
require_once $__dir . '/HTMLPurifier/ChildDef.php';
require_once $__dir . '/HTMLPurifier/Config.php';
require_once $__dir . '/HTMLPurifier/ConfigSchema.php';
require_once $__dir . '/HTMLPurifier/ContentSets.php';
require_once $__dir . '/HTMLPurifier/Context.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache.php';
require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php';
require_once $__dir . '/HTMLPurifier/Doctype.php';
require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php';
require_once $__dir . '/HTMLPurifier/ElementDef.php';
require_once $__dir . '/HTMLPurifier/Encoder.php';
require_once $__dir . '/HTMLPurifier/EntityLookup.php';
require_once $__dir . '/HTMLPurifier/EntityParser.php';
require_once $__dir . '/HTMLPurifier/ErrorCollector.php';
require_once $__dir . '/HTMLPurifier/ErrorStruct.php';
require_once $__dir . '/HTMLPurifier/Exception.php';
require_once $__dir . '/HTMLPurifier/Filter.php';
require_once $__dir . '/HTMLPurifier/Generator.php';
require_once $__dir . '/HTMLPurifier/HTMLDefinition.php';
require_once $__dir . '/HTMLPurifier/HTMLModule.php';
require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php';
require_once $__dir . '/HTMLPurifier/IDAccumulator.php';
require_once $__dir . '/HTMLPurifier/Injector.php';
require_once $__dir . '/HTMLPurifier/Language.php';
require_once $__dir . '/HTMLPurifier/LanguageFactory.php';
require_once $__dir . '/HTMLPurifier/Length.php';
require_once $__dir . '/HTMLPurifier/Lexer.php';
require_once $__dir . '/HTMLPurifier/Node.php';
require_once $__dir . '/HTMLPurifier/PercentEncoder.php';
require_once $__dir . '/HTMLPurifier/PropertyList.php';
require_once $__dir . '/HTMLPurifier/PropertyListIterator.php';
require_once $__dir . '/HTMLPurifier/Queue.php';
require_once $__dir . '/HTMLPurifier/Strategy.php';
require_once $__dir . '/HTMLPurifier/StringHash.php';
require_once $__dir . '/HTMLPurifier/StringHashParser.php';
require_once $__dir . '/HTMLPurifier/TagTransform.php';
require_once $__dir . '/HTMLPurifier/Token.php';
require_once $__dir . '/HTMLPurifier/TokenFactory.php';
require_once $__dir . '/HTMLPurifier/URI.php';
require_once $__dir . '/HTMLPurifier/URIDefinition.php';
require_once $__dir . '/HTMLPurifier/URIFilter.php';
require_once $__dir . '/HTMLPurifier/URIParser.php';
require_once $__dir . '/HTMLPurifier/URIScheme.php';
require_once $__dir . '/HTMLPurifier/URISchemeRegistry.php';
require_once $__dir . '/HTMLPurifier/UnitConverter.php';
require_once $__dir . '/HTMLPurifier/VarParser.php';
require_once $__dir . '/HTMLPurifier/VarParserException.php';
require_once $__dir . '/HTMLPurifier/Zipper.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Clone.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Enum.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Integer.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Switch.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Text.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Ident.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Class.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ContentEditable.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Background.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Input.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/NameSync.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Nofollow.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeObject.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeParam.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetBlank.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetNoopener.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetNoreferrer.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Textarea.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php';
require_once $__dir . '/HTMLPurifier/ChildDef/List.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Required.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php';
require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Table.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Forms.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Iframe.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Name.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Nofollow.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeObject.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeScripting.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetBlank.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetNoopener.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetNoreferrer.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Name.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
require_once $__dir . '/HTMLPurifier/Injector/DisplayLinkURI.php';
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveEmpty.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';
require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php';
require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php';
require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php';
require_once $__dir . '/HTMLPurifier/Node/Comment.php';
require_once $__dir . '/HTMLPurifier/Node/Element.php';
require_once $__dir . '/HTMLPurifier/Node/Text.php';
require_once $__dir . '/HTMLPurifier/Strategy/Composite.php';
require_once $__dir . '/HTMLPurifier/Strategy/Core.php';
require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php';
require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php';
require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php';
require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Font.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php';
require_once $__dir . '/HTMLPurifier/Token/Comment.php';
require_once $__dir . '/HTMLPurifier/Token/Tag.php';
require_once $__dir . '/HTMLPurifier/Token/Empty.php';
require_once $__dir . '/HTMLPurifier/Token/End.php';
require_once $__dir . '/HTMLPurifier/Token/Start.php';
require_once $__dir . '/HTMLPurifier/Token/Text.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableResources.php';
require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php';
require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php';
require_once $__dir . '/HTMLPurifier/URIFilter/Munge.php';
require_once $__dir . '/HTMLPurifier/URIFilter/SafeIframe.php';
require_once $__dir . '/HTMLPurifier/URIScheme/data.php';
require_once $__dir . '/HTMLPurifier/URIScheme/file.php';
require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php';
require_once $__dir . '/HTMLPurifier/URIScheme/http.php';
require_once $__dir . '/HTMLPurifier/URIScheme/https.php';
require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php';
require_once $__dir . '/HTMLPurifier/URIScheme/news.php';
require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php';
require_once $__dir . '/HTMLPurifier/URIScheme/tel.php';
require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php';
require_once $__dir . '/HTMLPurifier/VarParser/Native.php';

71
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php

@ -0,0 +1,71 @@
<?php
/**
* Converts a stream of HTMLPurifier_Token into an HTMLPurifier_Node,
* and back again.
*
* @note This transformation is not an equivalence. We mutate the input
* token stream to make it so; see all [MUT] markers in code.
*/
class HTMLPurifier_Arborize
{
public static function arborize($tokens, $config, $context) {
$definition = $config->getHTMLDefinition();
$parent = new HTMLPurifier_Token_Start($definition->info_parent);
$stack = array($parent->toNode());
foreach ($tokens as $token) {
$token->skip = null; // [MUT]
$token->carryover = null; // [MUT]
if ($token instanceof HTMLPurifier_Token_End) {
$token->start = null; // [MUT]
$r = array_pop($stack);
//assert($r->name === $token->name);
//assert(empty($token->attr));
$r->endCol = $token->col;
$r->endLine = $token->line;
$r->endArmor = $token->armor;
continue;
}
$node = $token->toNode();
$stack[count($stack)-1]->children[] = $node;
if ($token instanceof HTMLPurifier_Token_Start) {
$stack[] = $node;
}
}
//assert(count($stack) == 1);
return $stack[0];
}
public static function flatten($node, $config, $context) {
$level = 0;
$nodes = array($level => new HTMLPurifier_Queue(array($node)));
$closingTokens = array();
$tokens = array();
do {
while (!$nodes[$level]->isEmpty()) {
$node = $nodes[$level]->shift(); // FIFO
list($start, $end) = $node->toTokenPair();
if ($level > 0) {
$tokens[] = $start;
}
if ($end !== NULL) {
$closingTokens[$level][] = $end;
}
if ($node instanceof HTMLPurifier_Node_Element) {
$level++;
$nodes[$level] = new HTMLPurifier_Queue();
foreach ($node->children as $childNode) {
$nodes[$level]->push($childNode);
}
}
}
$level--;
if ($level && isset($closingTokens[$level])) {
while ($token = array_pop($closingTokens[$level])) {
$tokens[] = $token;
}
}
} while ($level > 0);
return $tokens;
}
}

148
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php

@ -0,0 +1,148 @@
<?php
/**
* Defines common attribute collections that modules reference
*/
class HTMLPurifier_AttrCollections
{
/**
* Associative array of attribute collections, indexed by name.
* @type array
*/
public $info = array();
/**
* Performs all expansions on internal data for use by other inclusions
* It also collects all attribute collection extensions from
* modules
* @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance
* @param HTMLPurifier_HTMLModule[] $modules Hash array of HTMLPurifier_HTMLModule members
*/
public function __construct($attr_types, $modules)
{
$this->doConstruct($attr_types, $modules);
}
public function doConstruct($attr_types, $modules)
{
// load extensions from the modules
foreach ($modules as $module) {
foreach ($module->attr_collections as $coll_i => $coll) {
if (!isset($this->info[$coll_i])) {
$this->info[$coll_i] = array();
}
foreach ($coll as $attr_i => $attr) {
if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) {
// merge in includes
$this->info[$coll_i][$attr_i] = array_merge(
$this->info[$coll_i][$attr_i],
$attr
);
continue;
}
$this->info[$coll_i][$attr_i] = $attr;
}
}
}
// perform internal expansions and inclusions
foreach ($this->info as $name => $attr) {
// merge attribute collections that include others
$this->performInclusions($this->info[$name]);
// replace string identifiers with actual attribute objects
$this->expandIdentifiers($this->info[$name], $attr_types);
}
}
/**
* Takes a reference to an attribute associative array and performs
* all inclusions specified by the zero index.
* @param array &$attr Reference to attribute array
*/
public function performInclusions(&$attr)
{
if (!isset($attr[0])) {
return;
}
$merge = $attr[0];
$seen = array(); // recursion guard
// loop through all the inclusions
for ($i = 0; isset($merge[$i]); $i++) {
if (isset($seen[$merge[$i]])) {
continue;
}
$seen[$merge[$i]] = true;
// foreach attribute of the inclusion, copy it over
if (!isset($this->info[$merge[$i]])) {
continue;
}
foreach ($this->info[$merge[$i]] as $key => $value) {
if (isset($attr[$key])) {
continue;
} // also catches more inclusions
$attr[$key] = $value;
}
if (isset($this->info[$merge[$i]][0])) {
// recursion
$merge = array_merge($merge, $this->info[$merge[$i]][0]);
}
}
unset($attr[0]);
}
/**
* Expands all string identifiers in an attribute array by replacing
* them with the appropriate values inside HTMLPurifier_AttrTypes
* @param array &$attr Reference to attribute array
* @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance
*/
public function expandIdentifiers(&$attr, $attr_types)
{
// because foreach will process new elements we add, make sure we
// skip duplicates
$processed = array();
foreach ($attr as $def_i => $def) {
// skip inclusions
if ($def_i === 0) {
continue;
}
if (isset($processed[$def_i])) {
continue;
}
// determine whether or not attribute is required
if ($required = (strpos($def_i, '*') !== false)) {
// rename the definition
unset($attr[$def_i]);
$def_i = trim($def_i, '*');
$attr[$def_i] = $def;
}
$processed[$def_i] = true;
// if we've already got a literal object, move on
if (is_object($def)) {
// preserve previous required
$attr[$def_i]->required = ($required || $attr[$def_i]->required);
continue;
}
if ($def === false) {
unset($attr[$def_i]);
continue;
}
if ($t = $attr_types->get($def)) {
$attr[$def_i] = $t;
$attr[$def_i]->required = $required;
} else {
unset($attr[$def_i]);
}
}
}
}
// vim: et sw=4 sts=4

144
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php

@ -0,0 +1,144 @@
<?php
/**
* Base class for all validating attribute definitions.
*
* This family of classes forms the core for not only HTML attribute validation,
* but also any sort of string that needs to be validated or cleaned (which
* means CSS properties and composite definitions are defined here too).
* Besides defining (through code) what precisely makes the string valid,
* subclasses are also responsible for cleaning the code if possible.
*/
abstract class HTMLPurifier_AttrDef
{
/**
* Tells us whether or not an HTML attribute is minimized.
* Has no meaning in other contexts.
* @type bool
*/
public $minimized = false;
/**
* Tells us whether or not an HTML attribute is required.
* Has no meaning in other contexts
* @type bool
*/
public $required = false;
/**
* Validates and cleans passed string according to a definition.
*
* @param string $string String to be validated and cleaned.
* @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object.
* @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object.
*/
abstract public function validate($string, $config, $context);
/**
* Convenience method that parses a string as if it were CDATA.
*
* This method process a string in the manner specified at
* <http://www.w3.org/TR/html4/types.html#h-6.2> by removing
* leading and trailing whitespace, ignoring line feeds, and replacing
* carriage returns and tabs with spaces. While most useful for HTML
* attributes specified as CDATA, it can also be applied to most CSS
* values.
*
* @note This method is not entirely standards compliant, as trim() removes
* more types of whitespace than specified in the spec. In practice,
* this is rarely a problem, as those extra characters usually have
* already been removed by HTMLPurifier_Encoder.
*
* @warning This processing is inconsistent with XML's whitespace handling
* as specified by section 3.3.3 and referenced XHTML 1.0 section
* 4.7. However, note that we are NOT necessarily
* parsing XML, thus, this behavior may still be correct. We
* assume that newlines have been normalized.
*/
public function parseCDATA($string)
{
$string = trim($string);
$string = str_replace(array("\n", "\t", "\r"), ' ', $string);
return $string;
}
/**
* Factory method for creating this class from a string.
* @param string $string String construction info
* @return HTMLPurifier_AttrDef Created AttrDef object corresponding to $string
*/
public function make($string)
{
// default implementation, return a flyweight of this object.
// If $string has an effect on the returned object (i.e. you
// need to overload this method), it is best
// to clone or instantiate new copies. (Instantiation is safer.)
return $this;
}
/**
* Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work
* properly. THIS IS A HACK!
* @param string $string a CSS colour definition
* @return string
*/
protected function mungeRgb($string)
{
$p = '\s*(\d+(\.\d+)?([%]?))\s*';
if (preg_match('/(rgba|hsla)\(/', $string)) {
return preg_replace('/(rgba|hsla)\('.$p.','.$p.','.$p.','.$p.'\)/', '\1(\2,\5,\8,\11)', $string);
}
return preg_replace('/(rgb|hsl)\('.$p.','.$p.','.$p.'\)/', '\1(\2,\5,\8)', $string);
}
/**
* Parses a possibly escaped CSS string and returns the "pure"
* version of it.
*/
protected function expandCSSEscape($string)
{
// flexibly parse it
$ret = '';
for ($i = 0, $c = strlen($string); $i < $c; $i++) {
if ($string[$i] === '\\') {
$i++;
if ($i >= $c) {
$ret .= '\\';
break;
}
if (ctype_xdigit($string[$i])) {
$code = $string[$i];
for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
if (!ctype_xdigit($string[$i])) {
break;
}
$code .= $string[$i];
}
// We have to be extremely careful when adding
// new characters, to make sure we're not breaking
// the encoding.
$char = HTMLPurifier_Encoder::unichr(hexdec($code));
if (HTMLPurifier_Encoder::cleanUTF8($char) === '') {
continue;
}
$ret .= $char;
if ($i < $c && trim($string[$i]) !== '') {
$i--;
}
continue;
}
if ($string[$i] === "\n") {
continue;
}
}
$ret .= $string[$i];
}
return $ret;
}
}
// vim: et sw=4 sts=4

136
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php

@ -0,0 +1,136 @@
<?php
/**
* Validates the HTML attribute style, otherwise known as CSS.
* @note We don't implement the whole CSS specification, so it might be
* difficult to reuse this component in the context of validating
* actual stylesheet declarations.
* @note If we were really serious about validating the CSS, we would
* tokenize the styles and then parse the tokens. Obviously, we
* are not doing that. Doing that could seriously harm performance,
* but would make these components a lot more viable for a CSS
* filtering solution.
*/
class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
{
/**
* @param string $css
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($css, $config, $context)
{
$css = $this->parseCDATA($css);
$definition = $config->getCSSDefinition();
$allow_duplicates = $config->get("CSS.AllowDuplicates");
// According to the CSS2.1 spec, the places where a
// non-delimiting semicolon can appear are in strings
// escape sequences. So here is some dumb hack to
// handle quotes.
$len = strlen($css);
$accum = "";
$declarations = array();
$quoted = false;
for ($i = 0; $i < $len; $i++) {
$c = strcspn($css, ";'\"", $i);
$accum .= substr($css, $i, $c);
$i += $c;
if ($i == $len) break;
$d = $css[$i];
if ($quoted) {
$accum .= $d;
if ($d == $quoted) {
$quoted = false;
}
} else {
if ($d == ";") {
$declarations[] = $accum;
$accum = "";
} else {
$accum .= $d;
$quoted = $d;
}
}
}
if ($accum != "") $declarations[] = $accum;
$propvalues = array();
$new_declarations = '';
/**
* Name of the current CSS property being validated.
*/
$property = false;
$context->register('CurrentCSSProperty', $property);
foreach ($declarations as $declaration) {
if (!$declaration) {
continue;
}
if (!strpos($declaration, ':')) {
continue;
}
list($property, $value) = explode(':', $declaration, 2);
$property = trim($property);
$value = trim($value);
$ok = false;
do {
if (isset($definition->info[$property])) {
$ok = true;
break;
}
if (ctype_lower($property)) {
break;
}
$property = strtolower($property);
if (isset($definition->info[$property])) {
$ok = true;
break;
}
} while (0);
if (!$ok) {
continue;
}
// inefficient call, since the validator will do this again
if (strtolower(trim($value)) !== 'inherit') {
// inherit works for everything (but only on the base property)
$result = $definition->info[$property]->validate(
$value,
$config,
$context
);
} else {
$result = 'inherit';
}
if ($result === false) {
continue;
}
if ($allow_duplicates) {
$new_declarations .= "$property:$result;";
} else {
$propvalues[$property] = $result;
}
}
$context->destroy('CurrentCSSProperty');
// procedure does not write the new CSS simultaneously, so it's
// slightly inefficient, but it's the only way of getting rid of
// duplicates. Perhaps config to optimize it, but not now.
foreach ($propvalues as $prop => $value) {
$new_declarations .= "$prop:$value;";
}
return $new_declarations ? $new_declarations : false;
}
}
// vim: et sw=4 sts=4

34
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php

@ -0,0 +1,34 @@
<?php
class HTMLPurifier_AttrDef_CSS_AlphaValue extends HTMLPurifier_AttrDef_CSS_Number
{
public function __construct()
{
parent::__construct(false); // opacity is non-negative, but we will clamp it
}
/**
* @param string $number
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return string
*/
public function validate($number, $config, $context)
{
$result = parent::validate($number, $config, $context);
if ($result === false) {
return $result;
}
$float = (float)$result;
if ($float < 0.0) {
$result = '0';
}
if ($float > 1.0) {
$result = '1';
}
return $result;
}
}
// vim: et sw=4 sts=4

113
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php

@ -0,0 +1,113 @@
<?php
/**
* Validates shorthand CSS property background.
* @warning Does not support url tokens that have internal spaces.
*/
class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef
{
/**
* Local copy of component validators.
* @type HTMLPurifier_AttrDef[]
* @note See HTMLPurifier_AttrDef_Font::$info for a similar impl.
*/
protected $info;
/**
* @param HTMLPurifier_Config $config
*/
public function __construct($config)
{
$def = $config->getCSSDefinition();
$this->info['background-color'] = $def->info['background-color'];
$this->info['background-image'] = $def->info['background-image'];
$this->info['background-repeat'] = $def->info['background-repeat'];
$this->info['background-attachment'] = $def->info['background-attachment'];
$this->info['background-position'] = $def->info['background-position'];
$this->info['background-size'] = $def->info['background-size'];
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
// regular pre-processing
$string = $this->parseCDATA($string);
if ($string === '') {
return false;
}
// munge rgb() decl if necessary
$string = $this->mungeRgb($string);
// assumes URI doesn't have spaces in it
$bits = explode(' ', $string); // bits to process
$caught = array();
$caught['color'] = false;
$caught['image'] = false;
$caught['repeat'] = false;
$caught['attachment'] = false;
$caught['position'] = false;
$caught['size'] = false;
$i = 0; // number of catches
foreach ($bits as $bit) {
if ($bit === '') {
continue;
}
foreach ($caught as $key => $status) {
if ($key != 'position') {
if ($status !== false) {
continue;
}
$r = $this->info['background-' . $key]->validate($bit, $config, $context);
} else {
$r = $bit;
}
if ($r === false) {
continue;
}
if ($key == 'position') {
if ($caught[$key] === false) {
$caught[$key] = '';
}
$caught[$key] .= $r . ' ';
} else {
$caught[$key] = $r;
}
$i++;
break;
}
}
if (!$i) {
return false;
}
if ($caught['position'] !== false) {
$caught['position'] = $this->info['background-position']->
validate($caught['position'], $config, $context);
}
$ret = array();
foreach ($caught as $value) {
if ($value === false) {
continue;
}
$ret[] = $value;
}
if (empty($ret)) {
return false;
}
return implode(' ', $ret);
}
}
// vim: et sw=4 sts=4

157
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php

@ -0,0 +1,157 @@
<?php
/* W3C says:
[ // adjective and number must be in correct order, even if
// you could switch them without introducing ambiguity.
// some browsers support that syntax
[
<percentage> | <length> | left | center | right
]
[
<percentage> | <length> | top | center | bottom
]?
] |
[ // this signifies that the vertical and horizontal adjectives
// can be arbitrarily ordered, however, there can only be two,
// one of each, or none at all
[
left | center | right
] ||
[
top | center | bottom
]
]
top, left = 0%
center, (none) = 50%
bottom, right = 100%
*/
/* QuirksMode says:
keyword + length/percentage must be ordered correctly, as per W3C
Internet Explorer and Opera, however, support arbitrary ordering. We
should fix it up.
Minor issue though, not strictly necessary.
*/
// control freaks may appreciate the ability to convert these to
// percentages or something, but it's not necessary
/**
* Validates the value of background-position.
*/
class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_AttrDef_CSS_Length
*/
protected $length;
/**
* @type HTMLPurifier_AttrDef_CSS_Percentage
*/
protected $percentage;
public function __construct()
{
$this->length = new HTMLPurifier_AttrDef_CSS_Length();
$this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage();
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = $this->parseCDATA($string);
$bits = explode(' ', $string);
$keywords = array();
$keywords['h'] = false; // left, right
$keywords['v'] = false; // top, bottom
$keywords['ch'] = false; // center (first word)
$keywords['cv'] = false; // center (second word)
$measures = array();
$i = 0;
$lookup = array(
'top' => 'v',
'bottom' => 'v',
'left' => 'h',
'right' => 'h',
'center' => 'c'
);
foreach ($bits as $bit) {
if ($bit === '') {
continue;
}
// test for keyword
$lbit = ctype_lower($bit) ? $bit : strtolower($bit);
if (isset($lookup[$lbit])) {
$status = $lookup[$lbit];
if ($status == 'c') {
if ($i == 0) {
$status = 'ch';
} else {
$status = 'cv';
}
}
$keywords[$status] = $lbit;
$i++;
}
// test for length
$r = $this->length->validate($bit, $config, $context);
if ($r !== false) {
$measures[] = $r;
$i++;
}
// test for percentage
$r = $this->percentage->validate($bit, $config, $context);
if ($r !== false) {
$measures[] = $r;
$i++;
}
}
if (!$i) {
return false;
} // no valid values were caught
$ret = array();
// first keyword
if ($keywords['h']) {
$ret[] = $keywords['h'];
} elseif ($keywords['ch']) {
$ret[] = $keywords['ch'];
$keywords['cv'] = false; // prevent re-use: center = center center
} elseif (count($measures)) {
$ret[] = array_shift($measures);
}
if ($keywords['v']) {
$ret[] = $keywords['v'];
} elseif ($keywords['cv']) {
$ret[] = $keywords['cv'];
} elseif (count($measures)) {
$ret[] = array_shift($measures);
}
if (empty($ret)) {
return false;
}
return implode(' ', $ret);
}
}
// vim: et sw=4 sts=4

56
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php

@ -0,0 +1,56 @@
<?php
/**
* Validates the border property as defined by CSS.
*/
class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef
{
/**
* Local copy of properties this property is shorthand for.
* @type HTMLPurifier_AttrDef[]
*/
protected $info = array();
/**
* @param HTMLPurifier_Config $config
*/
public function __construct($config)
{
$def = $config->getCSSDefinition();
$this->info['border-width'] = $def->info['border-width'];
$this->info['border-style'] = $def->info['border-style'];
$this->info['border-top-color'] = $def->info['border-top-color'];
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = $this->parseCDATA($string);
$string = $this->mungeRgb($string);
$bits = explode(' ', $string);
$done = array(); // segments we've finished
$ret = ''; // return value
foreach ($bits as $bit) {
foreach ($this->info as $propname => $validator) {
if (isset($done[$propname])) {
continue;
}
$r = $validator->validate($bit, $config, $context);
if ($r !== false) {
$ret .= $r . ' ';
$done[$propname] = true;
break;
}
}
}
return rtrim($ret);
}
}
// vim: et sw=4 sts=4

161
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php

@ -0,0 +1,161 @@
<?php
/**
* Validates Color as defined by CSS.
*/
class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_AttrDef_CSS_AlphaValue
*/
protected $alpha;
public function __construct()
{
$this->alpha = new HTMLPurifier_AttrDef_CSS_AlphaValue();
}
/**
* @param string $color
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($color, $config, $context)
{
static $colors = null;
if ($colors === null) {
$colors = $config->get('Core.ColorKeywords');
}
$color = trim($color);
if ($color === '') {
return false;
}
$lower = strtolower($color);
if (isset($colors[$lower])) {
return $colors[$lower];
}
if (preg_match('#(rgb|rgba|hsl|hsla)\(#', $color, $matches) === 1) {
$length = strlen($color);
if (strpos($color, ')') !== $length - 1) {
return false;
}
// get used function : rgb, rgba, hsl or hsla
$function = $matches[1];
$parameters_size = 3;
$alpha_channel = false;
if (substr($function, -1) === 'a') {
$parameters_size = 4;
$alpha_channel = true;
}
/*
* Allowed types for values :
* parameter_position => [type => max_value]
*/
$allowed_types = array(
1 => array('percentage' => 100, 'integer' => 255),
2 => array('percentage' => 100, 'integer' => 255),
3 => array('percentage' => 100, 'integer' => 255),
);
$allow_different_types = false;
if (strpos($function, 'hsl') !== false) {
$allowed_types = array(
1 => array('integer' => 360),
2 => array('percentage' => 100),
3 => array('percentage' => 100),
);
$allow_different_types = true;
}
$values = trim(str_replace($function, '', $color), ' ()');
$parts = explode(',', $values);
if (count($parts) !== $parameters_size) {
return false;
}
$type = false;
$new_parts = array();
$i = 0;
foreach ($parts as $part) {
$i++;
$part = trim($part);
if ($part === '') {
return false;
}
// different check for alpha channel
if ($alpha_channel === true && $i === count($parts)) {
$result = $this->alpha->validate($part, $config, $context);
if ($result === false) {
return false;
}
$new_parts[] = (string)$result;
continue;
}
if (substr($part, -1) === '%') {
$current_type = 'percentage';
} else {
$current_type = 'integer';
}
if (!array_key_exists($current_type, $allowed_types[$i])) {
return false;
}
if (!$type) {
$type = $current_type;
}
if ($allow_different_types === false && $type != $current_type) {
return false;
}
$max_value = $allowed_types[$i][$current_type];
if ($current_type == 'integer') {
// Return value between range 0 -> $max_value
$new_parts[] = (int)max(min($part, $max_value), 0);
} elseif ($current_type == 'percentage') {
$new_parts[] = (float)max(min(rtrim($part, '%'), $max_value), 0) . '%';
}
}
$new_values = implode(',', $new_parts);
$color = $function . '(' . $new_values . ')';
} else {
// hexadecimal handling
if ($color[0] === '#') {
$hex = substr($color, 1);
} else {
$hex = $color;
$color = '#' . $color;
}
$length = strlen($hex);
if ($length !== 3 && $length !== 6) {
return false;
}
if (!ctype_xdigit($hex)) {
return false;
}
}
return $color;
}
}
// vim: et sw=4 sts=4

48
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php

@ -0,0 +1,48 @@
<?php
/**
* Allows multiple validators to attempt to validate attribute.
*
* Composite is just what it sounds like: a composite of many validators.
* This means that multiple HTMLPurifier_AttrDef objects will have a whack
* at the string. If one of them passes, that's what is returned. This is
* especially useful for CSS values, which often are a choice between
* an enumerated set of predefined values or a flexible data type.
*/
class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef
{
/**
* List of objects that may process strings.
* @type HTMLPurifier_AttrDef[]
* @todo Make protected
*/
public $defs;
/**
* @param HTMLPurifier_AttrDef[] $defs List of HTMLPurifier_AttrDef objects
*/
public function __construct($defs)
{
$this->defs = $defs;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
foreach ($this->defs as $i => $def) {
$result = $this->defs[$i]->validate($string, $config, $context);
if ($result !== false) {
return $result;
}
}
return false;
}
}
// vim: et sw=4 sts=4

44
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php

@ -0,0 +1,44 @@
<?php
/**
* Decorator which enables CSS properties to be disabled for specific elements.
*/
class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_AttrDef
*/
public $def;
/**
* @type string
*/
public $element;
/**
* @param HTMLPurifier_AttrDef $def Definition to wrap
* @param string $element Element to deny
*/
public function __construct($def, $element)
{
$this->def = $def;
$this->element = $element;
}
/**
* Checks if CurrentToken is set and equal to $this->element
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$token = $context->get('CurrentToken', true);
if ($token && $token->name == $this->element) {
return false;
}
return $this->def->validate($string, $config, $context);
}
}
// vim: et sw=4 sts=4

77
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php

@ -0,0 +1,77 @@
<?php
/**
* Microsoft's proprietary filter: CSS property
* @note Currently supports the alpha filter. In the future, this will
* probably need an extensible framework
*/
class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_AttrDef_Integer
*/
protected $intValidator;
public function __construct()
{
$this->intValidator = new HTMLPurifier_AttrDef_Integer();
}
/**
* @param string $value
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($value, $config, $context)
{
$value = $this->parseCDATA($value);
if ($value === 'none') {
return $value;
}
// if we looped this we could support multiple filters
$function_length = strcspn($value, '(');
$function = trim(substr($value, 0, $function_length));
if ($function !== 'alpha' &&
$function !== 'Alpha' &&
$function !== 'progid:DXImageTransform.Microsoft.Alpha'
) {
return false;
}
$cursor = $function_length + 1;
$parameters_length = strcspn($value, ')', $cursor);
$parameters = substr($value, $cursor, $parameters_length);
$params = explode(',', $parameters);
$ret_params = array();
$lookup = array();
foreach ($params as $param) {
list($key, $value) = explode('=', $param);
$key = trim($key);
$value = trim($value);
if (isset($lookup[$key])) {
continue;
}
if ($key !== 'opacity') {
continue;
}
$value = $this->intValidator->validate($value, $config, $context);
if ($value === false) {
continue;
}
$int = (int)$value;
if ($int > 100) {
$value = '100';
}
if ($int < 0) {
$value = '0';
}
$ret_params[] = "$key=$value";
$lookup[$key] = true;
}
$ret_parameters = implode(',', $ret_params);
$ret_function = "$function($ret_parameters)";
return $ret_function;
}
}
// vim: et sw=4 sts=4

176
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php

@ -0,0 +1,176 @@
<?php
/**
* Validates shorthand CSS property font.
*/
class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef
{
/**
* Local copy of validators
* @type HTMLPurifier_AttrDef[]
* @note If we moved specific CSS property definitions to their own
* classes instead of having them be assembled at run time by
* CSSDefinition, this wouldn't be necessary. We'd instantiate
* our own copies.
*/
protected $info = array();
/**
* @param HTMLPurifier_Config $config
*/
public function __construct($config)
{
$def = $config->getCSSDefinition();
$this->info['font-style'] = $def->info['font-style'];
$this->info['font-variant'] = $def->info['font-variant'];
$this->info['font-weight'] = $def->info['font-weight'];
$this->info['font-size'] = $def->info['font-size'];
$this->info['line-height'] = $def->info['line-height'];
$this->info['font-family'] = $def->info['font-family'];
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
static $system_fonts = array(
'caption' => true,
'icon' => true,
'menu' => true,
'message-box' => true,
'small-caption' => true,
'status-bar' => true
);
// regular pre-processing
$string = $this->parseCDATA($string);
if ($string === '') {
return false;
}
// check if it's one of the keywords
$lowercase_string = strtolower($string);
if (isset($system_fonts[$lowercase_string])) {
return $lowercase_string;
}
$bits = explode(' ', $string); // bits to process
$stage = 0; // this indicates what we're looking for
$caught = array(); // which stage 0 properties have we caught?
$stage_1 = array('font-style', 'font-variant', 'font-weight');
$final = ''; // output
for ($i = 0, $size = count($bits); $i < $size; $i++) {
if ($bits[$i] === '') {
continue;
}
switch ($stage) {
case 0: // attempting to catch font-style, font-variant or font-weight
foreach ($stage_1 as $validator_name) {
if (isset($caught[$validator_name])) {
continue;
}
$r = $this->info[$validator_name]->validate(
$bits[$i],
$config,
$context
);
if ($r !== false) {
$final .= $r . ' ';
$caught[$validator_name] = true;
break;
}
}
// all three caught, continue on
if (count($caught) >= 3) {
$stage = 1;
}
if ($r !== false) {
break;
}
case 1: // attempting to catch font-size and perhaps line-height
$found_slash = false;
if (strpos($bits[$i], '/') !== false) {
list($font_size, $line_height) =
explode('/', $bits[$i]);
if ($line_height === '') {
// ooh, there's a space after the slash!
$line_height = false;
$found_slash = true;
}
} else {
$font_size = $bits[$i];
$line_height = false;
}
$r = $this->info['font-size']->validate(
$font_size,
$config,
$context
);
if ($r !== false) {
$final .= $r;
// attempt to catch line-height
if ($line_height === false) {
// we need to scroll forward
for ($j = $i + 1; $j < $size; $j++) {
if ($bits[$j] === '') {
continue;
}
if ($bits[$j] === '/') {
if ($found_slash) {
return false;
} else {
$found_slash = true;
continue;
}
}
$line_height = $bits[$j];
break;
}
} else {
// slash already found
$found_slash = true;
$j = $i;
}
if ($found_slash) {
$i = $j;
$r = $this->info['line-height']->validate(
$line_height,
$config,
$context
);
if ($r !== false) {
$final .= '/' . $r;
}
}
$final .= ' ';
$stage = 2;
break;
}
return false;
case 2: // attempting to catch font-family
$font_family =
implode(' ', array_slice($bits, $i, $size - $i));
$r = $this->info['font-family']->validate(
$font_family,
$config,
$context
);
if ($r !== false) {
$final .= $r . ' ';
// processing completed successfully
return rtrim($final);
}
return false;
}
}
return false;
}
}
// vim: et sw=4 sts=4

217
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php

@ -0,0 +1,217 @@
<?php
/**
* Validates a font family list according to CSS spec
*/
class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
{
protected $mask = null;
public function __construct()
{
// Lowercase letters
$l = range('a', 'z');
// Uppercase letters
$u = range('A', 'Z');
// Digits
$d = range('0', '9');
// Special bytes used by UTF-8
$b = array_map('chr', range(0x80, 0xFF));
// All valid characters for the mask
$c = array_merge($l, $u, $d, $b);
// Concatenate all valid characters into a string
// Use '_- ' as an initial value
$this->mask = array_reduce($c, function ($carry, $value) {
return $carry . $value;
}, '_- ');
/*
PHP's internal strcspn implementation is
O(length of string * length of mask), making it inefficient
for large masks. However, it's still faster than
preg_match 8)
for (p = s1;;) {
spanp = s2;
do {
if (*spanp == c || p == s1_end) {
return p - s1;
}
} while (spanp++ < (s2_end - 1));
c = *++p;
}
*/
// possible optimization: invert the mask.
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
static $generic_names = array(
'serif' => true,
'sans-serif' => true,
'monospace' => true,
'fantasy' => true,
'cursive' => true
);
$allowed_fonts = $config->get('CSS.AllowedFonts');
// assume that no font names contain commas in them
$fonts = explode(',', $string);
$final = '';
foreach ($fonts as $font) {
$font = trim($font);
if ($font === '') {
continue;
}
// match a generic name
if (isset($generic_names[$font])) {
if ($allowed_fonts === null || isset($allowed_fonts[$font])) {
$final .= $font . ', ';
}
continue;
}
// match a quoted name
if ($font[0] === '"' || $font[0] === "'") {
$length = strlen($font);
if ($length <= 2) {
continue;
}
$quote = $font[0];
if ($font[$length - 1] !== $quote) {
continue;
}
$font = substr($font, 1, $length - 2);
}
$font = $this->expandCSSEscape($font);
// $font is a pure representation of the font name
if ($allowed_fonts !== null && !isset($allowed_fonts[$font])) {
continue;
}
if (ctype_alnum($font) && $font !== '') {
// very simple font, allow it in unharmed
$final .= $font . ', ';
continue;
}
// bugger out on whitespace. form feed (0C) really
// shouldn't show up regardless
$font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font);
// Here, there are various classes of characters which need
// to be treated differently:
// - Alphanumeric characters are essentially safe. We
// handled these above.
// - Spaces require quoting, though most parsers will do
// the right thing if there aren't any characters that
// can be misinterpreted
// - Dashes rarely occur, but they fairly unproblematic
// for parsing/rendering purposes.
// The above characters cover the majority of Western font
// names.
// - Arbitrary Unicode characters not in ASCII. Because
// most parsers give little thought to Unicode, treatment
// of these codepoints is basically uniform, even for
// punctuation-like codepoints. These characters can
// show up in non-Western pages and are supported by most
// major browsers, for example: "MS 明朝" is a
// legitimate font-name
// <http://ja.wikipedia.org/wiki/MS_明朝>. See
// the CSS3 spec for more examples:
// <http://www.w3.org/TR/2011/WD-css3-fonts-20110324/localizedfamilynames.png>
// You can see live samples of these on the Internet:
// <http://www.google.co.jp/search?q=font-family+MS+明朝|ゴシック>
// However, most of these fonts have ASCII equivalents:
// for example, 'MS Mincho', and it's considered
// professional to use ASCII font names instead of
// Unicode font names. Thanks Takeshi Terada for
// providing this information.
// The following characters, to my knowledge, have not been
// used to name font names.
// - Single quote. While theoretically you might find a
// font name that has a single quote in its name (serving
// as an apostrophe, e.g. Dave's Scribble), I haven't
// been able to find any actual examples of this.
// Internet Explorer's cssText translation (which I
// believe is invoked by innerHTML) normalizes any
// quoting to single quotes, and fails to escape single
// quotes. (Note that this is not IE's behavior for all
// CSS properties, just some sort of special casing for
// font-family). So a single quote *cannot* be used
// safely in the font-family context if there will be an
// innerHTML/cssText translation. Note that Firefox 3.x
// does this too.
// - Double quote. In IE, these get normalized to
// single-quotes, no matter what the encoding. (Fun
// fact, in IE8, the 'content' CSS property gained
// support, where they special cased to preserve encoded
// double quotes, but still translate unadorned double
// quotes into single quotes.) So, because their
// fixpoint behavior is identical to single quotes, they
// cannot be allowed either. Firefox 3.x displays
// single-quote style behavior.
// - Backslashes are reduced by one (so \\ -> \) every
// iteration, so they cannot be used safely. This shows
// up in IE7, IE8 and FF3
// - Semicolons, commas and backticks are handled properly.
// - The rest of the ASCII punctuation is handled properly.
// We haven't checked what browsers do to unadorned
// versions, but this is not important as long as the
// browser doesn't /remove/ surrounding quotes (as IE does
// for HTML).
//
// With these results in hand, we conclude that there are
// various levels of safety:
// - Paranoid: alphanumeric, spaces and dashes(?)
// - International: Paranoid + non-ASCII Unicode
// - Edgy: Everything except quotes, backslashes
// - NoJS: Standards compliance, e.g. sod IE. Note that
// with some judicious character escaping (since certain
// types of escaping doesn't work) this is theoretically
// OK as long as innerHTML/cssText is not called.
// We believe that international is a reasonable default
// (that we will implement now), and once we do more
// extensive research, we may feel comfortable with dropping
// it down to edgy.
// Edgy: alphanumeric, spaces, dashes, underscores and Unicode. Use of
// str(c)spn assumes that the string was already well formed
// Unicode (which of course it is).
if (strspn($font, $this->mask) !== strlen($font)) {
continue;
}
// Historical:
// In the absence of innerHTML/cssText, these ugly
// transforms don't pose a security risk (as \\ and \"
// might--these escapes are not supported by most browsers).
// We could try to be clever and use single-quote wrapping
// when there is a double quote present, but I have choosen
// not to implement that. (NOTE: you can reduce the amount
// of escapes by one depending on what quoting style you use)
// $font = str_replace('\\', '\\5C ', $font);
// $font = str_replace('"', '\\22 ', $font);
// $font = str_replace("'", '\\27 ', $font);
// font possibly with spaces, requires quoting
$final .= "'$font', ";
}
$final = rtrim($final, ', ');
if ($final === '') {
return false;
}
return $final;
}
}
// vim: et sw=4 sts=4

32
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php

@ -0,0 +1,32 @@
<?php
/**
* Validates based on {ident} CSS grammar production
*/
class HTMLPurifier_AttrDef_CSS_Ident extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
// early abort: '' and '0' (strings that convert to false) are invalid
if (!$string) {
return false;
}
$pattern = '/^(-?[A-Za-z_][A-Za-z_\-0-9]*)$/';
if (!preg_match($pattern, $string)) {
return false;
}
return $string;
}
}
// vim: et sw=4 sts=4

56
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php

@ -0,0 +1,56 @@
<?php
/**
* Decorator which enables !important to be used in CSS values.
*/
class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_AttrDef
*/
public $def;
/**
* @type bool
*/
public $allow;
/**
* @param HTMLPurifier_AttrDef $def Definition to wrap
* @param bool $allow Whether or not to allow !important
*/
public function __construct($def, $allow = false)
{
$this->def = $def;
$this->allow = $allow;
}
/**
* Intercepts and removes !important if necessary
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
// test for ! and important tokens
$string = trim($string);
$is_important = false;
// :TODO: optimization: test directly for !important and ! important
if (strlen($string) >= 9 && substr($string, -9) === 'important') {
$temp = rtrim(substr($string, 0, -9));
// use a temp, because we might want to restore important
if (strlen($temp) >= 1 && substr($temp, -1) === '!') {
$string = rtrim(substr($temp, 0, -1));
$is_important = true;
}
}
$string = $this->def->validate($string, $config, $context);
if ($this->allow && $is_important) {
$string .= ' !important';
}
return $string;
}
}
// vim: et sw=4 sts=4

77
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php

@ -0,0 +1,77 @@
<?php
/**
* Represents a Length as defined by CSS.
*/
class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_Length|string
*/
protected $min;
/**
* @type HTMLPurifier_Length|string
*/
protected $max;
/**
* @param HTMLPurifier_Length|string $min Minimum length, or null for no bound. String is also acceptable.
* @param HTMLPurifier_Length|string $max Maximum length, or null for no bound. String is also acceptable.
*/
public function __construct($min = null, $max = null)
{
$this->min = $min !== null ? HTMLPurifier_Length::make($min) : null;
$this->max = $max !== null ? HTMLPurifier_Length::make($max) : null;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = $this->parseCDATA($string);
// Optimizations
if ($string === '') {
return false;
}
if ($string === '0') {
return '0';
}
if (strlen($string) === 1) {
return false;
}
$length = HTMLPurifier_Length::make($string);
if (!$length->isValid()) {
return false;
}
if ($this->min) {
$c = $length->compareTo($this->min);
if ($c === false) {
return false;
}
if ($c < 0) {
return false;
}
}
if ($this->max) {
$c = $length->compareTo($this->max);
if ($c === false) {
return false;
}
if ($c > 0) {
return false;
}
}
return $length->toString();
}
}
// vim: et sw=4 sts=4

112
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php

@ -0,0 +1,112 @@
<?php
/**
* Validates shorthand CSS property list-style.
* @warning Does not support url tokens that have internal spaces.
*/
class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef
{
/**
* Local copy of validators.
* @type HTMLPurifier_AttrDef[]
* @note See HTMLPurifier_AttrDef_CSS_Font::$info for a similar impl.
*/
protected $info;
/**
* @param HTMLPurifier_Config $config
*/
public function __construct($config)
{
$def = $config->getCSSDefinition();
$this->info['list-style-type'] = $def->info['list-style-type'];
$this->info['list-style-position'] = $def->info['list-style-position'];
$this->info['list-style-image'] = $def->info['list-style-image'];
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
// regular pre-processing
$string = $this->parseCDATA($string);
if ($string === '') {
return false;
}
// assumes URI doesn't have spaces in it
$bits = explode(' ', strtolower($string)); // bits to process
$caught = array();
$caught['type'] = false;
$caught['position'] = false;
$caught['image'] = false;
$i = 0; // number of catches
$none = false;
foreach ($bits as $bit) {
if ($i >= 3) {
return;
} // optimization bit
if ($bit === '') {
continue;
}
foreach ($caught as $key => $status) {
if ($status !== false) {
continue;
}
$r = $this->info['list-style-' . $key]->validate($bit, $config, $context);
if ($r === false) {
continue;
}
if ($r === 'none') {
if ($none) {
continue;
} else {
$none = true;
}
if ($key == 'image') {
continue;
}
}
$caught[$key] = $r;
$i++;
break;
}
}
if (!$i) {
return false;
}
$ret = array();
// construct type
if ($caught['type']) {
$ret[] = $caught['type'];
}
// construct image
if ($caught['image']) {
$ret[] = $caught['image'];
}
// construct position
if ($caught['position']) {
$ret[] = $caught['position'];
}
if (empty($ret)) {
return false;
}
return implode(' ', $ret);
}
}
// vim: et sw=4 sts=4

71
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php

@ -0,0 +1,71 @@
<?php
/**
* Framework class for strings that involve multiple values.
*
* Certain CSS properties such as border-width and margin allow multiple
* lengths to be specified. This class can take a vanilla border-width
* definition and multiply it, usually into a max of four.
*
* @note Even though the CSS specification isn't clear about it, inherit
* can only be used alone: it will never manifest as part of a multi
* shorthand declaration. Thus, this class does not allow inherit.
*/
class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef
{
/**
* Instance of component definition to defer validation to.
* @type HTMLPurifier_AttrDef
* @todo Make protected
*/
public $single;
/**
* Max number of values allowed.
* @todo Make protected
*/
public $max;
/**
* @param HTMLPurifier_AttrDef $single HTMLPurifier_AttrDef to multiply
* @param int $max Max number of values allowed (usually four)
*/
public function __construct($single, $max = 4)
{
$this->single = $single;
$this->max = $max;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = $this->mungeRgb($this->parseCDATA($string));
if ($string === '') {
return false;
}
$parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n
$length = count($parts);
$final = '';
for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) {
if (ctype_space($parts[$i])) {
continue;
}
$result = $this->single->validate($parts[$i], $config, $context);
if ($result !== false) {
$final .= $result . ' ';
$num++;
}
}
if ($final === '') {
return false;
}
return rtrim($final);
}
}
// vim: et sw=4 sts=4

90
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php

@ -0,0 +1,90 @@
<?php
/**
* Validates a number as defined by the CSS spec.
*/
class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef
{
/**
* Indicates whether or not only positive values are allowed.
* @type bool
*/
protected $non_negative = false;
/**
* @param bool $non_negative indicates whether negatives are forbidden
*/
public function __construct($non_negative = false)
{
$this->non_negative = $non_negative;
}
/**
* @param string $number
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return string|bool
* @warning Some contexts do not pass $config, $context. These
* variables should not be used without checking HTMLPurifier_Length
*/
public function validate($number, $config, $context)
{
$number = $this->parseCDATA($number);
if ($number === '') {
return false;
}
if ($number === '0') {
return '0';
}
$sign = '';
switch ($number[0]) {
case '-':
if ($this->non_negative) {
return false;
}
$sign = '-';
case '+':
$number = substr($number, 1);
}
if (ctype_digit($number)) {
$number = ltrim($number, '0');
return $number ? $sign . $number : '0';
}
// Period is the only non-numeric character allowed
if (strpos($number, '.') === false) {
return false;
}
list($left, $right) = explode('.', $number, 2);
if ($left === '' && $right === '') {
return false;
}
if ($left !== '' && !ctype_digit($left)) {
return false;
}
// Remove leading zeros until positive number or a zero stays left
if (ltrim($left, '0') != '') {
$left = ltrim($left, '0');
} else {
$left = '0';
}
$right = rtrim($right, '0');
if ($right === '') {
return $left ? $sign . $left : '0';
} elseif (!ctype_digit($right)) {
return false;
}
return $sign . $left . '.' . $right;
}
}
// vim: et sw=4 sts=4

54
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php

@ -0,0 +1,54 @@
<?php
/**
* Validates a Percentage as defined by the CSS spec.
*/
class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef
{
/**
* Instance to defer number validation to.
* @type HTMLPurifier_AttrDef_CSS_Number
*/
protected $number_def;
/**
* @param bool $non_negative Whether to forbid negative values
*/
public function __construct($non_negative = false)
{
$this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative);
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = $this->parseCDATA($string);
if ($string === '') {
return false;
}
$length = strlen($string);
if ($length === 1) {
return false;
}
if ($string[$length - 1] !== '%') {
return false;
}
$number = substr($string, 0, $length - 1);
$number = $this->number_def->validate($number, $config, $context);
if ($number === false) {
return false;
}
return "$number%";
}
}
// vim: et sw=4 sts=4

46
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php

@ -0,0 +1,46 @@
<?php
/**
* Validates the value for the CSS property text-decoration
* @note This class could be generalized into a version that acts sort of
* like Enum except you can compound the allowed values.
*/
class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
static $allowed_values = array(
'line-through' => true,
'overline' => true,
'underline' => true,
);
$string = strtolower($this->parseCDATA($string));
if ($string === 'none') {
return $string;
}
$parts = explode(' ', $string);
$final = '';
foreach ($parts as $part) {
if (isset($allowed_values[$part])) {
$final .= $part . ' ';
}
}
$final = rtrim($final);
if ($final === '') {
return false;
}
return $final;
}
}
// vim: et sw=4 sts=4

77
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php

@ -0,0 +1,77 @@
<?php
/**
* Validates a URI in CSS syntax, which uses url('http://example.com')
* @note While theoretically speaking a URI in a CSS document could
* be non-embedded, as of CSS2 there is no such usage so we're
* generalizing it. This may need to be changed in the future.
* @warning Since HTMLPurifier_AttrDef_CSS blindly uses semicolons as
* the separator, you cannot put a literal semicolon in
* in the URI. Try percent encoding it, in that case.
*/
class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI
{
public function __construct()
{
parent::__construct(true); // always embedded
}
/**
* @param string $uri_string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($uri_string, $config, $context)
{
// parse the URI out of the string and then pass it onto
// the parent object
$uri_string = $this->parseCDATA($uri_string);
if (strpos($uri_string, 'url(') !== 0) {
return false;
}
$uri_string = substr($uri_string, 4);
if (strlen($uri_string) == 0) {
return false;
}
$new_length = strlen($uri_string) - 1;
if ($uri_string[$new_length] != ')') {
return false;
}
$uri = trim(substr($uri_string, 0, $new_length));
if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) {
$quote = $uri[0];
$new_length = strlen($uri) - 1;
if ($uri[$new_length] !== $quote) {
return false;
}
$uri = substr($uri, 1, $new_length - 1);
}
$uri = $this->expandCSSEscape($uri);
$result = parent::validate($uri, $config, $context);
if ($result === false) {
return false;
}
// extra sanity check; should have been done by URI
$result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result);
// suspicious characters are ()'; we're going to percent encode
// them for safety.
$result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result);
// there's an extra bug where ampersands lose their escaping on
// an innerHTML cycle, so a very unlucky query parameter could
// then change the meaning of the URL. Unfortunately, there's
// not much we can do about that...
return "url(\"$result\")";
}
}
// vim: et sw=4 sts=4

44
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php

@ -0,0 +1,44 @@
<?php
/**
* Dummy AttrDef that mimics another AttrDef, BUT it generates clones
* with make.
*/
class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef
{
/**
* What we're cloning.
* @type HTMLPurifier_AttrDef
*/
protected $clone;
/**
* @param HTMLPurifier_AttrDef $clone
*/
public function __construct($clone)
{
$this->clone = $clone;
}
/**
* @param string $v
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($v, $config, $context)
{
return $this->clone->validate($v, $config, $context);
}
/**
* @param string $string
* @return HTMLPurifier_AttrDef
*/
public function make($string)
{
return clone $this->clone;
}
}
// vim: et sw=4 sts=4

73
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php

@ -0,0 +1,73 @@
<?php
// Enum = Enumerated
/**
* Validates a keyword against a list of valid values.
* @warning The case-insensitive compare of this function uses PHP's
* built-in strtolower and ctype_lower functions, which may
* cause problems with international comparisons
*/
class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef
{
/**
* Lookup table of valid values.
* @type array
* @todo Make protected
*/
public $valid_values = array();
/**
* Bool indicating whether or not enumeration is case sensitive.
* @note In general this is always case insensitive.
*/
protected $case_sensitive = false; // values according to W3C spec
/**
* @param array $valid_values List of valid values
* @param bool $case_sensitive Whether or not case sensitive
*/
public function __construct($valid_values = array(), $case_sensitive = false)
{
$this->valid_values = array_flip($valid_values);
$this->case_sensitive = $case_sensitive;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
if (!$this->case_sensitive) {
// we may want to do full case-insensitive libraries
$string = ctype_lower($string) ? $string : strtolower($string);
}
$result = isset($this->valid_values[$string]);
return $result ? $string : false;
}
/**
* @param string $string In form of comma-delimited list of case-insensitive
* valid values. Example: "foo,bar,baz". Prepend "s:" to make
* case sensitive
* @return HTMLPurifier_AttrDef_Enum
*/
public function make($string)
{
if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') {
$string = substr($string, 2);
$sensitive = true;
} else {
$sensitive = false;
}
$values = explode(',', $string);
return new HTMLPurifier_AttrDef_Enum($values, $sensitive);
}
}
// vim: et sw=4 sts=4

48
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php

@ -0,0 +1,48 @@
<?php
/**
* Validates a boolean attribute
*/
class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
{
/**
* @type string
*/
protected $name;
/**
* @type bool
*/
public $minimized = true;
/**
* @param bool|string $name
*/
public function __construct($name = false)
{
$this->name = $name;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
return $this->name;
}
/**
* @param string $string Name of attribute
* @return HTMLPurifier_AttrDef_HTML_Bool
*/
public function make($string)
{
return new HTMLPurifier_AttrDef_HTML_Bool($string);
}
}
// vim: et sw=4 sts=4

48
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php

@ -0,0 +1,48 @@
<?php
/**
* Implements special behavior for class attribute (normally NMTOKENS)
*/
class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_Nmtokens
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
protected function split($string, $config, $context)
{
// really, this twiddle should be lazy loaded
$name = $config->getDefinition('HTML')->doctype->name;
if ($name == "XHTML 1.1" || $name == "XHTML 2.0") {
return parent::split($string, $config, $context);
} else {
return preg_split('/\s+/', $string);
}
}
/**
* @param array $tokens
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
protected function filter($tokens, $config, $context)
{
$allowed = $config->get('Attr.AllowedClasses');
$forbidden = $config->get('Attr.ForbiddenClasses');
$ret = array();
foreach ($tokens as $token) {
if (($allowed === null || isset($allowed[$token])) &&
!isset($forbidden[$token]) &&
// We need this O(n) check because of PHP's array
// implementation that casts -0 to 0.
!in_array($token, $ret, true)
) {
$ret[] = $token;
}
}
return $ret;
}
}

51
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php

@ -0,0 +1,51 @@
<?php
/**
* Validates a color according to the HTML spec.
*/
class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
static $colors = null;
if ($colors === null) {
$colors = $config->get('Core.ColorKeywords');
}
$string = trim($string);
if (empty($string)) {
return false;
}
$lower = strtolower($string);
if (isset($colors[$lower])) {
return $colors[$lower];
}
if ($string[0] === '#') {
$hex = substr($string, 1);
} else {
$hex = $string;
}
$length = strlen($hex);
if ($length !== 3 && $length !== 6) {
return false;
}
if (!ctype_xdigit($hex)) {
return false;
}
if ($length === 3) {
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
}
return "#$hex";
}
}
// vim: et sw=4 sts=4

16
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php

@ -0,0 +1,16 @@
<?php
class HTMLPurifier_AttrDef_HTML_ContentEditable extends HTMLPurifier_AttrDef
{
public function validate($string, $config, $context)
{
$allowed = array('false');
if ($config->get('HTML.Trusted')) {
$allowed = array('', 'true', 'false');
}
$enum = new HTMLPurifier_AttrDef_Enum($allowed);
return $enum->validate($string, $config, $context);
}
}

38
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php

@ -0,0 +1,38 @@
<?php
/**
* Special-case enum attribute definition that lazy loads allowed frame targets
*/
class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum
{
/**
* @type array
*/
public $valid_values = false; // uninitialized value
/**
* @type bool
*/
protected $case_sensitive = false;
public function __construct()
{
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
if ($this->valid_values === false) {
$this->valid_values = $config->get('Attr.AllowedFrameTargets');
}
return parent::validate($string, $config, $context);
}
}
// vim: et sw=4 sts=4

113
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php

@ -0,0 +1,113 @@
<?php
/**
* Validates the HTML attribute ID.
* @warning Even though this is the id processor, it
* will ignore the directive Attr:IDBlacklist, since it will only
* go according to the ID accumulator. Since the accumulator is
* automatically generated, it will have already absorbed the
* blacklist. If you're hacking around, make sure you use load()!
*/
class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef
{
// selector is NOT a valid thing to use for IDREFs, because IDREFs
// *must* target IDs that exist, whereas selector #ids do not.
/**
* Determines whether or not we're validating an ID in a CSS
* selector context.
* @type bool
*/
protected $selector;
/**
* @param bool $selector
*/
public function __construct($selector = false)
{
$this->selector = $selector;
}
/**
* @param string $id
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($id, $config, $context)
{
if (!$this->selector && !$config->get('Attr.EnableID')) {
return false;
}
$id = trim($id); // trim it first
if ($id === '') {
return false;
}
$prefix = $config->get('Attr.IDPrefix');
if ($prefix !== '') {
$prefix .= $config->get('Attr.IDPrefixLocal');
// prevent re-appending the prefix
if (strpos($id, $prefix) !== 0) {
$id = $prefix . $id;
}
} elseif ($config->get('Attr.IDPrefixLocal') !== '') {
trigger_error(
'%Attr.IDPrefixLocal cannot be used unless ' .
'%Attr.IDPrefix is set',
E_USER_WARNING
);
}
if (!$this->selector) {
$id_accumulator =& $context->get('IDAccumulator');
if (isset($id_accumulator->ids[$id])) {
return false;
}
}
// we purposely avoid using regex, hopefully this is faster
if ($config->get('Attr.ID.HTML5') === true) {
if (preg_match('/[\t\n\x0b\x0c ]/', $id)) {
return false;
}
} else {
if (ctype_alpha($id)) {
// OK
} else {
if (!ctype_alpha(@$id[0])) {
return false;
}
// primitive style of regexps, I suppose
$trim = trim(
$id,
'A..Za..z0..9:-._'
);
if ($trim !== '') {
return false;
}
}
}
$regexp = $config->get('Attr.IDBlacklistRegexp');
if ($regexp && preg_match($regexp, $id)) {
return false;
}
if (!$this->selector) {
$id_accumulator->add($id);
}
// if no change was made to the ID, return the result
// else, return the new id if stripping whitespace made it
// valid, or return false.
return $id;
}
}
// vim: et sw=4 sts=4

56
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php

@ -0,0 +1,56 @@
<?php
/**
* Validates the HTML type length (not to be confused with CSS's length).
*
* This accepts integer pixels or percentages as lengths for certain
* HTML attributes.
*/
class HTMLPurifier_AttrDef_HTML_Length extends HTMLPurifier_AttrDef_HTML_Pixels
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
if ($string === '') {
return false;
}
$parent_result = parent::validate($string, $config, $context);
if ($parent_result !== false) {
return $parent_result;
}
$length = strlen($string);
$last_char = $string[$length - 1];
if ($last_char !== '%') {
return false;
}
$points = substr($string, 0, $length - 1);
if (!is_numeric($points)) {
return false;
}
$points = (int)$points;
if ($points < 0) {
return '0%';
}
if ($points > 100) {
return '100%';
}
return ((string)$points) . '%';
}
}
// vim: et sw=4 sts=4

72
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php

@ -0,0 +1,72 @@
<?php
/**
* Validates a rel/rev link attribute against a directive of allowed values
* @note We cannot use Enum because link types allow multiple
* values.
* @note Assumes link types are ASCII text
*/
class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef
{
/**
* Name config attribute to pull.
* @type string
*/
protected $name;
/**
* @param string $name
*/
public function __construct($name)
{
$configLookup = array(
'rel' => 'AllowedRel',
'rev' => 'AllowedRev'
);
if (!isset($configLookup[$name])) {
trigger_error(
'Unrecognized attribute name for link ' .
'relationship.',
E_USER_ERROR
);
return;
}
$this->name = $configLookup[$name];
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$allowed = $config->get('Attr.' . $this->name);
if (empty($allowed)) {
return false;
}
$string = $this->parseCDATA($string);
$parts = explode(' ', $string);
// lookup to prevent duplicates
$ret_lookup = array();
foreach ($parts as $part) {
$part = strtolower(trim($part));
if (!isset($allowed[$part])) {
continue;
}
$ret_lookup[$part] = true;
}
if (empty($ret_lookup)) {
return false;
}
$string = implode(' ', array_keys($ret_lookup));
return $string;
}
}
// vim: et sw=4 sts=4

60
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php

@ -0,0 +1,60 @@
<?php
/**
* Validates a MultiLength as defined by the HTML spec.
*
* A multilength is either a integer (pixel count), a percentage, or
* a relative number.
*/
class HTMLPurifier_AttrDef_HTML_MultiLength extends HTMLPurifier_AttrDef_HTML_Length
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
if ($string === '') {
return false;
}
$parent_result = parent::validate($string, $config, $context);
if ($parent_result !== false) {
return $parent_result;
}
$length = strlen($string);
$last_char = $string[$length - 1];
if ($last_char !== '*') {
return false;
}
$int = substr($string, 0, $length - 1);
if ($int == '') {
return '*';
}
if (!is_numeric($int)) {
return false;
}
$int = (int)$int;
if ($int < 0) {
return false;
}
if ($int == 0) {
return '0';
}
if ($int == 1) {
return '*';
}
return ((string)$int) . '*';
}
}
// vim: et sw=4 sts=4

70
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php

@ -0,0 +1,70 @@
<?php
/**
* Validates contents based on NMTOKENS attribute type.
*/
class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
// early abort: '' and '0' (strings that convert to false) are invalid
if (!$string) {
return false;
}
$tokens = $this->split($string, $config, $context);
$tokens = $this->filter($tokens, $config, $context);
if (empty($tokens)) {
return false;
}
return implode(' ', $tokens);
}
/**
* Splits a space separated list of tokens into its constituent parts.
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
protected function split($string, $config, $context)
{
// OPTIMIZABLE!
// do the preg_match, capture all subpatterns for reformulation
// we don't support U+00A1 and up codepoints or
// escaping because I don't know how to do that with regexps
// and plus it would complicate optimization efforts (you never
// see that anyway).
$pattern = '/(?:(?<=\s)|\A)' . // look behind for space or string start
'((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' .
'(?:(?=\s)|\z)/'; // look ahead for space or string end
preg_match_all($pattern, $string, $matches);
return $matches[1];
}
/**
* Template method for removing certain tokens based on arbitrary criteria.
* @note If we wanted to be really functional, we'd do an array_filter
* with a callback. But... we're not.
* @param array $tokens
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
protected function filter($tokens, $config, $context)
{
return $tokens;
}
}
// vim: et sw=4 sts=4

76
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php

@ -0,0 +1,76 @@
<?php
/**
* Validates an integer representation of pixels according to the HTML spec.
*/
class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef
{
/**
* @type int
*/
protected $max;
/**
* @param int $max
*/
public function __construct($max = null)
{
$this->max = $max;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
if ($string === '0') {
return $string;
}
if ($string === '') {
return false;
}
$length = strlen($string);
if (substr($string, $length - 2) == 'px') {
$string = substr($string, 0, $length - 2);
}
if (!is_numeric($string)) {
return false;
}
$int = (int)$string;
if ($int < 0) {
return '0';
}
// upper-bound value, extremely high values can
// crash operating systems, see <http://ha.ckers.org/imagecrash.html>
// WARNING, above link WILL crash you if you're using Windows
if ($this->max !== null && $int > $this->max) {
return (string)$this->max;
}
return (string)$int;
}
/**
* @param string $string
* @return HTMLPurifier_AttrDef
*/
public function make($string)
{
if ($string === '') {
$max = null;
} else {
$max = (int)$string;
}
$class = get_class($this);
return new $class($max);
}
}
// vim: et sw=4 sts=4

91
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php

@ -0,0 +1,91 @@
<?php
/**
* Validates an integer.
* @note While this class was modeled off the CSS definition, no currently
* allowed CSS uses this type. The properties that do are: widows,
* orphans, z-index, counter-increment, counter-reset. Some of the
* HTML attributes, however, find use for a non-negative version of this.
*/
class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef
{
/**
* Whether or not negative values are allowed.
* @type bool
*/
protected $negative = true;
/**
* Whether or not zero is allowed.
* @type bool
*/
protected $zero = true;
/**
* Whether or not positive values are allowed.
* @type bool
*/
protected $positive = true;
/**
* @param $negative Bool indicating whether or not negative values are allowed
* @param $zero Bool indicating whether or not zero is allowed
* @param $positive Bool indicating whether or not positive values are allowed
*/
public function __construct($negative = true, $zero = true, $positive = true)
{
$this->negative = $negative;
$this->zero = $zero;
$this->positive = $positive;
}
/**
* @param string $integer
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($integer, $config, $context)
{
$integer = $this->parseCDATA($integer);
if ($integer === '') {
return false;
}
// we could possibly simply typecast it to integer, but there are
// certain fringe cases that must not return an integer.
// clip leading sign
if ($this->negative && $integer[0] === '-') {
$digits = substr($integer, 1);
if ($digits === '0') {
$integer = '0';
} // rm minus sign for zero
} elseif ($this->positive && $integer[0] === '+') {
$digits = $integer = substr($integer, 1); // rm unnecessary plus
} else {
$digits = $integer;
}
// test if it's numeric
if (!ctype_digit($digits)) {
return false;
}
// perform scope tests
if (!$this->zero && $integer == 0) {
return false;
}
if (!$this->positive && $integer > 0) {
return false;
}
if (!$this->negative && $integer < 0) {
return false;
}
return $integer;
}
}
// vim: et sw=4 sts=4

86
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php

@ -0,0 +1,86 @@
<?php
/**
* Validates the HTML attribute lang, effectively a language code.
* @note Built according to RFC 3066, which obsoleted RFC 1766
*/
class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$string = trim($string);
if (!$string) {
return false;
}
$subtags = explode('-', $string);
$num_subtags = count($subtags);
if ($num_subtags == 0) { // sanity check
return false;
}
// process primary subtag : $subtags[0]
$length = strlen($subtags[0]);
switch ($length) {
case 0:
return false;
case 1:
if (!($subtags[0] == 'x' || $subtags[0] == 'i')) {
return false;
}
break;
case 2:
case 3:
if (!ctype_alpha($subtags[0])) {
return false;
} elseif (!ctype_lower($subtags[0])) {
$subtags[0] = strtolower($subtags[0]);
}
break;
default:
return false;
}
$new_string = $subtags[0];
if ($num_subtags == 1) {
return $new_string;
}
// process second subtag : $subtags[1]
$length = strlen($subtags[1]);
if ($length == 0 || ($length == 1 && $subtags[1] != 'x') || $length > 8 || !ctype_alnum($subtags[1])) {
return $new_string;
}
if (!ctype_lower($subtags[1])) {
$subtags[1] = strtolower($subtags[1]);
}
$new_string .= '-' . $subtags[1];
if ($num_subtags == 2) {
return $new_string;
}
// process all other subtags, index 2 and up
for ($i = 2; $i < $num_subtags; $i++) {
$length = strlen($subtags[$i]);
if ($length == 0 || $length > 8 || !ctype_alnum($subtags[$i])) {
return $new_string;
}
if (!ctype_lower($subtags[$i])) {
$subtags[$i] = strtolower($subtags[$i]);
}
$new_string .= '-' . $subtags[$i];
}
return $new_string;
}
}
// vim: et sw=4 sts=4

53
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php

@ -0,0 +1,53 @@
<?php
/**
* Decorator that, depending on a token, switches between two definitions.
*/
class HTMLPurifier_AttrDef_Switch
{
/**
* @type string
*/
protected $tag;
/**
* @type HTMLPurifier_AttrDef
*/
protected $withTag;
/**
* @type HTMLPurifier_AttrDef
*/
protected $withoutTag;
/**
* @param string $tag Tag name to switch upon
* @param HTMLPurifier_AttrDef $with_tag Call if token matches tag
* @param HTMLPurifier_AttrDef $without_tag Call if token doesn't match, or there is no token
*/
public function __construct($tag, $with_tag, $without_tag)
{
$this->tag = $tag;
$this->withTag = $with_tag;
$this->withoutTag = $without_tag;
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$token = $context->get('CurrentToken', true);
if (!$token || $token->name !== $this->tag) {
return $this->withoutTag->validate($string, $config, $context);
} else {
return $this->withTag->validate($string, $config, $context);
}
}
}
// vim: et sw=4 sts=4

21
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php

@ -0,0 +1,21 @@
<?php
/**
* Validates arbitrary text according to the HTML spec.
*/
class HTMLPurifier_AttrDef_Text extends HTMLPurifier_AttrDef
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
return $this->parseCDATA($string);
}
}
// vim: et sw=4 sts=4

111
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php

@ -0,0 +1,111 @@
<?php
/**
* Validates a URI as defined by RFC 3986.
* @note Scheme-specific mechanics deferred to HTMLPurifier_URIScheme
*/
class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
{
/**
* @type HTMLPurifier_URIParser
*/
protected $parser;
/**
* @type bool
*/
protected $embedsResource;
/**
* @param bool $embeds_resource Does the URI here result in an extra HTTP request?
*/
public function __construct($embeds_resource = false)
{
$this->parser = new HTMLPurifier_URIParser();
$this->embedsResource = (bool)$embeds_resource;
}
/**
* @param string $string
* @return HTMLPurifier_AttrDef_URI
*/
public function make($string)
{
$embeds = ($string === 'embedded');
return new HTMLPurifier_AttrDef_URI($embeds);
}
/**
* @param string $uri
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($uri, $config, $context)
{
if ($config->get('URI.Disable')) {
return false;
}
$uri = $this->parseCDATA($uri);
// parse the URI
$uri = $this->parser->parse($uri);
if ($uri === false) {
return false;
}
// add embedded flag to context for validators
$context->register('EmbeddedURI', $this->embedsResource);
$ok = false;
do {
// generic validation
$result = $uri->validate($config, $context);
if (!$result) {
break;
}
// chained filtering
$uri_def = $config->getDefinition('URI');
$result = $uri_def->filter($uri, $config, $context);
if (!$result) {
break;
}
// scheme-specific validation
$scheme_obj = $uri->getSchemeObj($config, $context);
if (!$scheme_obj) {
break;
}
if ($this->embedsResource && !$scheme_obj->browsable) {
break;
}
$result = $scheme_obj->validate($uri, $config, $context);
if (!$result) {
break;
}
// Post chained filtering
$result = $uri_def->postFilter($uri, $config, $context);
if (!$result) {
break;
}
// survived gauntlet
$ok = true;
} while (false);
$context->destroy('EmbeddedURI');
if (!$ok) {
return false;
}
// back to string
return $uri->toString();
}
}
// vim: et sw=4 sts=4

20
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php

@ -0,0 +1,20 @@
<?php
abstract class HTMLPurifier_AttrDef_URI_Email extends HTMLPurifier_AttrDef
{
/**
* Unpacks a mailbox into its display-name and address
* @param string $string
* @return mixed
*/
public function unpack($string)
{
// needs to be implemented
}
}
// sub-implementations
// vim: et sw=4 sts=4

29
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php

@ -0,0 +1,29 @@
<?php
/**
* Primitive email validation class based on the regexp found at
* http://www.regular-expressions.info/email.html
*/
class HTMLPurifier_AttrDef_URI_Email_SimpleCheck extends HTMLPurifier_AttrDef_URI_Email
{
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
// no support for named mailboxes i.e. "Bob <bob@example.com>"
// that needs more percent encoding to be done
if ($string == '') {
return false;
}
$string = trim($string);
$result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string);
return $result ? $string : false;
}
}
// vim: et sw=4 sts=4

142
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php

@ -0,0 +1,142 @@
<?php
/**
* Validates a host according to the IPv4, IPv6 and DNS (future) specifications.
*/
class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
{
/**
* IPv4 sub-validator.
* @type HTMLPurifier_AttrDef_URI_IPv4
*/
protected $ipv4;
/**
* IPv6 sub-validator.
* @type HTMLPurifier_AttrDef_URI_IPv6
*/
protected $ipv6;
public function __construct()
{
$this->ipv4 = new HTMLPurifier_AttrDef_URI_IPv4();
$this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6();
}
/**
* @param string $string
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($string, $config, $context)
{
$length = strlen($string);
// empty hostname is OK; it's usually semantically equivalent:
// the default host as defined by a URI scheme is used:
//
// If the URI scheme defines a default for host, then that
// default applies when the host subcomponent is undefined
// or when the registered name is empty (zero length).
if ($string === '') {
return '';
}
if ($length > 1 && $string[0] === '[' && $string[$length - 1] === ']') {
//IPv6
$ip = substr($string, 1, $length - 2);
$valid = $this->ipv6->validate($ip, $config, $context);
if ($valid === false) {
return false;
}
return '[' . $valid . ']';
}
// need to do checks on unusual encodings too
$ipv4 = $this->ipv4->validate($string, $config, $context);
if ($ipv4 !== false) {
return $ipv4;
}
// A regular domain name.
// This doesn't match I18N domain names, but we don't have proper IRI support,
// so force users to insert Punycode.
// There is not a good sense in which underscores should be
// allowed, since it's technically not! (And if you go as
// far to allow everything as specified by the DNS spec...
// well, that's literally everything, modulo some space limits
// for the components and the overall name (which, by the way,
// we are NOT checking!). So we (arbitrarily) decide this:
// let's allow underscores wherever we would have allowed
// hyphens, if they are enabled. This is a pretty good match
// for browser behavior, for example, a large number of browsers
// cannot handle foo_.example.com, but foo_bar.example.com is
// fairly well supported.
$underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : '';
// Based off of RFC 1738, but amended so that
// as per RFC 3696, the top label need only not be all numeric.
// The productions describing this are:
$a = '[a-z]'; // alpha
$an = '[a-z0-9]'; // alphanum
$and = "[a-z0-9-$underscore]"; // alphanum | "-"
// domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
$domainlabel = "$an(?:$and*$an)?";
// AMENDED as per RFC 3696
// toplabel = alphanum | alphanum *( alphanum | "-" ) alphanum
// side condition: not all numeric
$toplabel = "$an(?:$and*$an)?";
// hostname = *( domainlabel "." ) toplabel [ "." ]
if (preg_match("/^(?:$domainlabel\.)*($toplabel)\.?$/i", $string, $matches)) {
if (!ctype_digit($matches[1])) {
return $string;
}
}
// PHP 5.3 and later support this functionality natively
if (function_exists('idn_to_ascii')) {
if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) {
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
} else {
$string = idn_to_ascii($string);
}
// If we have Net_IDNA2 support, we can support IRIs by
// punycoding them. (This is the most portable thing to do,
// since otherwise we have to assume browsers support
} elseif ($config->get('Core.EnableIDNA') && class_exists('Net_IDNA2')) {
$idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true));
// we need to encode each period separately
$parts = explode('.', $string);
try {
$new_parts = array();
foreach ($parts as $part) {
$encodable = false;
for ($i = 0, $c = strlen($part); $i < $c; $i++) {
if (ord($part[$i]) > 0x7a) {
$encodable = true;
break;
}
}
if (!$encodable) {
$new_parts[] = $part;
} else {
$new_parts[] = $idna->encode($part);
}
}
$string = implode('.', $new_parts);
} catch (Exception $e) {
// XXX error reporting
}
}
// Try again
if (preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string)) {
return $string;
}
return false;
}
}
// vim: et sw=4 sts=4

45
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php

@ -0,0 +1,45 @@
<?php
/**
* Validates an IPv4 address
* @author Feyd @ forums.devnetwork.net (public domain)
*/
class HTMLPurifier_AttrDef_URI_IPv4 extends HTMLPurifier_AttrDef
{
/**
* IPv4 regex, protected so that IPv6 can reuse it.
* @type string
*/
protected $ip4;
/**
* @param string $aIP
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($aIP, $config, $context)
{
if (!$this->ip4) {
$this->_loadRegex();
}
if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) {
return $aIP;
}
return false;
}
/**
* Lazy load function to prevent regex from being stuffed in
* cache.
*/
protected function _loadRegex()
{
$oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255
$this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})";
}
}
// vim: et sw=4 sts=4

89
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php

@ -0,0 +1,89 @@
<?php
/**
* Validates an IPv6 address.
* @author Feyd @ forums.devnetwork.net (public domain)
* @note This function requires brackets to have been removed from address
* in URI.
*/
class HTMLPurifier_AttrDef_URI_IPv6 extends HTMLPurifier_AttrDef_URI_IPv4
{
/**
* @param string $aIP
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($aIP, $config, $context)
{
if (!$this->ip4) {
$this->_loadRegex();
}
$original = $aIP;
$hex = '[0-9a-fA-F]';
$blk = '(?:' . $hex . '{1,4})';
$pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128
// prefix check
if (strpos($aIP, '/') !== false) {
if (preg_match('#' . $pre . '$#s', $aIP, $find)) {
$aIP = substr($aIP, 0, 0 - strlen($find[0]));
unset($find);
} else {
return false;
}
}
// IPv4-compatiblity check
if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) {
$aIP = substr($aIP, 0, 0 - strlen($find[0]));
$ip = explode('.', $find[0]);
$ip = array_map('dechex', $ip);
$aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3];
unset($find, $ip);
}
// compression check
$aIP = explode('::', $aIP);
$c = count($aIP);
if ($c > 2) {
return false;
} elseif ($c == 2) {
list($first, $second) = $aIP;
$first = explode(':', $first);
$second = explode(':', $second);
if (count($first) + count($second) > 8) {
return false;
}
while (count($first) < 8) {
array_push($first, '0');
}
array_splice($first, 8 - count($second), 8, $second);
$aIP = $first;
unset($first, $second);
} else {
$aIP = explode(':', $aIP[0]);
}
$c = count($aIP);
if ($c != 8) {
return false;
}
// All the pieces should be 16-bit hex strings. Are they?
foreach ($aIP as $piece) {
if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) {
return false;
}
}
return $original;
}
}
// vim: et sw=4 sts=4

60
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php

@ -0,0 +1,60 @@
<?php
/**
* Processes an entire attribute array for corrections needing multiple values.
*
* Occasionally, a certain attribute will need to be removed and popped onto
* another value. Instead of creating a complex return syntax for
* HTMLPurifier_AttrDef, we just pass the whole attribute array to a
* specialized object and have that do the special work. That is the
* family of HTMLPurifier_AttrTransform.
*
* An attribute transformation can be assigned to run before or after
* HTMLPurifier_AttrDef validation. See HTMLPurifier_HTMLDefinition for
* more details.
*/
abstract class HTMLPurifier_AttrTransform
{
/**
* Abstract: makes changes to the attributes dependent on multiple values.
*
* @param array $attr Assoc array of attributes, usually from
* HTMLPurifier_Token_Tag::$attr
* @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object.
* @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object
* @return array Processed attribute array.
*/
abstract public function transform($attr, $config, $context);
/**
* Prepends CSS properties to the style attribute, creating the
* attribute if it doesn't exist.
* @param array &$attr Attribute array to process (passed by reference)
* @param string $css CSS to prepend
*/
public function prependCSS(&$attr, $css)
{
$attr['style'] = isset($attr['style']) ? $attr['style'] : '';
$attr['style'] = $css . $attr['style'];
}
/**
* Retrieves and removes an attribute
* @param array &$attr Attribute array to process (passed by reference)
* @param mixed $key Key of attribute to confiscate
* @return mixed
*/
public function confiscateAttr(&$attr, $key)
{
if (!isset($attr[$key])) {
return null;
}
$value = $attr[$key];
unset($attr[$key]);
return $value;
}
}
// vim: et sw=4 sts=4

28
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php

@ -0,0 +1,28 @@
<?php
/**
* Pre-transform that changes proprietary background attribute to CSS.
*/
class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTransform
{
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (!isset($attr['background'])) {
return $attr;
}
$background = $this->confiscateAttr($attr, 'background');
// some validation should happen here
$this->prependCSS($attr, "background-image:url($background);");
return $attr;
}
}
// vim: et sw=4 sts=4

27
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php

@ -0,0 +1,27 @@
<?php
// this MUST be placed in post, as it assumes that any value in dir is valid
/**
* Post-trasnform that ensures that bdo tags have the dir attribute set.
*/
class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
{
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (isset($attr['dir'])) {
return $attr;
}
$attr['dir'] = $config->get('Attr.DefaultTextDir');
return $attr;
}
}
// vim: et sw=4 sts=4

28
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php

@ -0,0 +1,28 @@
<?php
/**
* Pre-transform that changes deprecated bgcolor attribute to CSS.
*/
class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform
{
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (!isset($attr['bgcolor'])) {
return $attr;
}
$bgcolor = $this->confiscateAttr($attr, 'bgcolor');
// some validation should happen here
$this->prependCSS($attr, "background-color:$bgcolor;");
return $attr;
}
}
// vim: et sw=4 sts=4

47
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php

@ -0,0 +1,47 @@
<?php
/**
* Pre-transform that changes converts a boolean attribute to fixed CSS
*/
class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform
{
/**
* Name of boolean attribute that is trigger.
* @type string
*/
protected $attr;
/**
* CSS declarations to add to style, needs trailing semicolon.
* @type string
*/
protected $css;
/**
* @param string $attr attribute name to convert from
* @param string $css CSS declarations to add to style (needs semicolon)
*/
public function __construct($attr, $css)
{
$this->attr = $attr;
$this->css = $css;
}
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (!isset($attr[$this->attr])) {
return $attr;
}
unset($attr[$this->attr]);
$this->prependCSS($attr, $this->css);
return $attr;
}
}
// vim: et sw=4 sts=4

26
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php

@ -0,0 +1,26 @@
<?php
/**
* Pre-transform that changes deprecated border attribute to CSS.
*/
class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform
{
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (!isset($attr['border'])) {
return $attr;
}
$border_width = $this->confiscateAttr($attr, 'border');
// some validation should happen here
$this->prependCSS($attr, "border:{$border_width}px solid;");
return $attr;
}
}
// vim: et sw=4 sts=4

68
wms/contract-repair/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php

@ -0,0 +1,68 @@
<?php
/**
* Generic pre-transform that converts an attribute with a fixed number of
* values (enumerated) to CSS.
*/
class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform
{
/**
* Name of attribute to transform from.
* @type string
*/
protected $attr;
/**
* Lookup array of attribute values to CSS.
* @type array
*/
protected $enumToCSS = array();
/**
* Case sensitivity of the matching.
* @type bool
* @warning Currently can only be guaranteed to work with ASCII
* values.
*/
protected $caseSensitive = false;
/**
* @param string $attr Attribute name to transform from
* @param array $enum_to_css Lookup array of attribute values to CSS
* @param bool $case_sensitive Case sensitivity indicator, default false
*/
public function __construct($attr, $enum_to_css, $case_sensitive = false)
{
$this->attr = $attr;
$this->enumToCSS = $enum_to_css;
$this->caseSensitive = (bool)$case_sensitive;
}
/**
* @param array $attr
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return array
*/
public function transform($attr, $config, $context)
{
if (!isset($attr[$this->attr])) {
return $attr;
}
$value = trim($attr[$this->attr]);
unset($attr[$this->attr]);
if (!$this->caseSensitive) {
$value = strtolower($value);
}
if (!isset($this->enumToCSS[$value])) {
return $attr;
}
$this->prependCSS($attr, $this->enumToCSS[$value]);
return $attr;
}
}
// vim: et sw=4 sts=4

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save