<?php
$strTableName="Visit Report";
$_SESSION["OwnerID"] = $_SESSION["_".$strTableName."_OwnerID"];

$strOriginalTableName="visit_register";

$gstrOrderBy="ORDER BY Date(visit_register.`Date Of Visit`) DESC";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy="order by ".$gstrOrderBy;

$g_orderindexes=array();
$g_orderindexes[] = array(7, (0 ? "ASC" : "DESC"), "Date(visit_register.`Date Of Visit`)");
$gsqlHead="SELECT COUNT(visit_register.idvisit_register) AS Nos,  visit_register.`Employee Name`,  visit_register.`Customer Name`,  visit_register.`Contact Person`,  visit_register.`Purpose Of Visit`,  visit_register.`MOM Summary`,  Date(visit_register.`Date Of Visit`) AS `Date`,  visit_register.`Visit Status`,  customer_list.Region";
$gsqlFrom="FROM visit_register  INNER JOIN customer_list ON visit_register.`Customer Name` = customer_list.`Customer Name`";
$gsqlWhereExpr="";
$gsqlTail="GROUP BY visit_register.`Employee Name`, visit_register.`Customer Name`, visit_register.`Contact Person`, visit_register.`Purpose Of Visit`, visit_register.`MOM Summary`, Date(visit_register.`Date Of Visit`), visit_register.`Visit Status`";

include(getabspath("include/Visit_Report_settings.php"));

// alias for 'SQLQuery' object
$gQuery = &$queryData_Visit_Report;
$eventObj = &$tableEvents["Visit Report"];

$reportCaseSensitiveGroupFields = false;

$gstrSQL = gSQLWhere("");


?>