<?php
/**
 * 
 * @file ad_edit.php
 * @copyright (c) 2005 - 2007 eifr.com
 * @license http://www.gnu.org/copyleft/gpl.html gnu/gpl
 * eifr is free software
 */

require_once('../../includes/inc_admin.php');
require_once('class_ad.php');

$url = 'mod_ad/ad_edit.php';
Common::checkAdminFileAuth($url); //check file authority
$clComAd = new ComAd();

if (!isset($act)) $act = '';
switch ($act) {
    case 'save':
        $selectid = '';
        if (isset($_POST['selectValue'])) $selectid = $_POST['selectValue'];
        if ($selectid == '') {
            $clComAd -> addRecords();
        } else {
            $clComAd -> editRecords();
        } 
        break;

    case 'add':
    case 'edit':
    default :
        $clComAd -> layout_ad_edit();
        break;
} 

?>