delete_projects( $_POST[ 'project_cb' ] ); } // We'll check for add or edit if( isset( $_POST[ 'submit_project' ] ) ) { // We've got a submission, let's figure out what to do $errors = $this->validate_project( $_POST ); if( empty( $errors ) ) { // The $_POST array is already escaped, so that's why they aren't escaped here if( isset( $_POST[ 'project_id' ] ) ) { // We're editing an existing project $result = $this->edit_project( $_POST[ 'project_id' ], $_POST[ 'project_title' ], $_POST[ 'client_id' ], $_POST[ 'project_description' ] ); if( $result === FALSE ) { ?>
There was an error updating the project. Your changes may not have been saved. Please try again.
Your project "" has been updated.
There was an error adding the project. Your changes may not have been saved. Please try again.
Your project "" has been added.