function manage_staff() { access_control($this); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); #Get the paginated list of users $data = paginate_list($this, $data, 'search_school_users', array('limittext' => '', 'searchstring' => ' AND school =' . $this->myschool['id'])); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $this->load->view('user/manage_staff_view', $data); }
function view_report() { check_user_access($this, 'view_reports', 'redirect'); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'p')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $data['page_title'] = 'Report panel'; $data['current_menu'] = 'view_reports'; $data['view_to_load'] = 'reports/report_panel'; $data['view_data']['form_title'] = $data['page_title']; $data['search_url'] = ''; $this->load->view('dashboard_v', $data); }
function notifyrop($bidinvitation) { $bidinvitation = $bidinvitation; ################################################# # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(2, array('m', 'p')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); #print_r($data); exit(); $data = handle_redirected_msgs($this, $data); $search_str = ''; $level = $status = $this->uri->segment(3); $data['level'] = $level; $search_str = ' AND bidinvitations.id="' . $bidinvitation . '"'; $records = paginate_list($this, $data, 'bid_invitation_details', array('orderby' => 'bid_dateadded DESC', 'searchstring' => 'bidinvitations.isactive = "Y" AND bidinvitations.id not in (SELECT bid_id FROM receipts INNER JOIN bidinvitations ON receipts.bid_id = bidinvitations.id INNER JOIN bestevaluatedbidder ON receipts.receiptid = bestevaluatedbidder.pid WHERE receipts.beb="Y" ) ' . $search_str), 10); #bid invitation details $recorded_data = $records['page_list'][0]; #procurement type:: $procurementType = $recorded_data['procurement_type']; if ($procurementType == 'Non consultancy services' || $procurementType == 'Consultancy Services') { $procurementType = "Services"; } #connect to ROP to fetch providers with that procurement method. $this->load->model('Remoteapi_m'); $emaillist = $this->Remoteapi_m->emaillist_providers($procurementType); # print_r($recorded_data); $str = '<table>' . '<tr> <th colspan="2"><h2> RE: BID INVITATION </h2> </th> </tr>' . '<tr> <th> PROCUREMENT AND DISPOSING ENTITY </th> <td>' . $recorded_data['pdename'] . '<td> </tr>' . '<tr> <th> FINANCIAL YEAR </th> <td>' . $recorded_data['financial_year'] . '<td> </tr>' . '<tr> <th> PROCUREMENT REFERENCE NUMBER </th> <td>' . $recorded_data['procurement_ref_no'] . '<td> </tr>' . '<tr> <th> SUBJECT OF PROCUREMENT </th> <td>' . $recorded_data['subject_of_procurement'] . '<td> </tr>' . '<tr> <th> PROCUREMENT TYPE </th> <td>' . $recorded_data['procurement_type'] . '<td> </tr>' . '<tr> <th> PROCUREMENT METHOD </th> <td>' . $recorded_data['procurement_method'] . '<td> </tr>' . '<tr> <th> SOURCE OF FUNDING </th> <td>' . $recorded_data['funding_source'] . '<td> </tr>' . '<tr> <th>BID SUBMISSION DEADLINE </th> <td>' . date('m -d,Y', strtotime($recorded_data['bid_submission_deadline'])) . '<td> </tr>' . '</table>' . ' NOTE : <BR/>' . ' FOR MORE INFORMATION : '; $strbody = html_entity_decode($str); # $this->load->library('email'); echo "sending starts <br/> <br/>"; echo "<ul>"; while ($row = mysqli_fetch_array($emaillist)) { $this->email->from('*****@*****.**', 'Tender Portal Notifications'); $this->email->to('' . $row['email'] . ''); // $this->email->cc('*****@*****.**'); #$this->email->bcc('*****@*****.**'); $this->email->subject('RE: BID INVITATION'); $this->email->message('' . $strbody . ''); $this->email->send(); echo "<li>" . $row['email'] . "</li>"; } echo "</ul><br/><br/>Sending Finished"; #fetch data about these guys ## fetch records ### # print_r($records['page_list'][0]); ################################################## # end }
function manage_pdetypes() { access_control($this, array('admin')); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); //fetchpdetypes $data = $this->Pdetypes_m->fetchpdetypes($status = 'Y', $data); //$data['archived'] = $this-> Pdetypes_m -> fetchpdetypes($status='N'); //end $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $data['page_title'] = 'Manage PDE Types'; $data['current_menu'] = 'manage_pdetypes'; $data['view_to_load'] = 'pde/manage_pdatype_v'; $data['view_data']['form_title'] = $data['page_title']; $data['search_url'] = 'admin/search_pdetypes'; $this->load->view('dashboard_v', $data); }
function load_edit_provider_form() { check_user_access($this, 'edit_provider', 'redirect'); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $suspendid = decryptValue($this->uri->segment(3)); #print_r($suspendid); exit(); $data['suspension_details'] = $this->Remoteapi_m->fetch_suspended_provider($suspendid); #print_r($data['suspension_details'] ); exit(); #print_r($result); $data['formtype'] = "edit"; #$data['active_procurements'] = $this-> Proc_m -> fetch_active_procurement_list2($idx=0); $data['page_title'] = 'Suspend Provider '; $data['current_menu'] = 'suspend_provider'; $data['view_to_load'] = 'providers/suspend_provider_v'; $data['view_data']['form_title'] = $data['page_title']; $data['ropproviders'] = $this->Remoteapi_m->fetchproviders(); $data['countrylist'] = $this->Proc_m->fetchcountries(); $this->load->view('dashboard_v', $data); }
function awarded_beb_to_suspended_providers(){ $urldata = $this->uri->uri_to_assoc(4, array('m', 'i')); $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $userid = $this->session->userdata['userid']; $pde = mysql_query("select * from users where userid =".$userid); $q = mysql_fetch_array($pde); $result = paginate_list($this, $data, 'view_bebs', array('SEARCHSTRING' => ' and bidinvitations.isactive="Y" AND procurement_plan_entries.isactive = "Y" and bidinvitations.id not in ( select bidinvitation_id FROM contracts ) and users.userid = '.$userid.' ORDER BY bestevaluatedbidder.dateadded DESC' ),100); // $provider = ''; $provider_selected = ''; $contract_status = ''; $visible = 0 ; //header information $st = '<div class="widget-body" id="results"><table class="table table-striped table-hover">'. '<thead>'. '<tr>'. '<th>Procurement Ref Number</th>'. '<th class="hidden-480">Selected Provider</th>'. '<th class="hidden-480">Subject of Procurement</th>'. '<th class="hidden-480">Value</th>'. '<th>Status</th>'. '<th>Date Added</th>'. '</tr>'. '</thead>'. '<tbody>'; //end of header information foreach ($result['page_list'] as $key => $row) { # print_r($row); $provider = rtrim($row['providers'],','); $result = $this-> db->query("SELECT providernames FROM providers where providerid in(".$provider.")")->result_array(); $providerlist = ''; $x = 0; foreach($result as $key => $record){ $providerlist .= $x > 0 ? $record['providernames'].',' : $record['providernames']; $provider_selected = str_replace('-', ' ',$record['providernames']); # print_r($providerlist); /*get me the provider names and get me the date beb was added :*/ $provider = $provider_selected; $dateadded = $row['dateadded']; # print_r( $dateadded); $result_data = mysqli_fetch_array($this -> Remoteapi_m -> suspended_provider_betweendates($dateadded,$provider_selected)); if(count($result_data) > 0 ) { $contract_status = "Y"; $visible = 1 ; break; } } if($contract_status == "Y") { //records fetch right here $bidd = $row['bid_id']; #print_r($row['bid_id']); exit(); $st .= '<tr> '. '<td>'.$row['procurement_ref_no'].'</td>'; $provider = rtrim($row['providers'],','); $result = $this-> db->query("SELECT providernames FROM providers where providerid in(".$provider.")")->result_array(); $st .= '<td class="hidden-480">'; $providerlist = ''; $x = 0; foreach($result as $key => $record){ $providerlist .= $x > 0 ? $record['providernames'].',' : $record['providernames']; $x ++ ; } //print_r($providerlist); $providerlists = ($x > 1 )? rtrim($providerlist,',').' <span class="label label-info">Joint Venture</span> ' : $providerlist; $st .= $providerlists.'</td>'. '<td class="hidden-480">'.$row['subject_of_procurement'].'</td>'. '<td class="hidden-480">'.number_format($row['contractprice']).$row['currency'].'</td>'. '<td>'; if($row['isreviewed'] == 'Y') { $st .= "<span class='label label-info minst'> Under Administrative Review </span>"; } else { $st .= '-'; } $st .= ' </th>'. '<td>'.date('Y-M-d',strtotime($row['dateadded'])).'</th>'. '</tr>'; } $contract_status = ''; } $st .= '</tbody></table></div>'; if($visible == 1) { // $adons = ' | '.date('d-m-y'); $level = "Procurement"; $titles = "Monthly Report on Soon Expiring Contracts for ".$entityname.'| '. $adons; $body = " ".html_entity_decode($st); $permission = "awarded_beb_to_suspended_providers"; $this-> push_permission_all($titles,$body,$level,$permission,$records ['pdeid']); echo $body; #print_r($st); } }
function manage_contracts() { $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $data['manage_bes'] = $this->disposal->manage_disposal_contracts(0, $data); #print_r($data['manage_bes']); $data['page_title'] = 'Manage Disposal Contracts '; $data['current_menu'] = 'view_bid_responses'; $data['view_to_load'] = 'disposal/manage_contracts'; $data['view_data']['form_title'] = $data['page_title']; $this->load->view('dashboard_v', $data); }
function populatelots() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $result = $this->Receipts_m->findlottedproviders($_POST); // # fetch receipts Id :: // $post = $_POST; // $lotid = $post['lotid']; // #$query = $this->db->query("SELECT * FROM "); print_r($result); }
function manage_receipts() { $urldata = $this->uri->uri_to_assoc(3, array('m')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $data['page_title'] = 'Manage Receipts'; $data['current_menu'] = 'manage_bid_receipts'; $data['view_to_load'] = 'receipts/manage_receipts_v'; $data['view_data']['form_title'] = $data['page_title']; $this->load->view('dashboard_v', $data); }
function manage_contracts() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'p')); # Pick all assigned data $data = assign_to_data($urldata); $data = add_msg_if_any($this, $data); $data = handle_redirected_msgs($this, $data); $search_str = ''; if ($this->session->userdata('isadmin') == 'N') { $userdata = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array(); $search_str = ' AND PP.pde_id="' . $userdata[0]['pde'] . '"'; } #Get the paginated list of users $data = paginate_list($this, $data, 'get_published_contracts', array('orderby' => 'C.date_signed DESC', 'searchstring' => ' AND C.isactive="Y"' . $search_str)); #exit($this->db->last_query()); $data = handle_redirected_msgs($this, $data); $data = add_msg_if_any($this, $data); $data['page_title'] = 'Manage contracts'; $data['current_menu'] = 'view_contracts'; $data['view_to_load'] = 'contracts/manage_contracts'; $data['search_url'] = 'contracts/search_contracts'; $data['form_title'] = $data['page_title']; $this->load->view('dashboard_v', $data); }
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'); } }
function manage_access_groups() { access_control($this, array('admin')); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); $result = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array())); $data['access_group_list'] = $result->result_array(); $data = handle_redirected_msgs($this, $data); $data = add_msg_if_any($this, $data); $this->load->view('admin/manage_access_groups', $data); }