예제 #1
0
					      			<th>Нийт үрэлт</th>
					      			<th>Бэлэн байгаа</th>
					      			<th>Өр зээл</th>
					      		</tr>
						      	<?php 
$finance = new db_cn\Table("finance");
$party = new db_cn\Table("party");
$income = new db_cn\Table("income");
$outcome = new db_cn\Table("outcome");
$list = new db_cn\Table("financial_list");
$companies = new db_cn\Table("companies");
$result = $list->select("financeid,partyid,outcomeid,incomeid");
foreach ($result as $res) {
    $finance_res = $finance->selectFirst("debt,remaining", "id = " . $res['financeid']);
    $party_res = $party->selectFirst("title", "id = " . $res['partyid']);
    $outcome_res = $outcome->selectFirst("total", "id = " . $res['outcomeid']);
    $income_res = $income->selectFirst("total", "id = " . $res['incomeid']);
    echo "<tr>";
    echo "<td>" . $party_res['title'] . "</td>";
    echo "<td>\$" . $income_res['total'] . "</td>";
    echo "<td>\$" . $outcome_res['total'] . "</td>";
    echo "<td>\$" . $finance_res['remaining'] . "</td>";
    echo "<td>\$" . $finance_res['debt'] . "</td>";
    echo "</tr>";
}
?>
					      	</table>
					    </div>
				  	</div>
				  	<div class="panel panel-default">
				  		<div class="panel-heading" role="tab" id="headingThree" data-toggle="collapse" data-target="#collapseThree" data-parent="#accordion" aria-expanded="true" aria-controls="collapseThree">
예제 #2
0
        ?>
#eco">Бэлэн байгаа</a></th>
                                                <th><a href="economics.php?year=<?php 
        echo $year;
        ?>
#eco">Өр зээл</a></th>
                                            </tr>
                                            <?php 
        $res = $finance->select("id");
        $f_party_id = 0;
        for ($i = 0; $i < sizeof($res); $i++) {
            $inner_result = $party_finance_list->select("financeid,partyid,outcomeid,incomeid", "financeid = " . $res[$i]['id']);
            for ($in = 0; $in < sizeof($inner_result); $in++) {
                $finance_res = $finance->selectFirst("year,month,day,debt,remaining", "id = " . $inner_result[$in]['financeid']);
                $party_res = $party->selectFirst("id, title, acronym", "id = " . $inner_result[$in]['partyid']);
                $outcome_res = $outcome->selectFirst("id, total", "id = " . $inner_result[$in]['outcomeid']);
                $income_res = $income->selectFirst("id, total", "id = " . $inner_result[$in]['incomeid']);
                $total_income = $income_res['total'];
                $total_outcome = $outcome_res['total'];
                $total_rem = $finance_res['remaining'];
                $total_debt = $finance_res['debt'];
                $fi_id = $inner_result[$in]['financeid'];
                if ($fi_id == 18) {
                    $total_income = 14471847.1;
                    $total_outcome = 14252447;
                    $total_rem = 219400.1;
                    $total_debt = 9960;
                } else {
                    if ($fi_id == 20) {
                        $total_income = 1293467.4;
                        $total_outcome = 1289953.8;