<?php
/**********************************************************************
***********************************************************************/





function get_approve_est_project_details($project_id)
{
	$sql = "SELECT dep.value_name department_name,
                        p.* 
                        
		FROM  ".TB_PREF."est_projects_master p                           

                        LEFT JOIN ".TB_PREF."list_values dep ON
                            p.department_id = dep.id
           
                    LEFT JOIN ".TB_PREF."debtors_master dm ON
                            p.customer_id = dm.debtor_no

                            
		WHERE p.est_project_id = $project_id"; 
                              
                                  
	$result = db_query($sql,"get_approve_est_project_details");        
	return db_fetch($result);
}


function get_budget_total_cost($project_id)
{
    $sql = "SELECT SUM(budget) new_budgets_total 
            FROM ".TB_PREF."project_tasks
            WHERE project_id=".db_escape($project_id);
    
    $result = db_query($sql);
    $row =  db_fetch($result);
    return $row['new_budgets_total'];
    
}



?>
