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 " |
| Submission Date | \n"; echo "Submitter | \n"; echo "Application | \n"; echo "Version | \n"; echo "Type | \n"; echo "Action | \n"; echo "|
| ".date("Y-n-t h:i:sa", $ob->submitTime)." | \n"; if($ob->userId) { $oUser = new User($ob->userId); echo "".$oUser->sRealname." (".$oUser->sEmail.") | \n"; } else echo "Anonymous | \n"; echo "".lookup_app_name($ob->appId)." | \n"; echo "".lookup_version_name($ob->versionId)." | \n"; echo "".$ob->type." | \n"; echo "[process] | \n"; echo "
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(); ?>