diff --git a/.gitignore b/.gitignore
index 45fd8c9..0a65337 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
MMEX_New_Transaction.db
configuration_user.php
+/WebApp/attachments/Transaction*.*
diff --git a/WebApp/about.php b/WebApp/about.php
index c8ca759..e0321cb 100644
--- a/WebApp/about.php
+++ b/WebApp/about.php
@@ -13,8 +13,8 @@
Money Manager EX
-
-
+
+
diff --git a/WebApp/attachments.php b/WebApp/attachments.php
new file mode 100644
index 0000000..f3f3125
--- /dev/null
+++ b/WebApp/attachments.php
@@ -0,0 +1,43 @@
+";
+ echo "";
+ for ($i = 0; $i < sizeof($Attachments); $i++)
+ {
+ echo "";
+ $File = $Attachments[$i];
+ design::table_cell(substr($File,strpos($File,"Attach"),strlen($File)),"");
+ design::table_cell("
+ Open","text_align_right");
+ design::table_cell("
+ Delete","text_align_right");
+ echo "
";
+ }
+ echo "";
+ echo "";
+ }
+?>
\ No newline at end of file
diff --git a/WebApp/attachments/Readme.txt b/WebApp/attachments/Readme.txt
new file mode 100644
index 0000000..8687148
--- /dev/null
+++ b/WebApp/attachments/Readme.txt
@@ -0,0 +1 @@
+Folder for attachments. Do not delete!
\ No newline at end of file
diff --git a/WebApp/attachments/htaccess.txt b/WebApp/attachments/htaccess.txt
new file mode 100644
index 0000000..399ab92
--- /dev/null
+++ b/WebApp/attachments/htaccess.txt
@@ -0,0 +1,10 @@
+#######################################
+## htaccess for block important file ##
+#######################################
+
+# Block folder list
+Options All -Indexes
+
+# Block entire folder
+Order deny,allow
+Deny from all
\ No newline at end of file
diff --git a/WebApp/configuration_system.php b/WebApp/configuration_system.php
index 33aebde..cbb7df2 100644
--- a/WebApp/configuration_system.php
+++ b/WebApp/configuration_system.php
@@ -4,8 +4,9 @@
## don't touch ##
######################################
$dbpath = "MMEX_New_Transaction.db";
-$app_version = "1.0.0";
-$api_version = "0.9.9";
+$app_version = "1.0.1";
+$api_version = "1.0.1";
$tr_default_status = "R";
$tr_default_type = "Withdrawal";
+$attachments_folder = "attachments";
?>
\ No newline at end of file
diff --git a/WebApp/error.php b/WebApp/error.php
index 07fabd4..a5906a7 100644
--- a/WebApp/error.php
+++ b/WebApp/error.php
@@ -13,8 +13,8 @@
Money Manager EX
-
-
+
+
diff --git a/WebApp/functions.php b/WebApp/functions.php
index 341563d..9db94e6 100644
--- a/WebApp/functions.php
+++ b/WebApp/functions.php
@@ -16,7 +16,7 @@ function input_date ($TrDateDefault)
echo "";
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -39,7 +39,7 @@ function input_status ($TrStatusDefault)
}
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -60,7 +60,7 @@ function input_type ($TrTypeDefault)
}
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -83,7 +83,7 @@ function input_account ($TrAccountDefault)
}
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -105,7 +105,7 @@ function input_toaccount ($TrToAccountDefault)
}
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -119,13 +119,10 @@ function input_payee ($TrPayeeDefault)
echo "";
echo "";
echo "";
- echo "";
+ echo "\n";
echo "";
}
@@ -162,20 +156,13 @@ function input_subcategory ($TrSubCategoryDefault)
{
echo "";
echo "";
- if ($TrSubCategoryDefault == "")
- {
- echo "";
- }
- else
- {
- echo "";
- }
+ echo "";
echo "";
- echo "
";
+ echo "\n";
echo "";
}
@@ -194,7 +181,7 @@ function input_amount ($TrAmountDefault)
echo "";
}
echo "";
- echo "";
+ echo "\n";
}
@@ -213,7 +200,7 @@ function input_notes ($TrNotesDefault)
echo "";
}
echo "";
- echo "";
+ echo "\n";
}
@@ -251,7 +238,7 @@ function settings ($VarName,$VarValue,$PlaceHolder,$InputType,$Required)
}
}
echo "";
- echo "";
+ echo "\n";
}
//Create seting checkbox element
@@ -264,7 +251,7 @@ function settings_checkbox ($VarName,$VarValue,$VarDescription)
else
{echo "${VarDescription}";}
echo "";
- echo "";
+ echo "\n";
}
@@ -280,7 +267,7 @@ function settings_password ($VarName,$PlaceHolder,$Required)
elseif ($Required == False)
{echo "";}
echo "";
- echo "";
+ echo "\n";
}
@@ -303,7 +290,7 @@ function settings_default_account ($TrAccountDefault)
}
echo "";
echo "";
- echo "";
+ echo "\n";
}
@@ -412,6 +399,7 @@ function db_vacuum ()
// Insert transaction
function transaction_insert ($TrDate, $TrStatus, $TrType, $TrAccount, $TrToAccount, $TrPayee, $TrCategory, $TrSubCategory, $TrAmount, $TrNotes)
{
+ $ID = 0;
$const_dbpath = costant::database_path();
$db = new PDO("sqlite:${const_dbpath}");
@@ -429,7 +417,9 @@ function transaction_insert ($TrDate, $TrStatus, $TrType, $TrAccount, $TrToAccou
$statement->bindParam(":TrNotes",$TrNotes);
$statement-> execute ();
+ $ID = $db->lastInsertId();
$db = null;
+ return $ID;
}
@@ -903,6 +893,9 @@ function upgrade_db ()
case "0.9.9":
db_upgrade::upgrade_version("1.0.0");
break;
+ case "1.0.0":
+ db_upgrade::upgrade_version("1.0.1");
+ break;
case $app_version;
break;
default:
@@ -1000,7 +993,7 @@ class various
{
function send_alert_and_redirect ($AlertMessage, $AlertRedirect)
{
- echo "";
+ echo "";
echo "
-
+
+
-
+
@@ -29,7 +29,9 @@
test_html5();
- ";
+ echo "
";
+ echo "";
+ echo "";
+ echo "\n";
+
+ echo "";
+ echo "
\n";
+ echo "
";
if ($FlagNew)
{
@@ -119,16 +131,18 @@
{
design::input_hidden("TrEditedNr",$TrEditNr);
echo "";
}
echo "";
echo "
";
echo "
";
echo "";
- echo "";
+ echo "\n";
echo "
-
+
+
diff --git a/WebApp/show.php b/WebApp/show.php
index 2e5518d..8d6bb5f 100644
--- a/WebApp/show.php
+++ b/WebApp/show.php
@@ -13,13 +13,13 @@
Show Transaction
-
-
+
+
-
-
-
+
+
+
@@ -111,7 +111,12 @@
$TrNotesShow = $resultarray[$i]["Notes"];
if ($TrNotesShow != "" && $TrNotesShow != "None")
{
- design::table_cell("","text_align_center");
+ if (attachments::get_number_of_attachments($lineid) > 0)
+ design::table_cell("
+ ","text_align_center");
+ else
+ design::table_cell("",
+ "text_align_center");
}
else
{design::table_cell("","");}
@@ -131,7 +136,7 @@
}
echo "";
echo "";
- echo "";
+ echo "\n";
echo "
";
echo "";
echo "
";
@@ -142,7 +147,7 @@
echo "';
echo "
";
echo "
";
- echo "";
+ echo "\n";
#JavaScript for notes tooltip
echo "