Hey, I've seen the coding which you use for putting a "backup CSV" button on the front-end but I have no clue what to do with it. Can someone please tell me where I have to put the code for it to work?
Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.
Thank you for your support!
global $mosConfig_absolute_path, $database, $mosConfig_dbprefix; $formname = $_GET['chronoformname']; $database->setQuery( "SELECT id FROM #__chrono_contact WHERE name='".$formname."'" ); $formid = $database->loadResult(); $tablename = $mosConfig_dbprefix."chronoforms_".$formid; $tables = array( $tablename ); $result = $database->getTableFields( $tables ); $table_fields = array_keys($result[$tablename]); $database->setQuery( "SELECT * FROM ".$tablename."" ); $datarows = $database->loadObjectList(); $titcol = 0; foreach($table_fields as $table_field){ if($titcol){$csvline .=",";} $csvline .= $table_field; $titcol++; } $csvline .="\n"; $datacol = 0; $rowcount = 1; foreach($datarows as $datarow){ foreach($table_fields as $table_field){ if($datacol){$csvline .=",";} $csvline .= '"'.addslashes($datarow->$table_field).'"'; $datacol++; } $csvline .="\n"; $datacol = 0; $rowcount++; } if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) { $UserBrowser = "Opera"; } elseif (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) { $UserBrowser = "IE"; } else { $UserBrowser = ''; } $mime_type = ($UserBrowser == 'IE' || $UserBrowser == 'Opera') ? 'application/octetstream' : 'application/octet-stream'; @ob_end_clean(); ob_start(); header('Content-Type: ' . $mime_type); header('Expires: ' . gmdate('D, d M Y H:i:«»s') . ' GMT'); if ($UserBrowser == 'IE') { header('Content-Disposition: inline; filename="' . "ChronoForms - ".$formname." - ".date("j_n_Y"«»).'.csv"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header('Content-Disposition: attachment; filename="' . "ChronoForms - ".$formname." - ".date("j_n_Y"«»).'.csv"'); header('Pragma: no-cache'); } print $csvline; exit();
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com