<?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['txtcode'];

$prodesc = $_POST['txtdesc'];

$protype = $_POST['txttype'];

$prolev = $_POST['txtqtylevel'];

$proact = $_POST['txtactive'];

$incdays = $_POST['txtdays'];

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

$osDB->query( 'INSERT INTO ! (  promocode, pdesc, promotype, memberlevel, active, increasedays) VALUES ( ?, ?, ?, ?, ?,? )', array( PROMO_TABLE, $procode, $prodesc, $protype, $prolev, $proact, $incdays) );

header( 'location: managepromo.php' );

exit;

?>