@@ -11,10 +11,10 @@ |
||
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | if (isset($_FILES['UploadedAttachments']) && isset($_POST['Attachment_TrId'])) { |
| 14 | - $TrNumber = (int) $_POST['Attachment_TrId']; |
|
| 14 | + $TrNumber = (int)$_POST['Attachment_TrId']; |
|
| 15 | 15 | $FileName = $_FILES['UploadedAttachments']['name']; |
| 16 | - $FileExtension = substr($FileName, strpos($FileName, '.') + 1, strlen($FileName)); |
|
| 17 | - $NewFileName = 'Transaction_'.$TrNumber.'_Attach'.(attachments::get_number_of_attachments($TrNumber) + 1).'.'.$FileExtension; |
|
| 16 | + $FileExtension = substr($FileName, strpos($FileName, '.')+1, strlen($FileName)); |
|
| 17 | + $NewFileName = 'Transaction_'.$TrNumber.'_Attach'.(attachments::get_number_of_attachments($TrNumber)+1).'.'.$FileExtension; |
|
| 18 | 18 | move_uploaded_file($_FILES['UploadedAttachments']['tmp_name'], 'attachments/'.$NewFileName); |
| 19 | 19 | echo $NewFileName; |
| 20 | 20 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | if (!empty($TransactionsArr)) { |
| 61 | 61 | for ($i = 0; $i < count($TransactionsArr); $i++) { |
| 62 | 62 | $TransactionsArr[$i]['Attachments'] = |
| 63 | - implode(';', attachments::get_attachments_filename_array((int) $TransactionsArr[$i]['ID'])); |
|
| 63 | + implode(';', attachments::get_attachments_filename_array((int)$TransactionsArr[$i]['ID'])); |
|
| 64 | 64 | } |
| 65 | 65 | echo json_encode($TransactionsArr, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_FORCE_OBJECT); |
| 66 | 66 | } |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | if (function_exists('com_create_guid')) { |
| 808 | 808 | return com_create_guid(); |
| 809 | 809 | } else { |
| 810 | - mt_srand((float) microtime() * 10000); |
|
| 810 | + mt_srand((float)microtime() * 10000); |
|
| 811 | 811 | $charid = strtoupper(md5(uniqid(rand(), true))); |
| 812 | 812 | $hyphen = chr(45); // "-" |
| 813 | 813 | $uuid = chr(123)// "{" |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | if ($handle = opendir(costant::attachments_folder())) { |
| 1044 | 1044 | while (false !== ($entry = readdir($handle))) { |
| 1045 | 1045 | if (strpos($entry, 'Transaction_'.$TrID) == 0 && strpos($entry, 'Transaction_'.$TrID) !== false) { |
| 1046 | - $AttachNumb = substr($entry, strpos($entry, 'Attach') + 6, strpos($entry, '.') - (strpos($entry, 'Attach') + 6)); |
|
| 1046 | + $AttachNumb = substr($entry, strpos($entry, 'Attach')+6, strpos($entry, '.')-(strpos($entry, 'Attach')+6)); |
|
| 1047 | 1047 | if ($AttachNumb > $LastAttachNum) { |
| 1048 | 1048 | $LastAttachNum = $AttachNumb; |
| 1049 | 1049 | } |