예제 #1
0
Print Master is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Print Master.  If not, see <http://www.gnu.org/licenses/>.
*/
// Include initialisation file
include_once 'inc/core.php';
// Get action from query string
$action = fRequest::getValid('action', array('list'));
$printer_id = fCRUD::getSearchValue('printer_id');
$date_from = fCRUD::getSearchValue('date_from');
$date_to = fCRUD::getSearchValue('date_to');
/**
 * Default action - show report of consumable installation
 */
if ($action == 'list') {
    // Set the users to be sortable by name or email, defaulting to name
    $sort = fCRUD::getSortColumn(array('events.date', 'models.name', 'printers.name', 'consumables.name', 'events.cost'));
    // Set the sorting to default to ascending
    $dir = fCRUD::getSortDirection('desc');
    // Redirect the user if one of the values was loaded from the session
    fCRUD::redirectWithLoadedValues();
    // Determine search parameters
    $sql_where = '';
    if ($printer_id) {
        $printer = new Printer($printer_id);
        $sql_where .= ' AND events.printer_id = ' . $db->escape('integer', $printer_id);
예제 #2
0
파일: index.php 프로젝트: mrjwc/printmaster
		<form method="get" action="<?php 
echo fURL::get();
?>
">

			<div class="grid_3 alpha">
				<label>Date from:</label>
				<input type="text" class="text-input datepicker" name="date_from" value="<?php 
echo fCRUD::getSearchValue('date_from');
?>
">
			</div>
			<div class="grid_3">
				<label>Date to:</label>
				<input type="text" class="text-input datepicker" name="date_to" value="<?php 
echo fCRUD::getSearchValue('date_to');
?>
">
			</div>
			<div class="grid_3">
				<label>Printer:</label>
				<select name="printer_id">
					<option value="" <?php 
echo $printer_id ? '' : 'selected="selected"';
?>
>(Any)</option>
					<?php 
foreach ($printers as $printer) {
    $selected = $printer_id == $printer->id ? 'selected="selected"' : '';
    echo '<option value="' . $printer->id . '" ' . $selected . '>' . $printer->name . '</option>';
}