-
Notifications
You must be signed in to change notification settings - Fork 0
/
file_edit_folder.php
211 lines (170 loc) · 7.17 KB
/
file_edit_folder.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php require_once('config/tank_config.php'); ?>
<?php require_once('session.php'); ?>
<?php
$restrictGoTo = "user_error3.php";
if ($_SESSION['MM_rank'] < "2") {
header("Location: ". $restrictGoTo);
exit;
}
$project_id = "-1";
if (isset($_GET['projectID'])) {
$project_id = $_GET['projectID'];
}
$p_id = "-1";
if (isset($_GET['pid'])) {
$p_id = $_GET['pid'];
}
$fd = null;
if (isset($_GET['folder'])) {
$fd = $_GET['folder'];
}
$pfiles = "-1";
if (isset($_GET['pfile'])) {
$pfiles = $_GET['pfile'];
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$colname_Recordset1 = "-1";
if (isset($_GET['editID'])) {
$colname_Recordset1 = $_GET['editID'];
}
if ( $pfiles== "1") {
$pf = "&pfile=1";
} else {
$pf = "";
}
$pagetabs = "mcfile";
if (isset($_GET['pagetab'])) {
$pagetabs = $_GET['pagetab'];
}
$ptab = "&pagetab=".$pagetabs;
if ( empty( $_POST['tk_doc_description'] ) ){
$tk_doc_description = "tk_doc_description='',";
}else{
$tk_doc_description = sprintf("tk_doc_description=%s,", GetSQLValueString(str_replace("%","%%",$_POST['tk_doc_description']), "text"));
}
if ( empty( $_POST['csa_remark1'] ) ){
$tk_doc_attachment = "tk_doc_attachment='',";
}else{
$tk_doc_attachment = sprintf("tk_doc_attachment=%s,", GetSQLValueString(str_replace("%","%%",$_POST['csa_remark1']), "text"));
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE tk_document SET tk_doc_title=%s, $tk_doc_description $tk_doc_attachment tk_doc_class2=%s, tk_doc_edit=%s WHERE docid=%s",
GetSQLValueString($_POST['tk_doc_title'], "text"),
GetSQLValueString($_POST['tk_doc_class2'], "text"),
GetSQLValueString($_POST['tk_doc_edit'], "text"),
GetSQLValueString($_POST['docid'], "int"));
mysql_select_db($database_tankdb, $tankdb);
$Result1 = mysql_query($updateSQL, $tankdb) or die(mysql_error());
$newID = $colname_Recordset1;
$newName = $_SESSION['MM_uid'];
$insertSQL2 = sprintf("INSERT INTO tk_log (tk_log_user, tk_log_action, tk_log_type, tk_log_class, tk_log_description) VALUES (%s, %s, %s, 2, '')",
GetSQLValueString($newName, "text"),
GetSQLValueString($multilingual_log_editdoc, "text"),
GetSQLValueString($newID, "text"));
$Result2 = mysql_query($insertSQL2, $tankdb) or die(mysql_error());
$updateGoTo = "log_finish.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
}
header(sprintf("Location: %s", $updateGoTo));
}
mysql_select_db($database_tankdb, $tankdb);
$query_Recordset1 = sprintf("SELECT * FROM tk_document WHERE docid = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $tankdb) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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-Type" content="text/html; charset=utf-8" />
<title>WSS - <?php echo $multilingual_project_file_editfolder; ?></title>
<link href="skin/themes/base/lhgdialog.css" rel="stylesheet" type="text/css" />
<link href="skin/themes/base/lhgcheck.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="srcipt/lhgcore.js"></script>
<script type="text/javascript" src="srcipt/lhgcheck.js"></script>
<script type="text/javascript">
var P = window.parent, D = P.loadinndlg();
function closreload(url)
{
if(!url)
P.reload();
}
function over()
{
P.cancel();
}
</script>
<script type="text/javascript">
J.check.rules = [
{ name: 'tk_doc_title', mid: 'doctitle', type: 'limit', requir: true, min: 1, max: 30, warn: '<?php echo $multilingual_announcement_titlerequired; ?>' }
];
window.onload = function()
{
J.check.regform('form1');
}
</script>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="srcipt/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script charset="utf-8" src="editor/kindeditor.js"></script>
<script charset="utf-8" src="editor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#tk_doc_description', {
width : '100%',
height: '246px',
items:[
'source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', '|', 'fullscreen',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
'flash', 'media', 'insertfile', 'table', 'hr', 'map', 'code', 'pagebreak', 'anchor',
'link', 'unlink', '|', 'about'
]
});
});
</script>
</head>
<body>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<div class="modal-body" style="padding:12px;">
<div class="form-group col-xs-12">
<label for="tk_doc_title"><?php echo $multilingual_project_file_foldertitle; ?><span id="doctitle"></span></label>
<div>
<input type="text" name="tk_doc_title" id="tk_doc_title" value="<?php echo $row_Recordset1['tk_doc_title']; ?>" placeholder="<?php echo $multilingual_project_file_foldertitle; ?>" class="form-control" />
</div>
</div>
<div class="form-group col-xs-12">
<label for="tk_doc_description"><?php echo $multilingual_project_file_description; ?></label>
<div>
<textarea name="tk_doc_description" id="tk_doc_description" ><?php echo $row_Recordset1['tk_doc_description']; ?></textarea>
</div>
</div>
<div class="clearboth"></div>
</div>
<div class="modal-footer" style="margin-top:0px; padding:10px 10px 10px;">
<button type="button" class="btn btn-default btn-sm" id="btn1" onclick="over()"><?php echo $multilingual_global_action_cancel; ?></button>
<button type="submit" class="btn btn-primary btn-sm" data-loading-text="<?php echo $multilingual_global_wait; ?>" id="b02"><?php echo $multilingual_global_action_save; ?></button>
<input type="hidden" name="tk_doc_class2" id="tk_doc_class2" value="<?php echo $row_Recordset1['tk_doc_class2']; ?>" />
<input type="hidden" name="docid" id="docid" value="<?php echo $row_Recordset1['docid']; ?>" />
<input name="tk_doc_edit" type="hidden" value="<?php echo "{$_SESSION['MM_uid']}"; ?>" />
<input type="hidden" name="MM_update" value="form1" />
</div>
<script type="text/javascript">
$('button[data-loading-text]').click(function () {
var btn = $(this).button('loading');
setTimeout(function () {
btn.button('reset');
}, 3000);
});
</script>
</form>
</body>
</html>