Пример #1
0
 function dashboard()
 {
     # 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 the news items
     $data = add_msg_if_any($this, $data);
     $current_financial_year = date('m') > 5 ? date('Y') . '-' . (date('Y') + 1) : date('Y') - 1 . '-' . date('Y');
     $search_str = ' PP.financial_year = "' . $current_financial_year . '" ';
     if ($this->session->userdata('isadmin') == 'N') {
         $userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
         $search_str .= ' AND PP.pde_id ="' . $userdetails[0]['pde'] . '"';
     }
     /*
     		#Get the paginated list of bid invitations
     		$data = paginate_list($this, $data, 'procurement_plan_details_advanced', array('orderby'=>'bid_dateadded DESC', 'orderby'=>' procurement_plan_entries.dateadded ', 'searchstring'=>$app_select_str)); */
     $data['current_financial_year'] = $current_financial_year;
     $data['num_of_pdes'] = count($this->db->get_where('pdes', array('status' => 'IN', 'isactive' => 'Y'))->result_array());
     $data['total_procurement_records'] = end($this->Query_reader->get_row_as_array('count_procurement_records', array('searchstring' => $search_str)));
     $data['plans_submitted'] = end($this->Query_reader->get_row_as_array('count_plans_submitted', array('searchstring' => $search_str)));
     $data['ifbs_submitted'] = end($this->Query_reader->get_row_as_array('count_ifbs_published', array('searchstring' => $search_str)));
     $data['bebs_published'] = end($this->Query_reader->get_row_as_array('count_bebs_published', array('searchstring' => $search_str)));
     $data['contracts_awarded'] = end($this->Query_reader->get_row_as_array('count_contracts_awarded', array('searchstring' => $search_str)));
     $data['financial_years'] = array(array('fy' => '2016-2017', 'label' => '2016 - 2017'), array('fy' => '2015-2016', 'label' => '2015 - 2016'), array('fy' => '2014-2015', 'label' => '2014 - 2015'), array('fy' => '2013-2014', 'label' => '2013 - 2014'), array('fy' => '2012-2013', 'label' => '2012 - 2013'));
     #exit($this->db->last_query());
     $data['page_title'] = 'Dashboard';
     $data['current_menu'] = 'dashboard';
     $data['incl_to_load'] = 'dashboard';
     $data['view_to_load'] = 'admin/overview2';
     $this->load->view('dashboard_v', $data);
 }
Пример #2
0
 function manage_school_info()
 {
     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);
     $data = add_msg_if_any($this, $data);
     #get school info
     $data['schooldetails'] = $this->Query_reader->get_row_as_array('search_schools_list', array('limittext' => '', 'searchstring' => ' AND id = ' . $this->myschool['id']));
     $this->load->view('schoolinfo/school_info_view', $data);
 }
Пример #3
0
 function manage_settings()
 {
     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);
     $data = add_msg_if_any($this, $data);
     #default to curriculum settings
     $data = paginate_list($this, $data, 'search_subjects', array('isactive' => 'Y', 'searchstring' => ' AND school = ' . $this->myschool['id']));
     $this->load->view('settings/manage_settings_view', $data);
 }
Пример #4
0
 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);
 }
Пример #5
0
 function manage_incidents()
 {
     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);
     $student_id = !empty($data['i']) ? decryptValue($data['i']) : '';
     #get the student info
     $data['student_details'] = $this->Query_reader->get_row_as_array('get_students_list', array('isactive' => 'Y', 'searchstring' => ' AND id=\'' . $student_id . '\'', 'limittext' => ''));
     #Get the paginated list of incidents
     $data = paginate_list($this, $data, 'search_discipline', array('isactive' => 'Y', 'searchstring' => (!empty($student_id) ? ' students.id=\'' . $student_id . '\'' : '1=1') . '  ORDER BY incidentdate DESC', 'school' => '\'' . $this->myschool['id'] . '\''));
     $data = add_msg_if_any($this, $data);
     $this->load->view('discipline/manage_incidents_view', $data);
 }
Пример #6
0
 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
 }
Пример #7
0
 function manage_gradebook()
 {
     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 subjects assigned to the teacher
     #Get the school terms
     $data['terms'] = $this->terms->get_terms('', ' AND startdate<"' . date("Y-m-d") . '"', 'DESC');
     #print_r($data['terms']);
     //Concatenate years to the terms for the user
     foreach ($data['terms'] as $key => $termdetails) {
         $data['terms'][$key]['term'] = $data['terms'][$key]['term'] . ' [' . $termdetails['year'] . ']';
     }
     //get the subjects assigned to the teacher
     $data['subjects'] = $this->db->query($this->Query_reader->get_query_by_code('get_teacher_subjects', array('teacher' => $this->session->userdata('userid'))))->result_array();
     //get the current term info
     $data['current_term'] = current_term($this, $this->myschool['id']);
     $data = add_msg_if_any($this, $data);
     $this->load->view('gradebook/manage_gradebook_view', $data);
 }
Пример #8
0
 function preview_photo()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     //echo decryptValue($data['i']);
     #Get disease details
     if (!empty($data['i'])) {
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_image_by_id', array('id' => decryptValue($data['i'])));
     } else {
         $this->session->set_userdata('fmsg', "WARNING: The photo details could not be obtained.");
         redirect(base_url() . "photo/album/m/fmsg");
     }
     $data = add_msg_if_any($this, $data);
     $this->load->view('photo/preview_photo', $data);
 }
Пример #9
0
 function report_list()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'up'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $isactive = !empty($data['t']) && decryptValue($data['t']) == 'archive' ? 'N' : 'Y';
     #Get the paginated list of the reports
     $data = paginate_list($this, $data, 'get_user_report_list', array('userid' => $this->session->userdata('userid'), 'isactive' => $isactive, 'searchstring' => ''));
     $data = add_msg_if_any($this, $data);
     $this->load->view('reports/user_report_list_view', $data);
 }
Пример #10
0
 function view_video()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 's'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $data['area'] = "view_video";
     $data = add_msg_if_any($this, $data);
     $this->load->view('incl/addons', $data);
 }
Пример #11
0
 function manage_student_sponsors()
 {
     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);
     $data['student_info'] = get_db_object_details($this, 'students', decryptValue($data['i']));
     #Get the paginated list of the students
     $data = paginate_list($this, $data, 'student_sponsors', array('searchstring' => ' AND students.id=' . decryptValue($data['i']), 'orderby' => 'fromdate DESC', 'student' => decryptValue($data['i'])));
     $data = add_msg_if_any($this, $data);
     $this->load->view('students/manage_student_sponsors_view', $data);
 }
Пример #12
0
 function show_nav_details()
 {
     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);
     if (!empty($data['fundedamount']) && !empty($data['commitmentamount'])) {
         $fundedamount = removeCommas(restore_bad_chars($data['fundedamount']));
         $commitmentamount = removeCommas(restore_bad_chars($data['commitmentamount']));
         $fundedamt = !empty($fundedamount) ? $fundedamount : 0;
         $commitmentamt = !empty($commitmentamount) ? $commitmentamount : 0;
     }
     if (!empty($fundedamt) && !empty($commitmentamt)) {
         $data['unfunded'] = $commitmentamt - $fundedamt;
     }
     $data['area'] = "nav_amt_details";
     $data = add_msg_if_any($this, $data);
     $this->load->view('incl/addons', $data);
 }
Пример #13
0
 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);
 }
Пример #14
0
 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);
 }
Пример #15
0
 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);
 }
Пример #16
0
 function initiate_procurement()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 's'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $data = add_msg_if_any($this, $data);
     if (!empty($_POST['save'])) {
         $required_fields = array('vote_no', 'date_initiated', 'initiated_by');
         $_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']) {
             #check if an active procurement initialization already exists for selected procurement ref no
             $similar_bid_invitation = $this->db->query($this->Query_reader->get_query_by_code('search_table', array('table' => 'initiate_procurements', 'orderby' => 'procurement_ref_no', 'limittext' => '', 'searchstring' => ' procurement_ref_no = "' . $_POST['procurement_ref_no'] . '" AND isactive="Y"' . (!empty($data['i']) ? ' AND id !="' . decryptValue($data['i']) . '"' : ''))))->result_array();
             if (!empty($similar_bid_invitation)) {
                 $data['msg'] = "WARNING: The procurement initialization for the selected procurement reference number has already started.";
             } else {
                 $_POST['author'] = $this->session->userdata('userid');
                 $_POST['approval_status'] = 'Pending';
                 if (!empty($data['i'])) {
                     #$result = $this->db->query($this->Query_reader->dbupdate_str('events', $_POST, decryptValue($data['i']), 'id'));
                 } else {
                     $result = $this->db->query($this->Query_reader->get_query_by_code('initiate_procurement', $_POST));
                 }
             }
             #procurement has been initiated successfully
             if (!empty($result) && $result) {
                 $data['msg'] = "SUCCESS: The procurement has been initiated successfully.";
                 $this->session->set_userdata('sres', $data['msg']);
                 redirect('procurement/procurement_plan_entries' . (!empty($_POST['proc_no']) ? "/v/" . $_POST['proc_no'] : '') . '/m/sres');
             } else {
                 if (empty($data['msg'])) {
                     $data['msg'] = "ERROR: The procurement could not be initiated or was not initiated 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'];
     }
     $data['formdata'] = $_POST;
     $app_select_str = ' procurement_plan_entries.isactive="Y" ';
     if ($this->session->userdata('isadmin') == 'N') {
         $userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
         $app_select_str .= ' AND pde_id ="' . $userdetails[0]['pde'] . '"';
     }
     $data['procurement_plan_entries'] = $this->db->query($this->Query_reader->get_query_by_code('procurement_plan_details', array('searchstring' => $app_select_str, 'limittext' => '', 'orderby' => ' procurement_plan_entries.dateadded ')))->result_array();
     $data['page_title'] = !empty($data['i']) ? 'Edit procurement initiation details' : 'Procurement initiation details';
     $data['current_menu'] = 'initiate_procurement';
     $data['view_to_load'] = 'procurement/initiate_procurement_form';
     $data['view_data']['form_title'] = $data['page_title'];
     $this->load->view('dashboard_v', $data);
 }
Пример #17
0
 function manage_classes()
 {
     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 the students
     $current_term_arr = current_term($this, $this->myschool['id']);
     $current_term_id = !empty($current_term_arr) ? $current_term_arr['id'] : 0;
     $data = paginate_list($this, $data, 'search_classes_register', array('isactive' => 'Y', 'term' => $current_term_id, 'school' => $this->myschool['id']));
     $data = add_msg_if_any($this, $data);
     $this->load->view('classes/manage_classes_view', $data);
 }
Пример #18
0
 function manage_borrowers()
 {
     access_control($this);
     $schooldetails = $this->session->userdata('schoolinfo');
     # 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 the returns
     $data = paginate_list($this, $data, 'get_return_list', array('isactive' => 'Y', 'searchstring' => ' b.school = ' . $schooldetails['id']));
     $data['returned'] = $data['page_list'];
     $data = paginate_list($this, $data, 'get_borrower_list', array('isactive' => 'Y', 'school' => $schooldetails['id'], 'searchstring' => '1'));
     $data['all'] = $data['page_list'];
     $data = add_msg_if_any($this, $data);
     $this->load->view('library/manage_returns_view', $data);
 }
Пример #19
0
 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);
 }
Пример #20
0
 function manage_help()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('s', 'i'));
     # Pick all assigned data
     $data = restore_bad_chars_in_array(assign_to_data($urldata));
     #Get the paginated list of the help items
     $data = paginate_list($this, $data, 'get_help_list', array('searchstring' => ''));
     $data = add_msg_if_any($this, $data);
     $this->load->view('help/manage_help_view', $data);
 }
Пример #21
0
 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);
 }
Пример #22
0
 function add_word()
 {
     access_control($this);
     # Get the passed details into the form data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('d'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     if (!empty($data['i']) || $this->input->post('editid')) {
         $editid = $this->input->post('editid') ? $this->input->post('editid') : decryptValue($data['i']);
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_word_by_id', array('wordid' => $editid));
         $data['formdata']['synonyms'] = explode(',', $data['formdata']['synonyms']);
         $data['formdata']['wordtype'] = $data['formdata']['type'];
         $data['i'] = encryptValue($editid);
     }
     if ($this->input->post('addword')) {
         $required_fields = array('word', 'wordtype');
         $_POST = clean_form_data($_POST);
         $validation_results = validate_form('', $_POST, $required_fields);
         if ($validation_results['bool']) {
             if (!empty($editid)) {
                 $result = $this->db->query($this->Query_reader->get_query_by_code('update_word_data', array('type' => $_POST['wordtype'], 'synonyms' => implode(",", $_POST['synonyms']), 'wordid' => $editid)));
             } else {
                 $result = $this->db->query($this->Query_reader->get_query_by_code('save_new_word', array('word' => htmlentities($_POST['word'], ENT_QUOTES), 'type' => $_POST['wordtype'], 'synonyms' => implode(",", $_POST['synonyms']))));
             }
             #Called from a popup
             #Show the appropriate message
             if ($result) {
                 $this->session->set_userdata('smsg', "The word data has been saved.");
                 $data['msg'] = "The word data has been saved.";
             } else {
                 $data['msg'] = "ERROR: The word data could not be saved.";
             }
         }
         if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
             $data['msg'] = "WARNING: The word data could not be saved because of some missing information.";
         }
         $this->session->set_userdata('wmsg', $data['msg']);
         redirect(base_url() . "search/manage_words/m/wmsg");
     }
     $data = add_msg_if_any($this, $data);
     $this->load->view('search/add_word', $data);
 }
Пример #23
0
 function manage_exams()
 {
     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 the students
     $data = paginate_list($this, $data, 'search_exams', array('searchstring' => ' AND isactive = "Y" AND school = ' . $this->myschool['id']));
     $data = add_msg_if_any($this, $data);
     $this->load->view('exams/manage_exams_view', $data);
 }
Пример #24
0
 function settings()
 {
     access_control($this);
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('i'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     #Get user settings
     $editid = $this->session->userdata('userid');
     if ($this->session->userdata('usertype') == 'SCHOOL') {
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_school_user_by_id', array('id' => $editid));
     } elseif ($this->session->userdata('usertype') == 'MSR') {
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_user_by_id', array('id' => $editid));
     }
     $data['isview'] = !empty($data['a']) && decryptValue($data['a']) == 'view' ? "Y" : "";
     if ($this->input->post('savesettings')) {
         $required_fields = array('firstname', 'lastname', 'address', 'emailaddress*EMAILFORMAT', 'telephone');
         $_POST = clean_form_data($_POST);
         $validation_results = validate_form('', $_POST, $required_fields);
         $update_string = '';
         #Only proceed if the validation for required fields passes
         if ($validation_results['bool']) {
             #Check if the password has been changed, is strong enough and the repeated value is the same
             if (!empty($_POST['password']) || !empty($_POST['repeatpassword'])) {
                 $passwordmsg = $this->user1->check_password_strength($_POST['password']);
                 if (!$passwordmsg['bool']) {
                     $data['msg'] = "WARNING: " . $passwordmsg['msg'];
                 } elseif ($_POST['password'] == $_POST['repeatpassword']) {
                     $update_string = ", password = '******'password']) . "'";
                 } else {
                     $data['msg'] = "WARNING: The passwords provided do not match.";
                 }
             }
             #Check if a new photo has been uploaded
             if (!empty($_FILES['imageurl']['tmp_name'])) {
                 $new_file_url = 'ac_' . strtotime('now') . generate_random_letter() . "." . end(explode('.', $_FILES['imageurl']['name']));
                 if (copy($_FILES['imageurl']['tmp_name'], UPLOAD_DIRECTORY . "users/" . $new_file_url)) {
                     #Create a thumb nail as well
                     $config['image_library'] = 'gd2';
                     $config['source_image'] = UPLOAD_DIRECTORY . "users/" . $new_file_url;
                     $config['create_thumb'] = TRUE;
                     $config['maintain_ratio'] = TRUE;
                     $config['width'] = 100;
                     $config['height'] = 80;
                     $this->load->library('image_lib', $config);
                     $this->image_lib->resize();
                     #Delete the previous image from the server if it exists
                     if (!empty($data['formdata']['photo'])) {
                         @unlink(UPLOAD_DIRECTORY . "users/" . $data['formdata']['photo']);
                     }
                     $update_string .= ',photo ="' . $new_file_url . '"';
                 }
             }
             #Update or Save the new form data
             if (empty($data['msg'])) {
                 if ($this->session->userdata('usertype') == 'SCHOOL') {
                     $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_school_user_data', array_merge(array('editid' => $editid, 'usertype' => $this->session->userdata('usertype'), 'usergroup' => $this->session->userdata('usergroup'), 'isschooladmin' => $this->session->userdata('isschooladmin'), 'updatecond' => $update_string), $_POST)));
                 } elseif ($this->session->userdata('usertype') == 'MSR') {
                     $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_user_data', array('editid' => $editid, 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'middlename' => $_POST['middlename'], 'addressline1' => $_POST['addressline1'], 'emailaddress' => $_POST['emailaddress'], 'telephone' => $_POST['telephone'], 'usertype' => $this->session->userdata('usertype'), 'isadmin' => $_POST['isadmin'], 'updatecond' => $update_string)));
                 }
                 $msg = !empty($save_result) && $save_result ? "Your settings have been saved." : "ERROR: Your settings were not saved.";
                 $this->session->set_userdata('sres', $msg);
                 redirect($this->user1->get_dashboard() . "/m/sres");
             }
         }
         #VALIDATION end
         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'];
         $data['formdata'] = $_POST;
     }
     if (empty($data['formdata'])) {
         $this->session->set_userdata('suser', "ERROR: Your settings could not be resolved.");
         redirect($this->user1->get_dashboard() . "/m/suser");
     }
     $data = add_msg_if_any($this, $data);
     $this->load->view('admin/settings_view', $data);
 }
Пример #25
0
 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);
 }
Пример #26
0
 function terms_and_conditions()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('m', 's'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     $data = add_msg_if_any($this, $data);
     $this->load->view('incl/terms_and_conditions_view', $data);
 }
Пример #27
0
 function manage_miscelleneous()
 {
     access_control($this);
     $schooldetails = $this->session->userdata('schoolinfo');
     # 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 the deals
     $data = paginate_list($this, $data, 'get_miscelleneous_list', array('isactive' => 'Y', 'searchstring' => '1'));
     $data = add_msg_if_any($this, $data);
     $this->load->view('students/manage_miscelleneous_view', $data);
 }
Пример #28
0
 function view_actual_image()
 {
     # Get the passed details into the url data array if any
     $urldata = $this->uri->uri_to_assoc(3, array('u', 'f'));
     # Pick all assigned data
     $data = assign_to_data($urldata);
     #the folder
     if (!empty($data['f'])) {
         $data['folder'] = decryptValue($data['f']);
     } else {
         $data['folder'] = "documents";
     }
     #the file url
     if (empty($data['u'])) {
         $data['msg'] = "WARNING: The image details can not be resolved.";
     } else {
         $data['fileurl'] = decryptValue($data['u']);
     }
     $data['area'] = 'actual_image';
     $data = add_msg_if_any($this, $data);
     $this->load->view('incl/addons', $data);
 }
Пример #29
0
 function add_organization()
 {
     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);
     $this->session->set_userdata('local_allowed_extensions', array('.jpg', '.jpeg', '.gif', '.png', '.tiff', '.bmp'));
     if (!empty($data['i'])) {
         $data['formdata'] = $this->Query_reader->get_row_as_array('get_organization_by_id', array('id' => decryptValue($data['i'])));
         $data['isview'] = !empty($data['a']) && decryptValue($data['a']) == 'view' ? "Y" : "";
     }
     #Save the document details
     if ($this->input->post('saveorgn')) {
         $required_fields = array('organizationname', 'datestarted', 'contactperson', 'contactemail*EMAILFORMAT', 'contactphone', 'contactaddressline1', 'contactcity', 'contactzipcode', 'contactstate');
         $_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']) {
             $_POST['datestarted'] = empty($_POST['datestarted']) ? "" : date('Y-m-d', strtotime($_POST['datestarted']));
             $_POST['logourl'] = !empty($_FILES['logourl']['name']) ? $this->sysfile->local_file_upload($_FILES['logourl'], 'Upload_' . strtotime('now'), 'images', 'filename') : '';
             $_POST['iconurl'] = !empty($_FILES['iconurl']['name']) ? $this->sysfile->local_file_upload($_FILES['iconurl'], 'iUpload_' . strtotime('now'), 'images', 'filename') : '';
             #Use the old versions if no new ones are entered
             $_POST['logourl'] = empty($_POST['logourl']) && !empty($data['formdata']['logourl']) ? $data['formdata']['logourl'] : $_POST['logourl'];
             $_POST['iconurl'] = empty($_POST['iconurl']) && !empty($data['formdata']['iconurl']) ? $data['formdata']['iconurl'] : $_POST['iconurl'];
             #First remove the document record and file from the system
             if (!empty($data['formdata']) && !empty($data['i'])) {
                 $save_result = $this->db->query($this->Query_reader->get_query_by_code('update_organization', array_merge($_POST, array('editid' => decryptValue($data['i'])))));
             } else {
                 $save_result = $this->db->query($this->Query_reader->get_query_by_code('save_new_organization', $_POST));
             }
             $data['msg'] = $save_result ? "The organization has been saved." : "ERROR: The organization was not saved. Please contact your administrator.";
             $this->session->set_userdata('sres', $data['msg']);
             redirect(base_url() . "user/manage_organizations/m/sres");
         }
         #VALIDATION end
         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'];
         $data['formdata'] = $_POST;
     }
     $data = add_msg_if_any($this, $data);
     $this->load->view('user/add_organization_view', $data);
 }
Пример #30
0
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);   
      
         }



}