Current File : /home/inlingua/public_html/icentex/admin_fd/refund_action.php
<?php
session_start();
// Include the database connection details
require('../dbConnection.php');

// Include common functions
require('../commonFunc.php');

// Include common functions
require('../globalVars.php');

// Include the table handler class
require('../dbHandler.class.php');

// Setup table name, configuration and data entry form
$tableName = "ingl_invoice_main";
$tableConf = $tableName . ".conf.php";
$dataForm = $tableName . ".form.php";
$viewForm = $tableName . ".view.php";


$dbObject = new dbHandler();
$dbObject->setTableName($tableName);
$dbObject->setDbFieldList($dbFieldList);
$dbObject->setKeyFieldName("recNo");
$dbObject->connect();

// Retrieve parameters from request
//$dbObject->getDbFieldsFromRequest();
$action = $_REQUEST['aC'];
if ($action == "Refund")
{
        $dbObject->setDbField("refunded_by","".$_SESSION['id']."");
	$dbObject->setDbField("refunded_date",date("Y-m-d"));
        $dbObject->setDbField("status_delete",2);
        $dbObject->setDbField("refunded_amount",$_REQUEST['refunded_amount']);
        $dbObject->setDbField("refunded_details",$_REQUEST['refunded_details']);
	
	if ($dbObject->Update("recNo",$_REQUEST["kV"]))
	{
        $succFailMesg = "<b>Entry modified successfully</b><br>";
	
		$_SESSION['dispMesg'] = array(date("U"), $succFailMesg);
		//$goUrl = "ingl_invoice_main.main.php?aC=sV&kV=".$_REQUEST['kV']."";
		//header('Location: '.$goUrl);
		?>
		<script language='javascript'>
		parent.$.fn.colorbox.close();
		</script>
		<?php
	
        }
        else
	{	$succFailMesg = "<font color='#da0000'><b>Could not modify entry. Contact system administrator</b></font>&nbsp;&nbsp;&nbsp;&nbsp;[<a href='javascript:history.back()'>Back</a>]<br>" ; 
	}
}

?>