echo get_pde_info_by_id($row['pdeid'], 'title');
            ?>
</td>
                                <?php 
        }
        ?>
                                <td><?php 
        echo $row['procurement_ref_no'];
        ?>
</td>
                                <td><?php 
        echo $row['subject_of_procurement'];
        ?>
</td>
                                <td><?php 
        echo get_procurement_method_info_by_id($row['procurement_method'], 'title');
        ?>
</td>

                                <td><?php 
        echo custom_date_format('d.F.Y', $row['dateofconfirmationoffunds']);
        ?>
</td>
                                <td><?php 
        echo custom_date_format('d.F.Y', $row['contract_award_date']);
        ?>
</td>
                                <td><?php 
        echo seconds_to_days(strtotime($row['dateofconfirmationoffunds']) - strtotime($row['contract_award_date']));
        ?>
</td>
Exemplo n.º 2
0
            <tbody>
            <?php 
foreach ($all_entries_paginated as $entry) {
    ?>
                    <tr>
                        <td>-</td>
                        <td><?php 
    echo $entry['subject_of_procurement'];
    ?>
</td>
                        <td><?php 
    echo get_procurement_type_info_by_id($entry['procurement_type'], 'title');
    ?>
</td>
                        <td><?php 
    echo get_procurement_method_info_by_id($entry['procurement_type'], 'title');
    ?>
</td>
                        <td><?php 
    echo get_source_funding_info_by_id($entry['funding_source'], 'title');
    ?>
</td>
                        <td style="text-align: right;"><?php 
    echo number_format($entry['estimated_amount']);
    ?>
   <?php 
    echo get_currency_info_by_id($entry['currency'], 'title');
    ?>
</td>
                    </tr>
            <?php 
Exemplo n.º 3
0
    }
    //contracts completed on time
    if (strtotime($row['commencement_date']) == strtotime($row['actual_completion_date'])) {
        $contracts_completed_on_time[] = $row['id'];
    }
    //contracts completed on late
    if (strtotime($row['commencement_date']) < strtotime($row['actual_completion_date'])) {
        $contracts_completed_late[] = $row['id'];
    }
    $total_bid_receipts[] = count(get_bid_receipts_by_bid($row['id']));
    if (!in_array($row['procurement_method'], $procurement_methods)) {
        $procurement_methods[$row['procurement_method']] = count(get_bid_receipts_by_procurement_method($row['procurement_method'], $from, $to));
    }
    //better totals
    if (!in_array(get_procurement_method_info_by_id($row['procurement_method'], 'title'), $available_procurement_methods)) {
        $available_procurement_methods[] = get_procurement_method_info_by_id($row['procurement_method'], 'title');
    }
}
//$occurence_procurement_types=array_count_values($procurement_types);
$bids_by_procurement_method = array();
foreach ($procurement_methods as $key => $value) {
    $bids_by_procurement_method[] = $value;
}
$total_bids_by_procurement_method = array_sum($bids_by_procurement_method);
//print_array($_POST);
//print_array($available_procurement_methods);
//print_array(json_encode($available_procurement_methods, JSON_NUMERIC_CHECK));
$prepared_methods = "'" . implode("','", $available_procurement_methods) . "'";
?>

Exemplo n.º 4
0
/**
 * Created by PhpStorm.
 * User: GADGETS 0752423205
 * Date: 7/13/2015
 * Time: 2:10 AM
 */
function template_awarded_contracts($report_heading, $financial_year, $reporting_period, $results)
{
    $ci =& get_instance();
    ob_start();
    ?>

    <style type="text/css">
        .tg  {border-collapse:collapse;border-spacing:0;border-color:#aabcfe;margin:0px auto;}
        .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#669;background-color:#e8edff;}
        .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#039;background-color:#b9c9fe;}
        .tg .tg-0ord{text-align:right}
        .tg .tg-ifyx{background-color:#D2E4FC;text-align:right}
        .tg .tg-s6z2{text-align:center}
        .tg .tg-vn4c{background-color:#D2E4FC}
        th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header::selection      { background:transparent; }th.tg-sort-header { cursor:pointer; }table th.tg-sort-header:after {  content:'';  float:right;  margin-top:7px;  border-width:0 4px 4px;  border-style:solid;  border-color:#404040 transparent;  visibility:hidden;  }table th.tg-sort-header:hover:after {  visibility:visible;  }table th.tg-sort-desc:after,table th.tg-sort-asc:after,table th.tg-sort-asc:hover:after {  visibility:visible;  opacity:0.4;  }table th.tg-sort-desc:after {  border-bottom:none;  border-width:4px 4px 0;  }@media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;margin: auto 0px;}}
        .page-header {
            padding-bottom: 9px;
            margin: 20px 0 30px;
            border-bottom: 1px solid #eee;
        }
        .text-center {
            text-align: center;
        }
        @media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;}}
    </style>

    <div class="page-header text-center">

        <?php 
    echo '<p><b>' . get_pde_info_by_id($ci->session->userdata('pdeid'), 'title') . '</b></p>';
    ?>
        <?php 
    echo $report_heading;
    ?>

        <p>
        <h5>
            Financial Year : <?php 
    echo $financial_year;
    ?>
<br><br>
            <small>
                Reporting Period : <?php 
    echo $reporting_period;
    ?>
            </small>

        </h5>



        </p>
    </div>
    <div class="tg-wrap"><table id="tg-r2gGz" class="tg">

            <thead>
            <tr>
                <th>Procurement Reference Number</th>
                <?php 
    if ($ci->session->userdata('isadmin') == 'Y') {
        ?>
                    <th>PDE</th>
                <?php 
    }
    ?>

                <th>Subject of procurement</th>
                <th>Method of procurement</th>
                <th>Provider</th>
                <th>Date of award of contract</th>
                <th>Market price of the procurement</th>
                <th>Contract value (UGX)</th>


            </tr>
            </thead>

            <tbody>
            <?php 
    $grand_total_actual_payments = array();
    $grand_amount = array();
    //print_array($results);
    foreach ($results as $row) {
        $grand_total_actual_payments[] = $row['estimated_amount'];
        $grand_amount[] = $row['amount'] * $row['xrate'];
        ?>
                <tr>
                    <td>
                        <?php 
        echo $row['procurement_ref_no'];
        ?>
                    </td>
                    <?php 
        if ($ci->session->userdata('isadmin') == 'Y') {
            ?>
                        <td><?php 
            echo $row['pdename'];
            ?>
</td>
                    <?php 
        }
        ?>
                    <td>
                        <?php 
        echo $row['subject_of_procurement'];
        ?>
                    </td>
                    <td>
                        <?php 
        echo get_procurement_method_info_by_id($row['procurement_method'], 'title');
        ?>
                    </td>
                    <td><?php 
        echo get_provider_by_procurement($row['procurement_ref_id']);
        ?>
</td>


                    <td>
                        <?php 
        echo custom_date_format('d M Y', $row['contract_award_date']);
        ?>
                    </td>
                    <td style="text-align: right;">
                        <?php 
        echo number_format($row['estimated_amount']);
        ?>
                    </td>

                    <td style="text-align: right;">
                        <?php 
        echo number_format($row['amount'] * $row['xrate']);
        ?>
                    </td>


                </tr>
            <?php 
    }
    ?>
            <tr>
                <td></td>
                <?php 
    if ($ci->session->userdata('isadmin') == 'Y') {
        ?>
                    <td></td>
                <?php 
    }
    ?>
                <td></td>

                <td></td>
                <td></td>

                <td></td>
                <td style="border-top: 1px solid #000; text-align: right; ">
                    <b><?php 
    echo number_format(array_sum($grand_total_actual_payments));
    ?>
</b></td>
                <td style="border-top: 1px solid #000; text-align: right;">
                    <b><?php 
    echo number_format(array_sum($grand_amount));
    ?>
</b></td>

            </tr>


            </tbody>
        </table></div>

<?php 
    $my_var = ob_get_clean();
    return $my_var;
}
 function get_plan_entry_info_by_ref_num($id = '', $param = '')
 {
     if ($id == '') {
         return NULL;
     } else {
         $this->db->cache_on();
         $query = $this->db->select()->from($this->_tablename)->where('procurement_ref_no', $id)->get();
     }
     if ($query->result_array()) {
         foreach ($query->result_array() as $row) {
             switch ($param) {
                 case 'title':
                     $result = $row['subject_of_procurement'];
                     break;
                 case 'subject_of_procurement':
                     $result = $row['subject_of_procurement'];
                     break;
                 case 'procurement_type_id':
                     $result = $row['procurement_type'];
                     break;
                 case 'procurement_type':
                     $result = get_procurement_type_info_by_id($row['procurement_type'], 'title');
                     break;
                 case 'procurement_method_id':
                     $result = $row['procurement_method'];
                     break;
                 case 'procurement_method':
                     $result = get_procurement_method_info_by_id($row['procurement_method'], 'title');
                     break;
                 case 'department_id':
                     $result = $row['pde_department'];
                     break;
                 case 'department':
                     $result = get_pde_department_info_by_id($row['pde_department'], 'title');
                     break;
                 case 'funding_source_id':
                     $result = $row['funding_source'];
                     break;
                 case 'funding_source':
                     $result = get_source_funding_info_by_id($row['funding_source'], 'title');
                     break;
                 case 'source_funding_id':
                     $result = $row['funding_source'];
                     break;
                 case 'source_funding':
                     $result = get_source_funding_info_by_id($row['funding_source'], 'title');
                     break;
                 case 'id':
                     $result = $row['id'];
                     break;
                 case 'estimated_amount':
                     $result = $row['estimated_amount'];
                     break;
                 case 'currency':
                     $result = $result = get_currency_info_by_id($row['currency'], 'abbrv');
                     break;
                 case 'currency_id':
                     $result = $result = $row['currency'];
                     break;
                 case 'pre_bid_events_date':
                     $result = $row['pre_bid_events_date'];
                     break;
                 case 'pre_bid_events_duration':
                     $result = $row['pre_bid_events_duration'];
                     break;
                 case 'contracts_committee_approval_date':
                     $result = $row['contracts_committee_approval_date'];
                     break;
                 case 'contracts_committee_approval_date_duration':
                     $result = $row['contracts_committee_approval_date_duration'];
                     break;
                 case 'publication_of_pre_qualification_date':
                     $result = $row['publication_of_pre_qualification_date'];
                     break;
                 case 'publication_of_pre_qualification_date_duration':
                     $result = $row['publication_of_pre_qualification_date_duration'];
                     break;
                 case 'proposal_submission_date':
                     $result = $row['proposal_submission_date'];
                     break;
                 case 'proposal_submission_date_duration':
                     $result = $row['proposal_submission_date_duration'];
                     break;
                 case 'contracts_committee_approval_of_shortlist_date':
                     $result = $row['contracts_committee_approval_of_shortlist_date'];
                     break;
                 case 'contracts_committee_approval_of_shortlist_date_duration':
                     $result = $row['contracts_committee_approval_of_shortlist_date_duration'];
                     break;
                 case 'bid_issue_date_duration':
                     $result = $row['bid_issue_date_duration'];
                     break;
                 case 'bid_submission_opening_date':
                     $result = $row['bid_submission_opening_date'];
                     break;
                 case 'bid_submission_opening_date_duration':
                     $result = $row['bid_submission_opening_date_duration'];
                     break;
                 case 'bid_issue_date':
                     $result = $row['bid_issue_date'];
                     break;
                 case 'secure_necessary_approval_date':
                     $result = $row['secure_necessary_approval_date'];
                     break;
                 case 'secure_necessary_approval_date_duration':
                     $result = $row['secure_necessary_approval_date_duration'];
                     break;
                 case 'contract_award':
                     $result = $row['contract_award'];
                     break;
                 case 'contract_award_duration':
                     $result = $row['contract_award_duration'];
                     break;
                 case 'best_evaluated_bidder_date':
                     $result = $row['best_evaluated_bidder_date'];
                     break;
                 case 'best_evaluated_bidder_date_duration':
                     $result = $row['best_evaluated_bidder_date_duration'];
                     break;
                 case 'contract_sign_date':
                     $result = $row['bid_issue_date'];
                     break;
                 case 'contract_sign_date_duration':
                     $result = $row['contract_sign_duration'];
                     break;
                 case 'cc_approval_of_evaluation_report':
                     $result = $row['cc_approval_of_evaluation_report'];
                     break;
                 case 'cc_approval_of_evaluation_report_duration':
                     $result = $row['cc_approval_of_evaluation_report_duration'];
                     break;
                 case 'negotiation_date':
                     $result = $row['negotiation_date'];
                     break;
                 case 'negotiation_date_duration':
                     $result = $row['negotiation_date_duration'];
                     break;
                 case 'negotiation_approval_date':
                     $result = $row['negotiation_approval_date'];
                     break;
                 case 'negotiation_approval_date_duration':
                     $result = $row['negotiation_approval_date_duration'];
                     break;
                 case 'advanced_payment_date':
                     $result = $row['advanced_payment_date'];
                     break;
                 case 'advanced_payment_date_duration':
                     $result = $row['advanced_payment_date_duration'];
                     break;
                 case 'mobilise_advance_payment':
                     $result = $row['mobilise_advance_payment'];
                     break;
                 case 'mobilise_advance_payment_duration':
                     $result = $row['mobilise_advance_payment_duration'];
                     break;
                 case 'substantial_completion':
                     $result = $row['substantial_completion'];
                     break;
                 case 'substantial_completion_duration':
                     $result = $row['substantial_completion_duration'];
                     break;
                 case 'final_acceptance':
                     $result = $row['final_acceptance'];
                     break;
                 case 'final_acceptance_duration':
                     $result = $row['final_acceptance_duration'];
                     break;
                 case 'procurement_plan_id':
                     $result = $row['procurement_plan_id'];
                     break;
                 case 'procurement_plan':
                     $result = get_procurement_plan_info($row['procurement_plan_id'], 'title');
                     break;
                 case 'pde_id':
                     $result = get_procurement_plan_info($row['procurement_plan_id'], 'pde_id');
                     break;
                 case 'pde':
                     $result = get_procurement_plan_info($row['procurement_plan_id'], 'pde');
                     break;
                 case 'author_id':
                     $result = $row['author'];
                     break;
                 case 'updated_by':
                     $result = $row['updated_by'];
                     break;
                 case 'author':
                     $result = get_user_info($row['author'], 'fullname');
                     break;
                 case 'isactive':
                     $result = $row['active'];
                     break;
                 case 'dateadded':
                     $result = $row['dateadded'];
                     break;
                 default:
                     $result = $query->result_array();
             }
         }
         return $result;
     } else {
         return NULL;
     }
 }