?>
"><?php 
        _e('Copy', 'formbuilder');
        ?>
</a>
						 |
						<a href="<?php 
        echo formbuilder_build_url(array('fbaction' => 'exportForm', 'fbid' => $form->id), array('page', 'fbtag', 'pageNumber'));
        ?>
"><?php 
        _e('Export', 'formbuilder');
        ?>
</a>
						 |
						<a href="<?php 
        echo formbuilder_build_url(array('fbaction' => 'removeForm', 'fbid' => $form->id), array('page', 'fbtag', 'pageNumber'));
        ?>
" onclick="return(confirm('<?php 
        _e('Are you sure you want to delete this form?', 'formbuilder');
        ?>
'));"><?php 
        _e('Remove', 'formbuilder');
        ?>
</a>
					</td>
				</tr>
			<?php 
    }
    ?>
			
			<tr valign="top">
function formbuilder_options_removeForm($form_id)
{
    global $wpdb, $formbuilder_admin_nav_options;
    if (!formbuilder_user_can('create')) {
        formbuilder_admin_alert('You do not have permission to access this area.');
        return;
    }
    _e("Deleting form.  Please wait...", 'formbuilder');
    flush();
    $sql = "DELETE FROM " . FORMBUILDER_TABLE_FORMS . " WHERE id = '{$form_id}';";
    $wpdb->query($sql);
    $sql = "SELECT * FROM " . FORMBUILDER_TABLE_FIELDS . " WHERE form_id = '{$form_id}';";
    $related = $wpdb->get_results($sql, ARRAY_A);
    if ($related) {
        foreach ($related as $field) {
            $sql = "DELETE FROM " . FORMBUILDER_TABLE_FIELDS . " WHERE id = '" . $field['id'] . "';";
            $wpdb->query($sql);
        }
    }
    $sql = "SELECT * FROM " . FORMBUILDER_TABLE_TAGS . " WHERE form_id = '{$form_id}';";
    $related = $wpdb->get_results($sql, ARRAY_A);
    if ($related) {
        foreach ($related as $field) {
            $sql = "DELETE FROM " . FORMBUILDER_TABLE_TAGS . " WHERE id = '" . $field['id'] . "';";
            $wpdb->query($sql);
        }
    }
    $homeURL = formbuilder_build_url(array('fbaction' => 'forms', 'fbmsg' => __('The form has been deleted.', 'formbuilder')), array('page', 'pageNumber', 'fbtag'));
    echo "<meta HTTP-EQUIV='REFRESH' content='0; url=" . $homeURL . "'>";
}