Пример #1
0
<?php

require_once "functions.php";
session_start();
security::redirect_if_not_loggedin();
$Guid = costant::desktop_guid();
if (isset($_GET["DeleteAttach"])) {
    attachments::delete_attachment_by_name($_GET["DeleteAttach"]);
}
if (isset($_FILES['UploadedAttachments']) && isset($_POST["Attachment_TrId"])) {
    $TrNumber = (int) $_POST['Attachment_TrId'];
    $FileName = $_FILES['UploadedAttachments']['name'];
    $FileExtension = substr($FileName, strpos($FileName, ".") + 1, strlen($FileName));
    $NewFileName = "Transaction_" . $TrNumber . "_Attach" . (attachments::get_number_of_attachments($TrNumber) + 1) . "." . $FileExtension;
    move_uploaded_file($_FILES['UploadedAttachments']['tmp_name'], "attachments/" . $NewFileName);
    echo $NewFileName;
}
if (isset($_GET["AttachmentsTable"])) {
    $TrId = $_GET["AttachmentsTable"];
    $Attachments = attachments::get_attachments_filename_array($TrId, true);
    echo "<table class = 'table'>";
    echo "<tbody>";
    for ($i = 0; $i < sizeof($Attachments); $i++) {
        echo "<tr>";
        $File = $Attachments[$i];
        design::table_cell(substr($File, strpos($File, "Attach"), strlen($File)), "");
        design::table_cell("<a href='services.php?guid={$Guid}&download_attachment={$File}'>\n                            <span class='glyphicon glyphicon-download-alt'> </span> Open</a>", "text_align_right");
        design::table_cell("<a href='#' onclick='attachment_delete(\"{$File}\",{$TrId});return false;'>\n                            <span class='glyphicon glyphicon-remove'> </span> Delete</a>", "text_align_right");
        echo "</tr>";
    }
    echo "</tbody>";
Пример #2
0
<?php

# Import configuration file
require_once "functions.php";
$operation_succeded = "Operation has succeeded";
$wrong_guid = "Wrong GUID";
header("Content-Type: text/plain; charset=utf-8");
if (isset($_GET["guid"]) && $_GET["guid"] == costant::desktop_guid()) {
    #Test guid
    if (isset($_GET["check_guid"])) {
        echo $operation_succeded;
    }
    #Return WebApp API Version
    if (isset($_GET["check_api_version"])) {
        echo costant::api_version();
    }
    #Delete BankAccount
    if (isset($_GET["delete_bankaccount"])) {
        db_function::bankaccount_delete_all();
        echo $operation_succeded;
    }
    #Import BankAccount
    if (isset($_GET["import_bankaccount"])) {
        db_function::bankaccount_insert_json($_POST["MMEX_Post"]);
        echo $operation_succeded;
    }
    #Delete Payee
    if (isset($_GET["delete_payee"])) {
        db_function::payee_delete_all();
        echo $operation_succeded;
    }
Пример #3
0
        <?php 
if (isset($const_username) and isset($const_password)) {
    echo "<h3 class='text_align_center'>Edit settings</h3>";
} else {
    echo "<br />";
    echo "<p style='text-align:center'><img src='res\\mmex.ico' alt='Money Manager EX Logo' height='150' width='150' /></p>";
    echo "<h3 class='text_align_center'>Insert new settings to start use Money Manager</h3>";
}
?>
        <br />
        <form id="login" method="post" action="settings.php">
            <?php 
$const_disable_authentication = costant::disable_authentication();
$const_username = costant::login_username();
$const_password = costant::login_password();
$const_desktop_guid = costant::desktop_guid();
$const_disable_payee = costant::disable_payee();
$const_disable_category = costant::disable_category();
$const_defaultaccountname = costant::transaction_default_account();
//SECTION AUTHENTICATION
design::section_legened("Authentication");
if ($const_disable_authentication == True) {
    design::settings_checkbox("Set_Disable_authentication", True, "Disable authentication (Not recommended)");
} else {
    design::settings_checkbox("Set_Disable_authentication", False, "Disable authentication (Not recommended)");
}
if (isset($const_username) && $const_disable_authentication == False) {
    design::settings("Username", $const_username, "", "Text", True);
} else {
    design::settings("Username", "", "Insert a new username", "Text", True);
}
Пример #4
0
    </head>
    
    <body>
        <div class="container text_align_center">
            <h3><strong>Guide</strong></h3>
            <br />
            <p>
                To start use Money Manager Ex WebApp you need to insert this data in your existing desktop installation
            </p>
            <?php 
echo "<p>WebApp URL:</p>";
$CurrentPage = str_replace("/guide.php", "", costant::current_page_url());
echo "<p><strong>" . $CurrentPage . "</strong></p>";
echo "<br />";
echo "<p>Desktop GUID:</p>";
echo "<p><strong>" . costant::desktop_guid() . "</strong></p>";
echo "<br />";
echo "<br />";
?>
            <p>
                Please open desktop version to import bank account and start use Web version
            </p>
            <br />
            <br />
            <!--
            <input type="button" class="btn btn-default" value="Copy URL" />
            &nbsp;&nbsp;
            <input type="button" class="btn btn-default" value="Copy GUID" />
            -->
            <input type="button" class="btn btn-lg btn-success btn-block" value="Return to menu" onclick="top.location.href = 'landing.php'" />
            <br />
Пример #5
0
 public static function to_0_9_9()
 {
     $parameterarray = array("disable_authentication" => costant::disable_authentication() ? "True" : "False", "user_username" => costant::login_username(), "user_password" => costant::login_password(), "disable_payee" => costant::disable_payee() ? "True" : "False", "disable_category" => "False", "defaultaccountname" => costant::transaction_default_account(), "desktop_guid" => costant::desktop_guid());
     various::update_configuration_file($parameterarray);
     $const_dbpath = costant::database_path();
     $db = new PDO("sqlite:{$const_dbpath}");
     $db->exec("ALTER TABLE Payee_List ADD DefCateg TEXT");
     $db->exec("ALTER TABLE Payee_List ADD DefSubCateg TEXT");
     $db->exec("UPDATE Payee_List SET DefCateg = 'None', DefSubCateg = 'None'");
     $db->exec("UPDATE New_Transaction SET Category = 'None', SubCategory = 'None'");
     $db->exec("UPDATE Parameters SET Value = '0.9.9' WHERE Parameter = 'Version';");
     $db = null;
 }