-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAddDataOFS.php
More file actions
63 lines (63 loc) · 1.67 KB
/
Copy pathAddDataOFS.php
File metadata and controls
63 lines (63 loc) · 1.67 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" href="style.css" media="screen"/>
<?php
include("header.php");
?>
<body>
<div id="page">
<form action="GenOFS.php" method="post" enctype="multipart/form-data">
<b>Add socio-economic data:</b>
<input type="file" name="upfil" />
<?php
if(isset($_GET['error']) && $_GET['error']=='filedirec')
{
echo "<er>Check file format and directory!</er>";
}
if(isset($_GET['error']) && $_GET['error']=='nofile')
{
echo "<er>No file selected!</er>";
}
if(isset($_GET['error']) && $_GET['error']=='extension')
{
echo "<er>Wrong extension!</er>";
}
?>
<p>Please put the order of the columns for the file you want to upload.<br />
You can have empty columns at the end<br />
The num_ofs field is mandatory but might be placed anywhere</p>
<?php
include("connectDataBase.php");
$dbh=db_connect();
$sql="select * from ofs";
$sql1=pg_query($sql);
$num_field=pg_num_fields($sql1);
?>
<!--<form action="">-->
<?php
for($j=0;$j<$num_field;$j++){
$k=$j+1;
?>
<?php echo 'column '.$k.' ';?><select name="<?php echo 'column'.$j;?>">
<option value=""></option>
<?php
for($i=0;$i<$num_field;$i++){
?>
<option value="<?php echo pg_field_name($sql1,$i);?>"><?php echo pg_field_name($sql1,$i);?></option>
<?php
}
?>
</select><br />
<?php
}
db_disconnect($dbh);
?>
<br />
Year (of the data to enter. Ex: 2013): <input type="text" name="year"><br /><br />
<input type="submit" value="Upload this file" /> </form>
<?php
include("footer.php");
?>
</div>
</body>
</html>