include(DOCUMENT_ROOT.'/include/sidebar.php'); ?>
include(DOCUMENT_ROOT.'/include/topbar.php'); ?>
Sales Person Report -
echo "from ".$startDate." to ".$endDate; ?>
/*
*/ ?>
Communication with Customers
| Customer |
Date |
Message Type |
Message |
| Customer |
Date |
Message Type |
Message |
$query = "SELECT communication.id AS id, messageType, message,
dateAdded, customers.companyName AS companyName
FROM communication
LEFT JOIN users ON communication.userID = users.id
LEFT JOIN customers ON communication.customerID = customers.id
WHERE communication.userID = :userID AND dateAdded >=:startDate AND dateAdded <=:endDate";
$values = array(":userID" => $userID,
":startDate" => $startDate,
":endDate" => $endDate);
$messages = db_query_val($query, $values);
foreach ($messages as $message){
?>
|
|
|
|
} ?>
| ID |
Company Name |
Sales Person |
Contact Status |
Last Contact Date |
email |
phone |
|
| ID |
Company Name |
Sales Person |
Contact Status |
Last Contact Date |
email |
phone |
|
| ID |
Company Name |
Sales Person |
Contact Status |
Last Contact Date |
email |
phone |
|
$query = "SELECT
customers.id AS id,
customers.companyName AS companyName,
users.first_name AS sales_first_name,
users.last_name AS sales_last_name,
customers.registrationDate AS registrationDate,
customers.contactStatus AS contactStatus,
customers.email AS email,
customers.phone AS phone
FROM customers
LEFT JOIN users
ON customers.userId = users.id
WHERE
customers.userId=:userId";
$values = array(":userId" => $userID);
$res = db_query_val($query, $values);
foreach ($res as $row){
echo "";
echo "| ".$row['id']." | ";
echo "".$row['companyName']." | ";
echo "".$row['sales_first_name']." ".$row['sales_last_name']." | ";
echo "".$row['contactStatus']." | ";
$query = "SELECT dateAdded FROM communication WHERE customerID=:customerID ORDER BY dateAdded DESC LIMIT 1";
$values = array(":customerID" => $row['id']);
$res_dateAdded = db_query_val($query, $values);
echo "".$res_dateAdded[0][0]." | ";
echo "".$row['email']." | ";
echo "".$row['phone']." | ";
echo "View Details | ";
echo "
";
}
?>
include(DOCUMENT_ROOT.'/include/footer.php'); ?>