0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: pi_project_report.php
<?php $MAIN_HEADING = "Project Report"; include( "../lib/config.php"); include_once("../model/defaults_mdl.php"); //require_once "../model/Notification_mdl.php"; require_once BASE_DIR."/lib/db/connection.php"; require_once "../model/defaultValues_mdl.php"; require_once "pi_models.php"; if(is_numeric(@$_GET['project_id'])){ $project_details =Pi_Models::getProjectDetails(@$_GET['project_id']); if(!empty($project_details)){ $installement_details =Pi_Models::getProjectInstallment(@$_GET['project_id']); $outlay_details =Pi_Models::getProjectOutlay(@$_GET['project_id']); $budget_head_details =Pi_Models::getProjectBudgetHead(@$_GET['project_id']); // echo "<pre>"; // print_r($project_details); // print_r($budget_head_details); // print_r($installement_details); // print_r($outlay_details); // echo "</pre>"; }else{ // redirectToView($server_ip,"error","No details found"); } } function redirectToView($server_ip,$key,$message){ $url=$server_ip."user/pi_project_list.php?$key=$message"; echo "<script>window.location='$url'</script>"; } include("include/pi_header.php"); ?> <p><span class="msgText"> <?php if (isset($message)) echo $message;?> </span> <style type="text/css"> tr.bold{ font-weight: bold; } </style> <div class="col-md-12 col-sm-12"> <h2 class="center">Project Details</h2> <table class="table table-striped table-bordered jambo_table bulk_action dataTable "> <thead> <tr> <th>Project Code</th> <th>Project Title</th> <th>Fund Type</th> <th>Fund Agency</th> <th>Co-Investigator</th> <th>Project Outlay</th> <th>Start date</th> <th>End Date</th> <th>Duration</th> </tr> <tbody> <tr> <td><?php echo $project_details["project_code"];?></td> <td><?php echo $project_details["project_title"];?></td> <td><?php echo $project_details["fundtype"];?></td> <td><?php echo $project_details["fundagency"];?></td> <td><?php echo $project_details["investigators"];?></td> <td><?php echo $project_details["project_outlay"];?></td> <td><?php echo $project_details["startdate"];?></td> <td><?php echo $project_details["end_date"];?></td> <td><?php echo $project_details["duration"];?></td> </tr> <tbody> </table> <br/> </div> <br/> <h2 class="center">Budget Details</h2> <table class="table table-striped table-bordered jambo_table bulk_action dataTable "> <thead> <tr> <th>Budget Name</th> <th>Amount</th> </tr> <tbody> <?php $tot = 0; if(!empty($budget_head_details)){ foreach ($budget_head_details as $value) { $tot+=$value["amount"]?> <tr> <td><?php echo $value["name"];?></td> <td><?php echo $value["amount"];?></td> </tr> <?php } ?> <tr class="success bold"> <td><?php echo "Total";?></td> <td><?php echo $tot;?></td> </tr> <?php }else{ echo "no details"; } ?> <tbody> </table> <br/> <h2 class="center">Project Outlay</h2> <table class="table table-striped table-bordered jambo_table bulk_action dataTable "> <thead> <tr> <th>Outlay</th> <th>Amount</th> </tr> <tbody> <?php $i=0; $tot= 0; if(!empty($outlay_details)){ foreach ($outlay_details as $value) { $tot+=$value["amount"]?> <tr> <td><?php echo ++$i;?></td> <td><?php echo $value["amount"];?></td> </tr> <?php } ?> <tr class="success bold"> <td><?php echo "Total";?></td> <td><?php echo $tot;?></td> </tr> <?php }else{ echo "no details"; } ?> <tbody> </table> </div> <br/> <h2 class="center">Installment Splitup</h2> <div class="col-md-12 col-sm-12"> <?php if(!empty($installement_details)){ foreach ($installement_details as $installment_id => $inst_array) { ?> <div class="col-md-6 col-sm-6"> <table class="table table-striped table-bordered jambo_table bulk_action dataTable "> <thead> <tr> <th>Budget Head</th> <th><?php echo $inst_array[0]['installment_name'] ?></th> </tr> <tbody> <?php $i=0; $tot= 0; if(!empty($inst_array)){ foreach ($inst_array as $value) { $tot+=$value["amount"]?> <tr> <td><?php echo $value["debit_name"];?></td> <td><?php echo $value["amount"];?></td> </tr> <?php } ?> <tr class="success bold"> <td><?php echo "Total";?></td> <td><?php echo $tot;?></td> </tr> <?php }else{ echo "no details"; } ?> <tbody> </table> </div> <?php } }else{ echo "No installment details"; } ?> </div> <?php include "include/footer.php"; ?>