hasPriv("admin")) { errorpage("Insufficient privileges."); exit; } // shows the list of appdata in queue if (!$_REQUEST['id']) { apidb_header("Admin Application Data Queue"); // get available appData $sQuery = "SELECT appData.*, appVersion.appId AS appId FROM appData, appVersion WHERE appVersion.versionId = appData.versionID AND appData.queued = 'true';"; $hResult = query_appdb($sQuery); if(!$hResult || !mysql_num_rows($hResult)) { // no appData in queue echo html_frame_start("","90%"); echo '

The App Data 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 a list of application data submitted by users.\n"; echo "Please inspect carefully this data before accepting it.\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($hResult)) { if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo "\n"; $oUser = new User($ob->submitterId); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; $c++; } echo "
Submission DateSubmitterApplicationVersionTypeAction
".print_date(mysqltimestamp_to_unixtimestamp($ob->submitTime)).""; echo $oUser->sEmail ? "sEmail."\">":""; echo $oUser->sRealname; echo $oUser->sEmail ? "":""; echo "".lookup_app_name($ob->appId)."".lookup_version_name($ob->versionId)."".$ob->type."[process]
\n\n"; echo html_frame_end(" "); } } else // shows a particular appdata { $sQuery = "SELECT appData.*, appVersion.appId AS appId FROM appData,appVersion WHERE appVersion.versionId = appData.versionId AND id='".$_REQUEST['id']."'"; $hResult = query_appdb($sQuery); $obj_row = mysql_fetch_object($hResult); if(!$_REQUEST['sub']=="inside_form") { apidb_header("Admin Application Data Queue"); echo '
',"\n"; // help echo "
\n\n"; echo "Please enter an accurate and personalized reply anytime a submitted scrrenshot is rejected.\n"; echo "It is not polite to reject someones attempt at trying to help out without explaining why.\n"; echo "
\n\n"; // view application details echo html_frame_start("New Application Data Form",600,"",0); echo "\n"; // app name echo '',"\n"; echo "\n"; // version echo '',"\n"; echo "\n"; //dataDescription echo '',"\n"; echo '',"\n"; //data if($obj_row->type == "image") { $oScreenshot = new Screenshot($obj_row->id); echo '',"\n"; echo '',"\n"; } elseif($obj_row->type == "url") { echo '',"\n"; echo '',"\n"; } //email response echo '',"\n"; echo "\n"; /* Add button */ echo '',"\n"; /* Reject button */ echo '',"\n"; echo '
App Name".lookup_app_name($obj_row->appId)."
App Version".lookup_version_name($obj_row->versionId)."
Description
Submited image'; $imgSRC = ''; // generate random tag for popup window $randName = generate_passwd(5); // set image link based on user pref $img = ''.$imgSRC.''; if ($_SESSION['current']->isLoggedIn()) { if ($_SESSION['current']->getpref("window:screenshot") == "no") { $img = ''.$imgSRC.''; } } echo $img; echo '
Submitted link
Email reply
' ,"\n"; echo '
' ,"\n"; echo '
',"\n"; echo '',"\n"; echo '',"\n"; echo '
'; } elseif ($_REQUEST['add']) // we accepted the request { $statusMessage = ""; $goodtogo = 0; if($obj_row->type == "image") { $oScreenshot = new Screenshot($obj_row->id); $oScreenshot->unQueue(); } elseif ($obj_row->type == "url") { // FIXME: use Link class $query = "INSERT INTO appData VALUES (null, ".$obj_row->versionId.", 'url', ". "'".addslashes($_REQUEST['description'])."', '".$obj_row->url."')"; if (query_appdb($sQuery)) { $statusMessage = "

The application data was successfully added into the database

\n"; //delete the item from the queue query_appdb("DELETE from appData where id = ".$obj_row->id.";"); //Send Status Email $oUser = new User($obj_row->userId); if ($oUser->sEmail) { $sSubject = "Application Data Request Report"; $sMsg = "Your submission of an application data for ".lookup_app_name($obj_row->appId).lookup_version_name($obj_row->versionId)." has been accepted. "; $sMsg .= $_REQUEST['replyText']; $sMsg .= "We appreciate your help in making the Application Database better for all users.\r\n"; mail_appdb($oUser->sEmail, $sSubject ,$sMsg); } } } redirect(apidb_fullurl("admin/adminAppDataQueue.php")); } elseif ($_REQUEST['reject']) { if($obj_row->type == "image") { $oScreenshot = new Screenshot($obj_row->id); $oScreenshot->delete(); } elseif ($obj_row->type == "url") { // FIXME: use Link class $oUser = new User($obj_row->userId); if ($oUser->sEmail) { $sSubject = "Application Data Request Report"; $sMsg = "Your submission of an application data for ".lookup_app_name($obj_row->appId).lookup_version_name($obj_row->versionId)." was rejected. "; $sMsg .= $_REQUEST['replyText']; mail_appdb($oUser->sEmail, $sSubject ,$sMsg); } //delete main item $sQuery = "DELETE from appData where id = ".$obj_row->id.";"; $hResult = query_appdb($sQuery); if($hResult) { //success echo "

Application data was successfully deleted from the Queue.

\n"; } } redirect(apidb_fullurl("admin/adminAppDataQueue.php")); } } echo html_frame_end(" "); echo html_back_link(1,'adminAppDataQueue.php'); apidb_footer(); ?>