Example #1
0
<?php

/*Secured user only page*/
include '../includes/constant/config.inc.php';
secure_page();
return_meta("Golf Club Entries");
include '../includes/constant/nav.inc.php';
?>

<h1>Golf Clubs</h1>

<?php 
$query_for_table = mysql_query("SELECT * FROM " . TABLE_PRODUCTS . " ORDER BY club ASC;") or die(mysql_error());
//constant/config.inc.php line 393
generate_html_table();
include '../includes/constant/footer.inc.php';
Example #2
0
        $PAGE->set_title($page_title);
        $PAGE->set_heading($page_heading);
        $PAGE->navbar->add("AE Reports", $index_url);
        $PAGE->navbar->add("Time on Task", $this_url);
        echo $OUTPUT->header();
        echo '<script src="//code.jquery.com/jquery-1.10.2.js"></script>';
        echo '<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>';
        if (sizeof($user_data) > 0) {
            if ($debug) {
                var_dump($where_items);
                var_dump($usersinfo_sql);
                var_dump($query_arr);
                var_dump($user_data);
            } else {
                echo html_writer::start_tag('div', array('id' => 'ae_reports_display'));
                //echo html_writer::start_tag('div',array('class' => 'ae_reports_view'));
                echo html_writer::nonempty_tag('h3', "Teacher Time on Task: {$group_heading}");
                echo html_writer::nonempty_tag('h5', "{$subj_heading}{$start_heading}{$end_heading}");
                echo generate_html_table($user_data, "id");
                //echo html_writer::nonempty_tag('p',"<strong>Reported Users</strong>: ".sizeof($user_data));
                echo html_writer::nonempty_tag('p', "<strong>Time on Task</strong>: " . gmdate("H:i:s", $avg_seconds));
                echo html_writer::link(new moodle_url($this_url, array('g' => $groupid, 'type' => 'csv')), "Download CSV");
                //echo html_writer::end_tag('div');
                echo html_writer::end_tag('div');
            }
        } else {
            echo "No records found.";
        }
        echo $OUTPUT->footer();
        break;
}
    $add_attributes = $sdb->batch_put_attributes($domain, array('Item_01' => array('Category' => 'Clothes', 'Subcategory' => 'Sweater', 'Name' => 'Cathair Sweater', 'Color' => 'Siamese', 'Size' => array('Small', 'Medium', 'Large')), 'Item_02' => array('Category' => 'Clothes', 'Subcategory' => 'Pants', 'Name' => 'Designer Jeans', 'Color' => 'Paisley Acid Wash', 'Size' => array('30x32', '32x32', '32x34')), 'Item_03' => array('Category' => 'Clothes', 'Subcategory' => 'Pants', 'Name' => 'Sweatpants', 'Color' => array('Blue', 'Yellow', 'Pink'), 'Size' => 'Large', 'Year' => array('2006', '2007')), 'Item_04' => array('Category' => 'Car Parts', 'Subcategory' => 'Engine', 'Name' => 'Turbos', 'Make' => 'Audi', 'Model' => 'S4', 'Year' => array('2000', '2001', '2002')), 'Item_05' => array('Category' => 'Car Parts', 'Subcategory' => 'Emissions', 'Name' => 'O2 Sensor', 'Make' => 'Audi', 'Model' => 'S4', 'Year' => array('2000', '2001', '2002'))));
    // Were the attributes added successfully?
    if ($add_attributes->isOK()) {
        // Add an additional size to Item_01
        $append_attributes = $sdb->put_attributes($domain, 'Item_01', array('Size' => 'Extra Large'));
        // Were the new attributes appended successfully?
        if ($append_attributes->isOK()) {
            // Use a SELECT expression to query the data.
            // Notice the use of backticks around the domain name.
            $results = $sdb->select("SELECT * FROM `{$domain}` WHERE Category = 'Clothes'");
            // Get all of the <Item> nodes in the response
            $items = $results->body->Item();
            // Re-structure the data so access is easier (see helper function below)
            $data = reorganize_data($items);
            // Generate <table> HTML from the data (see helper function below)
            $html = generate_html_table($data);
        }
    }
}
/*%******************************************************************************************%*/
// HELPER FUNCTIONS
function reorganize_data($items)
{
    // Collect rows and columns
    $rows = array();
    $columns = array();
    // Loop through each of the items
    foreach ($items as $item) {
        // Let's append to a new row
        $row = array();
        $row['id'] = (string) $item->Name;