objectManager: Fix lower-case letter in 'email Text'
[NewAppDB.git] / admin / editBundle.php
blobb0523e62dba925587a3dc750c190545bc0da7fa1
1 <?php
3 require("path.php");
4 require(BASE."include/"."incl.php");
6 if(!$_SESSION['current']->hasPriv("admin"))
7 util_show_error_page_and_exit();
9 function build_app_list()
11 $hResult = query_parameters("SELECT appId, appName FROM appFamily ORDER BY appName");
13 echo "<select name=iAppId size=5 onChange='this.form.submit()'>\n";
14 while($oRow = query_fetch_object($hResult))
16 echo "<option value=$oRow->appId>$oRow->appName</option>\n";
18 echo "</select>\n";
21 if($aClean['sCmd'])
23 if($aClean['sCmd'] == "delete")
25 $hResult = query_parameters("DELETE FROM appBundle WHERE appId ='?' AND bundleId = '?'",
26 $aClean['iAppId'], $aClean['iBundleId']);
27 if($hResult)
28 addmsg("App deleted from bundle", "green");
29 else
30 addmsg("Failed to delete app from bundle!", "red");
32 if($aClean['sCmd'] == "add")
34 $hResult = query_parameters("INSERT INTO appBundle (bundleId, appId) VALUES".
35 "('?', '?')",
36 $aClean['iBundleId'],
37 $aClean['iAppId']);
38 if($hResult)
39 addmsg("App $appId added to Bundle".$aClean['iBundleId'], "green");
44 apidb_header("Edit Application Bundle");
46 $hResult = query_parameters("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
47 "WHERE bundleId = '?' AND appFamily.appId = appBundle.appId",
48 $aClean['iBundleId']);
50 echo html_frame_start("Apps in this Bundle","300",'',0);
51 echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
53 echo "<tr class=color4>\n";
54 echo " <td><font color=white> Application Name </font></td>\n";
55 echo " <td><font color=white> Delete </font></td>\n";
56 echo "</tr>\n\n";
58 if($hResult && query_num_rows($hResult))
60 $c = 1;
61 while($oRow = query_fetch_object($hResult))
63 //set row color
64 if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
66 $delete_link = "[<a href='editBundle.php?sCmd=delete&amp;iBundleId=".$aClean['iBundleId']."&amp;iAppId=$oRow->appId'>delete</a>]";
68 echo "<tr class=$bgcolor>\n";
69 echo " <td>$oRow->appName &nbsp;</td>\n";
70 echo " <td>$delete_link &nbsp;</td>\n";
71 echo "</tr>\n\n";
73 $c++;
75 } else if($hResult && !query_num_rows($hResult))
77 /* indicate to the user that there are no apps in this bundle at the moment */
78 echo "<tr>\n";
79 echo " <td colspan=2 align=center><b>No applications in this bundle</b></td>\n";
80 echo "</tr>\n";
83 echo "</table>\n\n";
84 echo html_frame_end();
86 echo "<form method=post action=editBundle.php>\n";
88 echo html_frame_start("Application List (double click to add)","",'',2);
89 build_app_list();
90 echo html_frame_end();
92 echo "<input type=\"hidden\" name=\"iBundleId\" value=\"".$aClean['iBundleId']."\">\n";
93 echo "<input type=\"hidden\" name=\"sCmd\" value=\"add\">\n";
94 echo "</form>\n";
96 apidb_footer();