* add category to app submission page. code cleanup and formatting fixes
This commit is contained in:
committed by
Jeremy Newman
parent
56aa6d18b5
commit
da68923dad
@@ -1,7 +1,6 @@
|
||||
<?
|
||||
|
||||
/* code to View and approve new Apps */
|
||||
/* last modified 06-07-01 by Jeremy Newman */
|
||||
|
||||
include("path.php");
|
||||
require(BASE."include/"."incl.php");
|
||||
@@ -47,16 +46,18 @@ if ($sub)
|
||||
|
||||
//help
|
||||
echo "<div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
|
||||
echo "<p>This is the full view of the application waiting to be approved. You need to pick a category before submitting \n";
|
||||
echo "it into the database. If you approve this application, an email will be sent to the author of the submission.<p>\n";
|
||||
echo "<p>This is the full view of the application waiting to be approved. \n";
|
||||
echo "You need to pick a category before submitting \n";
|
||||
echo "it into the database. If you approve this application,\n";
|
||||
echo "an email will be sent to the author of the submission.<p>\n";
|
||||
echo "<p>There are two kinds of applications in this database:</p>\n";
|
||||
echo "<ol>\n";
|
||||
echo " <li><b>App Family</b> This is a parent group application, that will have multiple versions under it.<br>\n";
|
||||
echo " To add this submission as a Family, choose 'Application' from the type drop down. Then set the category.\n";
|
||||
echo " The version and app parent fields will be ignored in this type.<br>\n";
|
||||
echo " If the vendor does not exist, leave the vendor drop down unset, and the field will be used.</li><p>\n";
|
||||
echo " <li><b>App Version</b> This type of application will be nested under the selected application parent. The category,\n";
|
||||
echo " name, and vendor fields will be ignored.</li>\n";
|
||||
echo " <li><b>App Version</b> This type of application will be nested under the selected application parent.\n";
|
||||
echo " The category, name, and vendor fields will be ignored.</li>\n";
|
||||
echo "</td></tr></table></div>\n\n";
|
||||
|
||||
//view application details
|
||||
@@ -69,50 +70,75 @@ if ($sub)
|
||||
echo '</td></tr>',"\n";
|
||||
|
||||
//category
|
||||
|
||||
$query = "select * from appCategory where catId = '$ob->queueCatId';";
|
||||
$result = mysql_query($query);
|
||||
if($result)
|
||||
{
|
||||
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>Category</b></td><td>',"\n";
|
||||
$x->make_option_list("cat",stripslashes($ob2->catId),"appCategory","catId","catName");
|
||||
echo '</td></tr>',"\n";
|
||||
} else
|
||||
{
|
||||
echo '<tr valign=top><td class=color0><b>Category</b></td><td>',"\n";
|
||||
$x->make_option_list("cat","","appCategory","catId","catName");
|
||||
echo '</td></tr>',"\n";
|
||||
|
||||
}
|
||||
//app parent
|
||||
echo '<tr valign=top><td class=color0><b>App Parent</b></td><td>',"\n";
|
||||
$x->make_option_list("appParent","","appFamily","appId","appName");
|
||||
echo '</td></tr>',"\n";
|
||||
|
||||
//name
|
||||
echo '<tr valign=top><td class=color0><b>App Name</b></td><td><input type=text name="queueName" value="'.stripslashes($ob->queueName).'" size=20></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Name</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueName" value="'.stripslashes($ob->queueName).'" size=20></td></tr>',"\n";
|
||||
|
||||
//version
|
||||
echo '<tr valign=top><td class=color0><b>App Version</b></td><td><input type=text name="queueVersion" value="'.stripslashes($ob->queueVersion).'" size=20></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Version</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueVersion" value="'.stripslashes($ob->queueVersion).'" size=20></td></tr>',"\n";
|
||||
|
||||
//vendor/alt vendor fields
|
||||
// try for an exact match
|
||||
// Use the first match if we found one and clear out the vendor field,
|
||||
// otherwise don't pick a vendor
|
||||
$query = "select * from vendor where vendorname = '$ob->queueVendor';";
|
||||
$result = mysql_query($query);
|
||||
if(!$result)
|
||||
$checkvendor = 0;
|
||||
if($result)
|
||||
{
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
$checkvendor = $ob2->vendorId;
|
||||
}
|
||||
if(!$checkvendor)
|
||||
{
|
||||
// try for a partial match
|
||||
$query = "select * from vendor where vendorname like '%$ob->queueVendor%';";
|
||||
$result = mysql_query($query);
|
||||
}
|
||||
|
||||
// Use the first match if we found one and clear out the vendor field,
|
||||
// otherwise don't pick a vendor
|
||||
if($result)
|
||||
{
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
$checkvendor = $ob2->vendorId;
|
||||
}
|
||||
}
|
||||
if(checkvendor)
|
||||
{
|
||||
$ob->queueVendor = '';
|
||||
|
||||
//vendor field
|
||||
echo '<tr valign=top><td class=color0><b>App Vendor</b></td><td><input type=text name="queueVendor" value="'.stripslashes($ob->queueVendor).'" size=20></td></tr>',"\n";
|
||||
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
echo '<tr valign=top><td class=color0><b>App Vendor</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueVendor" value="'.stripslashes($ob->queueVendor).'" size=20></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0> </td><td>',"\n";
|
||||
$x->make_option_list("altvendor","$ob2->vendorId","vendor","vendorId","vendorName");
|
||||
$x->make_option_list("altvendor", $checkvendor ,"vendor","vendorId","vendorName");
|
||||
echo '</td></tr>',"\n";
|
||||
} else
|
||||
{
|
||||
//vendor field
|
||||
echo '<tr valign=top><td class=color0><b>App Vendor</b></td><td><input type=text name="queueVendor" value="'.stripslashes($ob->queueVendor).'" size=20></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Vendor</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueVendor" value="'.stripslashes($ob->queueVendor).'" size=20></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0> </td><td>',"\n";
|
||||
$x->make_option_list("altvendor","","vendor","vendorId","vendorName");
|
||||
@@ -121,15 +147,20 @@ if ($sub)
|
||||
|
||||
|
||||
//url
|
||||
echo '<tr valign=top><td class=color0><b>App URL</b></td><td><input type=text name="queueURL" value="'.stripslashes($ob->queueURL).'" size=20></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueURL" value="'.stripslashes($ob->queueURL).'" size=20></td></tr>',"\n";
|
||||
|
||||
//desc
|
||||
echo '<tr valign=top><td class=color0><b>App Desc</b></td><td><textarea name="queueDesc" rows=10 cols=35>'.stripslashes($ob->queueDesc).'</textarea></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
||||
echo '<td><textarea name="queueDesc" rows=10 cols=35>'.stripslashes($ob->queueDesc).'</textarea></td></tr>',"\n";
|
||||
|
||||
//echo '<tr valign=top><td bgcolor=class=color0><b>Email</b></td><td><input type=text name="queueEmail" value="'.$ob->queueEmail.'" size=20></td></tr>',"\n";
|
||||
//echo '<tr valign=top><td bgcolor=class=color0><b>Image</b></td><td><input type=file name="queueImage" value="'.$ob->.'" size=15></td></tr>',"\n";
|
||||
//echo '<tr valign=top><td bgcolor=class=color0><b>Email</b></td>,"\n";
|
||||
//echo '<td><input type=text name="queueEmail" value="'.$ob->queueEmail.'" size=20></td></tr>',"\n";
|
||||
//echo '<tr valign=top><td bgcolor=class=color0><b>Image</b></td>,"\n";
|
||||
//echo '<td><input type=file name="queueImage" value="'.$ob->.'" size=15></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color3 align=center colspan=2> <input type=submit value=" Submit App Into Database " class=button> </td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
|
||||
echo '<input type=submit value=" Submit App Into Database " class=button> </td></tr>',"\n";
|
||||
echo '</table>',"\n";
|
||||
echo '<input type=hidden name="sub" value="add">',"\n";
|
||||
echo '<input type=hidden name="queueId" value="'.$queueId.'">',"\n";
|
||||
@@ -278,7 +309,7 @@ else
|
||||
{
|
||||
//get available apps
|
||||
$query = "SELECT queueId, queueName, queueVendor,".
|
||||
"queueEmail,".
|
||||
"queueVersion, queueEmail,".
|
||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||
"from appQueue;";
|
||||
$result = mysql_query($query);
|
||||
|
||||
@@ -91,7 +91,9 @@ if ($_REQUEST['queueName'])
|
||||
addslashes($_REQUEST['queueEmail'])."', '".
|
||||
addslashes($_REQUEST['queueURL'])."', '".
|
||||
addslashes($_REQUEST['queueImage'])."',".
|
||||
"NOW());";
|
||||
"NOW()".",".
|
||||
addslashes($_REQUEST['queueCatId']).");";
|
||||
|
||||
mysql_query($query);
|
||||
|
||||
if ($error = mysql_error())
|
||||
@@ -136,8 +138,17 @@ else
|
||||
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Name</b></td><td><input type=text name="queueName" value="" size=20></td></tr>',"\n";
|
||||
echo '<tr valign=top><td class=color0><b>App Version</b></td><td><input type=text name="queueVersion" value="" size=20></td></tr>',"\n";
|
||||
|
||||
// app Category
|
||||
$w = new TableVE("view");
|
||||
echo '<tr valign=top><td class=color0><b>Category</b></td><td>',"\n";
|
||||
$w->make_option_list("queueCatId","","appCategory","catId","catName");
|
||||
echo '</td></tr>',"\n";
|
||||
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App Vendor</b></td><td><input type=text name="queueVendor" value="" size=20></td></tr>',"\n";
|
||||
|
||||
|
||||
//alt vendor
|
||||
$x = new TableVE("view");
|
||||
echo '<tr valign=top><td class=color0> </td><td>',"\n";
|
||||
|
||||
@@ -73,6 +73,7 @@ create table appQueue (
|
||||
queueURL varchar(100),
|
||||
queueImage varchar(100) not null,
|
||||
submitTime timestamp,
|
||||
queueCatId int,
|
||||
key(queueId)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user