forked from NYCPlanning/edm-metadata-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_metadata.php
More file actions
101 lines (76 loc) · 3.47 KB
/
export_metadata.php
File metadata and controls
101 lines (76 loc) · 3.47 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
include ('navbar.php');
?>
<style>
.header-h3 {
margin-left: 23px;
}
table, td, th {
border: 0.5px solid #D6D7DB;
text-align: center;
}
th, td {
padding: 10px;
}
.export-button {
display: inline !important;
}
</style>
<div class="wrapper">
<h3 class="header-h3">Export Metadata</h3>
<?php
include 'config.php';
$query = 'select * from readme';
$result = pg_query($query);
echo '<div class="col-md-10 col-md-offset-3">
<table class="form-table">
<tr>';
//Column names for the table
echo '<th> Dataset </th> <th> Readme </th> <th> Data Dictionary </th>';
$i = 0;
while ($row = pg_fetch_row($result))
{
echo "<tr>";
$count = count($row);
// Fetching dataset name to every row
$uid = $row[0];
$common_name = $row[1];
$sde_name_normalize = trim($row[2]);
$sde_name_underscore = str_replace(' ', '_', $sde_name_normalize);
echo "<td><a href=display.php?id=".$uid. " > ".$common_name."</a></td>";
echo "<td>
<form action=expcsv_readme.php?id=" . $uid . "&tbname=" . $common_name . " method='post' name='upload_excel' enctype='multipart/form-data' class='export-button'>
<input type=submit name=Export class='btn btn-default btn-rounded mb-4' value='.CSV'/>
</form>
<form action=expxml_readme.php?id=" . $uid . "&tbname=" . $common_name . " method='post' name='upload_excel' enctype='multipart/form-data' class='export-button'>
<input type=submit name=Expor2xml class='btn btn-default btn-rounded mb-4' value='.XML'/>
</form>
<form class='form-horizontal export-button' action=expmd_readme.php?id=" . $uid . "&tbname=". $common_name . " method='post' enctype='multipart/form-data'>
<input type=submit name=Expor2md class='btn btn-default btn-rounded mb-4' value='.MD'/>
</form>
</td>";
echo "<td>
<form class='form-horizontal export-button' action=expcsv_dict.php?sde_underscore=" . $sde_name_underscore ." method='post' name='upload_excel' enctype='multipart/form-data'>
<input type='submit' name='Export' class='btn btn-default btn-rounded mb-4' value='.CSV'/>
</form>
<form class='form-horizontal export-button' action=expxml_dict.php?sde_underscore=" . $sde_name_underscore . " method='post' name='upload_excel' enctype='multipart/form-data'>
<input type='submit' name='Expor2xml' class='btn btn-default btn-rounded mb-4' value='.XML'/>
</form>
<form class='form-horizontal export-button' action=expmd_dict.php?sde_underscore=" . $sde_name_underscore . " method='post' enctype='multipart/form-data'>
<input type='submit' name='Expor2md' class='btn btn-default btn-rounded mb-4' value='.MD'/>
</form>
</td>";
// echo "<td>
// <form action=expcsv_dict.php?sde_normalize=" . $row[2] . "&sde_underscore=" . $sde_name_underscore . " method='post' name='upload_excel' enctype='multipart/form-data' class='export-button'>
// <input type=submit name=Export class='btn btn-default btn-rounded mb-4' value='.CSV'/>
// </form>
// <form action=expxml_dict.php?sde_normalize=" . $row[2] . "&sde_underscore=" . $sde_name_underscore . " method='post' name='upload_excel' enctype='multipart/form-data' class='export-button'>
// <input type=submit name=Expor2xml class='btn btn-default btn-rounded mb-4' value='.XML'/>
// </form>
// </td>";
$i = $i + 1;
}
pg_free_result($result);
echo '</table></div>';
?>
</div>