2008-11-26 22:50:40 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* AgileBill - Open Billing Software
|
|
|
|
*
|
|
|
|
* This body of work is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the Open AgileBill License
|
|
|
|
* License as published at http://www.agileco.com/agilebill/license1-4.txt
|
2009-08-03 04:10:16 +00:00
|
|
|
*
|
|
|
|
* Originally authored by Tony Landis, AgileBill LLC
|
|
|
|
* Recent modifications by Deon George
|
|
|
|
*
|
|
|
|
* @author Deon George <deonATleenooksDOTnet>
|
|
|
|
* @copyright 2009 Deon George
|
|
|
|
* @link http://osb.leenooks.net
|
2008-11-26 22:50:40 +00:00
|
|
|
*
|
|
|
|
* @link http://www.agileco.com/
|
|
|
|
* @copyright 2004-2008 Agileco, LLC.
|
|
|
|
* @license http://www.agileco.com/agilebill/license1-4.txt
|
2009-08-03 04:10:16 +00:00
|
|
|
* @author Tony Landis <tony@agileco.com>
|
2008-11-26 22:50:40 +00:00
|
|
|
* @package AgileBill
|
|
|
|
*/
|
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
/**
|
|
|
|
* The main AgileBill CORE Database DELETE Method
|
|
|
|
*
|
|
|
|
* @package AgileBill
|
|
|
|
* @subpackage Core:Database
|
|
|
|
* @uses CORE_Trigger
|
|
|
|
*/
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
function CORE_database_delete($VAR,$construct,$type) {
|
|
|
|
global $C_debug,$C_translate;
|
2008-11-26 22:50:40 +00:00
|
|
|
|
|
|
|
$db = &DB();
|
2009-08-03 04:10:16 +00:00
|
|
|
|
|
|
|
# Execute the SQL
|
|
|
|
$result = $db->Execute(sqlDelete($db,$construct->table,array('id'=>$VAR['id'])));
|
2008-11-26 22:50:40 +00:00
|
|
|
|
|
|
|
# Alert
|
2009-08-03 04:10:16 +00:00
|
|
|
$C_debug->value['id'] = $VAR[$construct->table.'_id'];
|
|
|
|
$C_debug->value['module_name'] = $C_translate->translate('menu',$construct->module,'');
|
|
|
|
$C_debug->alert($C_translate->translate('alert_delete_id','',''));
|
2008-11-26 22:50:40 +00:00
|
|
|
|
|
|
|
# error reporting
|
2009-08-03 04:10:16 +00:00
|
|
|
if ($result === false) {
|
2008-11-26 22:50:40 +00:00
|
|
|
global $C_debug;
|
2009-08-03 04:10:16 +00:00
|
|
|
$C_debug->error(__FILE__,__METHOD__,$db->ErrorMsg());
|
|
|
|
}
|
2008-11-26 22:50:40 +00:00
|
|
|
|
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
if (isset($construct->trigger[$type])) {
|
|
|
|
include_once(PATH_CORE.'trigger.inc.php');
|
|
|
|
$trigger = new CORE_trigger;
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
$trigger->trigger($construct->trigger[$type],0,$VAR);
|
2008-11-26 22:50:40 +00:00
|
|
|
}
|
|
|
|
}
|
2009-08-03 04:10:16 +00:00
|
|
|
?>
|