public function loadAccountSubscript ionAction sql SELECT subscription

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
public function loadAccountSubscriptionAction() {
$sql = "SELECT subscriptions.start_date, subscriptions.end_date,
transactions.transaction_id, transactions.amount_paid,
transactions.notes
FROM subscriptions JOIN transactions
ON subscriptions.transaction_id = transactions.transaction_id
WHERE transactions.account_id = ?";
$data = $this->db->query($sql, array((int)$_GET['account_id']));
$subscriptions = $data->fetchAll();
$values = array_map(function($row) {
return array_values($row);
}, $subscriptions);
$this->_helper->json(array("data" => $values));
}