Edit Your PHPGTK Application");
//
// if the form was submitted add it to the databas
//
if( $action == "modify" ) {
$res = mysql_query("SELECT * FROM app WHERE id = $app_id");
if( $res ) {
$app = mysql_fetch_object($res);
if( $app->submitter == $submitter ) {
if( !empty($_FILES[screenshot][name]) && ereg("^image/", $_FILES[screenshot][type]) ) {
$has_screenshot = 'Y';
}else {
$has_screenshot = 'N';
}
$res = mysql_query("
INSERT INTO app
(id, modify_id, status, cat_id, date_added, name, has_screenshot, homepage_url, submitter, blurb)
VALUES
(0, $app->id, 'M', $cat_id, NOW(), '$name', '$has_screenshot', '$homepage_url', '$submitter', '$blurb')
");
if( $res == true ) {
if( $has_screenshot == 'Y' ) {
$app_id = mysql_insert_id();
handleAppImage($_FILES[screenshot][tmp_name], $app_id);
}
print("Thank you for the update. Someone will review it shortly.");
}else {
print("There was a problem with your update. Please try it again.");
print("
");
print("Error: (" . mysql_errno() . ") " . mysql_error() );
}
}else {
print("
Sorry, the email address you entered does not match the address on file for this application.
"); } }else { print("Unable to find app #$app_id for editing.
"); } }else if( $action == "edit" ) { $res = mysql_query("SELECT * FROM app WHERE id = $app_id"); if( $res ) { $form_app = mysql_fetch_object($res); $form_app->submitter = ""; $form_url = "edit.php"; $form_action = "modify"; $form_submit = "Edit"; print("Please enter your email again for security purposes."); include_once("form.php"); appFooter(); commonFooter(); exit; }else { print("Unable to find app #$app_id for editing.
"); } }else if( $action == "list" ) { $email = ereg_replace("'", "", $email); $res = mysql_query("SELECT * FROM app WHERE status = 'A' AND submitter = '$email' ORDER BY name"); $num_rows = mysql_num_rows($res); if( $res && $num_rows > 0 ) { print("