MANAGEMENT DASHBOARD - SALES LEADS
1. Sales tracking (link to SuiteCRM)
<?php
defined('_JEXEC') or die('Restricted Access');
function connectToDatabase() {
$option = array(
'driver' => 'mysql',
'host' => 'localhost',
'user' => 'readOnly',
'password' => 'kDvgI4cC4oING4go',
'database' => 'suitecrm',
'prefix' => ''
);
return JDatabaseDriver::getInstance($option);
}
function executeQuery($db, $query) {
$db->setQuery($query);
return $db->loadAssocList();
}
function renderTable($results) {
echo <<<HTML
<table style="border-color: #000000; background-color: #eeeeee;" border="1" cellpadding="10">
<tbody>
<tr>
<td style="text-align: left;"><b>Product</b></td>
<td width="125px" style="text-align: left;"><b>Start date</b></td>
<!-- ... Other headers ... -->
</tr>
HTML;
foreach ($results as $row) {
echo "<tr>
<td style=\"text-align: left;\">{$row['name']}</td>
<td style=\"text-align: left;\">{$row['s_date']}</td>
<!-- ... Other cells ... -->
</tr>";
}
echo '</tbody></table>';
}
$db = connectToDatabase();
$query = $db->getQuery(true)
->select(array(
// ... Your select statements ...
))
->from($db->quoteName('cases_cstm', 'cc'))
// ... Your join statements ...
->group('aos_products_id_c')
->order('ap.date_entered DESC');
$results = executeQuery($db, $query);
renderTable($results);
?>
Client reports (TESTING)
1) Blitzscaling > click to view the PDF and download if required
2) Rockaway > click to view the PDF and download if required
3) Protos > click to view the PDF and download if required
4) Lloyd Jones > click to view the PDF and download if required