prepare_items();
include 'submissions-list.php';
break;
case 'delete':
$ID = @$_REQUEST['ID'];
if ( is_array( $ID ) && 1 == count( $ID ) ) {
$ID = reset( $ID );
}
if ( is_array( $ID ) ) {
foreach ( $ID as $_ID ) {
FQP\DB::delete_submission( $_ID );
}
$_SESSION['FQP_SUBMISSIONS']['messages'][] = 'Submissions have been deleted';
} else {
if ( FQP\DB::delete_submission( $ID ) ) {
$_SESSION['FQP_SUBMISSIONS']['messages'][] = 'Submission has been deleted';
}
}
wp_redirect( get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=' . rawurlencode( $_REQUEST['page'] ) );
break;
case 'view':
$ID = @$_REQUEST['ID'];
if ( ! $ID ) {
wp_die( 'Something went wrong! ID is empty.' );
}
$view = new \FQP\SubmissionView( $ID );
$submission = $view->get();
if ( ! $submission ) {
wp_die( 'Something went wrong! Submission is not found.' );
}
include 'submissions-view.php';
break;
default:
wp_die( 'Something went wrong! Action is not found.' );
break;
} ?>