@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $TrEditNr = $_GET["TrEditNr"]; |
43 | 43 | $FlagNew = False; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $TrEditNr = 0; |
48 | 47 | $FlagNew = True; |
@@ -63,8 +62,7 @@ discard block |
||
63 | 62 | $TransactionAmount = "0"; |
64 | 63 | $TransactionNotes = "Empty"; |
65 | 64 | $TransactionSubmit = "Insert transaction"; |
66 | - } |
|
67 | - else |
|
65 | + } else |
|
68 | 66 | { |
69 | 67 | $resultarray = db_function::transaction_select_one($TrEditNr); |
70 | 68 | $TransactionHeaderText = "Edit transcation"; |
@@ -97,8 +95,7 @@ discard block |
||
97 | 95 | if (costant::disable_payee() !== True) |
98 | 96 | { |
99 | 97 | design::input_payee($TransactionPayee); |
100 | - } |
|
101 | - else |
|
98 | + } else |
|
102 | 99 | { |
103 | 100 | design::input_hidden("Payee","Keine Auswahl"); |
104 | 101 | } |
@@ -106,8 +103,7 @@ discard block |
||
106 | 103 | { |
107 | 104 | design::input_category($TransactionCategory); |
108 | 105 | design::input_subcategory($TransactionSubCategory); |
109 | - } |
|
110 | - else |
|
106 | + } else |
|
111 | 107 | { |
112 | 108 | design::input_hidden("Category","Keine Auswahl"); |
113 | 109 | design::input_hidden("SubCategory","Keine Auswahl"); |
@@ -131,8 +127,7 @@ discard block |
||
131 | 127 | echo "var date_today = get_today();"; |
132 | 128 | echo "document.getElementById('Date').value=date_today;"; |
133 | 129 | echo "</script>"; |
134 | - } |
|
135 | - else |
|
130 | + } else |
|
136 | 131 | { |
137 | 132 | design::input_hidden("TrEditedNr",$TrEditNr); |
138 | 133 | echo "<script type='text/javascript'>"; |
@@ -33,20 +33,16 @@ discard block |
||
33 | 33 | $TrType = $_POST["Type"]; |
34 | 34 | $TrAccount = $_POST["Account"]; |
35 | 35 | if (isset($_POST["ToAccount"])) |
36 | - {$TrToAccount = $_POST["ToAccount"];} |
|
37 | - else |
|
36 | + {$TrToAccount = $_POST["ToAccount"];} else |
|
38 | 37 | {$TrToAccount = "None";} |
39 | 38 | if (isset($_POST["Payee"])) |
40 | - {$TrPayee = $_POST["Payee"];} |
|
41 | - else |
|
39 | + {$TrPayee = $_POST["Payee"];} else |
|
42 | 40 | {$TrPayee = "None";} |
43 | 41 | if (isset($_POST["Category"])) |
44 | - {$TrCategory = $_POST["Category"];} |
|
45 | - else |
|
42 | + {$TrCategory = $_POST["Category"];} else |
|
46 | 43 | {$TrCategory = "None";} |
47 | 44 | if (isset($_POST["SubCategory"])) |
48 | - {$TrSubCategory = $_POST["SubCategory"];} |
|
49 | - else |
|
45 | + {$TrSubCategory = $_POST["SubCategory"];} else |
|
50 | 46 | {$TrSubCategory = "None";} |
51 | 47 | $TrAmount = $_POST["Amount"]; |
52 | 48 | $TrNotes = $_POST["Notes"]; |
@@ -65,8 +61,7 @@ discard block |
||
65 | 61 | echo "<script type='text/javascript'>"; |
66 | 62 | echo "location.href='show.php'"; |
67 | 63 | echo "</script>"; |
68 | - } |
|
69 | - else |
|
64 | + } else |
|
70 | 65 | { |
71 | 66 | $TrEditedNr = db_function::transaction_insert ($TrDate, $TrStatus, $TrType, $TrAccount, $TrToAccount, $TrPayee, $TrCategory, $TrSubCategory, $TrAmount, $TrNotes); |
72 | 67 | } |
@@ -4,8 +4,7 @@ discard block |
||
4 | 4 | if ($error !== "ok") |
5 | 5 | { |
6 | 6 | echo $error; |
7 | - } |
|
8 | -else |
|
7 | + } else |
|
9 | 8 | { |
10 | 9 | $upgrade_result = db_upgrade::upgrade_db(); |
11 | 10 | if ($upgrade_result == "update_done") |
@@ -45,19 +44,16 @@ discard block |
||
45 | 44 | $_SESSION["login_string"] = hash("sha512", $password . $user_browser); |
46 | 45 | header("Location: landing.php"); |
47 | 46 | |
48 | - } |
|
49 | - else |
|
47 | + } else |
|
50 | 48 | { |
51 | 49 | header("Location: index.php"); |
52 | 50 | } |
53 | 51 | |
54 | - } |
|
55 | - else |
|
52 | + } else |
|
56 | 53 | { |
57 | 54 | header("Location: index.php"); |
58 | 55 | } |
59 | - } |
|
60 | -else |
|
56 | + } else |
|
61 | 57 | { |
62 | 58 | ?> |
63 | 59 |
@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | for ($i = 0; $i < sizeof($StatusArrayDesc); $i++) |
34 | 34 | { |
35 | 35 | if ($StatusArrayDB[$i] == $TrStatusDefault) |
36 | - {echo "<option value = '${StatusArrayDB[$i]}' selected> ${StatusArrayDesc[$i]} </option>";} |
|
37 | - else |
|
36 | + {echo "<option value = '${StatusArrayDB[$i]}' selected> ${StatusArrayDesc[$i]} </option>";} else |
|
38 | 37 | {echo "<option value = '${StatusArrayDB[$i]}'> ${StatusArrayDesc[$i]} </option>";} |
39 | 38 | } |
40 | 39 | echo "</select>"; |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | for ($i = 0; $i < sizeof($TypeArrayDesc); $i++) |
55 | 54 | { |
56 | 55 | if ($TypeArrayDesc[$i] == $TrTypeDefault) |
57 | - {echo "<option value='${TypeArrayDesc[$i]}' selected> ${TypeArrayDesc[$i]} </option>";} |
|
58 | - else |
|
56 | + {echo "<option value='${TypeArrayDesc[$i]}' selected> ${TypeArrayDesc[$i]} </option>";} else |
|
59 | 57 | {echo "<option value='${TypeArrayDesc[$i]}'> ${TypeArrayDesc[$i]} </option>";} |
60 | 58 | } |
61 | 59 | echo "</select>"; |
@@ -77,8 +75,7 @@ discard block |
||
77 | 75 | for ($i = 0; $i < sizeof($AccountArrayDesc); $i++) |
78 | 76 | { |
79 | 77 | if ($AccountArrayDesc[$i] == $TrAccountDefault) |
80 | - {echo "<option value=\"${AccountArrayDesc[$i]}\" selected> ${AccountArrayDesc[$i]} </option>";} |
|
81 | - else |
|
78 | + {echo "<option value=\"${AccountArrayDesc[$i]}\" selected> ${AccountArrayDesc[$i]} </option>";} else |
|
82 | 79 | {echo "<option value=\"${AccountArrayDesc[$i]}\"> ${AccountArrayDesc[$i]} </option>";} |
83 | 80 | } |
84 | 81 | echo "</select>"; |
@@ -99,8 +96,7 @@ discard block |
||
99 | 96 | for ($i = 0; $i < sizeof($ToAccountArrayDesc); $i++) |
100 | 97 | { |
101 | 98 | if ($ToAccountArrayDesc[$i] == $TrToAccountDefault) |
102 | - {echo "<option value=\"${ToAccountArrayDesc[$i]}\" selected> ${ToAccountArrayDesc[$i]} </option>";} |
|
103 | - else |
|
99 | + {echo "<option value=\"${ToAccountArrayDesc[$i]}\" selected> ${ToAccountArrayDesc[$i]} </option>";} else |
|
104 | 100 | {echo "<option value=\"${ToAccountArrayDesc[$i]}\"> ${ToAccountArrayDesc[$i]} </option>";} |
105 | 101 | } |
106 | 102 | echo "</select>"; |
@@ -175,8 +171,7 @@ discard block |
||
175 | 171 | if ($TrAmountDefault <> 0) |
176 | 172 | { |
177 | 173 | echo "<input id='Amount' type='number' name='Amount' class='form-control' placeholder='New transaction amount' min='0.01' step ='0.01' value='${TrAmountDefault}' required />"; |
178 | - } |
|
179 | - else |
|
174 | + } else |
|
180 | 175 | { |
181 | 176 | echo "<input id='Amount' type='number' name='Amount' class='form-control' placeholder='New transaction amount' min='0.01' step ='0.01' required />"; |
182 | 177 | } |
@@ -194,8 +189,7 @@ discard block |
||
194 | 189 | if ($TrNotesDefault <> "Empty") |
195 | 190 | { |
196 | 191 | echo "<textarea id='Notes' name='Notes' class='form-control' rows='5' placeholder='New transaction notes'>${TrNotesDefault}</textarea>"; |
197 | - } |
|
198 | - else |
|
192 | + } else |
|
199 | 193 | { |
200 | 194 | echo "<textarea id='Notes' name='Notes' class='form-control' rows='5' placeholder='New transaction notes'></textarea>"; |
201 | 195 | } |
@@ -284,8 +278,7 @@ discard block |
||
284 | 278 | for ($i = 0; $i < sizeof($AccountArrayDesc); $i++) |
285 | 279 | { |
286 | 280 | if ($AccountArrayDesc[$i] == $TrAccountDefault) |
287 | - {echo "<option selected> ${AccountArrayDesc[$i]} </option>";} |
|
288 | - else |
|
281 | + {echo "<option selected> ${AccountArrayDesc[$i]} </option>";} else |
|
289 | 282 | {echo "<option> ${AccountArrayDesc[$i]} </option>";} |
290 | 283 | } |
291 | 284 | echo "</select>"; |
@@ -362,8 +355,7 @@ discard block |
||
362 | 355 | );"); |
363 | 356 | $db -> exec ("INSERT or IGNORE INTO Parameters VALUES ('Version','${const_app_version}');"); |
364 | 357 | $db = null; |
365 | - } |
|
366 | - catch(PDOException $e) |
|
358 | + } catch(PDOException $e) |
|
367 | 359 | {$error = $e->getMessage();} |
368 | 360 | |
369 | 361 | return $error; |
@@ -828,8 +820,7 @@ discard block |
||
828 | 820 | $login_check = hash('sha512', $password . $user_browser); |
829 | 821 | if ($login_check !== $login_string) |
830 | 822 | {header("Location: index.php");} |
831 | - } |
|
832 | - else |
|
823 | + } else |
|
833 | 824 | {header("Location: index.php");} |
834 | 825 | } |
835 | 826 | } |
@@ -838,8 +829,7 @@ discard block |
||
838 | 829 | public static function generate_guid() |
839 | 830 | { |
840 | 831 | if (function_exists('com_create_guid')) |
841 | - {return com_create_guid();} |
|
842 | - else |
|
832 | + {return com_create_guid();} else |
|
843 | 833 | { |
844 | 834 | mt_srand((double)microtime()*10000); |
845 | 835 | $charid = strtoupper(md5(uniqid(rand(), true))); |
@@ -913,8 +903,7 @@ discard block |
||
913 | 903 | } |
914 | 904 | } |
915 | 905 | if ($start_db_version !== $app_version && db_function::db_version() == $app_version) |
916 | - {return "update_done";} |
|
917 | - else |
|
906 | + {return "update_done";} else |
|
918 | 907 | {return "update_not_need";} |
919 | 908 | } |
920 | 909 | |
@@ -1086,8 +1075,9 @@ discard block |
||
1086 | 1075 | if (strpos($entry,"Transaction_".$TrID) == 0 && strpos($entry,"Transaction_".$TrID) !== false) |
1087 | 1076 | { |
1088 | 1077 | $AttachNumb = substr($entry,strpos($entry,"Attach")+6,strpos($entry,".")-(strpos($entry,"Attach")+6)); |
1089 | - if ($AttachNumb > $LastAttachNum) |
|
1090 | - $LastAttachNum = $AttachNumb; |
|
1078 | + if ($AttachNumb > $LastAttachNum) { |
|
1079 | + $LastAttachNum = $AttachNumb; |
|
1080 | + } |
|
1091 | 1081 | } |
1092 | 1082 | } |
1093 | 1083 | closedir($handle); |
@@ -1151,8 +1141,9 @@ discard block |
||
1151 | 1141 | public static function delete_attachment_by_name($FileName) |
1152 | 1142 | { |
1153 | 1143 | $FullPath = costant::attachments_folder()."/".$FileName; |
1154 | - if (!empty($FileName) && file_exists($FullPath)) |
|
1155 | - unlink($FullPath); |
|
1144 | + if (!empty($FileName) && file_exists($FullPath)) { |
|
1145 | + unlink($FullPath); |
|
1146 | + } |
|
1156 | 1147 | } |
1157 | 1148 | } |
1158 | 1149 | |
@@ -1225,8 +1216,7 @@ discard block |
||
1225 | 1216 | { |
1226 | 1217 | global $disable_authentication; |
1227 | 1218 | if ($disable_authentication == "True") |
1228 | - {return True;} |
|
1229 | - else |
|
1219 | + {return True;} else |
|
1230 | 1220 | {return False;} |
1231 | 1221 | } |
1232 | 1222 | |
@@ -1234,8 +1224,7 @@ discard block |
||
1234 | 1224 | { |
1235 | 1225 | global $disable_payee; |
1236 | 1226 | if ($disable_payee == "True") |
1237 | - {return True;} |
|
1238 | - else |
|
1227 | + {return True;} else |
|
1239 | 1228 | {return False;} |
1240 | 1229 | } |
1241 | 1230 | |
@@ -1243,20 +1232,19 @@ discard block |
||
1243 | 1232 | { |
1244 | 1233 | global $disable_category; |
1245 | 1234 | if ($disable_category == "True") |
1246 | - {return True;} |
|
1247 | - else |
|
1235 | + {return True;} else |
|
1248 | 1236 | {return False;} |
1249 | 1237 | } |
1250 | 1238 | |
1251 | 1239 | public static function current_page_url () |
1252 | 1240 | { |
1253 | 1241 | $pageURL = 'http'; |
1254 | - if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") |
|
1255 | - $pageURL .= "s"; |
|
1242 | + if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { |
|
1243 | + $pageURL .= "s"; |
|
1244 | + } |
|
1256 | 1245 | $pageURL .= "://"; |
1257 | 1246 | if ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") |
1258 | - {$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];} |
|
1259 | - else |
|
1247 | + {$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];} else |
|
1260 | 1248 | {$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];} |
1261 | 1249 | return $pageURL; |
1262 | 1250 | } |
@@ -106,8 +106,7 @@ |
||
106 | 106 | attachments::delete_group($deletegroup_array); |
107 | 107 | echo $operation_succeded; |
108 | 108 | } |
109 | - } |
|
110 | -else |
|
109 | + } else |
|
111 | 110 | { |
112 | 111 | echo $wrong_guid; |
113 | 112 | } |
@@ -13,36 +13,30 @@ discard block |
||
13 | 13 | if ($_SERVER["REQUEST_METHOD"] == "POST") |
14 | 14 | { |
15 | 15 | if (isset ($_POST["Set_Disable_authentication"])) |
16 | - {$disable_authentication = $_POST["Set_Disable_authentication"];} |
|
17 | - else |
|
16 | + {$disable_authentication = $_POST["Set_Disable_authentication"];} else |
|
18 | 17 | {$disable_authentication = "False";} |
19 | 18 | |
20 | 19 | if (isset ($_POST["Set_Username"])) |
21 | - {$username = $_POST["Set_Username"];} |
|
22 | - else |
|
20 | + {$username = $_POST["Set_Username"];} else |
|
23 | 21 | {$username = "";} |
24 | 22 | |
25 | 23 | $default_account = $_POST["Default_Account"]; |
26 | 24 | |
27 | 25 | if (isset ($_POST["Set_Disable_payee"])) |
28 | - {$disable_payee = $_POST["Set_Disable_payee"];} |
|
29 | - else |
|
26 | + {$disable_payee = $_POST["Set_Disable_payee"];} else |
|
30 | 27 | {$disable_payee = "False";} |
31 | 28 | |
32 | 29 | if (isset ($_POST["Set_Disable_category"])) |
33 | - {$disable_category = $_POST["Set_Disable_category"];} |
|
34 | - else |
|
30 | + {$disable_category = $_POST["Set_Disable_category"];} else |
|
35 | 31 | {$disable_category = "False";} |
36 | 32 | |
37 | 33 | $guid = $_POST["Set_Guid"]; |
38 | 34 | |
39 | 35 | if (isset($_POST["Set_Password"]) && $_POST["Set_Password"] !== "" && $_POST["Set_Password"] !== Null) |
40 | - {$password = hash("sha512", $_POST["Set_Password"]);} |
|
41 | - else |
|
36 | + {$password = hash("sha512", $_POST["Set_Password"]);} else |
|
42 | 37 | { |
43 | 38 | if (isset ($_POST["Set_Disable_authentication"])) |
44 | - {$password = "";} |
|
45 | - else |
|
39 | + {$password = "";} else |
|
46 | 40 | {$password = costant::login_password();} |
47 | 41 | } |
48 | 42 | |
@@ -61,8 +55,7 @@ discard block |
||
61 | 55 | { |
62 | 56 | various::update_configuration_file($parameterarray); |
63 | 57 | header("Location: landing.php"); |
64 | - } |
|
65 | - else |
|
58 | + } else |
|
66 | 59 | { |
67 | 60 | various::update_configuration_file($parameterarray); |
68 | 61 | header("Location: guide.php"); |
@@ -95,8 +88,7 @@ discard block |
||
95 | 88 | <div class="container"> |
96 | 89 | <?php |
97 | 90 | if (isset($const_username) AND isset($const_password)) |
98 | - {echo "<h3 class='text_align_center'>Edit settings</h3>";} |
|
99 | - else |
|
91 | + {echo "<h3 class='text_align_center'>Edit settings</h3>";} else |
|
100 | 92 | { |
101 | 93 | echo "<br />"; |
102 | 94 | echo "<p style='text-align:center'><img src='res\mmex.png' alt='Money Manager EX Logo' height='150' width='150' /></p>"; |
@@ -117,18 +109,15 @@ discard block |
||
117 | 109 | //SECTION AUTHENTICATION |
118 | 110 | design::section_legened("Authentication"); |
119 | 111 | if ($const_disable_authentication == True) |
120 | - {design::settings_checkbox("Set_Disable_authentication",True,"Disable authentication (Not recommended)");} |
|
121 | - else |
|
112 | + {design::settings_checkbox("Set_Disable_authentication",True,"Disable authentication (Not recommended)");} else |
|
122 | 113 | {design::settings_checkbox("Set_Disable_authentication",False,"Disable authentication (Not recommended)");} |
123 | 114 | |
124 | 115 | if (isset($const_username) && $const_disable_authentication == False) |
125 | - {design::settings("Username",$const_username,"","Text",True);} |
|
126 | - else |
|
116 | + {design::settings("Username",$const_username,"","Text",True);} else |
|
127 | 117 | {design::settings("Username","","Insert a new username","Text",True);} |
128 | 118 | |
129 | 119 | if (isset($const_password) && $const_disable_authentication == False) |
130 | - {design::settings_password("Password","To change insert a new password",False);} |
|
131 | - else |
|
120 | + {design::settings_password("Password","To change insert a new password",False);} else |
|
132 | 121 | {design::settings_password("Password","Insert a password",True);} |
133 | 122 | |
134 | 123 | design::settings_password("Confirm_Password","Confirm new password",False); |
@@ -137,26 +126,22 @@ discard block |
||
137 | 126 | //SECTION NEW TRANSACTIONS |
138 | 127 | design::section_legened("New transactions"); |
139 | 128 | if ($const_disable_payee == True) |
140 | - {design::settings_checkbox("Set_Disable_payee",True,"Disable payees management");} |
|
141 | - else |
|
129 | + {design::settings_checkbox("Set_Disable_payee",True,"Disable payees management");} else |
|
142 | 130 | {design::settings_checkbox("Set_Disable_payee",False,"Disable payees management");} |
143 | 131 | |
144 | 132 | if ($const_disable_category == True) |
145 | - {design::settings_checkbox("Set_Disable_category",True,"Disable categories management");} |
|
146 | - else |
|
133 | + {design::settings_checkbox("Set_Disable_category",True,"Disable categories management");} else |
|
147 | 134 | {design::settings_checkbox("Set_Disable_category",False,"Disable categories management");} |
148 | 135 | |
149 | 136 | if (isset($const_defaultaccountname)) |
150 | - {design::settings_default_account($const_defaultaccountname);} |
|
151 | - else |
|
137 | + {design::settings_default_account($const_defaultaccountname);} else |
|
152 | 138 | {design::settings_default_account("None");} |
153 | 139 | echo "<br />"; |
154 | 140 | |
155 | 141 | //SECTION DESKTOP INTEGRATION |
156 | 142 | design::section_legened("Desktop integration"); |
157 | 143 | if (isset($const_desktop_guid)) |
158 | - {design::settings("Guid",$const_desktop_guid,"","Text",True);} |
|
159 | - else |
|
144 | + {design::settings("Guid",$const_desktop_guid,"","Text",True);} else |
|
160 | 145 | {design::settings("Guid",security::generate_guid(),"","Text",True);} |
161 | 146 | |
162 | 147 | ?> |
@@ -193,8 +178,7 @@ discard block |
||
193 | 178 | echo ("<button type='button' id='EditSettings' name='EditSettings' class='btn btn-lg btn-success btn-block' onclick='check_password_match_and_submit(\"Set_Password\",\"Set_Confirm_Password\",\"login\")'>Edit Settings</button>"); |
194 | 179 | echo "<br />"; |
195 | 180 | echo ("<a href='landing.php' class='btn btn-lg btn-success btn-block'>Return to menu</a>"); |
196 | - } |
|
197 | - else |
|
181 | + } else |
|
198 | 182 | { |
199 | 183 | echo ("<button type='button' id='EditSettings' name='EditSettings' class='btn btn-lg btn-success btn-block' onclick='check_password_match_and_submit(\"Set_Password\",\"Set_Confirm_Password\",\"login\")'>Apply Settings</button>"); |
200 | 184 | } |
@@ -108,10 +108,12 @@ |
||
108 | 108 | //NOTES |
109 | 109 | $TrNotesShow = $resultarray[$i]["Notes"]; |
110 | 110 | $NotesHTMLCode = ""; |
111 | - if ($TrNotesShow != "" && $TrNotesShow != "None") |
|
112 | - $NotesHTMLCode .= "<span class='glyphicon glyphicon-info-sign' data-toggle='tooltip' title='${TrNotesShow}' id='tooltip_notes_${lineid}'></span> "; |
|
113 | - if (attachments::get_number_of_attachments($lineid) > 0) |
|
114 | - $NotesHTMLCode .= "<span class='glyphicon glyphicon-paperclip'></span>"; |
|
111 | + if ($TrNotesShow != "" && $TrNotesShow != "None") { |
|
112 | + $NotesHTMLCode .= "<span class='glyphicon glyphicon-info-sign' data-toggle='tooltip' title='${TrNotesShow}' id='tooltip_notes_${lineid}'></span> "; |
|
113 | + } |
|
114 | + if (attachments::get_number_of_attachments($lineid) > 0) { |
|
115 | + $NotesHTMLCode .= "<span class='glyphicon glyphicon-paperclip'></span>"; |
|
116 | + } |
|
115 | 117 | design::table_cell($NotesHTMLCode,"text_align_center"); |
116 | 118 | |
117 | 119 | //DELETE |