# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: af_save.php,v 1.5 2005/02/19 00:32:29 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if (pathos_permissions_check('manage_af', $loc)) {
    $af = null;
    if (isset($_POST['id'])) {
        $af = $db->selectObject('banner_affiliate', 'id=' . $_POST['id']);
    }
    $af = banner_affiliate::update($_POST, $af);
    if (isset($af->id)) {
        $db->updateObject($af, 'banner_affiliate');
    } else {
        $db->insertObject($af, 'banner_affiliate');
    }
    pathos_flow_redirect();
} else {
    echo SITE_403_HTML;
}
# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: af_edit.php,v 1.5 2005/02/19 00:32:29 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
$af = null;
if (isset($_GET['id'])) {
    $af = $db->selectObject('banner_affiliate', 'id=' . $_GET['id']);
}
if (pathos_permissions_check('manage_af', $loc)) {
    $form = banner_affiliate::form($af);
    $form->meta('module', 'bannermodule');
    $form->meta('action', 'af_save');
    $template = new template('bannermodule', '_form_af_edit', $loc);
    $template->assign('form_html', $form->toHTML());
    $template->assign('is_edit', isset($_GET['id']));
    $template->output();
} else {
    echo SITE_403_HTML;
}