示例#1
0
 public function render($data)
 {
     $icons = array('search', 'minus-square-filled', 'minus-circle-filled', 'minus', 'plus-square-filled', 'plus-circle-filled', 'plus', 'play', 'empty-trash', 'stop', 'pause', 'record', 'next', 'previous', 'fast-forward', 'rewind', 'archive', 'arrow-left', 'star-filled', 'star', 'bookmark', 'shopping-cart', 'music-note', 'open-book', 'login', 'logout', 'user', 'users', 'leaf', 'keyboard', 'key', 'youtube', 'gear', 'hamburger', 'arrows-ccw');
     $output = '<h2>Icons and id</h2>';
     foreach ($icons as $icon) {
         $output .= IconView::render(new IconModel($icon, $icon));
     }
     return $output;
 }
				<li><a href="<?php 
        echo $relative_base_path;
        ?>
"><?php 
        echo IconView::render(new IconModel('gear', 'Apps'));
        ?>
</a></li>
<?php 
    }
    ?>
			<li><a href="<?php 
    echo $relative_base_path;
    ?>
auth/logout.php"><?php 
    echo IconView::render(new IconModel('logout', 'Log out'));
    ?>
</a></li>
<?php 
} else {
    ?>
			<li><a href="<?php 
    echo $relative_base_path;
    ?>
auth/login.php"><?php 
    echo IconView::render(new IconModel('login', 'Log in'));
    ?>
</a></li>
<?php 
}
?>
	</ul>
示例#3
0
<?php

session_start();
$relative_base_path = './';
require_once 'global.php';
require_once $relative_base_path . 'models/icon.php';
DB_Connect($DB_ADDRESS, $DB_USER, $DB_PASS, $DB_NAME);
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : "overview";
$page_title = 'SARAH';
if (isset($_SESSION['username'])) {
    $alt_menu = '<a href="auth/logout.php' . (isset($_REQUEST['page']) ? '?page=' . $_REQUEST['page'] : '') . '" id="logout" class="add">' . IconView::render(new IconModel('logout', 'Logout')) . '</a>';
} else {
    $alt_menu = '<a href="auth/login.php' . (isset($_REQUEST['page']) ? '?page=' . $_REQUEST['page'] : '') . '" id="login" class="add">' . IconView::render(new IconModel('login', 'Login')) . '</a>';
}
include 'views/_header.php';
?>
		<div id="navigation" class="tabs">
<?php 
include 'views/_appList.php';
?>
		</div>
<?php 
include 'views/_footer.php';
		</style>
<?php 
    }
    if (isset($meta)) {
        echo $meta;
    }
    ?>
	</head>
	<body>
		<header>
<?php 
    if ($relative_base_path != './') {
        // <a href="<?php  echo ( endsWith ($_SERVER['REQUEST_URI'], 'index.php') || endsWith ($_SERVER['REQUEST_URI'], '/') ) ? '../../' : './'; ?*****>" class="back">&lt; SARAH</a>
        ?>
			<?php 
        echo IconView::render(new IconModel('hamburger', 'Menu'));
        ?>
			<?php 
        if (isset($header_other)) {
            echo $header_other;
        }
    }
    if (isset($alt_menu)) {
        echo $alt_menu;
    }
    ?>
			<h1><?php 
    echo explode('|', isset($page_title) ? $page_title : $app_title)[0];
    ?>
</h1>
		</header>
function getBackButton($label = null)
{
    $labelUrlVariable = $label != null ? '?label=' . $label : '';
    return ButtonView::render(new ButtonModel(IconView::render(new IconModel('arrow-left', 'Back')), './', 'back'));
}
示例#6
0
         $db_delete_success = BudgetManager::deleteRecord($id);
         break;
 }
 $spending_history_data = BudgetManager::getAllRecords($year, $month);
 $filterDOM = '';
 if ($year != null) {
     $filterDOM .= "<input type='hidden' name='year' value='{$year}' />";
 }
 if ($month != null) {
     $filterDOM .= "<input type='hidden' name='month' value='{$month}' />";
 }
 $page_title = 'Budget';
 if (!(isset($_REQUEST['year']) && isset($_REQUEST['month']))) {
     $meta = "<meta http-equiv='refresh' content='0;url=index.php?year=" . date("Y") . "&month=" . date("m") . "' />";
 }
 $alt_menu = getAddButton() . ButtonView::render(new ButtonModel(IconView::render(new IconModel('arrows-ccw', 'Recurring')), 'recurring.php', 'recurring'));
 $addModel = new AddModel('Add', 'add_budget_item', 'receipt.php');
 $addModel->addRow('store', 'Store');
 $addModel->addRadioOption('dateOption-current', 'CURRENT_TIMESTAMP', 'dateOption', 'checked="checked"');
 $addModel->addRadioOption('dateOption-selectTime', 'Date/Time', 'dateOption');
 $addModel->addRow('selectTime-date', 'Date', '', 'YYYY-MM-DD');
 $addModel->addRow('selectTime-time', 'Time', '', 'HH:MM:SS');
 // build recurring table model
 $recurringModel = new TableModel('Recurring items', 'recurring');
 $recurringModel->addRow(array(TableView2::createCell('amount', 'Amount', 'th'), TableView2::createCell('category', 'Category', 'th'), TableView2::createCell('store', 'Store', 'th'), TableView2::createCell('items', 'Items', 'th')));
 $recurring_items_data = BudgetManager::getAllRecurringByMonth($year, $month);
 while (($recurring_items_row = mysql_fetch_array($recurring_items_data)) != null) {
     $amount = $recurring_items_row['amount'];
     $category = $recurring_items_row['category'];
     $recurringModel->addRow(array(TableView2::createCell('amount', format_currency($amount)), TableView2::createCell('category', $category), TableView2::createCell('store', $recurring_items_row['store']), TableView2::createCell('items', $recurring_items_row['items'])));
     $total_spent += $amount;