@@ -944,6 +944,9 @@ discard block |
||
944 | 944 | $db = null; |
945 | 945 | } |
946 | 946 | |
947 | + /** |
|
948 | + * @param string $version |
|
949 | + */ |
|
947 | 950 | public static function upgrade_version($version) |
948 | 951 | { |
949 | 952 | $const_dbpath = costant::database_path(); |
@@ -961,6 +964,10 @@ discard block |
||
961 | 964 | //######################### |
962 | 965 | class various |
963 | 966 | { |
967 | + /** |
|
968 | + * @param string $AlertMessage |
|
969 | + * @param string $AlertRedirect |
|
970 | + */ |
|
964 | 971 | public static function send_alert_and_redirect($AlertMessage, $AlertRedirect) |
965 | 972 | { |
966 | 973 | echo "<script src='res/app/functions-1.0.4.js' type='text/javascript'></script>"; |
@@ -1153,6 +1160,9 @@ discard block |
||
1153 | 1160 | return $tr_default_type; |
1154 | 1161 | } |
1155 | 1162 | |
1163 | + /** |
|
1164 | + * @return string |
|
1165 | + */ |
|
1156 | 1166 | public static function attachments_folder() |
1157 | 1167 | { |
1158 | 1168 | global $attachments_folder; |
@@ -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 | } |
@@ -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 | } |