_total_debt.php 338 Bytes
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$id = $user->getId();
$q = Doctrine_Query::create()
    ->select('d.debt_sum')
    ->from('Debt d')
    ->where('d.user_id=?', $id)
    ->execute();
//print_r($user);
$total_sum = 0;
foreach ($q as $row)
{
  $total_sum += $row['debt_sum'];
  /*print_r($row['debt_sum']);*/
}
echo $total_sum;
//echo $q->getDiscountValue() . ' %';
?>