Menu

[2eb2a2]: / add_module_to_project.php  Maximize  Restore  History

Download this file

65 lines (54 with data), 2.1 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
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>deltasql - Add module to project</title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
</head>
<body>
<?php
include("head.inc.php");
include("conf/config.inc.php");
include("utils/utils.inc.php");
$rights = $_SESSION["rights"];
if ($rights<2) die("<b>Not enough rights to add a module to the project.</b>");
if (!isset($_GET['id'])) $projectid=''; else $projectid = $_GET['id'];
if (!isset($_GET['name'])) $projectname=''; else $projectname = $_GET['name'];
?>
<h2>Insert a New Database Module to the Project <?php echo "$projectname";?></h2>
<form action="add_module_to_project.php" method="post">
<?php
echo "<select NAME=\"frmmoduleid\">";
mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
$query="SELECT * FROM tbmodule where visible=1 order by name asc";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
while ($i<$num) {
$moduleid=mysql_result($result,$i,"id");
$modulename=mysql_result($result,$i,"name");
echo "<option VALUE=\"$moduleid\">$modulename";
$i++;
}
echo "</select>";
echo "<input type=\"hidden\" name=\"frmprojectid\" value=\"$projectid\">";
echo "<input type=\"hidden\" name=\"frmprojectname\" value=\"$projectname\">";
mysql_close();
?>
<input type="Submit" value="Add module">
</form>
<?php include("bottom.inc.php"); ?>
</body>
</html>
<?php
if (isset($_POST['frmmoduleid'])) $frm_moduleid=$_POST['frmmoduleid']; else exit;
$frm_projectid=$_POST['frmprojectid'];
$frm_projectname=$_POST['frmprojectname'];
mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
$query="INSERT INTO tbmoduleproject (id, module_id, project_id) VALUES('',$frm_moduleid, $frm_projectid);";
mysql_query($query);
mysql_close();
js_redirect("list_project_modules.php?id=$frm_projectid&amp;name=$frm_projectname");
?>
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.