*/
$actions_result = db_query("SELECT DISTINCT * FROM target_email_actions WHERE (digest_date IS NULL OR digest_date = '') AND project_id = '$project_id' ORDER BY redcap_data_access_group ASC, abs(record) ASC");
if ($actions_result) {
	while ($actions_row = db_fetch_assoc($actions_result)) {
		$item_count++;
		foreach ($actions_row AS $key => $value) {
			$$key = $value;
		}
		$event_keys = Event::getUniqueKeys($project_id);
		$event_id = array_search($redcap_event_name, $event_keys);
		$url = APP_PATH_WEBROOT_FULL . "redcap_v" . $redcap_version . "/DataEntry/index.php?pid=$project_id&id=$record&event_id=$event_id&page=$form_name";
		$rows .= RCView::tr(array('style' => 'border:1px solid #d0d0d0;'),
			RCView::td(array('class' => 'data_1', 'style' => "font-family:Verdana;font-size:8pt;background-color:" . row_style($item_count) . ";border:1px solid #CCCCCC;text-align:left;padding:5px 8px;"),
				"<a href='{$url}'>$record</a>"
			) .
			RCView::td(array('class' => 'data_1', 'style' => "font-family:Verdana;font-size:8pt;background-color:" . row_style($item_count) . ";border:1px solid #CCCCCC;text-align:left;padding:5px 8px;"),
				$redcap_data_access_group
			)
		);
		if (!$debug) {
			if (!db_query("UPDATE target_email_actions SET digest_date = '$today' WHERE action_id = '$action_id'")) {
				error_log("ERROR: failed to update target_email_actions.digest_date");
			}
		}
		d($actions_row);
	}
	if ($item_count > 0) {
		/**
		 * construct html for email
		 */
		$html = "<div>";
             $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $result_row['aedecod']);
             $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $result_row['aehlt']);
             $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $result_row['aehlgt']);
             $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $result_row['aesoc']);
             $rows .= RCView::tr('', $columns);
             $item_count++;
         }
         if ($loose_result) {
             if (db_num_rows($loose_result) > 0) {
                 while ($loose_result_row = db_fetch_assoc($loose_result)) {
                     $columns = '';
                     $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $loose_result_row['aellt']);
                     $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $loose_result_row['aedecod']);
                     $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $loose_result_row['aehlt']);
                     $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $loose_result_row['aehlgt']);
                     $columns .= RCView::td(array('class' => row_style($item_count), 'style' => 'white-space: nowrap;'), $loose_result_row['aesoc']);
                     $rows .= RCView::tr('', $columns);
                     $item_count++;
                 }
             }
         }
         $tbody = "<tbody>" . $rows . "</tbody>";
         echo RCView::table(array('id' => 'ae_report_results', 'class' => 'dt', 'cellspacing' => '0'), $thead . $tbody);
         echo RCView::br() . RCView::br();
     } else {
         echo RCView::h3('', "Sorry, there were no results for that search. Try again?");
     }
 }
 /**
  * after submit and results are returned, highlight the search term
  * @TODO: figure out why we can't set focus back to the search input field
Esempio n. 3
0
    }
}
if (sizeof($entries) > 0) {
    $topSize = $entries[0]->getTotalSize();
    echo "<table class='data'>";
    echo "<tr>\n";
    echo "  <th>rank</th>\n";
    echo "  <th>self+desc</th>\n";
    echo "  <th>self</th>\n";
    echo "  <th>desc</th>\n";
    echo "  <th>count</th>\n";
    echo "  <th>class</th>\n";
    echo "</tr>\n";
    for ($i = 0; $i < sizeof($entries); $i++) {
        $entry = $entries[$i];
        echo "<tr class='" . row_style($i) . "'>";
        echo "<td>";
        printf("%.4f", $entry->getTotalSize() / $topSize);
        echo "</td>";
        echo "<td align='right'>";
        printf("%.3fM", $entry->getTotalSize() / (1024 * 1024));
        echo "</td>";
        echo "<td align='right'>";
        printf("%.3fM", $entry->getSelfSize() / (1024 * 1024));
        echo "</td>";
        echo "<td align='right'>";
        printf("%.3fM", $entry->getChildSize() / (1024 * 1024));
        echo "</td>";
        echo "<td align='right'>";
        printf("%d", $entry->getCount());
        echo "</td>";
Esempio n. 4
0
function print_db_pools($db_pools)
{
    ob_start();
    ?>

<table class="data">
  <tr>
    <th>&nbsp;</th>
    <th colspan='5' id='connections'><?php 
    echo info("Connections", "Database_Connections");
    ?>
</th>
    <th colspan='2' id='config'><?php 
    echo info("Config", "Database_Connections");
    ?>
</th>
  </tr>
  <tr>
    <th id='name'><?php 
    echo gettext('Name');
    ?>
</th>
    <th id='active'><?php 
    echo gettext('Active');
    ?>
</th>
    <th id='idle'><?php 
    echo gettext('Idle');
    ?>
</th>
    <th id='created'><?php 
    echo gettext('Created');
    ?>
</th>
    <th id='failed' colspan='2'><?php 
    echo gettext('Failed');
    ?>
</th>
    <th id='max-connections'>max-connections</th>
    <th id='idle-time'>idle-time</th>
  </tr>

<?php 
    $row = 0;
    foreach ($db_pools as $pool) {
        ?>

  <tr class='<?php 
        echo row_style($row++);
        ?>
'>
    <td headers="name"><?php 
        echo $pool->Name;
        ?>
</td>
    <td headers="connections active"><?php 
        echo $pool->ConnectionActiveCount;
        ?>
</td>
    <td headers="connections idle"><?php 
        echo $pool->ConnectionIdleCount;
        ?>
</td>
    <td headers="connections created"><?php 
        echo format_miss_ratio($pool->ConnectionCountTotal, $pool->ConnectionCreateCountTotal);
        ?>
</td>
    <td headers="connections failed"><?php 
        echo $pool->ConnectionFailCountTotal;
        ?>
</td>
    <td headers="connections failed" class='<?php 
        echo format_ago_class($pool->LastFailTime);
        ?>
'>
        <?php 
        echo format_ago($pool->LastFailTime);
        ?>
</td>
    <td headers="config max-connections"><?php 
        echo $pool->MaxConnections;
        ?>
</td>
    <td headers="config idle-time"><?php 
        echo sprintf("%.2fs", $pool->MaxIdleTime * 0.001);
        ?>
</td>
  </tr>
<?php 
    }
    ?>
</table>
<?php 
    return ob_get_clean();
}
Esempio n. 5
0
  <tr>
    <th>Name</th>
    <th>Active count</th>
    <th>Idle count</th>
    <th>Total count</th>
    <th>max-connections</th>
    <th>idle-time</th>
  </tr>

<?php 
    $row = 0;
    foreach ($db_pools as $pool) {
        ?>

  <tr class='<?php 
        echo row_style($row++);
        ?>
'>
    <td><?php 
        echo $pool->Name;
        ?>
</td>
    <td><?php 
        echo $pool->ConnectionActiveCount;
        ?>
</td>
    <td><?php 
        echo $pool->ConnectionIdleCount;
        ?>
</td>
    <td><?php