|
@@ -535,7 +535,7 @@ class ChangeController extends DooController
|
|
|
//附件添加cid
|
|
|
if(!empty($_POST['changeatt'])){
|
|
|
Doo::loadModel('changeatt');
|
|
|
- $attlist = explode(',', $_POST['changeatt']);
|
|
|
+ $attlist = explode('{,}', $_POST['changeatt']);
|
|
|
foreach($attlist as $ak => $av){
|
|
|
$changeAtt = new ChangeAtt();
|
|
|
$changeAtt->id = $av;
|
|
@@ -595,10 +595,10 @@ class ChangeController extends DooController
|
|
|
Doo::loadModel('changeauditlist');
|
|
|
$total = 0;
|
|
|
if(!empty($_POST['changelist'])){
|
|
|
- $clist = explode(',',$_POST['changelist']);
|
|
|
+ $clist = explode('{,}',$_POST['changelist']);
|
|
|
foreach($clist as $ck => $cv){
|
|
|
$clistid = explode('->',$cv)[0];
|
|
|
- $clistarr = explode(';',explode('->',$cv)[1]);
|
|
|
+ $clistarr = explode('<;>',explode('->',$cv)[1]);
|
|
|
if(!empty($clistarr[0]) && !empty($clistarr[1]) && is_numeric($clistarr[3]) && is_numeric($clistarr[4]) && is_numeric($clistarr[5])){
|
|
|
$changelistArr = $this->change->getChangeListbyid($clistid);
|
|
|
if(!empty($changelistArr)){
|
|
@@ -640,9 +640,9 @@ class ChangeController extends DooController
|
|
|
}
|
|
|
}
|
|
|
if(!empty($_POST['changewhitelist'])){
|
|
|
- $wlist = explode(',',$_POST['changewhitelist']);
|
|
|
+ $wlist = explode('{,}',$_POST['changewhitelist']);
|
|
|
foreach($wlist as $wk => $wv){
|
|
|
- $wlistarr = explode(';',explode('->',$wv)[1]);
|
|
|
+ $wlistarr = explode('<;>',explode('->',$wv)[1]);
|
|
|
if(!empty($wlistarr[0]) && !empty($wlistarr[1]) && is_numeric($wlistarr[3]) && is_numeric($wlistarr[4]) && is_numeric($wlistarr[5])){
|
|
|
$total += todecimal(floatval($wlistarr[3])*floatval($wlistarr[5]),$decimalnum['costdnum']);
|
|
|
|
|
@@ -1224,7 +1224,7 @@ class ChangeController extends DooController
|
|
|
//附件添加cid
|
|
|
if(!empty($_POST['changeatt'])){
|
|
|
Doo::loadModel('changeatt');
|
|
|
- $attlist = explode(',', $_POST['changeatt']);
|
|
|
+ $attlist = explode('{,}', $_POST['changeatt']);
|
|
|
foreach($attlist as $ak => $av){
|
|
|
$changeAtt = new ChangeAtt();
|
|
|
$changeAtt->id = $av;
|
|
@@ -1273,10 +1273,10 @@ class ChangeController extends DooController
|
|
|
//清单添加,不分顺序,最终展示按清单编号排序
|
|
|
$total = 0;
|
|
|
if(!empty($_POST['changelist'])){
|
|
|
- $clist = explode(',',$_POST['changelist']);
|
|
|
+ $clist = explode('{,}',$_POST['changelist']);
|
|
|
foreach($clist as $ck => $cv){
|
|
|
$clistid = explode('->',$cv)[0];
|
|
|
- $clistarr = explode(';',explode('->',$cv)[1]);
|
|
|
+ $clistarr = explode('<;>',explode('->',$cv)[1]);
|
|
|
if(!empty($clistarr[0]) && !empty($clistarr[1]) && is_numeric($clistarr[3]) && is_numeric($clistarr[4]) && is_numeric($clistarr[5])){
|
|
|
$changelistArr = $this->change->getChangeListbyid($clistid);
|
|
|
if(!empty($changelistArr)){
|
|
@@ -1318,9 +1318,9 @@ class ChangeController extends DooController
|
|
|
}
|
|
|
}
|
|
|
if(!empty($_POST['changewhitelist'])){
|
|
|
- $wlist = explode(',',$_POST['changewhitelist']);
|
|
|
+ $wlist = explode('{,}',$_POST['changewhitelist']);
|
|
|
foreach($wlist as $wk => $wv){
|
|
|
- $wlistarr = explode(';',explode('->',$wv)[1]);
|
|
|
+ $wlistarr = explode('<;>',explode('->',$wv)[1]);
|
|
|
if(!empty($wlistarr[0]) && !empty($wlistarr[1]) && is_numeric($wlistarr[3]) && is_numeric($wlistarr[4]) && is_numeric($wlistarr[5])){
|
|
|
$total += todecimal(floatval($wlistarr[3])*floatval($wlistarr[5]),$decimalnum['costdnum']);
|
|
|
|
|
@@ -1436,12 +1436,12 @@ class ChangeController extends DooController
|
|
|
$oneclist = $this->change->getChangeListbyid($cv['lid']);
|
|
|
if($cv['lid'] != 0 && !empty($oneclist)){
|
|
|
array_push($changeidlist,$cv['lid']);
|
|
|
- array_push($changelist,$cv['lid'].'->'.$cv['lnum'].';'.$cv['lname'].';'.$cv['unit'].';'.$cv['unitprice'].';'.$cv['oamount'].';'.$cv['camount']);
|
|
|
+ array_push($changelist,$cv['lid'].'->'.$cv['lnum'].'<;>'.$cv['lname'].'<;>'.$cv['unit'].'<;>'.$cv['unitprice'].'<;>'.$cv['oamount'].'<;>'.$cv['camount']);
|
|
|
$clist[$ck]['iswhite'] = 0;
|
|
|
array_push($changeRepeatList, $cv['lnum'].'|'.$cv['lname'].'|'.$cv['unit'].'|'.$cv['unitprice']);
|
|
|
}else{
|
|
|
$clist[$ck]['add'] = $addnum;
|
|
|
- array_push($changewhitelist,$addnum.'->'.$cv['lnum'].';'.$cv['lname'].';'.$cv['unit'].';'.$cv['unitprice'].';'.$cv['oamount'].';'.$cv['camount']);
|
|
|
+ array_push($changewhitelist,$addnum.'->'.$cv['lnum'].'<;>'.$cv['lname'].'<;>'.$cv['unit'].'<;>'.$cv['unitprice'].'<;>'.$cv['oamount'].'<;>'.$cv['camount']);
|
|
|
$addnum++;
|
|
|
$clist[$ck]['changeunit'] = $this->changeUnit;
|
|
|
$clist[$ck]['iswhite'] = 1;
|
|
@@ -1451,15 +1451,15 @@ class ChangeController extends DooController
|
|
|
$ototalnum += $osum;
|
|
|
}
|
|
|
}
|
|
|
- $this->data['changelist'] = implode(',',$changelist);
|
|
|
- $this->data['changewhitelist'] = implode(',',$changewhitelist);
|
|
|
+ $this->data['changelist'] = implode('{,}',$changelist);
|
|
|
+ $this->data['changewhitelist'] = implode('{,}',$changewhitelist);
|
|
|
$this->data['changeidlist'] = implode(',',$changeidlist);
|
|
|
$this->data['ototalnum'] = $ototalnum;
|
|
|
$this->data['ctotalnum'] = todecimal($ctotalnum,$decimalnum['costdnum']);
|
|
|
$this->data['clist'] = $clist;
|
|
|
|
|
|
- $this->data['changeRepeatList'] = implode(',',$changeRepeatList);
|
|
|
- $this->data['changeRepeatWhiteList'] = implode(',',$changeRepeatWhiteList);
|
|
|
+ $this->data['changeRepeatList'] = implode('{,}',$changeRepeatList);
|
|
|
+ $this->data['changeRepeatWhiteList'] = implode('{,}',$changeRepeatWhiteList);
|
|
|
|
|
|
//获取已添加的附件列表
|
|
|
$attlist = $this->change->getChangeAttListbycid($cid);
|
|
@@ -1663,7 +1663,7 @@ class ChangeController extends DooController
|
|
|
$fileArray = $this->change->getChangeAttbyFid($fid);
|
|
|
if (!empty($fileArray)) {
|
|
|
$pathf = DOO::conf()->SITE_PATH;
|
|
|
- $this->file_down($pathf.$fileArray['filepath'],$fileArray['filename'].'.'.$fileArray['fileext']);
|
|
|
+ $this->file_down($pathf.$fileArray['filepath'], $fileArray['filesize'], $fileArray['filename'].'.'.$fileArray['fileext']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1862,18 +1862,47 @@ class ChangeController extends DooController
|
|
|
* @param $filepath 文件路径
|
|
|
* @param $filename 文件名称
|
|
|
*/
|
|
|
- public function file_down($filepath,$filename) {
|
|
|
+// public function file_down($filepath,$filename) {
|
|
|
+// if (ob_get_length() !== false)
|
|
|
+// @ob_end_clean();
|
|
|
+// header('Content-Description: File Download');
|
|
|
+// header('Content-Type: application/octet-stream');
|
|
|
+// header('Content-Disposition: attachment; filename='.basename($filename));
|
|
|
+// header('Content-Transfer-Encoding: binary');
|
|
|
+// header('Expires: 0');
|
|
|
+// header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
|
|
+// header('Pragma: public');
|
|
|
+// header('Content-Length: ' . filesize($filepath));
|
|
|
+// @readfile($filepath);
|
|
|
+// exit;
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 文件下载
|
|
|
+ * @param $filepath 文件路径
|
|
|
+ * @param $filename 文件名称
|
|
|
+ */
|
|
|
+ function file_down($filepath, $filesize, $filename = '')
|
|
|
+ {
|
|
|
+ if (!$filename)
|
|
|
+ $filename = basename($filepath);
|
|
|
+ if ($this->is_ie())
|
|
|
+ $filename = rawurlencode($filename);
|
|
|
+ $filetype = $this->fileext($filename);
|
|
|
+// $filesize = sprintf("%u", filesize($filepath));
|
|
|
if (ob_get_length() !== false)
|
|
|
@ob_end_clean();
|
|
|
- header('Content-Description: File Download');
|
|
|
- header('Content-Type: application/octet-stream');
|
|
|
- header('Content-Disposition: attachment; filename='.basename($filename));
|
|
|
- header('Content-Transfer-Encoding: binary');
|
|
|
- header('Expires: 0');
|
|
|
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
|
|
header('Pragma: public');
|
|
|
- header('Content-Length: ' . filesize($filepath));
|
|
|
+ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
|
|
+ header('Cache-Control: no-store, no-cache, must-revalidate');
|
|
|
+ header('Cache-Control: pre-check=0, post-check=0, max-age=0');
|
|
|
+ header('Content-Transfer-Encoding: binary');
|
|
|
+ header('Content-Encoding: none');
|
|
|
+ header('Content-type: ' . $filetype);
|
|
|
+ header('Content-Disposition: attachment; filename="' . $filename . '"');
|
|
|
+ header('Content-length: ' . $filesize);
|
|
|
@readfile($filepath);
|
|
|
+ exit;
|
|
|
}
|
|
|
|
|
|
}
|