Exemplo n.º 1
0
 public function strExportUserTable($lTableID)
 {
     $cUF = new muser_fields();
     $cUF->lTableID = $lTableID;
     $cUF->loadTableViaTableID();
     $lNumFields = $cUF->lNumUF_TableFields($lTableID);
     if ($lNumFields == 0) {
         return '';
     }
     $cUF->loadTableFields();
     $enumTType = $cUF->userTables[0]->enumTType;
     $strTmpTable = 'tmpUFExport';
     $sqlStr = $this->strCreateTempTableUFExport($cUF->fields, $strTmpTable, $sqlDelete, $strFieldNamesSel);
     $this->db->query($sqlDelete);
     $this->db->query($sqlStr);
     //------------------------------------------------
     // populate the temp table with personalized data
     //------------------------------------------------
     $this->strPopulateUFTempData($cUF, $lTableID, $strTmpTable, $enumTType, $cUF->fields);
     //---------------------------
     // tie it all together
     //---------------------------
     $sqlStr = $this->strTmpTableJoinedToContext($enumTType, $strTmpTable, $strFieldNamesSel, 'tmp_lForeignID', true, '', '');
     $query = $this->db->query($sqlStr);
     return $this->dbutil->csv_from_result($query);
 }