Menu

[r50]: / html / editcolumn.php  Maximize  Restore  History

Download this file

134 lines (133 with data), 4.0 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
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
<?php
session_start();
$user_ID=$_SESSION[user_ID];
if (!$user_ID || $user_ID=='0')
{
header('location: index.php');
die('Login failed');
}
require("util.php");
$sql = new MySQL_class;
$sql->Create("generator");
$esql = new MySQL_class;
$esql->Create("generator");
if ($_GET[sheet]) { $_SESSION[var_sheet] = $_GET[sheet]; }
if ($_GET[ColumnID]) { $_SESSION[var_ColumnID] = $_GET[ColumnID]; }
$sheet=$_SESSION[var_sheet];
$ColumnID=$_SESSION[var_ColumnID];
?>
<?php
$sql->QueryItem("SELECT column.name as F468, column.size as F469, column.type as F470, column.sql as F471, column.calculation as F472, column.order as F581 FROM `column` WHERE column.column='$ColumnID' AND column.sheet='$sheet'");
$Name = htmlspecialchars($sql->data['F468']);
$Size = htmlspecialchars($sql->data['F469']);
$Type = htmlspecialchars($sql->data['F470']);
$intern = htmlspecialchars($sql->data['F471']);
$Calculation = htmlspecialchars($sql->data['F472']);
$Sort = htmlspecialchars($sql->data['F581']);
if ($_POST['ColumnID']!='') {
$Name = htmlspecialchars($_POST['Name']);
$Size = htmlspecialchars($_POST['Size']);
$Type = htmlspecialchars($_POST['Type']);
$intern = htmlspecialchars($_POST['intern']);
$Calculation = htmlspecialchars($_POST['Calculation']);
$Sort = htmlspecialchars($_POST['Sort']);
}
?>
<html>
<head>
<link href="list.css" type="text/css" rel=stylesheet>
<meta content="text/css" http-equiv="Content-Style-Type">
<title>Edit Column</title>
<script>
function confirmDelete(delUrl) {
if (confirm("Remove Column?")) {
document.location = delUrl;
}
}
</script>
</head>
<body class="top" onload="document.Edit.<?php
if ($_POST[FOCUS]==470) {echo 'intern';}
else {echo 'Name';}
?>.focus();">
<form name="Edit" action="posteditcolumn.php" method="post">
<input type=hidden name="FOCUS" value="">
<?php echo("<input type=hidden name=\"ColumnID\" size=5 value=\"$ColumnID\">\n");?>
<table class=enter>
<tr id=title><th colspan=2>Edit Column</th></tr>
<tr><th>Name</th>
<td>
<?php echo("<input type=text name=\"Name\" size=0 value=\"$Name\">");?>
</td></tr>
<tr><th>Size</th>
<td>
<?php echo("<input type=text name=\"Size\" size=5 value=\"$Size\">");?>
</td></tr>
<tr><th>Type</th>
<td>
<?php
echo ("<select name=\"Type\" OnChange=\"Edit.action=''; Edit.FOCUS.value='470'; Edit.submit();\">");
if ($Type=='date') {
echo "<option value=\"date\" selected>date</option>\n";
} else {
echo "<option value=\"date\">date</option>\n";
}
if ($Type=='datemin') {
echo "<option value=\"datemin\" selected>datemin</option>\n";
} else {
echo "<option value=\"datemin\">datemin</option>\n";
}
if ($Type=='datemax') {
echo "<option value=\"datemax\" selected>datemax</option>\n";
} else {
echo "<option value=\"datemax\">datemax</option>\n";
}
if ($Type=='number') {
echo "<option value=\"number\" selected>number</option>\n";
} else {
echo "<option value=\"number\">number</option>\n";
}
if ($Type=='select') {
echo "<option value=\"select\" selected>select</option>\n";
} else {
echo "<option value=\"select\">select</option>\n";
}
if ($Type=='char') {
echo "<option value=\"char\" selected>char</option>\n";
} else {
echo "<option value=\"char\">char</option>\n";
}
if ($Type=='text') {
echo "<option value=\"text\" selected>text</option>\n";
} else {
echo "<option value=\"text\">text</option>\n";
}
echo "</select>";
?>
</td></tr>
<tr><th>SQL Table</th>
<td>
<?php echo("<input type=text name=\"intern\" size=0 value=\"$intern\">");?>
</td></tr>
<tr><th>Calculation</th>
<td>
<?php echo("<textarea name=\"Calculation\" rows=5 cols=40>$Calculation</textarea>");?>
</td></tr>
<tr><th>Sort</th>
<td>
<?php echo("<input type=text name=\"Sort\" size=5 value=\"$Sort\">");?>
</td></tr>
</table>
<p id=buttons>
<input type=submit value=Change>
<?php
$test=true;
if ($test) {
echo "<input type=button value=Delete onClick=\"confirmDelete('postdeletecolumn.php?ColumnID=$ColumnID&ColumnID=$ColumnID&sheet=$sheet')\">\n";
}
?>
<input type=button value="Cancel" onClick="window.close()">
</p>
</form>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.