-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexportexcel.php
More file actions
46 lines (35 loc) · 876 Bytes
/
exportexcel.php
File metadata and controls
46 lines (35 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require 'config.php';
/*
* Logged in page initialization
*/
include($config['root_dir'] . 'includes/bootstrap.inc');
connect();
include($config['root_dir'] . 'theme/admin_header.php');
echo "Hi";
$select = "SELECT * FROM map";
$export = mysql_query($select);
$count = mysql_num_fields($export);
for ($i = 0; $i < $count; $i++) {
$header .= mysql_field_name($export, $i)."t";
}
while($row = mysql_fetch_row($export)) {
$line = "";
foreach($row as $value) {
if ((!isset($value)) OR ($value == "")) {
$value = "t";
} else {
$value = str_replace(""", """", $value);
$value = ""‘ . $value . ‘"‘ . “t";
}
$line .= $value;
}
$data .= trim($line)."n";
}
$data = str_replace("r", “", $data);
if ($data == “") {
$data = “n(0) Records Found!n";
}
print “$headern$data";
include($config['root_dir'].'theme/footer.php');
?>