',"\n"; if ($sub) { if ($queueId) { //get data $query = "SELECT * from appQueue where queueId = $queueId;"; $result = mysql_query($query); $ob = mysql_fetch_object($result); mysql_free_result($result); } else { //error no Id! echo html_frame_start("Error","300"); echo '

Application Not Found!

',"\n"; echo html_frame_end(" "); } //process according to sub flag if ($sub == 'view' && $queueId) { $x = new TableVE("view"); //help echo "
\n\n"; echo "

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.

\n"; echo "

There are two kinds of applications in this database:

\n"; echo "
    \n"; echo "
  1. App Family This is a parent group application, that will have multiple versions under it.
    \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.
    \n"; echo " If the vendor does not exist, leave the vendor drop down unset, and the field will be used.
  2. \n"; echo "

  3. App Version This type of application will be nested under the selected application parent. The category,\n"; echo " name, and vendor fields will be ignored.
  4. \n"; echo "
\n\n"; //view application details echo html_frame_start("New Application Form",400,"",0); echo "\n"; //type echo '',"\n"; //category echo '',"\n"; //app parent echo '',"\n"; //name echo '',"\n"; //version echo '',"\n"; //vendor/alt vendor fields // try for an exact match $query = "select * from vendor where vendorname = '$ob->queueVendor';"; $result = mysql_query($query); if(!$result) { // 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) { $ob->queueVendor = ''; //vendor field echo '',"\n"; $ob2 = mysql_fetch_object($result); echo '',"\n"; } else { //vendor field echo '',"\n"; echo '',"\n"; } //url echo '',"\n"; //desc echo '',"\n"; //echo '',"\n"; //echo '',"\n"; echo '',"\n"; echo '
Type',"\n"; echo '',"\n"; echo '
Category',"\n"; $x->make_option_list("cat","","appCategory","catId","catName"); echo '
App Parent',"\n"; $x->make_option_list("appParent","","appFamily","appId","appName"); echo '
App Name
App Version
App Vendor
 ',"\n"; $x->make_option_list("altvendor","$ob2->vendorId","vendor","vendorId","vendorName"); echo '
App Vendor
 ',"\n"; $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); echo '
App URL
App Desc
Email
Image
',"\n"; echo '',"\n"; echo '',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminAppQueue.php'); } else if ($sub == 'add' && $queueId) { //add item to main db $statusMessage = ""; $goodtogo = 0; if ($type == 'app') { //process as application family if ($altvendor == 0 && $queueVendor) { //add new vendor mysql_query("INSERT into vendor VALUES (null, '".addslashes($queueVendor)."', '');"); $altvendor = mysql_insert_id(); } $query = "INSERT into appFamily VALUES (null, '". addslashes($queueName)."', $altvendor, '', '". addslashes($queueDesc)."', '". addslashes($queueURL)."', $cat);"; if (mysql_query($query)) { //get the id of the app just added $appParent = mysql_insert_id(); //delete queue item mysql_query("DELETE from appQueue where queueId = $queueId;"); //set ver if not set if (!$queueVersion) $queueVersion = '1.0'; if (!$queueDesc) $queueDesc = 'released version'; $verQuery = "INSERT into appVersion VALUES (null, $appParent, '". addslashes($queueVersion)."', '', '". addslashes($queueDesc)."', '". addslashes($queueURL)."', 0.0, 0.0);"; //Now add a version if (mysql_query($verQuery)) { //successful $statusMessage = "

The application $queueName was successfully added into the database

\n"; $goodtogo = 1; } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; $statusMessage .= "

Note: The application family was successfully added.

\n"; } } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; } } else if ($type == 'ver') { //process as application version if ($appParent) { $query = "INSERT into appVersion VALUES (null, $appParent, '". addslashes($queueVersion)."', '', '". addslashes($queueDesc)."', '". addslashes($queueURL)."', 0.0, 0.0);"; if (mysql_query($query)) { //successful $statusMessage = "

The application $queueName was successfully added into the database

\n"; mysql_query("DELETE from appQueue where queueId = $queueId;"); $goodtogo = 1; } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; } } else { $statusMessage = "

Error
You did not pick an application Parent!

\n"; } } //Send Status Email if ($ob->queueEmail && $goodtogo) { $ms = "Application Database Status Report\n"; $ms .= "----------------------------------\n\n"; $ms .= "Your application ".stripslashes($ob->queueName)." has been entered "; $ms .= "into the application database.\n\n"; $ms .= "Thanks!\n"; mail(stripslashes($ob->queueEmail),'[AppDB] Status Report',$ms); } //done echo html_frame_start("Submit Application","300"); echo "

$statusMessage

\n"; echo html_frame_end(" "); echo html_back_link(1,'adminAppQueue.php'); } else if ($sub == 'delete' && $queueId) { //delete main item $query = "DELETE from appQueue where queueId = $queueId;"; $result = mysql_query($query); echo html_frame_start("Delete Application: $ob->queueName",400,"",0); if(!$result) { //error echo "

Internal Error: unable to delete selected application!

\n"; } else { //success echo "

Application was successfully deleted from the Queue.

\n"; } echo html_frame_end(" "); echo html_back_link(1,'adminAppQueue.php'); } else { //error no sub! echo html_frame_start("Error","300"); echo '

Internal Routine Not Found!

',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminAppQueue.php'); } } else { //get available apps $query = "SELECT * from appQueue;"; $result = mysql_query($query); if(!$result || !mysql_num_rows($result)) { //no apps in queue echo html_frame_start("","90%"); echo '

The Application Queue is empty.

',"\n"; echo '

There is nothing for you to do. Check back later.

',"\n"; echo html_frame_end(" "); } else { //help echo "
\n\n"; echo "

This is the list of applications waiting for your approval, or to be annihilated from existence.

\n"; echo "

To view a submission, click on its name. From that page you can edit, and approve it into the AppDB.
\n"; echo "Click the delete link to remove the selected item from the queue. An email will automatically be sent to the\n"; echo "submitter to let them know the item was deleted.

\n"; echo "
\n\n"; //show applist echo html_frame_start("","90%","",0); echo "\n\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c = 1; while($ob = mysql_fetch_object($result)) { if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c++; } echo "
Application NameVersionVendorSubmitter Email 
$ob->queueName".stripslashes($ob->queueVersion)."  ".stripslashes($ob->queueVendor)."  ".stripslashes($ob->queueEmail)."  [delete]
\n\n"; echo html_frame_end(" "); } } echo ""; apidb_footer(); ?>