-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinputFiles03.php
131 lines (121 loc) · 6.17 KB
/
inputFiles03.php
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php include("parts_checkSession.php"); ?>
<?php $p_pageNum=4; $p_page="input03"; include("parts_checkTabsStatus.php"); ?>
<!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">
<head>
<meta http-equiv="Content-Language" content="en-US" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/frame.css" />
<script type="text/javascript" src="js/function.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function addFileInput(idStr) {
$("#Files_"+idStr).append("<input id='FilePath_" + idStr + "' name='FilePath_" + idStr + "[]' type='file' size='60' onchange=\"changeToUploadById2('" + idStr + "');\" /><br/>");
}
</script>
<title>Input Files 03 WTH</title>
</head>
<body>
<div id="container">
<?php include("parts_header.php"); ?>
<?php include("errMsg.php"); ?>
<div id="content">
<?php include("parts_title.php"); ?>
<?php include("parts_inputTabs.php"); ?>
<form id="form1" method="post" action="checkInputWFiles.php" enctype="multipart/form-data">
<?php include("parts_explain.php"); ?>
<?php
if (isset($_SESSION["errFlg"])) {
$errMsg = getSessErrMsg($_SESSION["errFlg"]);
echo "<div id='errMsg'>" . $errMsg . "</div>";
}
?>
<table id="inputArea" align="center">
<tr id="titleRow">
<td style="width: 90px">Weather ID</td>
<td style="width: 160px">Availability</td>
<td style="width: 400px">Additional Info</td>
<td style="width: 50px">Update</td>
</tr>
<?php
$content_status = $_POST["content_status"];
$content_id = $_POST["content_id"];
$content_start = $_POST["content_start"];
$content_end = $_POST["content_end"];
$ids = "";
for ($i = 0; $i < count($content_id); $i++) {
$ids = $ids . $content_id[$i] . ",";
$sYear = subStr($content_start[$i], 0, -3);
if ($sYear == "") $sYear = "00";
else if (strlen($sYear) == 1) $sYear = "0".$sYear;
$sDay = subStr($content_start[$i], -3);
$eYear = subStr($content_end[$i], 0, -3);
if ($eYear == "") $eYear = "00";
else if (strlen($eYear) == 1) $eYear = "0".$eYear;
$eDay = subStr($content_end[$i], -3);
if ($content_status[$i] == "1") {
$dbStatus = "Fully Available In DB";
$checked = " onclick=\"changeActiveStatusW('" . $content_id[$i] . "');\"";
$disabled = " disabled='disabled' ";
if (isset($_POST["upload_file"]) && $_POST["upload_file"][$i] != "") {
$checked .= " checked = 'checked' ";
$disabled = "";
}
} else if ($content_status[$i] == "-1") {
$dbStatus = "Unavailable In DB";
$checked = " disabled='disabled' checked = 'checked' ";
$disabled = "";
} else {
$dbStatus = "Partly Available In DB";
$checked = " disabled='disabled' checked = 'checked' ";
$disabled = "";
}
echo " <tr id='inputRow'>\r\n";
echo " <td rowspan='2'>" . $content_id[$i] . "</td>\r\n";
echo " <td>" . $dbStatus . "</td>\r\n";
echo " <td>Duration required From <input id='FromY' name='sYear[]' type='text' maxlength='2' size='2' value='" . $sYear . "' disabled='disabled'/>-<input id='FromD' name='sDay[]' type='text' maxlength='3' size='3' value='" . $sDay . "' disabled='disabled' /> To <input id='ToY' name='eYear[]' type='text' maxlength='2' size='2' value='" . $eYear . "' disabled='disabled' />-<input id='ToD' name='eDay[]' type='text' maxlength='3' size='3' value='" . $eDay . "' disabled='disabled' /></td>\r\n";
echo " <td class='center'>\r\n";
echo " <input id='check_" . $content_id[$i] . "' name='checkbox[]' type='checkbox' value='1'" . $checked . " />\r\n";
echo " <input id='FileId_" . $content_id[$i] . "' type='hidden' name='FileId[]' value='" . $content_id[$i] . "'" . $disabled . "/>\r\n";
echo " </td>\r\n";
echo " </tr>\r\n";
echo " <tr id='inputRow'><td colspan='3' id='Files_" . $content_id[$i] . "'>\r\n";
if (isset($_POST["upload_file"])) {
$fileNames = json_decode($_POST["upload_file"][$i], true);
echo "Read From <strong>";
for($j=0; $j<count($fileNames); $j++) echo $fileNames[$j] . ", ";
echo "</strong> OR<br/>\r\n";
//echo "Read From <strong>" . $fileNames . "</strong> OR<br/>\r\n";
}
echo "<input id='FilePath_" . $content_id[$i] . "' name='FilePath_" . $content_id[$i] . "[]' type='file' size='60' onchange=\"changeToUploadById('" . $content_id[$i] . "');\"" . $disabled . "/>\r\n";
echo "<input id='FileAdd_" . $content_id[$i] . "' value='Add More' type='button' onclick=\"addFileInput('" . $content_id[$i] . "');\"" . $disabled . " /><br/></td></tr>\r\n";
echo "<input type='hidden' name='wid[]' value='" . $content_id[$i] . "' />\r\n";
$AllInDBFlg = true;
if ((isset($_POST["upload_file"]) && $_POST["upload_file"][$i] != "") || $content_status[$i] == "1") {
echo "<input type='hidden' id='upload_file_" . $content_id[$i] . "' name='upload_file_id[]' value='1' />\r\n";
} else {
$AllInDBFlg = false;
echo "<input type='hidden' id='upload_file_" . $content_id[$i] . "' name='upload_file_id[]' value='0' />\r\n";
}
}
// If temporary or formal table contain this id
if ($AllInDBFlg) {
echo "<input type='hidden' id='upload_file' name='upload_file' value='1' />\r\n";
} else {
echo "<input type='hidden' id='upload_file' name='upload_file' value='0' />\r\n";
}
$ids = substr($ids, 0, -1);
?>
<input type="hidden" id="submitType" name="submitType" value="next" />
</table>
<div id="subBtns">
<input type="button" value="Back" onclick="goBack();" />
<input id="Submit" type="button" value="Next" onclick="checkExdForWthfile('next', '<?php echo $ids; ?>')" />
<input id="Submit" type="button" value="Finish" onclick="checkExdForWthfile('finish', '<?php echo $ids; ?>')" />
</div>
</form>
</div>
<?php include("parts_footer.php"); ?>
</div>
</body>
</html>