-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathform_file.php
98 lines (89 loc) · 3.51 KB
/
form_file.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
<?PHP
/**
* GUI Template: convert file template.
*
* @category GUI
*
* @author Andrey Hristov <andrey@php.net>, Ulf Wendel <ulf.wendel@phpdoc.de>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
*
* @version CVS: $Id:$, Release: @package_version@
*
* @link http://www.mysql.com
* @since Available since Release 1.0
*/
?>
<div class="maintextbox">
Convert a file
</div>
<div class="maintextbox">
You can choose if the result of the conversion gets displayed on the
screen or if you want to modify the source file. By default a
backup of the source file will be created before
it gets modified.
</div>
<?PHP
if (!empty($snippet_errors)) {
?>
<div class="maintextbox">
<h2>Errors</h2>
<ul>
<?PHP
foreach ($snippet_errors as $field => $msg) {
printf('<li class="error">%s</li>', htmlspecialchars($msg));
} ?>
</ul>
</div>
<?php
}
?>
<div class="maintextbox">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" name="file" id="file" method="post">
<script language="JavaScript">
function activate_backup() {
if (document.file.update[0].checked == true)
document.file.backup.checked = false;
if (document.file.update[1].checked == true)
document.file.backup.checked = true;
}
function validate_form() {
if (document.file.file.value == "") {
document.file.file.focus();
alert("Please specify a file!");
return false;
}
return true;
}
</script>
<fieldset>
<legend>Convert a file</legend>
<br />
<table align="right">
<tr>
<td class="<?php echo isset($snippet_errors['file']) ? 'formlabelerror' : 'formlabel'; ?>">File</td>
<td class="formelement"><input type="text" name="file" size="60" value="<?php echo (isset($_POST['file'])) ? $_POST['file'] : ''; ?>" /></td>
</tr>
<tr>
<td class="<?php echo (isset($snippet_errors['update'])) ? 'formlabelerror' : 'formlabel'; ?>">Update file?</td>
<td class="formelement">
<input type="radio" name="update" id="update" value="no" onClick="activate_backup()" <?php echo (isset($_POST['update']) && $_POST['update'] != 'no') ? '' : 'checked'; ?>> No<br />
<input type="radio" name="update" id="update" value="yes" onClick="activate_backup()" <?php echo (isset($_POST['update']) && $_POST['update'] == 'yes') ? 'checked' : ''; ?>> Yes
</td>
<tr>
<tr>
<td class="<?php echo (isset($snippet_errors['backup'])) ? 'formlabelerror' : 'formlabel'; ?>">Backup file?</td>
<td class="formelement">
<input type="checkbox" name="backup" id="backup" <?php echo (isset($_POST['backup'])) ? 'checked' : ''; ?>> Yes, backup the original file to <name.org>
</td>
<tr>
<tr>
<td colspan="2" class="formsubmit">
<input type="submit" name="start" value="Start the conversion >" onclick="return validate_form()">
<input type="submit" name="cancel" value="Cancel">
</td>
</tr>
</table>
</fieldset>
</form>
</div>