function printInsert() { global $tpl, $us, $badgerDb; $widgets = new WidgetEngine($tpl); $widgets->addNavigationHead(); $insertTitle = getBadgerTranslation2('importExport', 'insertTitle'); $updateInfo = ''; echo $tpl->getHeader($insertTitle); $goToStartPagePreLink = getBadgerTranslation2('importExport', 'goToStartPagePreLink'); $goToStartPageLinkText = getBadgerTranslation2('importExport', 'goToStartPageLinkText'); $goToStartPagePostLink = getBadgerTranslation2('importExport', 'goToStartPagePostLink'); if (!isset($_POST['confirmUpload']) || $_POST['confirmUpload'] !== 'yes') { $insertMsg = getBadgerTranslation2('importExport', 'insertNoInsert'); } else { if (!isset($_FILES['sqlDump']) || !is_uploaded_file($_FILES['sqlDump']['tmp_name'])) { $insertMsg = getBadgerTranslation2('importExport', 'insertNoFile'); } else { $insertMsg = getBadgerTranslation2('importExport', 'insertSuccessful'); $newerVersionMsg = getBadgerTranslation2('importExport', 'newerVersion'); if (applySqlDump() === 'newerVersion') { eval(' $updateInfo = "' . $tpl->getTemplate('importExport/newerVersion') . '";'); } } } $us = new UserSettings($badgerDb); $startPageURL = getAbsoluteStartPage(); eval('echo "' . $tpl->getTemplate('importExport/insert') . '";'); eval('echo "' . $tpl->getTemplate('badgerFooter') . '";'); }
function update() { global $tpl, $us; $versionHistory = array(array('version' => '1.0 beta', 'function' => 'update1_0betaTo1_0beta2'), array('version' => '1.0 beta 2', 'function' => false)); $widgets = new WidgetEngine($tpl); $widgets->addNavigationHead(); $updateTitle = getUpdateTranslation('updateUpdate', 'pageTitle'); echo $tpl->getHeader($updateTitle); $currentDbVersion = getBadgerDbVersion(); for ($dbVersionIndex = 0; $dbVersionIndex < count($versionHistory); $dbVersionIndex++) { if ($versionHistory[$dbVersionIndex]['version'] == $currentDbVersion) { break; } } $numNeededSteps = count($versionHistory) - $dbVersionIndex - 1; $dbVersion = $currentDbVersion; $fileVersion = BADGER_VERSION; $betweenVersions = ''; for ($i = $dbVersionIndex + 1; $i < count($versionHistory) - 1; $i++) { $currentVersion = $versionHistory[$i]; eval('$betweenVersions .= "' . $tpl->getTemplate('update/betweenVersionsLine') . '";'); } $betweenVersionsText = getUpdateTranslation('updateUpdate', 'betweenVersionsText'); if ($betweenVersions !== '') { eval('$betweenVersionsBlock = "' . $tpl->getTemplate('update/betweenVersionsBlock') . '";'); } else { $betweenVersionsBlock = ''; } $updateLog = ''; $preCurrentText = getUpdateTranslation('updateUpdate', 'preCurrentText'); $postCurrentText = getUpdateTranslation('updateUpdate', 'postCurrentText'); $postNextText = getUpdateTranslation('updateUpdate', 'postNextText'); $logEntryHeader = getUpdateTranslation('updateUpdate', 'logEntryHeader'); for ($currentVersionIndex = $dbVersionIndex; $currentVersionIndex < count($versionHistory) - 1; $currentVersionIndex++) { $currentVersion = $versionHistory[$currentVersionIndex]['version']; $nextVersion = $versionHistory[$currentVersionIndex + 1]['version']; eval('$updateLog .= "' . $tpl->getTemplate('update/updateStepHeader') . '";'); $logEntry = $versionHistory[$currentVersionIndex]['function'](); eval('$updateLog .= "' . $tpl->getTemplate('update/updateStepEntry') . '";'); } $updateInformation = getUpdateTranslation('updateUpdate', 'updateInformation'); $errorInformation = getUpdateTranslation('updateUpdate', 'errorInformation'); $dbVersionText = getUpdateTranslation('updateProcedure', 'dbVersionText'); $fileVersionText = getUpdateTranslation('updateProcedure', 'fileVersionText'); $updateFinished = getUpdateTranslation('updateUpdate', 'updateFinished'); $goToStartPagePreLink = getUpdateTranslation('updateUpdate', 'goToStartPagePreLink'); $goToStartPageLinkText = getUpdateTranslation('updateUpdate', 'goToStartPageLinkText'); $goToStartPagePostLink = getUpdateTranslation('updateUpdate', 'goToStartPagePostLink'); $startPageURL = getAbsoluteStartPage(); eval('echo "' . $tpl->getTemplate('update/update') . '";'); eval('echo "' . $tpl->getTemplate('badgerFooter') . '";'); }
function printFrontend() { global $pageTitle; global $tpl; global $cm; global $redirectPageAfterSave; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addJSValMessages(); $tpl->addJavaScript("js/prototype.js"); $tpl->addOnLoadEvent("Form.focusFirstElement('mainform')"); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); if (isset($_GET['ID'])) { //edit: load values for this ID $ID = getGPC($_GET, 'ID', 'integer'); $currency = $cm->getCurrencyById($ID); $symbolValue = $currency->getSymbol(); $langnameValue = $currency->getLongName(); } else { //new: empty values $ID = "new"; $symbolValue = ""; $langnameValue = ""; } //set vars with values $FormAction = $_SERVER['PHP_SELF']; $legend = getBadgerTranslation2('accountCurrency', 'legend'); $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $pageHeading = $pageTitle; //Fields & Labels $symbolLabel = $widgets->createLabel("symbol", getBadgerTranslation2('accountCurrency', 'symbol'), true); $symbolField = $widgets->createField("symbol", 20, $symbolValue, "", true, "text", "maxlength='3'"); $longnameLabel = $widgets->createLabel("longname", getBadgerTranslation2('accountCurrency', 'longname'), false); $longnameField = $widgets->createField("longname", 20, $langnameValue, "", false, "text", ""); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPageAfterSave}';return false;", "Widgets/back.gif"); //add vars to template, print site eval("echo \"" . $tpl->getTemplate("Account/Currency") . "\";"); }
function printInsert() { global $tpl; $widgets = new WidgetEngine($tpl); $widgets->addNavigationHead(); $insertTitle = getBadgerTranslation2('importExport', 'insertTitle'); echo $tpl->getHeader($insertTitle); if (!isset($_POST['confirmUpload']) || $_POST['confirmUpload'] !== 'yes') { $insertMsg = getBadgerTranslation2('importExport', 'insertNoInsert'); } else { if (!is_uploaded_file($_FILES['sqlDump']['tmp_name'])) { $insertMsg = getBadgerTranslation2('importExport', 'insertNoFile'); } else { applySqlDump(); $insertMsg = getBadgerTranslation2('importExport', 'insertSuccessful'); } } eval(' echo "' . $tpl->getTemplate('importExport/insert') . '";'); eval('echo "' . $tpl->getTemplate('badgerFooter') . '";'); }
function showSelectPage() { global $tpl; global $us; global $badgerDb; handleOldFinishedTransactions(new AccountManager($badgerDb)); $widgets = new WidgetEngine($tpl); $widgets->addCalendarJS(); $widgets->addToolTipJS(); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/prototype.js"); $tpl->addJavaScript("js/statistics.js"); $tpl->addHeaderTag('<script type="text/javascript">var badgerHelpChapter = "Statistiken";</script>'); $dataGrid = new DataGrid($tpl); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=AccountManager"; $dataGrid->headerName = array(getBadgerTranslation2('statistics', 'accColTitle'), getBadgerTranslation2('statistics', 'accColBalance'), getBadgerTranslation2('statistics', 'accColCurrency')); $dataGrid->columnOrder = array("title", "balance", 'currency'); $dataGrid->initialSort = "title"; $dataGrid->initialSortDirection = "asc"; $dataGrid->headerSize = array(160, 100, 75); $dataGrid->cellAlign = array("left", 'right', 'left'); $dataGrid->width = '30em'; $dataGrid->height = '7em'; $dataGrid->initDataGridJS(); try { $preselectedAccounts = $us->getProperty('statisticsPreselectedAccounts'); foreach ($preselectedAccounts as $currentPreselectedAccount) { $tpl->addOnLoadEvent("dgPreselectId('{$currentPreselectedAccount}');"); } } catch (BadgerException $ex) { } $tpl->addOnLoadEvent("Behaviour.register(statisticsBehaviour);"); $tpl->addOnLoadEvent("Behaviour.apply();"); $widgets->addNavigationHead(); $selectTitle = getBadgerTranslation2('statistics', 'pageTitle'); echo $tpl->getHeader($selectTitle); $widgets->addToolTipLayer(); $selectFormAction = BADGER_ROOT . '/modules/statistics/statistics.php'; $graphTypeText = getBadgerTranslation2('statistics', 'type'); $categoryTypeText = getBadgerTranslation2('statistics', 'category'); $timeFrameText = getBadgerTranslation2('statistics', 'period'); $summarizeCategoriesText = getBadgerTranslation2('statistics', 'catMerge'); $accountsText = getBadgerTranslation2('statistics', 'accounts'); $differentCurrencyWarningText = getBadgerTranslation2('statistics', 'attention'); $fromText = getBadgerTranslation2('statistics', 'from'); $toText = getBadgerTranslation2('statistics', 'to'); $trendRadio = $widgets->createField('mode', null, 'trendPage', '', false, 'radio', 'checked="checked"'); $trendLabel = $widgets->createLabel('mode', getBadgerTranslation2('statistics', 'trend')); $categoryRadio = $widgets->createField('mode', null, 'categoryPage', '', false, 'radio'); $categoryLabel = $widgets->createLabel('mode', getBadgerTranslation2('statistics', 'categories')); $accountSelect = $dataGrid->writeDataGrid(); $accountField = $widgets->createField('accounts', null, null, '', false, 'hidden'); $monthArray = array('fullYear' => getBadgerTranslation2('statistics', 'fullYear'), '1' => getBadgerTranslation2('statistics', 'jan'), '2' => getBadgerTranslation2('statistics', 'feb'), '3' => getBadgerTranslation2('statistics', 'mar'), '4' => getBadgerTranslation2('statistics', 'apr'), '5' => getBadgerTranslation2('statistics', 'may'), '6' => getBadgerTranslation2('statistics', 'jun'), '7' => getBadgerTranslation2('statistics', 'jul'), '8' => getBadgerTranslation2('statistics', 'aug'), '9' => getBadgerTranslation2('statistics', 'sep'), '10' => getBadgerTranslation2('statistics', 'oct'), '11' => getBadgerTranslation2('statistics', 'nov'), '12' => getBadgerTranslation2('statistics', 'dec')); $monthSelect = $widgets->createSelectField('monthSelect', $monthArray, 'fullYear', '', false, 'onchange="updateDateRange();"'); $now = new Date(); $beginOfYear = new Date(); $beginOfYear->setMonth(1); $beginOfYear->setDay(1); $yearInput = $widgets->createField('yearSelect', 4, $now->getYear(), '', false, 'text', 'onchange="updateDateRange();"'); $startDateField = $widgets->addDateField("startDate", $beginOfYear->getFormatted()); $endDateField = $widgets->addDateField("endDate", $now->getFormatted()); $inputRadio = $widgets->createField('type', null, 'i', '', false, 'radio', 'checked="checked"'); $inputLabel = $widgets->createLabel('type', getBadgerTranslation2('statistics', 'income')); $outputRadio = $widgets->createField('type', null, 'o', '', false, 'radio'); $outputLabel = $widgets->createLabel('type', getBadgerTranslation2('statistics', 'expenses')); $summarizeRadio = $widgets->createField('summarize', null, 't', '', false, 'radio', 'checked="checked"'); $summarizeLabel = $widgets->createLabel('summarize', getBadgerTranslation2('statistics', 'subCat')); $distinguishRadio = $widgets->createField('summarize', null, 'f', '', false, 'radio'); $distinguishLabel = $widgets->createLabel('summarize', getBadgerTranslation2('statistics', 'subCat2')); $dateFormatField = $widgets->createField('dateFormat', null, $us->getProperty('badgerDateFormat'), null, false, 'hidden'); $errorMsgAccountMissingField = $widgets->createField('errorMsgAccountMissing', null, getBadgerTranslation2('statistics', 'errorMissingAcc'), null, false, 'hidden'); $errorMsgStartBeforeEndField = $widgets->createField('errorMsgStartBeforeEnd', null, getBadgerTranslation2('statistics', 'errorDate'), null, false, 'hidden'); $errorMsgEndInFutureField = $widgets->createField('errorMsgEndInFuture', null, getBadgerTranslation2('statistics', 'errorEndDate'), null, false, 'hidden'); $submitButton = $widgets->createButton('submit', getBadgerTranslation2('statistics', 'showButton'), 'submitSelect();', "Widgets/accept.gif"); eval('echo "' . $tpl->getTemplate('statistics/select') . '";'); eval('echo "' . $tpl->getTemplate('badgerFooter') . '";'); }
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", ".."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; $tpl->addCSS("style.css"); $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $accountOverview = getBadgerTranslation2('accountAccount', 'pageTitleOverview'); $categoryOverview = getBadgerTranslation2('accountCategory', 'pageTitleOverview'); $statistics = getBadgerTranslation2('statistics', 'pageTitle'); $backup = getBadgerTranslation2('importExport', 'askTitle'); $userPrefrences = getBadgerTranslation2('UserSettingsAdmin', 'title'); $widgets->addNavigationHead(); echo $tpl->getHeader("Badger"); $Modul1 = "<a href='" . BADGER_ROOT . "/modules/account/AccountManagerOverview.php'>{$accountOverview}</a>"; $Modul2 = "<a href='" . BADGER_ROOT . "/modules/account/CategoryManagerOverview.php'>{$categoryOverview}</a>"; $Modul3 = "<a href='" . BADGER_ROOT . "/modules/statistics/statistics.php'>{$statistics}</a>"; $Modul4 = "<a href='" . BADGER_ROOT . "/modules/importExport/importExport.php?mode=export'>{$backup}</a>"; $Modul5 = "<a href='" . BADGER_ROOT . "/core/UserSettingsAdmin/UserSettingsAdmin.php'>{$userPrefrences}</a>"; eval("echo \"" . $tpl->getTemplate("badgerOverview") . "\";"); eval("echo \"" . $tpl->getTemplate("badgerFooter") . "\";");
/** * Returns all fields in an array. * * The result has the following form: * array ( * array ( * 'field name 0' => 'value of field 0', * 'field name 1' => 'value of field 1' * ) * ); * * The inner array is repeated for each row. * The fields need to be in the order returned by @link getFieldNames(). * * @return array A list of all fields. */ public function getAll() { global $badgerDb; $us = new UserSettings($badgerDb); $tpl = new TemplateEngine($us, BADGER_ROOT); $widgets = new WidgetEngine($tpl); $currentLanguage = $us->getProperty('badgerLanguage'); $result = array(); switch ($this->type) { case 'transaction': $this->fetchTransactions(); $sum = new Amount(); foreach ($this->finishedTransactions as $currentTransaction) { $sum->add($currentTransaction->getAmount()); $result[] = array('transactionId' => $currentTransaction->getId(), 'type' => $widgets->addImage($currentTransaction->getType() == 'FinishedTransaction' ? 'Account/finished_transaction.png' : 'Account/planned_transaction.png', 'title="' . getBadgerTranslation2('Account', $currentTransaction->getType()) . '"'), 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'valutaDate' => ($tmp = $currentTransaction->getValutaDate()) ? $tmp->getFormatted() : '', 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : '', 'sum' => $sum->getFormatted()); } break; case 'finished': while ($this->fetchNextFinishedTransaction()) { } foreach ($this->finishedTransactions as $currentTransaction) { $result[] = array('finishedTransactionId' => $currentTransaction->getId(), 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'valutaDate' => ($tmp = $currentTransaction->getValutaDate()) ? $tmp->getFormatted() : '', 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : '', 'exceptional' => is_null($tmp = $currentTransaction->getExceptional()) ? '' : $tmp, 'periodical' => is_null($tmp = $currentTransaction->getPeriodical()) ? '' : $tmp); } break; case 'planned': while ($this->fetchNextPlannedTransaction()) { } foreach ($this->plannedTransactions as $currentTransaction) { $result[] = array('plannedTransactionId' => 'p' . $currentTransaction->getId() . '_X', 'title' => $currentTransaction->getTitle(), 'description' => $currentTransaction->getDescription(), 'amount' => $currentTransaction->getAmount()->getFormatted(), 'outsideCapital' => is_null($tmp = $currentTransaction->getOutsideCapital()) ? '' : $tmp, 'transactionPartner' => $currentTransaction->getTransactionPartner(), 'beginDate' => $currentTransaction->getBeginDate()->getFormatted(), 'endDate' => ($tmp = $currentTransaction->getEndDate()) ? $tmp->getFormatted() : '', 'repeatUnit' => getBadgerTranslation2('Account', $currentTransaction->getRepeatUnit()), 'repeatFrequency' => $currentTransaction->getRepeatFrequency(), 'categoryId' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getId() : '', 'categoryTitle' => ($tmp = $currentTransaction->getCategory()) ? $tmp->getTitle() : ''); } break; } return $result; }
/** * Returns all fields in an array. * * The result has the following form: * array ( * array ( * 'field name 0' => 'value of field 0', * 'field name 1' => 'value of field 1' * ) * ); * * The inner array is repeated for each row. * The fields need to be in the order returned by @link getFieldNames(). * * @return array A list of all fields. */ public function getAll() { global $badgerDb; $us = new UserSettings($badgerDb); $tpl = new TemplateEngine($us, BADGER_ROOT); $widgets = new WidgetEngine($tpl); $currentLanguage = $us->getProperty('badgerLanguage'); while ($this->fetchNextCategory()) { } $this->sortCategories(); $result = array(); foreach ($this->categories as $currentCategory) { $parent = $currentCategory->getParent(); if (is_null($parent)) { $title = ''; $parentId = ''; $parentTitle = $currentCategory->getTitle(); } else { $title = $currentCategory->getTitle(); $parentId = $parent->getId(); $parentTitle = $parent->getTitle(); } if ($currentCategory->getOutsideCapital()) { $image = "Account/{$currentLanguage}/outside_capital.png"; $tooltip = 'title="' . getBadgerTranslation2('CategoryManager', 'outsideCapital') . '"'; } else { $image = "Account/{$currentLanguage}/own_capital.png"; $tooltip = 'title="' . getBadgerTranslation2('CategoryManager', 'ownCapital') . '"'; } $result[] = array('categoryId' => $currentCategory->getId(), 'title' => $title, 'description' => $currentCategory->getDescription(), 'outsideCapital' => $widgets->addImage($image, $tooltip), 'parentId' => $parentId, 'parentTitle' => $parentTitle); } return $result; }
*| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", ".."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; updateBalances(); $widgets = new WidgetEngine($tpl); $dataGrid = new DataGrid($tpl, "AccountManagerWelcomePage"); //$dataGrid->noRowSelectedMsg = "test"; $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=AccountManager"; $dataGrid->headerName = array(getBadgerTranslation2('accountAccount', 'colTitle'), getBadgerTranslation2('accountAccount', 'colBalance'), getBadgerTranslation2('accountAccount', 'colCurrency')); $dataGrid->columnOrder = array("title", "balance", "currency"); $dataGrid->headerSize = array(200, 150, 100); $dataGrid->cellAlign = array("left", "right", "left"); $dataGrid->height = "180px"; $dataGrid->width = "520px"; $dataGrid->discardSelectedRows = "true"; $dataGrid->editAction = "account/AccountOverview.php?accountID="; $dataGrid->initDataGridJS(); $widgets->addNavigationHead(); echo $tpl->getHeader("Badger"); $accountOverviewHeader = getBadgerTranslation2('welcome', 'pageTitle');
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; $pageTitle = getBadgerTranslation2('accountCurrency', 'pageTitleOverview'); $widgets = new WidgetEngine($tpl); $dataGrid = new DataGrid($tpl, "CurrencyManager"); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=CurrencyManager"; $dataGrid->headerName = array(getBadgerTranslation2('accountCurrency', 'colSymbol'), getBadgerTranslation2('accountCurrency', 'colLongName')); $dataGrid->columnOrder = array("symbol", "longName"); $dataGrid->headerSize = array(80, 120); $dataGrid->cellAlign = array("left", "left"); $dataGrid->width = "240px"; $dataGrid->height = "200px"; $dataGrid->deleteAction = "CurrencyManager.php?action=delete&ID="; $dataGrid->editAction = "CurrencyManager.php?action=edit&ID="; $dataGrid->newAction = "CurrencyManager.php?action=new"; $dataGrid->initDataGridJS(); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo "<h1>{$pageTitle}</h1>";
function printFrontendPlanned($AccountID, $ID) { global $pageTitle; global $tpl; global $am; global $redirectPage; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addJSValMessages(); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); $transactionType = "planned"; if ($ID != "new") { $acc = $am->getAccountById($AccountID); $transaction = $acc->getPlannedTransactionById($ID); $titleValue = $transaction->getTitle(); $descriptionValue = $transaction->getDescription(); $beginDateValue = is_null($tmp = $transaction->getBeginDate()) ? '' : $tmp->getFormatted(); $endDateValue = is_null($tmp = $transaction->getEndDate()) ? '' : $tmp->getFormatted(); $amountValue = is_null($tmp = $transaction->getAmount()) ? '' : $tmp->getFormatted(); $outsideCapitalValue = is_null($tmp = $transaction->getOutsideCapital()) ? '' : $tmp; $transactionPartnerValue = $transaction->getTransactionPartner(); $categoryValue = is_null($tmp = $transaction->getCategory()) ? '' : $tmp->getId(); $repeatUnitValue = $transaction->getRepeatUnit(); $repeatFrequencyValue = $transaction->getRepeatFrequency(); } else { //new: empty values $titleValue = ""; $descriptionValue = ""; $beginDateValue = ""; $endDateValue = ""; $amountValue = ""; $outsideCapitalValue = ""; $transactionPartnerValue = ""; $categoryValue = ""; $repeatUnitValue = ""; $repeatFrequencyValue = "1"; } //set vars with values $FormAction = $_SERVER['PHP_SELF']; if ($AccountID == "choose") { $AccountLabel = $widgets->createLabel("hiddenAccID", getBadgerTranslation2('accountTransaction', 'Account'), true); $hiddenAccID = $widgets->createSelectField("hiddenAccID", getAccountsSelectArray(), $AccountID, "", false, "style='width: 213px;'"); } else { $AccountLabel = ""; $hiddenAccID = $widgets->createField("hiddenAccID", 20, $AccountID, "", false, "hidden"); } $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $hiddenType = $widgets->createField("hiddenType", 20, $transactionType, "", false, "hidden"); //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountTransaction', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", ""); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountTransaction', 'description'), false); $descriptionField = $widgets->createField("description", 30, $descriptionValue, "", false, "text", ""); $beginDateLabel = $widgets->createLabel("beginDate", getBadgerTranslation2('accountTransaction', 'beginDate'), true); $beginDateField = $widgets->addDateField("beginDate", $beginDateValue); $endDateLabel = $widgets->createLabel("endDate", getBadgerTranslation2('accountTransaction', 'endDate'), true); $endDateField = $widgets->addDateField("endDate", $endDateValue); $amountLabel = $widgets->createLabel("amount", getBadgerTranslation2('accountTransaction', 'amount'), true); $amountField = $widgets->createField("amount", 30, $amountValue, "", true, "text", ""); $transactionPartnerLabel = $widgets->createLabel("transactionPartner", getBadgerTranslation2('accountTransaction', 'transactionPartner'), false); $transactionPartnerField = $widgets->createField("transactionPartner", 30, $transactionPartnerValue, "", false, "text", ""); $outsideCapitalLabel = $widgets->createLabel("outsideCapital", getBadgerTranslation2('accountTransaction', 'outsideCapital'), false); $outsideCapitalField = $widgets->createField("outsideCapital", 30, "on", "", false, "checkbox", $outsideCapitalValue); $categoryLabel = $widgets->createLabel("category", getBadgerTranslation2('accountTransaction', 'category'), false); $categoryField = $widgets->createSelectField("category", getCategorySelectArray(), $categoryValue, "", false, "style='width: 213px;'"); $repeatUnitLabel = $widgets->createLabel("repeatUnit", getBadgerTranslation2('accountTransaction', 'repeatFrequency'), true); $repeatUnitField = $widgets->createSelectField("repeatUnit", getIntervalUnitsArray(), $repeatUnitValue, "", true, "style='width: 104px;'"); $everyLabel = getBadgerTranslation2('intervalUnits', 'every'); $repeatFrequencyField = $widgets->createField("repeatFrequency", 1, $repeatFrequencyValue, "", true, "text", ""); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); if ($redirectPage) { $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPage}';return false;", "Widgets/back.gif"); } else { $backBtn = ""; } //add vars to template, print site $pageHeading = getBadgerTranslation2('accountTransaction', 'headingTransactionPlanned'); eval("echo \"" . $tpl->getTemplate("Account/PlannedTransaction") . "\";"); }
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; $pageTitle = getBadgerTranslation2('accountCategory', 'pageTitleOverview'); $widgets = new WidgetEngine($tpl); $dataGrid = new DataGrid($tpl, "CategoryManager"); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=CategoryManager"; $dataGrid->headerName = array(getBadgerTranslation2('accountCategory', 'colparentTitle'), getBadgerTranslation2('accountCategory', 'colTitle'), getBadgerTranslation2('accountCategory', 'colDescription'), getBadgerTranslation2('accountCategory', 'colOutsideCapital')); $dataGrid->columnOrder = array("parentTitle", "title", "description", "outsideCapital"); $dataGrid->deleteMsg = getBadgerTranslation2('accountCategory', 'deleteMsg'); $dataGrid->headerSize = array(200, 200, 300, 100); $dataGrid->cellAlign = array("left", "left", "left", "center"); $dataGrid->height = "350px"; $dataGrid->deleteAction = "CategoryManager.php?action=delete&ID="; $dataGrid->editAction = "CategoryManager.php?action=edit&ID="; $dataGrid->newAction = "CategoryManager.php?action=new"; $dataGrid->deleteRefreshType = 'refreshDataGrid'; $dataGrid->initDataGridJS(); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle);
eval("echo \"" . $tpl->getTemplate("Login/hiddenField") . "\";"); } } $MandatoryOldPasswordLabel = $widgets->createLabel("OldPassword", getBadgerTranslation2('UserSettingsAdmin', 'old_password_name'), true); $MandatoryOldPasswordField = $widgets->createField("OldPassword", 25, "", getBadgerTranslation2('UserSettingsAdmin', 'old_password_description'), true, 'password'); $MandatoryNewPasswordLabel = $widgets->createLabel("NewPassword", getBadgerTranslation2('UserSettingsAdmin', 'new_password_name'), true); $MandatoryNewPasswordField = $widgets->createField("NewPassword", 25, "", getBadgerTranslation2('UserSettingsAdmin', 'new_password_description'), true, 'password'); $MandatoryNewPasswordConfirmLabel = $widgets->createLabel("NewPasswordConfirm", getBadgerTranslation2('UserSettingsAdmin', 'new_password_confirm_name'), true); $MandatoryNewPasswordConfirmField = $widgets->createField("NewPasswordConfirm", 25, "", getBadgerTranslation2('UserSettingsAdmin', 'new_password_confirm_description'), true, 'password'); $MandatorySubmit = $widgets->createButton("SubmitMandatoryChangePassword", getBadgerTranslation2('UserSettingsAdmin', 'submit_button'), "submit", "Widgets/table_save.gif"); eval("echo \"" . $tpl->getTemplate("Login/mandatoryLogin") . "\";"); exit; } if ($passwordcorrect == false) { // Initialization $widgets = new WidgetEngine($tpl); $tpl->addOnLoadEvent("Form.focusFirstElement('loginForm')"); $widgets->addJSValMessages(); $widgets->addToolTipJS(); $tpl->addJavaScript("js/prototype.js"); echo $tpl->getHeader(getBadgerTranslation2('badger_login', 'header')); //write header echo $widgets->addToolTipLayer(); // End of Initialization $FsHeading = getBadgerTranslation2('badger_login', 'fs_heading'); set_session_var('number_of_login_attempts', $attempts + 1); $Heading = "<div class=\"LSPrompt\">" . getBadgerTranslation2('badger_login', 'enter_password') . "</div><br />"; if (isset($_GET['logout']) && $_GET['logout'] == "true") { $Action = getAbsoluteStartPage(); } else { $Action = $_SERVER['PHP_SELF'];
*| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://badger.berlios.org * **/ define('BADGER_ROOT', '../..'); require_once BADGER_ROOT . '/includes/fileHeaderFrontEnd.inc.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/core/widgets/DataGrid.class.php'; $FILTER_ID_MARKER = '__FILTER_ID__'; $widgets = new WidgetEngine($tpl); $widgets->addCalendarJS(); $widgets->addToolTipJS(); $widgets->addTwistieSectionJS(); $widgets->addPrototypeJS(); $widgets->addPageSettingsJS(); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/statistics2.js"); $dgAccounts = new DataGrid($tpl, 'Statistics2Accounts'); $dgAccounts->sourceXML = BADGER_ROOT . '/core/XML/getDataGridXML.php?q=AccountManager'; $dgAccounts->headerName = array(getBadgerTranslation2('statistics', 'accColTitle'), getBadgerTranslation2('statistics', 'accColBalance'), getBadgerTranslation2('statistics', 'accColCurrency')); $dgAccounts->columnOrder = array('title', 'balance', 'currency'); $dgAccounts->headerSize = array(160, 100, 75); $dgAccounts->cellAlign = array('left', 'right', 'left'); $dgAccounts->width = '30em'; $dgAccounts->height = '7em';
function printFrontendPlanned($AccountID, $plannedTransactionId, $finishedTransactionId = null) { global $pageTitle; global $tpl; global $am; global $redirectPage; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addJSValMessages(); $tpl->addJavaScript("js/prototype.js"); $tpl->addJavaScript('js/Transaction.js'); $tpl->addOnLoadEvent("Form.focusFirstElement('mainform')"); $now = new Date(); $categoryExpenseJS = getCategoryExpense(); $categoryExpenseWarning = getBadgerTranslation2('accountTransaction', 'categoryExpenseWarning'); $transactionType = "planned"; if ($plannedTransactionId != "new") { $acc = $am->getAccountById($AccountID); $transaction = $acc->getPlannedTransactionById($plannedTransactionId); $backToIdField = $widgets->createField('backToId', 0, $AccountID, '', false, 'hidden'); if (is_null($transaction->getTransferalTransaction())) { $transferalAmountValue = new Amount($transaction->getAmount()); $transferalAmountValue->mul(-1); $transferalAmountValue = $transferalAmountValue->getFormatted(); } else { if ($transaction->getTransferalSource()) { $transferalAmountValue = $transaction->getTransferalTransaction()->getAmount()->getFormatted(); } else { $transferalAmountValue = $transaction->getAmount()->getFormatted(); $AccountID = $transaction->getTransferalTransaction()->getAccount()->getId(); $plannedTransactionId = $transaction->getTransferalTransaction()->getId(); $ID = $transaction->getTransferalTransaction()->getId(); $transaction = $transaction->getTransferalTransaction(); } } $titleValue = $transaction->getTitle(); $descriptionValue = $transaction->getDescription(); $beginDateValue = is_null($tmp = $transaction->getBeginDate()) ? '' : $tmp->getFormatted(); $endDateValue = is_null($tmp = $transaction->getEndDate()) ? '' : $tmp->getFormatted(); $amountValue = is_null($tmp = $transaction->getAmount()) ? '' : $tmp->getFormatted(); $negativeAmountValue = new Amount($tmp); $negativeAmountValue->mul(-1); $negativeAmountValue = $negativeAmountValue->getFormatted(); $outsideCapitalValue = is_null($tmp = $transaction->getOutsideCapital()) ? '' : $tmp; $transactionPartnerValue = $transaction->getTransactionPartner(); $categoryValue = is_null($tmp = $transaction->getCategory()) ? '' : $tmp->getId(); $repeatUnitValue = $transaction->getRepeatUnit(); $repeatFrequencyValue = $transaction->getRepeatFrequency(); } else { //new: empty values $titleValue = ""; $descriptionValue = ""; $beginDateValue = $now->getFormatted(); $endDateValue = ""; $amountValue = ""; $negativeAmountValue = ''; $outsideCapitalValue = ""; $transactionPartnerValue = ""; $categoryValue = ""; $repeatUnitValue = ""; $repeatFrequencyValue = "1"; $transferalAmountValue = ''; $backToIdField = ''; } $tpl->addHeaderTag("<script type='text/javascript'>var previousAmount = '{$negativeAmountValue}';</script>"); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); if ($plannedTransactionId == 'new' || is_null($transaction->getTransferalTransaction())) { $transferalLabel = $widgets->createLabel('transferalEnabled', getBadgerTranslation2('accountTransaction', 'transferalEnabled'), false); $transferalField = $widgets->createField('transferalEnabled', 30, 'on', '', false, 'checkbox', "onclick='toggleTransferal();'"); $transferalFieldStyle = 'display: none;'; $transferalDataStyle = 'style="display: none;"'; $transferalAccountField = $widgets->createSelectField('transferalAccountId', getAccountsSelectArray($AccountID), '', '', false, "style='width: 213px;'"); } else { $transferalLabel = ''; $transferalField = ''; $transferalFieldStyle = ''; $transferalDataStyle = ''; $transferalAccountField = $transaction->getTransferalTransaction()->getAccount()->getTitle(); } $transferalAccountLabel = $widgets->createLabel('transferalAccountId', getBadgerTranslation2('accountTransaction', 'transferalAccount'), false); $transferalAmountLabel = $widgets->createLabel('transferalAmount', getBadgerTranslation2('accountTransaction', 'transferalAmount'), false); $transferalAmountField = $widgets->createField('transferalAmount', 30, $transferalAmountValue, '', true, 'text', " onkeyup='adjustInputNumberClass(this);' onkeydown='adjustInputNumberClass(this);' onkeypress='adjustInputNumberClass(this);' style='width: 30ex;{$transferalFieldStyle}'"); //set vars with values $FormAction = $_SERVER['PHP_SELF']; $backTo = $widgets->createField('backTo', 0, isset($_GET['backTo']) ? getGPC($_GET, 'backTo') : '', null, false, 'hidden'); if ($AccountID == "choose") { $AccountLabel = $widgets->createLabel("hiddenAccID", getBadgerTranslation2('accountTransaction', 'Account'), true); $hiddenAccID = $widgets->createSelectField("hiddenAccID", getAccountsSelectArray(), $AccountID, "", false, "style='width: 31ex;'"); } else { $AccountLabel = ""; $hiddenAccID = $widgets->createField("hiddenAccID", 20, $AccountID, "", false, "hidden"); } $hiddenID = $widgets->createField("hiddenID", 20, $plannedTransactionId, "", false, "hidden"); $hiddenType = $widgets->createField("hiddenType", 20, $transactionType, "", false, "hidden"); //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountTransaction', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", "style='width: 30ex;'"); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountTransaction', 'description'), false); $descriptionField = $widgets->createTextarea("description", $descriptionValue, "", false, "style='width: 30ex; height: 4em;'"); $beginDateLabel = $widgets->createLabel("beginDate", getBadgerTranslation2('accountTransaction', 'beginDate'), true); $beginDateField = $widgets->addDateField("beginDate", $beginDateValue); $endDateLabel = $widgets->createLabel("endDate", getBadgerTranslation2('accountTransaction', 'endDate'), true); $endDateField = $widgets->addDateField("endDate", $endDateValue); $amountLabel = $widgets->createLabel("amount", getBadgerTranslation2('accountTransaction', 'amount'), true); $amountField = $widgets->createField("amount", 30, $amountValue, "", true, "text", "onchange='updateTransferalAmount();' onkeyup='adjustInputNumberClass(this);' onkeydown='adjustInputNumberClass(this);' onkeypress='adjustInputNumberClass(this);' style='width: 30ex;'"); $transactionPartnerLabel = $widgets->createLabel("transactionPartner", getBadgerTranslation2('accountTransaction', 'transactionPartner'), false); $transactionPartnerField = $widgets->createField("transactionPartner", 30, $transactionPartnerValue, "", false, "text", "style='width: 30ex;'"); $outsideCapitalLabel = $widgets->createLabel("outsideCapital", getBadgerTranslation2('accountTransaction', 'outsideCapital'), false); $outsideCapitalField = $widgets->createField("outsideCapital", 30, "on", "", false, "checkbox", $outsideCapitalValue); $outsideToolTip = $widgets->addToolTip(getBadgerTranslation2("importCsv", "outsideCapitalToolTip")); $categoryLabel = $widgets->createLabel("category", getBadgerTranslation2('accountTransaction', 'category'), false); $categoryField = $widgets->createSelectField("category", getCategorySelectArray(), $categoryValue, "", false, "style='width: 31ex;' onchange='updateExpenseWarning();'"); $repeatUnitLabel = $widgets->createLabel("repeatUnit", getBadgerTranslation2('accountTransaction', 'repeatFrequency'), true); $repeatUnitField = $widgets->createSelectField("repeatUnit", getIntervalUnitsArray(), $repeatUnitValue, "", true, "style='width: 104px;'"); $everyLabel = getBadgerTranslation2('intervalUnits', 'every'); $repeatFrequencyField = $widgets->createField("repeatFrequency", 1, $repeatFrequencyValue, "", true, "text", ""); if (!is_null($finishedTransactionId) && $finishedTransactionId != 'X') { $hiddenFinishedTransactionID = $widgets->createField('hiddenFinishedTransactionID', 20, $finishedTransactionId, '', false, 'hidden'); $rangeLabel = getBadgerTranslation2('accountTransaction', 'range'); $rangeUnit = getBadgerTranslation2('accountTransaction', 'rangeUnit'); $rangeAllField = $widgets->createField('range', null, 'all', '', false, 'radio', 'checked="checked" onclick="checkBeginEndDate();"'); $rangeAllLabel = $widgets->createLabel('range', getBadgerTranslation2('accountTransaction', 'rangeAll')); $rangeThisField = $widgets->createField('range', null, 'this', '', false, 'radio', 'onclick="checkBeginEndDate();"'); $rangeThisLabel = $widgets->createLabel('range', getBadgerTranslation2('accountTransaction', 'rangeThis')); $rangePreviousField = $widgets->createField('range', null, 'previous', '', false, 'radio', 'onclick="checkBeginEndDate();"'); $rangePreviousLabel = $widgets->createLabel('range', getBadgerTranslation2('accountTransaction', 'rangePrevious')); $rangeFollowingField = $widgets->createField('range', null, 'following', '', false, 'radio', 'onclick="checkBeginEndDate();"'); $rangeFollowingLabel = $widgets->createLabel('range', getBadgerTranslation2('accountTransaction', 'rangeFollowing')); //$deleteBtn = $widgets->createButton('deleteBtn', getBadgerTranslation2('dataGrid', 'delete'), 'submit', 'Widgets/cancel.gif', "accesskey='d'"); $deleteBtn = ''; } else { $hiddenFinishedTransactionID = ''; $rangeLabel = ''; $rangeUnit = ''; $rangeAllField = $widgets->createField('range', 20, 'all', '', false, 'hidden'); $rangeAllLabel = ''; $rangeThisField = ''; $rangeThisLabel = ''; $rangePreviousField = ''; $rangePreviousLabel = ''; $rangeFollowingField = ''; $rangeFollowingLabel = ''; $deleteBtn = ''; } //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); if ($redirectPage) { $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPage}';return false;", "Widgets/back.gif"); } else { $backBtn = ''; } //add vars to template, print site $pageHeading = getBadgerTranslation2('accountTransaction', 'headingTransactionPlanned'); eval("echo \"" . $tpl->getTemplate("Account/PlannedTransaction") . "\";"); }
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", ".."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; $widgets = new WidgetEngine($tpl); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/prototype.js"); $dataGrid = new DataGrid($tpl); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=AccountManager"; $dataGrid->headerName = array(getBadgerTranslation2('accountAccount', 'colTitle'), getBadgerTranslation2('accountAccount', 'colBalance'), getBadgerTranslation2('accountAccount', 'colCurrency')); $dataGrid->columnOrder = array("title", "balance", "currency"); //$dataGrid->deleteMsg = getBadgerTranslation2('accountAccount', 'deleteMsg'); //$dataGrid->deleteRefreshType = "refreshPage"; $dataGrid->initialSort = "title"; $dataGrid->initialSortDirection = "asc"; $dataGrid->headerSize = array(200, 150, 100); $dataGrid->cellAlign = array("left", "right", "left"); $dataGrid->height = "130px"; $dataGrid->width = "520px"; $dataGrid->editAction = "account/AccountOverview.php?accountID=";
<?php /* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); echo $tpl->getHeader("Seitenname"); echo $widgets->addToolTipLayer(); ?> <form name="testform" method="post" action="process.php" onSubmit="return validateStandard(this, 'error');"> Name: <input type="text" required="1" regexp="/^\w*$/" name="name"><br /> Password: <input type="password" required="1" minlength="3" maxlength="8" name="password"><br /> Alter: <input type="text" name="age" id="age" maxlength="3" size="3" required="1" minvalue="10" maxvalue="90" /><br /> Asche: <input type="text" required="1" regexp="JSVAL_RX_MONEY" name="asche"><br /> <input type="submit" value="test"> blablabla
function printFrontend() { global $pageTitle; global $tpl; global $am; global $redirectPageAfterSave; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addJSValMessages(); $widgets->addNavigationHead(); if (isset($_GET['ID'])) { $pageTitle = getBadgerTranslation2('accountAccount', 'pageTitleProp'); } else { $pageTitle = getBadgerTranslation2('accountAccount', 'pageTitlePropNew'); } echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); if (isset($_GET['ID'])) { //edit: load values for this ID $ID = $_GET['ID']; $account = $am->getAccountById($ID); $titleValue = $account->getTitle(); $descriptionValue = $account->getDescription(); $lowerLimitValue = is_null($tmp = $account->getLowerLimit()) ? '' : $tmp->getFormatted(); $upperLimitValue = is_null($tmp = $account->getUpperLimit()) ? '' : $tmp->getFormatted(); $balanceValue = is_null($tmp = $account->getBalance()) ? '' : $tmp->getFormatted(); $currencyValue = $account->getCurrency()->getId(); $targetFutureCalcDateValue = is_null($account->getTargetFutureCalcDate()) ? '' : $tmp->getFormatted(); } else { //new: empty values $ID = "new"; $account = ""; $titleValue = ""; $descriptionValue = ""; $lowerLimitValue = ""; $upperLimitValue = ""; $balanceValue = ""; $currencyValue = ""; $targetFutureCalcDateValue = ""; } //set vars with values $FormAction = $_SERVER['PHP_SELF']; $legend = getBadgerTranslation2('accountAccount', 'legend'); $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $pageHeading = $pageTitle; //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountAccount', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", ""); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountAccount', 'description'), false); $descriptionField = $widgets->createField("description", 30, $descriptionValue, "", false, "text", ""); $lowerLimitLabel = $widgets->createLabel("lowerLimit", getBadgerTranslation2('accountAccount', 'lowerLimit'), false); $lowerLimitField = $widgets->createField("lowerLimit", 30, $lowerLimitValue, "", false, "text", "class='inputNumber'"); $upperLimitLabel = $widgets->createLabel("upperLimit", getBadgerTranslation2('accountAccount', 'upperLimit'), false); $upperLimitField = $widgets->createField("upperLimit", 30, $upperLimitValue, "", false, "text", "class='inputNumber'"); $currencyLabel = $widgets->createLabel("currency", getBadgerTranslation2('accountAccount', 'currency'), true); $currencies = getCurrencyArray('symbol'); $currencyField = $widgets->createSelectField("currency", $currencies, $default = $currencyValue, "", false, "style='width: 213px;'"); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPageAfterSave}';return false;", "Widgets/back.gif"); //add vars to template, print site eval("echo \"" . $tpl->getTemplate("Account/Account") . "\";"); }
*|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Finance Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . '/includes/fileHeaderFrontEnd.inc.php'; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/CategoryManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; require_once BADGER_ROOT . '/core/Date/Calc.php'; require_once BADGER_ROOT . '/modules/csvImport/csvImportCommon.php'; $pageHeading = getBadgerTranslation2('importCsv', 'pageHeading'); $legend = getBadgerTranslation2('importCsv', 'legend'); //include widget functionalaty $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addJSValMessages(); $tpl->addJavaScript('/js/prototype.js'); $tpl->addJavaScript('/js/csvImport.js'); $widgets->addNavigationHead(); echo $tpl->getHeader($pageHeading); echo $widgets->addToolTipLayer(); //create account manger object $am = new AccountManager($badgerDb); $am->setOrder(array(array('key' => 'title', 'dir' => 'asc'))); //if no Upload yet, show form if (!isset($_POST['btnSubmit'])) { if (!isset($_POST['Upload'])) { $fileLabel = $widgets->createLabel("", getBadgerTranslation2("importCsv", "selectFile") . ":", true);
**/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; if (isset($_GET['accountID'])) { $accountID = getGPC($_GET, 'accountID', 'integer'); } else { throw new badgerException('accountOverview', 'noAccountID', ''); } $am = new AccountManager($badgerDb); $account = $am->getAccountById($accountID); $pageTitle = getBadgerTranslation2('accountOverview', 'pageTitle'); $pageTitle .= ": " . $account->getTitle(); $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addTwistieSectionJS(); $dataGrid = new DataGrid($tpl, "Account{$accountID}"); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=Account&qp={$accountID}"; $dataGrid->headerName = array(getBadgerTranslation2('accountOverview', 'colValutaDate'), getBadgerTranslation2('accountOverview', 'colTitle'), getBadgerTranslation2('accountOverview', 'colType'), getBadgerTranslation2('accountOverview', 'colAmount'), getBadgerTranslation2('accountOverview', 'colBalance'), getBadgerTranslation2('accountOverview', 'colCategoryTitle')); $dataGrid->columnOrder = array("valutaDate", "title", "type", "amount", "balance", "concatCategoryTitle"); $dataGrid->height = "350px"; $dataGrid->headerSize = array(90, 350, 39, 80, 120, 200); $dataGrid->cellAlign = array("left", "left", "center", "right", "right", "left"); $dataGrid->deleteRefreshType = "refreshDataGrid"; $dataGrid->deleteAction = "Transaction.php?action=delete&accountID={$accountID}&ID="; $dataGrid->editAction = "Transaction.php?action=edit&accountID={$accountID}&ID="; $dataGrid->newAction = "Transaction.php?action=new&accountID={$accountID}"; $dataGrid->initDataGridJS();
* ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; $pageHeading = getBadgerTranslation2('forecast', 'title'); $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addJSValMessages(); $tpl->addJavaScript("js/prototype.js"); $tpl->addJavaScript("js/forecast.js"); $widgets->addNavigationHead(); echo $tpl->getHeader($pageHeading); echo $widgets->addToolTipLayer(); //Settings formular //help funktions for automatical calculation of pocket money from the finished transactions $standardStartDate = new Date(); $standardStartDate->subtractSeconds(60 * 60 * 24 * 180); $calculatePocketMoneyStartDateField = $widgets->addDateField("startDate", $standardStartDate->getFormatted()); $writeCalcuatedPocketMoneyButton = $widgets->createButton("writePocketMoney", getBadgerTranslation2("forecast", "calculatedPocketMoneyButton"), 'calcPocketMoney2();', "Widgets/accept.gif"); $calculatedPocketMoneyLabel = getBadgerTranslation2("forecast", "calculatedPocketMoneyLabel") . ":";
<?php /* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addCalendarJS(); $widgets->addNavigationHead(); echo $tpl->getHeader("Seitenname"); ?> <script> /*************************************************************** ** Standard translation *****************************************************************/ function _jsVal_Language() { this.err_form = "Please enter/select values for the following fields:\n\n"; this.err_select = "Please select a valid \"%FIELDNAME%\""; this.err_enter = "Please enter a valid \"%FIELDNAME%\""; };
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; $widgets = new WidgetEngine($tpl); $tpl->addCss("Widgets/dataGrid.css"); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/prototype.js"); $dataGrid = new DataGrid($tpl); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=CurrencyManager"; $dataGrid->headerName = array("Symbol", "LongName"); $dataGrid->columnOrder = array("symbol", "longName"); $dataGrid->initialSort = "symbol"; //$dataGrid->width = "410px"; $dataGrid->headerSize = array(200, 200); $dataGrid->cellAlign = array("left", "left"); $dataGrid->deleteMsg = getBadgerTranslation2('dataGrid', 'deleteMsg'); $dataGrid->rowCounterName = getBadgerTranslation2('dataGrid', 'rowCounterName'); $dataGrid->deleteAction = "CurrencyManager.php?action=delete&ID="; $dataGrid->editAction = "CurrencyManager.php?action=edit&ID=";
function printFrontend() { global $tpl; global $cm; global $order; global $redirectPageAfterSave; if (isset($_GET['ID'])) { //edit: load values for this ID $ID = getGPC($_GET, 'ID', 'integer'); $pageTitle = getBadgerTranslation2('accountCategory', 'pageTitleEdit'); $category = $cm->getCategoryById($ID); $titleValue = $category->getTitle(); $descriptionValue = $category->getDescription(); if ($category->getOutsideCapital() == "1") { $outsideCapitalValue = "checked"; } else { $outsideCapitalValue = ""; } $keywordsValue = $category->getKeywords(); if ($category->getParent()) { $parentValue = $category->getParent()->getTitle(); $parentId = $category->getParent()->getId(); } else { $parentValue = ""; $parentId = ""; } $expenseValue = $category->getExpense(); } else { //new: empty values $pageTitle = getBadgerTranslation2('accountCategory', 'pageTitleNew'); $ID = "new"; $titleValue = ""; $descriptionValue = ""; $outsideCapitalValue = ""; $keywordsValue = ""; $parentValue = ""; $parentId = ""; $expenseValue = null; } $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addJSValMessages(); $tpl->addJavaScript("js/prototype.js"); $tpl->addOnLoadEvent("Form.focusFirstElement('mainform')"); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); //set vars with values $FormAction = $_SERVER['PHP_SELF']; $legend = getBadgerTranslation2('accountCategory', 'legend'); $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $pageHeading = $pageTitle; //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountCategory', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", "style='width: 30ex;'"); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountCategory', 'description'), false); $descriptionField = $widgets->createTextarea("description", $descriptionValue, "", false, "style='width: 30ex; height: 5em;'"); $parentLabel = $widgets->createLabel("parent", getBadgerTranslation2('accountCategory', 'parent'), false); $parentCats = array("" => getBadgerTranslation2('CategoryManager', 'no_parent')); while ($cat = $cm->getNextCategory()) { $cat->getParent(); } $cm->resetCategories(); while ($cat = $cm->getNextCategory()) { if (is_null($cat->getParent())) { $parentCats[$cat->getId()] = $cat->getTitle(); } } $parentField = $widgets->createSelectField("parent", $parentCats, $parentId, '', false, "style='width: 31ex;'"); $outsideCapitalLabel = $widgets->createLabel("outsideCapital", getBadgerTranslation2('accountCategory', 'outsideCapital'), false); $outsideCapitalField = $widgets->createField("outsideCapital", 30, "on", "", false, "checkbox", $outsideCapitalValue); $keywordsLabel = $widgets->createLabel('keywords', getBadgerTranslation2('accountCategory', 'keywordsLabel'), false); $keywordsField = $widgets->createTextarea('keywords', $keywordsValue, getBadgerTranslation2('accountCategory', 'keywordsDescription'), false, "style='width: 30ex; height: 5em;'"); $expenseRowLabel = getBadgerTranslation2('accountCategory', 'expenseRowLabel'); $incomeField = $widgets->createField('expense', 0, 'income', '', false, 'radio', $expenseValue === false ? 'checked="checked"' : ''); $incomeLabel = $widgets->createLabel('expense', getBadgerTranslation2('accountCategory', 'expenseIncome'), false); $expenseField = $widgets->createField('expense', 0, 'expense', '', false, 'radio', $expenseValue === true ? 'checked="checked"' : ''); $expenseLabel = $widgets->createLabel('expense', getBadgerTranslation2('accountCategory', 'expenseExpense'), false); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPageAfterSave}';return false;", "Widgets/back.gif"); //add vars to template, print site eval("echo \"" . $tpl->getTemplate("Account/Category") . "\";"); }
**/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; if (isset($_GET['accountID'])) { $accountID = getGPC($_GET, 'accountID', 'integer'); } else { throw new badgerException('accountOverviewPlanned', 'noAccountID', ''); } $am = new AccountManager($badgerDb); $account = $am->getAccountById($accountID); $pageTitle = getBadgerTranslation2('accountOverviewPlanned', 'pageTitle'); $pageTitle .= ": " . $account->getTitle(); $widgets = new WidgetEngine($tpl); $dataGrid = new DataGrid($tpl, "Account" . $accountID . "planned"); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=Account&qp={$accountID};planned"; $dataGrid->headerName = array(getBadgerTranslation2('accountOverview', 'colTitle'), getBadgerTranslation2('accountOverviewPlanned', 'colBeginDate'), getBadgerTranslation2('accountOverviewPlanned', 'colEndDate'), getBadgerTranslation2('accountOverviewPlanned', 'colRepeatText'), getBadgerTranslation2('accountOverview', 'colAmount'), getBadgerTranslation2('accountOverview', 'colCategoryTitle')); //$dataGrid->columnOrder = array("title","beginDate", "endDate", "repeatUnit", "repeatFrequency", "amount", "categoryTitle"); $dataGrid->columnOrder = array("title", "beginDate", "endDate", "repeatText", "amount", "categoryTitle"); $dataGrid->height = "350px"; //$dataGrid->headerSize = array(210, 95, 85, 70, 75, 120, 200); $dataGrid->headerSize = array(210, 95, 85, 85, 120, 200); //$dataGrid->cellAlign = array("left", "right", "right", "left", "right", "right", "left"); $dataGrid->cellAlign = array("left", "right", "right", "left", "right", "left"); $dataGrid->deleteAction = "Transaction.php?action=delete&backTo=planned&accountID={$accountID}&ID="; $dataGrid->editAction = "Transaction.php?action=edit&backTo=planned&accountID={$accountID}&ID="; $dataGrid->newAction = "Transaction.php?action=new&backTo=planned&accountID={$accountID}"; $dataGrid->initDataGridJS(); $widgets->addNavigationHead();
**/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/AccountManager.class.php'; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; if (isset($_GET['accountID'])) { $accountID = $_GET['accountID']; } else { throw new badgerException('accountOverview', 'noAccountID', ''); } $am = new AccountManager($badgerDb); $account = $am->getAccountById($accountID); transferFormerFinishedTransactions($account); $pageTitle = getBadgerTranslation2('accountOverview', 'pageTitle'); $widgets = new WidgetEngine($tpl); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/prototype.js"); $dataGrid = new DataGrid($tpl); $pageTitle .= ": " . $account->getTitle(); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=Account&qp={$accountID}"; $dataGrid->headerName = array(getBadgerTranslation2('accountOverview', 'colValutaDate'), getBadgerTranslation2('accountOverview', 'colTitle'), getBadgerTranslation2('accountOverview', 'colType'), getBadgerTranslation2('accountOverview', 'colAmount'), getBadgerTranslation2('accountOverview', 'colSum'), getBadgerTranslation2('accountOverview', 'colCategoryTitle')); $dataGrid->columnOrder = array("valutaDate", "title", "type", "amount", "sum", "categoryTitle"); $dataGrid->initialSort = "valutaDate"; $dataGrid->initialSortDirection = "asc"; $dataGrid->height = "350px"; $dataGrid->headerSize = array(120, 210, 39, 80, 120, 200); $dataGrid->cellAlign = array("left", "left", "center", "right", "right", "left"); $dataGrid->deleteRefreshType = "refreshDataGrid"; $dataGrid->deleteAction = "Transaction.php?action=delete&accountID={$accountID}&ID="; $dataGrid->editAction = "Transaction.php?action=edit&accountID={$accountID}&ID=";
/* * ____ _____ _____ ______ _____ *| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; // Initialization $tpl->addCSS("style.css"); $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addNavigationHead(); //$us->setProperty('badgerPassword',md5("badger")); // Was the form for change of User Settings sent? if (isset($_POST['SubmitUserSettings'])) { // Validate submitted values // Is yet to be implemented // So lets just say that all is well for now $validation_user_settings = true; $validation_user_settings_errors = ""; // is something written in the change password fields? if (isset($_POST['OldPassword']) && $_POST['OldPassword'] == "" && (isset($_POST['NewPassword']) && $_POST['NewPassword'] == "") && (isset($_POST['NewPasswordConfirm']) && $_POST['NewPasswordConfirm'] == "")) { $change_password = false; } else { $change_password = true;
function printFrontend() { global $pageTitle; global $tpl; global $cm; global $redirectPageAfterSave; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addJSValMessages(); $widgets->addNavigationHead(); echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); if (isset($_GET['ID'])) { //edit: load values for this ID $ID = $_GET['ID']; $category = $cm->getCategoryById($ID); $titleValue = $category->getTitle(); $descriptionValue = $category->getDescription(); if ($category->getOutsideCapital() == "1") { $outsideCapitalValue = "checked"; } else { $outsideCapitalValue = ""; } if ($category->getParent()) { $parentValue = $category->getParent()->getTitle(); $parentId = $category->getParent()->getId(); } else { $parentValue = ""; $parentId = ""; } } else { //new: empty values $ID = "new"; $titleValue = ""; $descriptionValue = ""; $outsideCapitalValue = ""; $parentValue = ""; $parentId = ""; } //set vars with values $FormAction = $_SERVER['PHP_SELF']; $legend = getBadgerTranslation2('accountCategory', 'legend'); $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $pageHeading = $pageTitle; //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountCategory', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", ""); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountCategory', 'description'), false); $descriptionField = $widgets->createField("description", 30, $descriptionValue, "", false, "text", ""); $parentLabel = $widgets->createLabel("parent", getBadgerTranslation2('accountCategory', 'parent'), false); $parentCats = array("" => getBadgerTranslation2('CategoryManager', 'no_parent')); while ($cat = $cm->getNextCategory()) { $cat->getParent(); } $cm->resetCategories(); while ($cat = $cm->getNextCategory()) { if (is_null($cat->getParent())) { $parentCats[$cat->getId()] = $cat->getTitle(); } } $parentField = $widgets->createSelectField("parent", $parentCats, $default = $parentId); $outsideCapitalLabel = $widgets->createLabel("outsideCapital", getBadgerTranslation2('accountCategory', 'outsideCapital'), false); $outsideCapitalField = $widgets->createField("outsideCapital", 30, "on", "", false, "checkbox", $outsideCapitalValue); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPageAfterSave}';return false;", "Widgets/back.gif"); //add vars to template, print site eval("echo \"" . $tpl->getTemplate("Account/Category") . "\";"); }
function printFrontend() { global $pageTitle; global $tpl; global $am; global $redirectPageAfterSave; $widgets = new WidgetEngine($tpl); $widgets->addToolTipJS(); $widgets->addJSValMessages(); $tpl->addJavaScript("js/prototype.js"); $tpl->addOnLoadEvent("Form.focusFirstElement('mainform')"); $tpl->addJavaScript("js/account.js"); $widgets->addNavigationHead(); if (isset($_GET['ID'])) { $pageTitle = getBadgerTranslation2('accountAccount', 'pageTitleProp'); } else { $pageTitle = getBadgerTranslation2('accountAccount', 'pageTitlePropNew'); } echo $tpl->getHeader($pageTitle); echo $widgets->addToolTipLayer(); if (isset($_GET['ID'])) { //edit: load values for this ID $ID = getGPC($_GET, 'ID', 'integer'); $account = $am->getAccountById($ID); $titleValue = $account->getTitle(); $descriptionValue = $account->getDescription(); $lowerLimitValue = is_null($tmp = $account->getLowerLimit()) ? '' : $tmp->getFormatted(); $upperLimitValue = is_null($tmp = $account->getUpperLimit()) ? '' : $tmp->getFormatted(); $balanceValue = is_null($tmp = $account->getBalance()) ? '' : $tmp->getFormatted(); $currencyValue = $account->getCurrency()->getId(); $deleteOldPlannedTransactionsValue = $account->getDeleteOldPlannedTransactions() == false ? 'checked="checked"' : ''; $csvParserValue = $account->getCsvParser(); } else { //new: empty values $ID = "new"; $account = ""; $titleValue = ""; $descriptionValue = ""; $lowerLimitValue = ""; $upperLimitValue = ""; $balanceValue = ""; $currencyValue = ""; $deleteOldPlannedTransactionsValue = 'checked="checked"'; $csvParserValue = ''; } //set vars with values $FormAction = $_SERVER['PHP_SELF']; $legend = getBadgerTranslation2('accountAccount', 'legend'); $hiddenID = $widgets->createField("hiddenID", 20, $ID, "", false, "hidden"); $pageHeading = $pageTitle; //Fields & Labels $titleLabel = $widgets->createLabel("title", getBadgerTranslation2('accountAccount', 'title'), true); $titleField = $widgets->createField("title", 30, $titleValue, "", true, "text", "style='width: 30ex;'"); $descriptionLabel = $widgets->createLabel("description", getBadgerTranslation2('accountAccount', 'description'), false); $descriptionField = $widgets->createTextarea("description", $descriptionValue, "", false, "style='width: 30ex; height: 5em;'"); $lowerLimitLabel = $widgets->createLabel("lowerLimit", getBadgerTranslation2('accountAccount', 'lowerLimit'), false); $lowerLimitField = $widgets->createField("lowerLimit", 30, $lowerLimitValue, "", false, "text", "style='width: 30ex;' regexp='BADGER_NUMBER'"); $upperLimitLabel = $widgets->createLabel("upperLimit", getBadgerTranslation2('accountAccount', 'upperLimit'), false); $upperLimitField = $widgets->createField("upperLimit", 30, $upperLimitValue, "", true, "text", "style='width: 30ex;' regexp='BADGER_NUMBER'"); $currencyLabel = $widgets->createLabel("currency", getBadgerTranslation2('accountAccount', 'currency'), true); $currencies = getCurrencyArray('symbol'); $currencyField = $widgets->createSelectField("currency", $currencies, $default = $currencyValue, "", false, "style='width: 31ex;'"); $deleteOldPlannedTransactionsLabel = $widgets->createLabel('deleteOldPlannedTransactions', getBadgerTranslation2('accountAccount', 'deleteOldPlannedTransactions'), false); $deleteOldPlannedTransactionsField = $widgets->createField('deleteOldPlannedTransactions', 30, 'on', getBadgerTranslation2('accountAccount', 'deleteOldPlannedTransactionsDescription'), false, 'checkbox', $deleteOldPlannedTransactionsValue); $csvParserLabel = $widgets->createLabel('csvParser', getBadgerTranslation2('accountAccount', 'csvParser'), false); $csvParsers = getParsers(); $csvParsers = array_merge(array('NULL' => getBadgerTranslation2('accountAccount', 'csvNoParser')), $csvParsers); $csvParserField = $widgets->createSelectField('csvParser', $csvParsers, $csvParserValue, '', false, "style='width: 31ex;'"); //Buttons $submitBtn = $widgets->createButton("submitBtn", getBadgerTranslation2('dataGrid', 'save'), "submit", "Widgets/accept.gif", "accesskey='s'"); $backBtn = $widgets->createButton("backBtn", getBadgerTranslation2('dataGrid', 'back'), "location.href='{$redirectPageAfterSave}';return false;", "Widgets/back.gif"); //add vars to template, print site eval("echo \"" . $tpl->getTemplate("Account/Account") . "\";"); eval("echo \"" . $tpl->getTemplate("badgerFooter") . "\";"); }
*| _ \ /\ | __ \ / ____| ____| __ \ *| |_) | / \ | | | | | __| |__ | |__) | *| _ < / /\ \ | | | | | |_ | __| | _ / *| |_) / ____ \| |__| | |__| | |____| | \ \ *|____/_/ \_\_____/ \_____|______|_| \_\ * Open Source Financial Management * Visit http://www.badger-finance.org * **/ define("BADGER_ROOT", "../.."); require_once BADGER_ROOT . "/includes/fileHeaderFrontEnd.inc.php"; require_once BADGER_ROOT . "/core/widgets/DataGrid.class.php"; require_once BADGER_ROOT . '/modules/account/accountCommon.php'; handleOldFinishedTransactions(new AccountManager($badgerDb)); $pageTitle = getBadgerTranslation2('accountAccount', 'pageTitleOverview'); $widgets = new WidgetEngine($tpl); $tpl->addJavaScript("js/behaviour.js"); $tpl->addJavaScript("js/prototype.js"); $dataGrid = new DataGrid($tpl); $dataGrid->sourceXML = BADGER_ROOT . "/core/XML/getDataGridXML.php?q=AccountManager"; $dataGrid->headerName = array(getBadgerTranslation2('accountAccount', 'colTitle'), getBadgerTranslation2('accountAccount', 'colBalance'), getBadgerTranslation2('accountAccount', 'colCurrency')); $dataGrid->columnOrder = array("title", "balance", "currency"); $dataGrid->deleteMsg = getBadgerTranslation2('accountAccount', 'deleteMsg'); $dataGrid->deleteRefreshType = "refreshPage"; $dataGrid->initialSort = "title"; $dataGrid->initialSortDirection = "asc"; $dataGrid->headerSize = array(200, 150, 100); $dataGrid->cellAlign = array("left", "right", "left"); $dataGrid->height = "350px"; $dataGrid->deleteAction = "AccountManager.php?action=delete&ID="; $dataGrid->editAction = "AccountManager.php?action=edit&ID=";