-
Notifications
You must be signed in to change notification settings - Fork 0
/
software.php
executable file
·96 lines (81 loc) · 2.62 KB
/
software.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
<?php
require_once('config.php');
require_once('func.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-Type" content="text/html; charset=utf-8" />
<title>LIC - Devices</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.red {
color: #F00;
}
-->
</style>
</head>
<body>
<? include("menu.php");?>
<form action="software_action.php" method="post" name="software" id="software">
<table border="0" align="center" cellpadding="2">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Software name</td>
<td><input name="name" type="text" id="name" value="" size="32" /></td>
</tr>
<tr valign="top">
<td align="right" valign="baseline" nowrap="nowrap">Software type</td>
<td valign="baseline">
<select name="type" id="type">
<option value="0">-- software type --</option>
<?
$sql = "SELECT * FROM license_type";
$result = mysql_query($sql, $db) or die(mysql_error());
$row = mysql_fetch_assoc($result);
do {
?>
<option value="<?php echo $row['license_type_id']?>" ><?php echo $row['name'];?></option>
<?php
} while ($row = mysql_fetch_assoc($result));
?>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Save" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="software" />
</form>
<br />
<?php
//Atlasām konkrētas licences instalācijas, piesaistes pa datoriem
$sql = "SELECT s.name as sname, l.name, s.software_id from software s
left join license_type l on l.license_type_id=s.license_type
order by sname asc";
$result = mysql_query($sql, $db) or die(mysql_error());
$count = mysql_num_rows($result);
if ($count>0) {
?>
<br />
<br />
<table border="1">
<?
$th=0;
while ($row=mysql_fetch_assoc($result)) {
if ($th==0) foreach($row as $key => $val ) { echo "<td> <strong>$key</strong> </td> "; }
$th=1;
echo "<tr>" ;
foreach($row as $key => $val)
if($key<>'software_id')
{ echo "<td> $val </td>"; }
else
echo "<td bgcolor='#FFFFFF'><a href='action.php?edit_software&software_id=".$row['software_id']."'>Edit </a> <a href='action.php?delete_software&software_id=".$row['software_id']."' onclick='javascript:return confirm(\"dzēst?\")'>Dzēst</a></td>";
echo "</tr>"; }
?>
</table>
<?php } ?>
<br />
</body>
</html>