public function strExportBiz()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strDateFormat = strMysqlDateFormat(false);
     $strDateTimeFormat = strMysqlDateFormat(true);
     $sqlStr = 'SELECT ' . strExportFields_Biz() . ",\n\n             bizTab.pe_strImportID        AS `Import ID`,\n             bizTab.pe_lACO               AS `Accounting Country ID`,\n             aco_strName                  AS `Accounting Country`,\n             aco_strCurrencySymbol        AS `Currency Symbol`,\n             listAttrib.lgen_strListItem  AS `Attributed To`,\n             listBizCat.lgen_strListItem  AS `Business Category`,\n             bizTab.pe_lBizIndustryID     AS `Business Industry ID`,\n\n             DATE_FORMAT(bizTab.pe_dteOrigin,     {$strDateTimeFormat}) AS `Record Creation Date`,\n             DATE_FORMAT(bizTab.pe_dteLastUpdate, {$strDateTimeFormat}) AS `Record Last Update`\n\n          FROM people_names AS bizTab\n             INNER JOIN admin_aco     ON bizTab.pe_lACO=aco_lKeyID\n             LEFT  JOIN lists_generic AS listAttrib ON bizTab.pe_lAttributedTo  = listAttrib.lgen_lKeyID\n             LEFT  JOIN lists_generic AS listBizCat ON bizTab.pe_lBizIndustryID = listBizCat.lgen_lKeyID\n          WHERE\n             NOT bizTab.pe_bRetired\n             {$this->strBizWhere}\n             AND bizTab.pe_bBiz\n          ORDER BY bizTab.pe_lKeyID;";
     $query = $this->db->query($sqlStr);
     return $this->dbutil->csv_from_result($query);
 }
 private function strGroupRptExport_PeopleBiz($bBiz, &$strGroupsReviewed, $bShowAny)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     if ($bBiz) {
         $strFields = strExportFields_Biz();
         $strTableAlias = 'bizTab';
     } else {
         $strFields = strExportFields_People();
         $strTableAlias = 'peepTab';
     }
     $sqlStr = "SELECT {$strFields}\n          FROM tmpGroupMatch\n             INNER JOIN people_names AS {$strTableAlias} ON {$strTableAlias}.pe_lKeyID=gm_lForeignID\n          ORDER BY gm_lKeyID;";
     $query = $this->db->query($sqlStr);
     $rptExport = $this->dbutil->csv_from_result($query);
     if ($this->config->item('dl_addExportRptInfo')) {
         $rptExport .= strPrepStr(CS_PROGNAME . " export\n" . 'Created ' . date($genumDateFormat . ' H:i:s e') . "\n" . ($bBiz ? 'Businesses/Organizations' : 'People') . ' who are in ' . ($bShowAny ? 'any' : 'all') . ' of these groups: ' . $strGroupsReviewed, null, '"');
     }
     return $rptExport;
 }