db_host=$_SESSION['host']; $obj_parentchild->db_user=$_SESSION['user']; $obj_parentchild->db_pass=$_SESSION['psw']; $obj_parentchild->db_database=$_SESSION['db']; if(!$obj_parentchild->db_connect()) { echo "

Sorry! Could not connect to the database server.

"; exit(); } $obj_parentchild->db_table="mk_realisasi_anggaran"; $obj_parentchild->item_identifier_field_name="Id"; $obj_parentchild->parent_identifier_field_name="parentId"; $obj_parentchild->item_list_field_name="name"; $obj_parentchild->extra_condition=""; //if required $obj_parentchild->order_by_phrase=" ORDER BY `Id` "; $obj_parentchild->level_identifier=""; $obj_parentchild->item_pointer=""; if (!empty($_POST['tahun'])) $tahun=$_POST['tahun']; else $tahun=date('Y'); $tahunNext=$tahun-1; $total=0; $total_next=0; $root_item_id='-99'; $all_childs=$obj_parentchild->getAllChilds($root_item_id); ?>
Tahun
getAllFields(); foreach($all_childs as $item) { $nilai=0; $nilai_next=0; if ($item['slave'] == '1' ) { $strSQL="SELECT a.id, b.tahun , b.nilai, c.tahun as thn_next, c.nilai as nilai_next FROM mk_realisasi_anggaran a LEFT JOIN tk_realisasi_anggaran b ON a.id=b.id AND b.tahun IN('$tahun') LEFT JOIN tk_realisasi_anggaran c ON a.id=c.id AND c.tahun IN('$tahunNext') WHERE a.id='$item[Id]' "; $resQuery = $db->query($strSQL); foreach($resQuery, MYSQL_ASSOC->fetchAll() as $row) { $nilai=$row["nilai"]; $total=$total+$nilai; $nilai_next=$row["nilai_next"]; $total_next=$total_next+$nilai_next; } } ?> ">
Nama Akun Tahun
">" style="display:none;" />
db_disconnect(); ?>