/var/www/(Del)pathways.org.hk/MIS20140127/old20140414/student/ajax_subsidy_get.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
include_once '../include/DBConnect.php';
$percent 0;
if (isset(
$_POST['subsidy'])) {
    
$subsidy_id $_POST['subsidy'];
    for (
$i 0$i count($subsidy_id); $i++) {
        
$query "Select percent from subsidy where Subsidy_ID='$subsidy_id[$i]'";
        
$result $dbh->query($query);
        
$result->setFetchMode(PDO::FETCH_OBJ);
        
$percent+=($result->fetch()->percent);
    }
}
echo 
$percent."%";
?>