-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbselectProj.php
More file actions
56 lines (41 loc) · 1.19 KB
/
dbselectProj.php
File metadata and controls
56 lines (41 loc) · 1.19 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
<?php
//require_once('auth.php');
require_once('config.php');
$message=$_POST['project_id'];
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
}
$sql="SELECT * FROM assign WHERE projectID = '".$message."'";
$result = mysql_query($sql);
$sql="SELECT * FROM members";
$result = mysql_query($sql);
?>
<input type="hidden" id="actual_project_id" name="actual_project_id" value="<?php echo $message; ?>" />
<?php
echo "<table>
<tr>
<th>Nome</th>
<th>Aggiunto</th>
</tr>";
while($row = mysql_fetch_array($result))
{
$sql2="SELECT * FROM assign WHERE membersID = '".$row['member_id']."'AND projectID='".$message."'";
$result2 = mysql_query($sql2);
$row2 = mysql_fetch_array($result2);
echo "<tr>\n";
echo "<td>" . $row['login'] . "</td>";
echo "<td><input id=\"usr_".$row['member_id']."\" type=\"checkbox\" name=\"user_id\" value=\"".$row['member_id'] ."\" ";
if ($row2==TRUE) {echo "checked=\"checked\" "; }
echo "/> </td>\n";
echo "</tr>\n";
}
echo "</table>";
mysql_close($link);
?>