public function get_disposal_record_info($id = '', $param = '') { //if NO ID if ($id == '') { return NULL; } else { //get user info $query = $this->db->select()->from($this->_tablename)->where('id', $id)->get(); if ($query->result_array()) { foreach ($query->result_array() as $row) { //filter results switch ($param) { case 'plan_id': $result = $row['disposal_plan']; break; case 'plan': $result = get_disposal_plan_info_by_id($row['disposal_plan'], 'title'); break; case 'serial_no': $result = $row['disposal_serial_no']; break; case 'pde_id': $result = $row['pde_id']; break; case 'pde': $result = get_pde_info_by_id($row['pde_id'], 'title'); break; case 'title': $result = $row['subject_of_disposal']; break; case 'isactive': $result = $row['isactive']; break; case 'location': $result = $row['asset_location']; break; case 'amount': $result = $row['amount']; break; case 'currency': $result = $row['currence']; break; case 'approval_date': $result = $row['dateofaoapproval']; break; default: $result = $query->result_array(); } } return $result; } } }
public function get_procurement_plan_info($plan_id, $param) { $this->db->cache_on(); $query = $this->db->select()->from($this->_tablename)->where($this->_primary_key, $plan_id)->get(); # print_array($this->db->last_query()); # print_r($this->_tablename); exit(); $info_array = $query->result_array(); //if there is a result if (count($info_array)) { foreach ($info_array as $row) { switch ($param) { case 'financial_year': $result = $row['financial_year']; break; case 'title': $result = $row['title']; break; case 'pde_id': $result = $row['pde_id']; break; case 'pde': $result = get_pde_info_by_id($row['pde_id'], 'title'); break; case 'description': $result = $row['description']; break; case 'author_id': $result = $row['author']; break; case 'author': $result = get_user_info_by_id($row['author'], 'fullname'); break; case 'isactive': $result = $row['active']; break; case 'dateadded': $result = $row['dateadded']; break; default: //no parameter is passed display all user info $result = $info_array; } } return $result; } else { return NULL; } }
function procurement_plan_ref_number_hint($pde, $procurement_type, $financial_year, $procurement_plan) { $ci =& get_instance(); $ci->load->model('procurement_plan_entry_m'); //number sections $pde_abbrv = get_pde_info_by_id($pde, 'abbrv'); $procurement_type = get_procurement_type_info_by_id($procurement_type, 'title'); switch ($procurement_type) { case 'Works': $procurement_type = 'WRKS'; break; case 'Supplies': $procurement_type = 'SUPPLS'; break; case 'Services': $procurement_type = 'SRVCS'; break; case 'Non consultancy services': $procurement_type = 'NCSRVCS'; break; } $where = array('procurement_plan_id' => $procurement_plan); $last_instance = $ci->procurement_plan_entry_m->last_entered_procurement_ref_number($where); //echo $last_instance; $str = ''; //if there is an instance if ($last_instance) { $pieces = explode('/', $last_instance); $str .= '000'; $str .= $pieces[3] + 1; $instance = $str; } else { $instance = '0001'; } return $pde_abbrv . '/' . $procurement_type . '/' . $financial_year . '/' . $instance; }
</small></h2> <tr> <th>Reporting Period</th> <td><?php echo $reporting_period; ?> </td> </tr> <?php if ($this->input->post('pde')) { ?> <tr> <th>PDE</th> <td><?php echo get_pde_info_by_id($this->input->post('pde'), 'title'); ?> </td> </tr> <?php } ?> <tr class="text_danger"> <th>Bids with inconsistent evaluation time </th> <td class="number"><?php echo count($inconsitent_evalution); ?> </td> </tr> <tr class="text_danger">
function disposal() { check_user_access($this, 'disposal_reports', 'redirect'); $data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array(); $data['pdes'] = array_merge(array(array('pdeid' => 'ALL', 'pdename' => 'View All')), $data['pdes']); $data['financial_years'] = $this->financial_years; $data['page_title'] = 'Disposal reports'; $data['current_menu'] = 'disposal_reports'; $data['view_to_load'] = 'reports/disposal/disposal_reports_v'; $data['view_data']['form_title'] = $data['page_title']; $data['search_url'] = ''; $data['report_form'] = 'reports/disposal/forms/disposal_f'; $data['report_view'] = 'reports/disposal/disposal_home'; $data['report_heading'] = 'DISPOSAL REPORTS'; $data['financial_year'] = $data['financial_year'] = date('Y') . '-' . (date('Y') + 1); $from = date('Y') . '-' . date('m') . '-01'; //$from=date('Y').'-'.'01'.'-01'; $to = mysqldate(); $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b>  <i> to </i> <b>    ' . custom_date_format('d M, Y', $to) . '</b>'; if ($this->input->post('generate')) { $data['financial_year'] = $this->input->post('financial_year'); $start_year = substr($this->input->post('financial_year'), 0, 4); //$end_year=substr($this->input->post('financial_year'),5,4); $config = array(array('field' => 'report_type', 'label' => 'Quarter', 'rules' => 'required')); $this->form_validation->set_rules($config); if ($this->form_validation->run() == FALSE) { $data['errors'] = validation_errors(); } else { //switch by quarter switch ($this->input->post('report_type')) { case 'quarter_1': $from = date('Y-m-d', strtotime($start_year . '-01-01')); $to = date('Y-m-d', strtotime($start_year . '-04-01')); $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b>  <i> to </i> <b>    ' . custom_date_format('d M, Y', $to) . '</b>'; if ($this->session->userdata('isadmin') == 'Y') { if ($this->input->post('pde')) { $data['report_heading'] = 'DISPOSAL REPORTS IN THE FIRST QUARTER <small>: ' . get_pde_info_by_id($this->input->post('pde'), 'title') . '</small>'; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->input->post('pde')); } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE FIRST QUARTER '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to); } } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE FIRST QUARTER '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->session->userdata('pdeid')); } break; case 'quarter_2': $from = date('Y-m-d', strtotime($start_year . '-5-01')); $to = date('Y-m-d', strtotime($start_year . '-08-01')); $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b>  <i> to </i> <b>    ' . custom_date_format('d M, Y', $to) . '</b>'; if ($this->session->userdata('isadmin') == 'Y') { if ($this->input->post('pde')) { $data['report_heading'] = 'DISPOSAL REPORTS IN THE SECOND QUARTER <small>Filtered by PDE: ' . get_pde_info_by_id($this->input->post('pde'), 'title') . '</small>'; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->input->post('pde')); } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE SECOND QUARTER '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to); } } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE SECOND QUARTER '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->session->userdata('pdeid')); } break; case 'quarter_3': $from = date('Y-m-d', strtotime($start_year . '-06-01')); $to = date('Y-m-d', strtotime($start_year . '-12-01')); $data['reporting_period'] = '<b>' . custom_date_format('d M, Y', $from) . '</b>  <i> to </i> <b>    ' . custom_date_format('d M, Y', $to) . '</b>'; if ($this->session->userdata('isadmin') == 'Y') { if ($this->input->post('pde')) { $data['report_heading'] = 'DISPOSAL REPORTS IN THE THIRD QUARTER <small>Filtered by PDE: ' . get_pde_info_by_id($this->input->post('pde'), 'title') . '</small>'; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->input->post('pde')); } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE THIRD QUARTER '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to); } } else { $data['report_heading'] = 'DISPOSAL REPORTS IN THE THIRD QUARTER'; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->session->userdata('pdeid')); } break; } } } else { if ($this->session->userdata('isadmin') == 'Y') { $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $pde = ''); } else { $data['report_heading'] = strtoupper(get_pde_info_by_id($this->session->userdata('pdeid'), 'title')) . ' DISPOSAL REPORTS '; $data['results'] = $this->disposal_record_m->get_disposal_plans_by_month($from, $to, $this->session->userdata('pdeid')); } } $this->load->view('dashboard_v', $data); }
<th class="hidden-480">Procurement ref.no</th> <th class="hidden-480">Subject of procurement</th> <th class="hidden-480">Method of procurement</th> </tr> </thead> <?php //print_array($results); foreach ($results as $row) { ?> <tr> <td><?php echo get_pde_info_by_id($row['pde_id'], 'title'); ?> </td> <td><?php echo $row['final_contract_value']; ?> </td> <td><?php echo $row['total_actual_payments']; ?> </td> <td><?php echo get_procurement_plan_entry_info($row['procurement_ref_id'], 'procurement_ref_no'); ?> </td>
public function get_disposal_plan_info($id = '', $param = '') { //if NO ID if ($id == '') { return NULL; } else { //get user info $query = $this->db->select()->from($this->_tablename)->where('id', $id)->get(); if ($query->result_array()) { foreach ($query->result_array() as $row) { //filter results switch ($param) { case 'pde_id': $result = $row['pde_id']; break; case 'pde': $result = get_pde_info_by_id($row['pde'], 'title'); break; case 'financial_year': $result = $row['financial_year']; break; case 'description': $result = $row['description']; break; case 'isactive': $result = $row['isactive']; break; case 'title': $result = $row['title']; break; default: $result = $query->result_array(); } } return $result; } } }
<div class="column"> <?php if (count($all_plans)) { print '<div class="row titles_h"> <div class="col-md-8"> <b>Procuring/Disposing Entity</b> </div> <div class="col-md-4"> </div> </div><hr>'; foreach ($all_plans_paginated as $row) { print '<div class="row">' . '<div class="col-md-8 procurement_pde">' . get_pde_info_by_id($row['pde_id'], 'title') . '</div>' . '<div class="col-md-4"><a class="btn btn-xs btn-primary center" href="' . base_url() . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/details/' . encryptValue($row['id']) . '">Details of ' . $row['financial_year'] . ' Annual Procurement Plan </a></div>' . '</div>' . '<hr>'; } echo $pages; } else { print format_notice("ERROR: There are no verified plans"); } ?> </div> <?php } ?> </div>
function save_procurement_entry() { #check user access #1: for editing if (!empty($data['i'])) { check_user_access($this, 'edit_procurement_entry', 'redirect'); } else { check_user_access($this, 'add_procurement_entry', 'redirect'); } # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'p', 'v')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $plan_info = $this->procurement_plan_m->get_by_id(decryptValue($data['v'])); if (!empty($plan_info)) { $plan_info = $plan_info[0]; } #print_array($_POST); if (!empty($_POST['save_entry']) || !empty($_POST['save_and_new'])) { $data['formdata'] = $_POST; $required_fields = array('subject_of_procurement', 'pde_department', 'procurement_type', 'estimated_amount', 'currency', 'funding_source', 'procurement_method', 'contracts_committee_approval_date', 'contracts_committee_approval_of_shortlist_date', 'bid_issue_date', 'bid_closing_date', 'submission_of_evaluation_report_to_cc', 'cc_approval_of_evaluation_report', 'quantity'); if (!empty($_POST['currency']) && $_POST['currency'] > 1) { $required_fields = array_merge($required_fields, array('exchange_rate')); } #$_POST = clean_form_data($_POST); $validation_results = validate_form('', $_POST, $required_fields); #Only proceed if the validation for required fields passes if ($validation_results['bool']) { $procurement_plan_data = array('subject_of_procurement' => $this->input->post('subject_of_procurement'), 'procurement_type' => $this->input->post('procurement_type'), 'procurement_method' => $this->input->post('procurement_method'), 'pde_department' => $this->input->post('pde_department'), 'funding_source' => $this->input->post('funding_source'), 'estimated_amount' => removeCommas($this->input->post('estimated_amount')), 'currency' => $this->input->post('currency'), 'exchange_rate' => $_POST['currency'] == 1 ? 1 : $this->input->post('exchange_rate'), 'pre_bid_events_date' => custom_date_format('Y-m-d', $this->input->post('pre_bid_events_date')), 'contracts_committee_approval_date' => custom_date_format('Y-m-d', $this->input->post('contracts_committee_approval_date')), 'publication_of_pre_qualification_date' => custom_date_format('Y-m-d', $this->input->post('publication_of_pre_qualification_date')), 'proposal_submission_date' => custom_date_format('Y-m-d', $this->input->post('proposal_submission_date')), 'contracts_committee_approval_of_shortlist_date' => custom_date_format('Y-m-d', $this->input->post('contracts_committee_approval_of_shortlist_date')), 'bid_issue_date' => custom_date_format('Y-m-d', $this->input->post('bid_issue_date')), 'bid_submission_opening_date' => custom_date_format('Y-m-d', $this->input->post('bid_issue_date')), 'bid_closing_date' => custom_date_format('Y-m-d', $this->input->post('bid_closing_date')), 'submission_of_evaluation_report_to_cc' => custom_date_format('Y-m-d', $this->input->post('submission_of_evaluation_report_to_cc')), 'secure_necessary_approval_date' => custom_date_format('Y-m-d', $this->input->post('necessary_approval_date')), 'contract_award' => custom_date_format('Y-m-d', $this->input->post('contract_award')), 'best_evaluated_bidder_date' => custom_date_format('Y-m-d', $this->input->post('best_evaluated_bidder_date')), 'contract_sign_date' => custom_date_format('Y-m-d', $this->input->post('contract_sign_date')), 'cc_approval_of_evaluation_report' => custom_date_format('Y-m-d', $this->input->post('cc_approval_of_evaluation_report')), 'negotiation_date' => custom_date_format('Y-m-d', $this->input->post('negotiation_date')), 'negotiation_approval_date' => custom_date_format('Y-m-d', $this->input->post('negotiation_approval_date')), 'performance_security' => custom_date_format('Y-m-d', $this->input->post('performance_security')), 'accounting_officer_approval_date' => custom_date_format('Y-m-d', $this->input->post('accounting_officer_approval_date')), 'best_evaluated_bidder_date' => custom_date_format('Y-m-d', $this->input->post('best_evaluated_bidder_date')), 'advanced_payment_date' => custom_date_format('Y-m-d', $this->input->post('advanced_payment_date')), 'solicitor_general_approval_date' => custom_date_format('Y-m-d', $this->input->post('solicitor_general_approval_date')), 'mobilise_advance_payment' => custom_date_format('Y-m-d', $this->input->post('mobilise_advance_payment')), 'substantial_completion' => custom_date_format('Y-m-d', $this->input->post('substantial_completion')), 'final_acceptance' => custom_date_format('Y-m-d', $this->input->post('final_acceptance')), 'procurement_plan_id' => $plan_info['id'], 'quantity' => $this->input->post('quantity')); #check if the procurement already exists $similar_proc_ref_no = $this->Query_reader->get_row_as_array('search_table', array('table' => ' procurement_plan_entries', 'orderby' => 'procurement_ref_no', 'limittext' => '', 'searchstring' => ' procurement_plan_id = "' . $plan_info['id'] . '" AND pde_department ="' . $_POST['pde_department'] . '" AND subject_of_procurement = "' . $_POST['subject_of_procurement'] . '"' . (!empty($data['i']) ? ' AND id !="' . decryptValue($data['i']) . '"' : ''))); if (!empty($similar_proc_ref_no)) { $data['msg'] = 'ERROR: An entry with a similar subject of procurement <b><i>(' . $_POST['subject_of_procurement'] . ')</i></b> has already been created already exists.'; } else { if (!empty($data['i'])) { $procurement_plan_data['updated_by'] = $this->session->userdata('userid'); $result = $this->db->update('procurement_plan_entries', clean_form_data($procurement_plan_data), array('id' => decryptValue($data['i']))); } else { #$procurement_plan_data['procurement_ref_no'] = procurement_plan_ref_number_hint($plan_info['pde_id'], $this->input->post("procurement_type"), $plan_info['financial_year'], decryptValue($data['v'])); $procurement_plan_data['author'] = $this->session->userdata('userid'); $result = $this->procurement_plan_entry_m->create($procurement_plan_data); } } #exit($this->db->last_query()); #event has been added successfully if (!empty($result) && $result) { $data['msg'] = "SUCCESS: The procurement entry details have been saved."; $this->session->set_userdata('sres', $data['msg']); #user clicked publish if (!empty($_POST['save_and_new'])) { redirect('procurement/load_procurement_entry_form/m/sres' . (!empty($data['v']) ? "/v/" . $data['v'] : '')); } else { redirect('procurement/procurement_plan_entries/m/sres' . (!empty($data['v']) ? "/v/" . $data['v'] : '')); } } elseif (empty($data['msg'])) { $data['msg'] = "ERROR: The procurement entry details could not be saved or were not saved correctly."; } } if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) { $data['msg'] = "WARNING: The highlighted fields are required."; } $data['requiredfields'] = $validation_results['requiredfields']; } if ($plan_info) { if ($plan_info) { //get the plan id $pde_id = $plan_info['pde_id']; $financial_year = $plan_info['financial_year']; $data['page_title'] = get_pde_info_by_id($pde_id, 'title') . ' financial year (' . $financial_year . ') entries'; $data['current_menu'] = 'view_procurement_plans'; $data['plan_info'] = $plan_info; $data['financial_year'] = $financial_year; $data['view_to_load'] = 'procurement/admin/register_entry_v'; $data['view_data']['form_title'] = $data['page_title']; $data['plan_id'] = decryptValue($this->uri->segment(4)); $data['pde_id'] = $pde_id; //print_array($data); //load view $this->load->view('dashboard_v', $data); } else { echo error_template('No plan for this year'); } } else { //if pde does not exist //TODO redirect to a more good looking page echo error_template('No data to display'); } }
/** * 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; }
<th>Disposal Method</th> </tr> </thead> <tbody> <?php foreach ($all_records_paginated as $entry) { ?> <tr> <td><?php echo $entry['subject_of_disposal']; ?> </td> <td>-</td> <td><?php echo get_pde_info_by_id($entry['pde'], 'title'); ?> </td> <td><?php echo get_disposal_method_info_by_id($entry['method_of_disposal'], 'title'); ?> </td> </tr> <?php } ?> </tbody> </table> </div> </div>