',"\n"; echo '',"\n"; echo '',"\n"; If ($ob->queueCatId == -1) //app version { //help echo "
\n\n"; echo "

This is the full view of the application waiting to be approved. \n"; echo "If you approve this application,\n"; echo "an email will be sent to the author of the submission.

\n"; echo " App Version This type of application will be nested under the selected application parent.\n"; echo "

Click delete 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\n"; echo "
\n\n"; echo '',"\n"; echo html_frame_start("New Application Form",400,"",0); echo "\n"; //app parent echo '',"\n"; //version echo '',"\n"; echo '',"\n"; } else { //help echo "
App Parent',"\n"; $x->make_option_list("appParent",stripslashes($ob->queueName),"appFamily","appId","appName"); echo '
App Version
\n\n"; echo "

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.

\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.\n"; echo " The category, name, and vendor fields will be ignored.
  4. \n"; echo "

    Click delete 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\n"; echo "
\n\n"; //view application details echo html_frame_start("New Application Form",400,"",0); echo "\n"; //type echo '',"\n"; //category $query = "select * from appCategory where catId = '$ob->queueCatId';"; $result = query_appdb($query); if($result) { $ob2 = mysql_fetch_object($result); echo '',"\n"; } else { echo '',"\n"; } //app parent echo '',"\n"; //name echo '',"\n"; echo '',"\n"; //version echo '',"\n"; echo '',"\n"; echo '',"\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 = query_appdb($query); $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 = query_appdb($query); if($result) { $ob2 = mysql_fetch_object($result); $checkvendor = $ob2->vendorId; } } if($checkvendor) { $ob->queueVendor = ''; //vendor field echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; } else { //vendor field echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; } } //url echo '',"\n"; echo '',"\n"; //desc echo '',"\n"; echo '',"\n"; //email message text if ($ob->queueEmail) { echo '',"\n"; echo '',"\n"; } echo '',"\n"; echo '
Type',"\n"; echo '',"\n"; echo '
Category',"\n"; $x->make_option_list("cat",stripslashes($ob2->catId),"appCategory","catId","catName"); 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", $checkvendor ,"vendor","vendorId","vendorName"); echo '
App Vendor
 ',"\n"; $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); echo '
App URL
App Desc
email Text
' ,"\n"; echo ' ',"\n"; echo '
',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminAppQueue.php'); } else if ($_REQUEST['sub'] == 'add' && $_REQUEST['queueId']) { //add item to main db $statusMessage = ""; $goodtogo = 0; if ($_REQUEST['type'] == 'app') { //process as application family if ($_REQUEST['altvendor'] == 0 && $_REQUEST['queueVendor']) { //add new vendor $aInsert = compile_insert_string( array('vendorName' => $_REQUEST['queueVendor'], 'vendorURL' => $_REQUEST['queueURL'])); query_appdb("INSERT INTO `vendor` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"); $_REQUEST['altvendor'] = mysql_insert_id(); } $aInsert = compile_insert_string( array('AppName' => $_REQUEST['queueName'], 'vendorId' => $_REQUEST['altvendor'], 'description' => $_REQUEST['queueDesc'], 'webPage' => $_REQUEST['queueURL'], 'keywords' => "", 'catId' => $_REQUEST['cat'])); if (query_appdb("INSERT INTO `appFamily` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})")) { //get the id of the app just added $_REQUEST['appParent'] = mysql_insert_id(); //delete queue item query_appdb("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";"); //set ver if not set if (!$_REQUEST['queueVersion']) $_REQUEST['queueVersion'] = '1.0'; if (!$_REQUEST['queueDesc']) $_REQUEST['queueDesc'] = 'released version'; //Now add a version $aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'], 'versionName' => $_REQUEST['queueVersion'], 'description' => $_REQUEST['queueDesc'], 'webPage' => $_REQUEST['queueURL'], 'keywords' => "", 'maintainer_rating' => "", 'maintainer_release' => "")); if (query_appdb("INSERT INTO `appVersion` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})")) { //successful $_REQUEST['appVersion'] = mysql_insert_id(); addmsg("The application ".$_REQUEST['queueName']." was successfully added into the database", "green"); $goodtogo = 1; } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; $statusMessage .= "

Note: The application family was successfully added.

\n"; addmsg($statusMessage, "red"); } } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; addmsg($statusMessage, "red"); } } else if ($_REQUEST['type'] == 'ver') { //process as application version if ($_REQUEST['appParent']) { $aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'], 'versionName' => $_REQUEST['queueVersion'], 'description' => $_REQUEST['queueDesc'], 'webPage' => $_REQUEST['queueURL'], 'keywords' => "", 'maintainer_rating' => "", 'maintainer_release' => "")); if (query_appdb("INSERT INTO `appVersion` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})")) { //successful $_REQUEST['appVersion'] = mysql_insert_id(); $statusMessage = "

The application ".$_REQUEST['queueName']." was successfully added into the database

\n"; addmsg($statusMessage,"Green"); query_appdb("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";"); $goodtogo = 1; } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; addmsg($statusMessage,"red"); } } else { addmsg("You did not pick an application Parent!",red); redirect(apidb_fullurl("admin/adminAppQueue.php?cat=view&queueId=".$_REQUEST['queueId'])); exit; } } //Send Status Email if ($ob->queueEmail && $goodtogo) { $fullAppName = lookupAppName($_REQUEST['appParent'])." Version: ".lookupVersionName($_REQUEST['appParent'], $_REQUEST['appVersion']); $ms = "Application Database Status Report\n"; $ms .= "----------------------------------\n\n"; $ms .= "Your application: ".$fullAppName." has been entered "; $ms .= "into the application database.\n\n"; $ms .= APPDB_ROOT."appview.php?appId=".$_REQUEST['appParent']."&versionId=".$_REQUEST['appVersion']."\n\n"; $ms .= "Thanks!\n\n"; $ms .= $emailtext; mail(stripslashes($ob->queueEmail),'[AppDB] Status Report',$ms); } if ($goodtogo) { $email = getNotifyEmailAddressList($_REQUEST['appParent'], $_REQUEST['appVersion']); if($email) { $fullAppName = "Application: ".lookupAppName($_REQUEST['appParent']). " Version: ".lookupVersionName($_REQUEST['appParent'], $_REQUEST['appVersion']); $ms = APPDB_ROOT."appview.php?appId=".$_REQUEST['appParent']."&versionId=".$_REQUEST['appVersion']."\n\n"; $ms .= "New Application added to database:\n\n"; $ms .= $fullAppName."\n\n"; $ms .= STANDARD_NOTIFY_FOOTER; mail(stripslashes($email), "[AppDB] NEW ".$fullAppName ,$ms); } else { $email = "no one"; } addmsg("mesage sent to: ".$email, "green"); } //done addmsg("View App", "green"); redirect(apidb_fullurl("admin/adminAppQueue.php")); exit; } else if ($_REQUEST['sub'] == 'Delete' && $_REQUEST['queueId']) { //delete main item $query = "DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";"; $result = query_appdb($query, "unable to delete selected application!"); if(!$result) { redirect(apidb_fullurl("admin/adminAppQueue.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId'])); } else { //Send Status Email if ($ob->queueEmail) { if($ob->queueCatId == -1) //app version { $fullAppName = lookupAppName($_REQUEST['appParent'])." Version: ".$ob->queueVersion; } else { $fullAppName = $ob->queueName." Version: ".$ob->queueVersion; } $ms = "Application Database Status Report\n"; $ms .= "----------------------------------\n\n"; $ms .= "Your application: ".$fullAppName." has not been entered "; $ms .= "into the application database.\n\n"; $ms .= "Sorry!\n\n"; $ms .= $emailtext; mail(stripslashes($ob->queueEmail),'[AppDB] Status Report',$ms); } //success addmsg("Application was successfully deleted from the Queue.", "green"); redirect(apidb_fullurl("admin/adminAppQueue.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId'])); } } else { //error no sub! addmsg("Internal Routine Not Found!!", "red"); redirect(apidb_fullurl("admin/adminAppQueue.php")); } exit; } else { apidb_header("Admin App Queue"); echo '
',"\n"; //get available apps $query = "SELECT queueId, queueName, queueVendor,". "queueVersion, queueEmail, queueCatId,". "UNIX_TIMESTAMP(submitTime) as submitTime ". "from appQueue;"; $result = query_appdb($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, delete or approve it into \n"; echo "the AppDB .
\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"; echo "\n\n"; $c = 1; while($ob = mysql_fetch_object($result)) { if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo " \n"; if ($ob->queueCatId == -1) { $query2 = "select * from appFamily where appId = '$ob->queueName';"; $result2 = query_appdb($query2); if($result2) { $ob2 = mysql_fetch_object($result2); echo " \n"; } else { echo " \n"; } } else { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c++; } echo "
Submission DateApplication NameVersionVendorSubmitter Email 
".date("Y-n-t h:i:sa", $ob->submitTime)."  $ob2->appNameApp not found$ob->queueName".stripslashes($ob->queueVersion)."  ".stripslashes($ob->queueVendor)."  ".stripslashes($ob->queueEmail)."  
\n\n"; echo html_frame_end(" "); } echo "
"; apidb_footer(); } ?>