include("path.php"); include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); global $apidb_root; //FIXME: need to check for admin privs if(!loggedin() || (!havepriv("admin") && !$current->ownsApp($appId)) ) { errorpage("Insufficient Privileges!"); exit; } apidb_header("Edit Application Family"); $t = new TableVE("edit"); if($cmd) { $statusMessage = ''; //process add URL if($cmd == "add_url") { $query = "INSERT INTO appData VALUES (null, $appId, 0, 'url', ". "'$url_desc', '$url')"; if(debugging()) { echo "
query: $query
"; } if (mysql_query($query)) { //success $statusMessage = "The URL was successfully added into the database
\n"; } else { //error $statusMessage = "Database Error!
".mysql_error()."
$statusMessage
\n"; echo html_frame_end(); echo html_back_link(1,"editAppFamily.php?appId=$appId"); } } else if($HTTP_POST_VARS) { // commit changes of form to database $t->update($HTTP_POST_VARS); } else { // show form $table = "appFamily"; $query = "SELECT * FROM $table WHERE appId = $appId"; if(debugging()) { echo "query: $query
"; } $t->edit($query); //url entry box echo '',"\n"; echo html_back_link(1,$apidb_root."appview.php?appId=$appId"); } apidb_footer(); ?>