<?php
if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( '../init.php' );
}

include ( 'sessioninc.php' );

define( 'PAGE_ID', 'promo_mgt' );

if ( !checkAdminPermission( PAGE_ID ) ) {

	header( 'location: not_authorize.php' );
	exit;
}

$procode = $_POST['promocode'];

$prodesc = $_POST['pdesc'];

$protype = $_POST['promotype'];

$prolev = $_POST['memberlevel'];

$proact = $_POST['active'];

$increasedays = $_POST['increasedays'];

if ($increasedays == '') $increasedays=0;

$osDB->query( 'UPDATE ! set promocode=?, pdesc=?, promotype=?, memberlevel=?, increasedays=?, active=? where id=?', array( PROMO_TABLE, $procode, $prodesc, $protype, $prolev, $increasedays, $proact, $_POST['id']) );

header( 'location: managepromo.php' );

exit;

?>