Copyright (c) 2003, DM Solutions Group Inc. * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **/ //set the language resource file $GLOBALS["szLanguageResource"] = str_replace("\\","/",dirname(__FILE__))."/ExtractSR.dbf"; include( "../session.inc.php" ); include( "../CWC2ButtonCache.php" ); $szDLFilename = (isset($_GET['txtDLFilename']))? $_GET['txtDLFilename'] : 'data.csv'; if (isset($_GET['srname'])) { $szSessionKey = 'EXTRACTSR_DATA_'.$_GET['srname']; if (isset($_SESSION[$szSessionKey]) && count($_SESSION[$szSessionKey]) > 0) { $aData = $_SESSION[$szSessionKey]; $szData = ""; $szSep = ""; foreach($aData[0] as $key => $data) { $szData .= $szSep.$key; $szSep = ","; } $szData .= "\n"; foreach($aData as $row) { $szSep = ""; foreach($row as $key=>$data) { $szData .= $szSep.$data; $szSep = ","; } $szData .= "\n"; } $f = $_SESSION['gszTmpImgPath']."/".$szSessionKey.'.csv'; $h = fopen( $f, "w" ); fwrite( $h, $szData ); fclose( $h ); } } // force download if requested if ( isset($_GET['txtExtract']) && $_GET['txtExtract'] == '1') { //print_r($_SESSION); $_SESSION['DOWNLOADFILE'] = $_SESSION['gszTmpWebPath']."/".$szSessionKey.".csv"; if (stristr($_SESSION['DOWNLOADFILE'], 'http://') == false ) $_SESSION['DOWNLOADFILE'] = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SESSION['DOWNLOADFILE']; $_SESSION['DOWNLOADFILE_SAVEAS'] = $szDLFilename; session_write_close(); header("Location: ../download.phtml?".SID ); } ?> <?php echo $oMLT->get("0", "Extract Data") ?>
get("0", "Extract Data") ?>

get("1", "Click 'extract' to download your data")) ?>

get("2", 'Output file name') ?>:
" onmouseup="javascript:execute()">
get("Close", "Close"), $oCommonMLT->get("CloseTip", "Close Dialog"), array( 'width' => 75) ); ?>