break;
    case "returns.php":
        $table = 'loaned_hardware';
        $primaryKey = 'eagle_id';
        $where = 'checkout_auth = 1';
        break;
    default:
        $table = 'hardware';
        $primaryKey = 'hardware_id';
}
/*-----------------------END CONFIG-----------------------*/
//get table columns
// Array of database columns which should be read and sent back to DataTables.
// The `db` parameter represents the column name in the database, while the `dt`
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columnNames = get_column_heads($table);
$columns = array();
for ($i = 0; $i < count($columnNames); $i++) {
    $pushArray = array('db' => $columnNames[$i], 'dt' => $i);
    array_push($columns, $pushArray);
}
if (isset($joinQuery)) {
    $results = SSP::simple($_GET, $sqlDetails, $table, $primaryKey, $columns, $joinQuery);
} elseif (isset($where)) {
    $results = SSP::complex($_GET, $sqlDetails, $table, $primaryKey, $columns, $where);
} else {
    $results = SSP::simple($_GET, $sqlDetails, $table, $primaryKey, $columns);
}
//query and echo results
echo json_encode(linkDataTablesID($results, $url));
Example #2
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/include/functions.php';
//config
$columnSetting = "front";
//initialize page variables
$title = ucfirst(basename(__FILE__, '.php'));
$header = 'Return Request';
$description = 'Please find item in system that you checked out. After, request to return so administrator can approve your item return.';
$columns = format_column_heads(truncate_columns(get_column_heads("loaned_hardware"), 4));
$types = get_types();
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/table_template.php';
Example #3
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/include/functions.php';
//config
$columnSetting = "front";
//initialize page variables
$title = ucfirst(basename(__FILE__, '.php'));
$header = 'Find Hardware';
$description = 'Filter your search by category, or search for a specific hardware ID, type of hardware, model, or location to best determine if there is hardware available to suit your needs.';
$columns = format_column_heads(truncate_columns(get_column_heads("hardware"), 6));
$types = get_types();
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/table_template.php';