<?php
$db =& JFactory::getDBO();
$db->setQuery("SELECT jos_users.username, COUNT(*) AS 'TOTAL' FROM jos_content INNER JOIN jos_users ON jos_content.created_by = jos_users.id GROUP BY created_by");
$rows1 = $db->loadObjectList();
echo "<table width='100%' border='0' cellspacing='2' cellpadding='2'>";
echo "<tr><td><strong>User</strong></td><td><strong>Descriptions</strong></td></tr>";
foreach ($rows1 as $row)
{
?>
<tr>
<td><?php echo $row->username; ?></td><td><?php echo $row->TOTAL; ?></td>
</tr>
<?php
}
echo "</table>";
?>
SELECT jos_users.username, COUNT(*) AS 'TOTAL' FROM jos_content INNER JOIN jos_users ON jos_content.created_by = jos_users.id WHERE catid = '3' GROUP BY created_by
<?php
$from = JRequest::getVar('from');
$to = JRequest::getVar('to');
$option = JRequest::getVar('option');
$view = JRequest::getVar('view');
$id = JRequest::getVar('id');
$Itemid = JRequest::getVar('Itemid');
if (isset($from)) {
$db =& JFactory::getDBO();
$db->setQuery("SELECT jos_users.username, COUNT(*) AS 'TOTAL' FROM jos_content INNER JOIN jos_users ON jos_content.created_by = jos_users.id WHERE catid = '34' AND created >= '" .$from. "' AND created <= '" .$to. "' GROUP BY created_by");
$rows1 = $db->loadObjectList();
echo "<table width='100%' border='0' cellspacing='2' cellpadding='2'>";
echo "<tr><td><strong>User</strong></td><td><strong>Descriptions</strong></td></tr>";
foreach ($rows1 as $row)
{
?>
<tr>
<td><?php echo $row->username; ?></td><td><?php echo $row->TOTAL; ?></td>
</tr>
<?php
}
echo "</table>";
} else {
?>
<form id="form1" name="form1" method="get" action="index.php">
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="view" value="<?php echo $view; ?>" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
<table>
<tr>
<td>
From:
</td>
<td>
<input type="text" name="from" id="from" />
</td>
</tr>
<tr>
<td>
To:
</td>
<td>
<input type="text" name="to" id="to" />
</td>
</tr>
</table>
<input type="submit" value="Submit" />
</form>
<?php
}
?>
Time to create page: 0.106 seconds