コード例 #1
0
$my_sql['pairs']['ResultsPerPage'] = array(array("display" => "50", "value" => "50", "default" => 1), array("display" => "25", "value" => "25"), array("display" => "10", "value" => "10"), array("display" => "100", "value" => "100"), array("display" => "All", "value" => "1000"));
/****************
Define Search Fields and Action Fields
****************/
$my_sql['search']['limit_to'] = array("input_type" => "text", "display" => "Limit Result", "value" => 100);
$my_sql['search']['sort_by'] = array("input_type" => "select", "display" => "Sort By");
$my_sql['search']['sort_by']['options']['source']['pairs'] = "SortBy";
$my_sql['search']['displayrange'] = array("input_type" => "select", "display" => "Display Range");
$my_sql['search']['displayrange']['options']['source']['pairs'] = "DisplayRange";
$my_sql['search']['tran_date'] = array("input_type" => "date", "display" => "Date", "date_format" => "Y-n-j");
$my_sql['search']['page_count'] = array("input_type" => "select", "display" => "Results Per Page");
$my_sql['search']['page_count']['options']['source']['pairs'] = "ResultsPerPage";
$my_sql['postpage'] = $_SERVER['PHP_SELF'];
$my_sql['title'] = "Rebill Lookup";
$my_sql['result_actions']['postpage'] = $_SERVER['PHP_SELF'];
$my_sql['result_actions']['title'] = "Rebills Found";
/****************
Process and Render Forms
****************/
require_once 'includes/header.php';
smart_search_form($my_sql);
if (smart_process_mysql_form($my_sql)) {
    $rebills->set_sort_by($_REQUEST['frm_sort_by']);
    $rebills->set_limit_offset($_REQUEST['frm_page_count'], $_REQUEST['frm_page_offset']);
    if (isset($_REQUEST['frm_displayrange']) && $_REQUEST['frm_displayrange'] == 1) {
        $rebills->set_date_range($_REQUEST['frm_tran_date_from'], $_REQUEST['frm_tran_date_to']);
    }
    $rebills->get_rebills_to_run();
    echo "<center>" . $rebills->render_rebilling_transactions() . "</center>";
}
require_once "includes/footer.php";