} elseif (!is_array($tables)) { $tables = array($tables); } $tab_list = array(); $result = $db->query("SHOW TABLES LIKE '" . $db_config['prefix'] . "_%'"); while ($item = $result->fetch(3)) { $tab_list[] = $item[0]; } $result->closeCursor(); $contents = array(); $contents['tables'] = empty($tables) ? $tab_list : array_values(array_intersect($tab_list, $tables)); $contents['type'] = $type != 'str' ? 'all' : 'str'; $contents['savetype'] = $ext != 'sql' ? 'gz' : 'sql'; $contents['filename'] = tempnam(NV_ROOTDIR . '/' . NV_TEMP_DIR, NV_TEMPNAM_PREFIX); include NV_ROOTDIR . '/includes/core/dump.php'; $result = nv_dump_save($contents); if (!empty($result)) { nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['download'], 'File name: ' . basename($contents['filename']), $admin_info['userid']); $content['mime'] = $contents['savetype'] == 'gz' ? 'application/x-gzip' : 'text/x-sql'; $contents['fname'] = $db->dbname . '.sql'; if ($contents['savetype'] == 'gz') { $contents['fname'] .= '.gz'; } //Download file require_once NV_ROOTDIR . '/includes/class/download.class.php'; $download = new download($result[0], NV_ROOTDIR . '/' . NV_TEMP_DIR, basename($contents['fname'])); $download->download_file(); exit; } } die;
$filename = "learning_solution_$user_id.txt"; header("content-type: application/stream"); header("content-length: $len"); header("content-disposition: attachment; filename=$filename"); $fp=fopen($file,"r"); fpassthru($fp); exit; } else { $str=<<<EOD <script> alert( '$err[cEmptyrecords]' ); window.location=document.referrer; </script> EOD; echo $str; } } }//end class $ob = new download; $ob->download_file($db_object,$common,$approved_on,$default,$err,$_POST); ?>
$_SERVER['HTTP_HOST'] = reset_url($_SERVER['HTTP_HOST']); if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) { @header('Location: ' . $config['http_home_url']); die("Access denied!!!<br /><br />Please visit <a href=\"{$config['http_home_url']}\">{$config['http_home_url']}</a>"); } } $id = intval($_REQUEST['id']); if ($_REQUEST['area'] == "static") { $row = $db->super_query("SELECT name, onserver FROM " . PREFIX . "_static_files WHERE id ='{$id}'"); } else { $row = $db->super_query("SELECT name, onserver FROM " . PREFIX . "_files WHERE id ='{$id}'"); } if (!$row) { die("Access denied"); } $config['files_max_speed'] = intval($config['files_max_speed']); $row['onserver'] = totranslit($row['onserver'], false); $file = new download(FILE_DIR . $row['onserver'], $row['name'], $config['files_force'], $config['files_max_speed']); if ($_REQUEST['area'] == "static") { if ($config['files_count'] == "yes" and !$file->range) { $db->query("UPDATE " . PREFIX . "_static_files SET dcount=dcount+1 WHERE id ='{$id}'"); } } else { if ($config['files_count'] == "yes" and !$file->range) { $db->query("UPDATE " . PREFIX . "_files SET dcount=dcount+1 WHERE id ='{$id}'"); } } $db->close(); session_write_close(); $file->download_file();
$str=<<<EOD <script> alert( '$err[cEmptyrecords]' ); window.location=document.referrer; </script> EOD; echo $str; } } function changedate_display($date) { list($year,$month,$date)=explode("-",$date); //$newdate=""; $newdate=$month.'.'.$date.'.'.$year; return ($newdate); } }//end class $ob = new download; $ob->download_file($db_object,$common,$employee_id,$default,$error_msg,$plan_id); ?>
if(file_exists($file)) { $len = filesize($file); $filename = "performance_status_report_$user_id.txt"; header("content-type: application/stream"); header("content-length: $len"); header("content-disposition: attachment; filename=$filename"); $fp=fopen($file,"r"); fpassthru($fp); exit; } else { $str=<<<EOD <script> alert( '$err[cEmptyrecords]' ); window.location=document.referrer; </script> EOD; echo $str; } } }//end class $ob = new download; $ob->download_file($db_object,$common,$user_id,$uid,$default,$error_msg); ?>
fpassthru($fp); exit; } else { $str=<<<EOD <script> alert( '$err[cEmptyrecords]' ); window.location=document.referrer; </script> EOD; //echo $str; } } }//end class $ob = new download; $user_id=$_GET["user_id"]; $load=$_GET["load"]; $ob->download_file($db_object,$common,$user_id,$load); ?>