-
-
Save c3media/9240d9ff5f5c4eb0ea897aec2454b838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function delete_budget($data) | |
{ | |
date_default_timezone_set('America/Bogota'); | |
//$data["params"]["date"] = date("Y-m-d H:i:s"); | |
$client_id = $data["params"]["tickets_id"]; | |
$budget_id = $data["params"]["id"]; | |
global $g; | |
/* Code to show errors | |
ob_start(); | |
print_r($data); | |
$str = ob_get_clean(); | |
phpgrid_error($str); | |
*/ | |
$restic = $g->execute_query("select id, tickets_id, total from ticket_budget WHERE id = '$budget_id'"); | |
#phpgrid_error($h->con->errormsg()); | |
$arrtic = $restic->GetRows(); | |
#phpgrid_error($arr); | |
$tickets_id = $arrtic[0]["tickets_id"]; | |
$total_delete = $arrtic[0]["total"]; | |
$restica = $g->execute_query("select id, ticket_budget_total from tickets WHERE id = '$client_id'"); | |
#phpgrid_error($h->con->errormsg()); | |
$arrtica = $restica->GetRows(); | |
#phpgrid_error($arr); | |
$ticket_budget_total = $arrtica[0]["ticket_budget_total"]; | |
$total_budget = $ticket_budget_total - $total_delete; | |
$g->execute_query("UPDATE tickets SET ticket_budget_total = '$total_budget' WHERE id = '$client_id'"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment