function load_form() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(4, array('action', 'container_id')); $data = assign_to_data($urldata); # User is editing if ($urldata['container_id'] !== FALSE) { $data['container_id'] = $urldata['container_id']; $data['companycargodetails'] = $this->Query_reader->get_row_as_array('pick_container_by_id', array('container_id' => $urldata['container_id'])); } $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $data['id'] = $id; $query = $this->Query_reader->get_query_by_code('pick_all_containers', array('company_id' => $id)); $result = $this->db->query($query); $data['returned'] = $result->num_rows(); $data['cargo_array'] = $result->result_array(); $ctr = 0; foreach ($result->result_array() as $no_of_bids) { $bids_result = $this->db->query('SELECT * FROM bid_replies where bid_request_id = (select bid_request_id from bid_requests where container_id =' . $no_of_bids['container_id'] . ')'); $data['cargo_array'][$ctr]['bids'] = $bids_result->num_rows(); $ctr = $ctr + 1; } $data['curPage'] = 'company'; $this->load->view('userprofile/cargo', $data); }
function save_company() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(4, array('company_id')); # Pick all assigned data $data = assign_to_data($urldata); $old_company_details = $this->Query_reader->get_row_as_array('pick_company_by_id', array('company_id' => $urldata['company_id'])); # Display appropriate message based on the results if (($this->input->post('saveandnew') || $this->input->post('save')) && $this->process_form_data($urldata, $_POST, 'save')) { # Load view base on where the user wants to go if ($this->input->post('saveandnew')) { $view_to_load = 'userprofile/register'; } $data['msg'] = "The company data was successfully saved."; } else { # For each error to be displayed as an error, it should start with "ERROR:" $data['msg'] = "ERROR: The company data was not saved or may not be saved correctly. Please contact your administrator."; # Check if error is because company email already exists if ($urldata['company_id'] === FALSE) { $data['msg'] .= $this->Control_check->check_if_already_exists('pick_company_by_email', array('emailaddress' => $_POST['emailaddress'])); } } if (!isset($view_to_load)) { $query = $this->Query_reader->get_query_by_code('pick_company_info', array()); $result = $this->db->query($query); $data['company_details'] = $result->result_array(); $view_to_load = 'userprofile/register'; } $data['userdetails'] = $this->session->userdata('alluserdata'); $this->load->view($view_to_load, $data); }
function manage_drivers() { security($this, 'isadmin'); $urldata = $this->uri->uri_to_assoc(4, array('action')); $data = assign_to_data($urldata); $this->load->view('userprofile/drivers', $data); }
function save_step1() { security($this); $urldata = $this->uri->uri_to_assoc(4, array('m', 'action')); $data = assign_to_data($urldata); # If a file has been uploaded, and there are no errors process it before continuing if (trim($_FILES['cashierphoto']['name']) != '' && $_FILES['cashierphoto']['error'] == '' && $this->input->post('editid')) { #The file name $file_stamp = 'cashierphoto' . $_POST['editid']; # Upload the file and return the results of the upload $processing_results = $this->acravfile->perfom_file_upload($this->libfileobj, $_FILES['cashierphoto'], $file_stamp, UPLOAD_DIRECTORY, $this->session->userdata('local_allowed_extensions')); $_FILES['cashierphoto']['error'] = $processing_results['errors']; # Will be saved in the database as the event's document file name $_POST['cashierphoto'] = $processing_results['filename']; } # Display appropriate message based on the results if ($this->input->post('save') && $this->process_form_data($urldata, $_POST, 'save')) { $data['msg'] = "The payment data was successfully saved."; } else { # For each error to be displayed as an error, it should start with "ERROR:" $data['msg'] = "ERROR: The payment data was not saved or may not be saved correctly. Please contact your administrator."; } $data['action'] = 'view'; $data['id'] = $this->input->post('editid'); # User is updating the company payment data if (isset($data['id'])) { $data['paymentdetails'] = $this->Query_reader->get_row_as_array('pick_payment_by_company_id', array('companyid' => $data['id'])); } $this->load->view('companyprofile/managepayments', $data); }
function load_form() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(5, array('action', 'bid_id')); $data = assign_to_data($urldata); # User is editing if ($this->uri->segment(5)) { #get bid_request_id $validate = serialize(array($this->uri->segment(5))); $hmac = hash_hmac('sha1', $validate, 'AC101'); if ($hmac != $this->uri->segment(4)) { show_404('error_404', $data); } $this->db->where('bid_request_id', $this->uri->segment(5)); $sqlresult = $this->db->get('bid_requests'); $data['returned'] = $sqlresult->num_rows(); $data['biddetails'] = array_shift($sqlresult->result_array()); } #user session data $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $data['id'] = $id; $this->db->where('to_employee', $data['userdetails']['userid']); $this->db->where('has_read', '0'); $notices = $this->db->get('notice_details'); $data['count_notices'] = $notices->num_rows(); $data['notice_details'] = $notices->result_array(); $data['curPage'] = 'bids'; $this->load->view('userjobs/invitebids', $data); }
function send_cron_mail() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(4, array('type')); # Pick all assigned data $data = assign_to_data($urldata); if (isset($data['type'])) { #The daily audit trail email if ($data['type'] == 'help') { $data['thedate'] = date('Y-m-d', strtotime('yesterday')); $query = $this->Query_reader->get_query_by_code('search_help_table', array('searchfield' => 'content', 'phrase' => 'topic')); $result = $this->db->query($query); $data['searchdata'] = $result->result_array(); $data['section_name'] = 'search help'; if ($result) { #Email specs $data['subject'] = "Help for " . $data['thedate']; $data['msg_header'] = "Below is the system help for " . $data['thedate']; $data['send_from'] = '*****@*****.**'; $data['from_email_name'] = SITE_TITLE; $data['send_to'] = SITE_ADMIN_MAILID; $data['auto_gen'] = 'Y'; $data['area'] = 'searchhelp'; $data['send_action'] = 'searchhelp'; $this->load->view('incl/addons', $data); } } #TODO: Add other email functions here if (!$result) { echo format_notice("ERROR: An error occured while sending the " . $data['section_name'] . " notifications."); } } else { echo format_notice("ERROR: No email type was specified."); } }
function load_form() { security($this); $urldata = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); $myid['ourid'] = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); $data = assign_to_data($urldata); $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; # User is editing if ($urldata['truck_id']) { $data['companytruckdetails'] = $this->Query_reader->get_row_as_array('pick_truck_by_id', array('truck_id' => $urldata['truck_id'])); } $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $query = $this->Query_reader->get_query_by_code('pick_all_trucks', array('company_id' => $id)); $result = $this->db->query($query); $data['returned'] = $result->num_rows(); $data['truck_array'] = $result->result_array(); $query2 = $this->Query_reader->get_query_by_code('pick_drivers_by_company_id', array('companyid' => $id)); $result2 = $this->db->query($query2); $data['returned'] = $result2->num_rows(); $data['companydriverdetails'] = $result2->result_array(); $data['curPage'] = 'company'; // notices $this->db->where('to_employee', $data['userdetails']['userid']); $this->db->where('has_read', '0'); $notices = $this->db->get('notice_details'); $data['count_notices'] = $notices->num_rows(); $data['notice_details'] = $notices->result_array(); $data['service'] = $this->reminder->get_reminders(); $data['insurance'] = $this->reminder->insurance_reminder(); $data['license'] = $this->reminder->license_reminder(); $this->load->view('userprofile/assign_truck', $data); }
function index() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(4, array('action')); # Pick all assigned data $data = assign_to_data($urldata); $data['userdetails'] = $this->session->userdata('alluserdata'); $this->load->view('settings/backupform_view', $data); }
function update_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', 'a', 't')); # Pick all assigned data $data = assign_to_data($urldata); $data = restore_bad_chars($data); if ($data['save']) { $data['schooldetails'] = $data; $required_fields = array('schoolname', 'emailaddress', 'telephone'); $_POST = clean_form_data($data); $validation_results = validate_form('', $_POST, $required_fields); $classname_error = ''; $rank_error = ''; #set status as editing on destination if updating if ($this->input->post('editid')) { $data['editid'] = $_POST['editid']; } #Only proceed if the validation for required fields passes if ($validation_results['bool'] && !(empty($data['editid']) && !empty($user_details))) { #Update school info $result = $this->db->query($this->Query_reader->get_query_by_code('user_update_school_data', array_merge($_POST, array('editid' => $this->myschool['id'])))); $data['schooldetails'] = $this->Query_reader->get_row_as_array('search_schools_list', array('limittext' => '', 'searchstring' => ' AND id = ' . $this->myschool['id'])); #Format and send the errors if (!empty($result) && $result) { $data['msg'] = "The school data has been successfully saved."; #Copy school badge to designated folder if (!empty($_POST['photo'])) { $copy_image_result = copy(UPLOAD_DIRECTORY . "temp/" . $_POST['photo'], UPLOAD_DIRECTORY . "schools/" . $_POST['photo']); #copy the thumb_nail as well $thumb_nail_ext = end(explode('.', $_POST['photo'])); $copy_image_thumb_result = copy(UPLOAD_DIRECTORY . "temp/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo']), UPLOAD_DIRECTORY . "schools/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo'])); if (!$copy_image_result && !$copy_image_thumb_result) { $data['msg'] = 'WARNING: ' & $data['msg'] . '<br />' . 'An error occured while saving the school badge'; } else { @unlink(UPLOAD_DIRECTORY . "temp/" . $_POST['photo']); @unlink(UPLOAD_DIRECTORY . "temp/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo'])); } } } else { if (empty($data['msg'])) { $data['msg'] = "ERROR: The school data could not be saved or was not saved correctly." . $classname_error . $rank_error; } } } 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']; } $this->load->view('schoolinfo/school_info_view', $data); }
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); }
function save_employee() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(4, array('id')); # Pick all assigned data $data = assign_to_data($urldata); $old_employee_details = $this->Query_reader->get_row_as_array('pick_employee_by_id', array('id' => $urldata['id'])); # Display appropriate message based on the results if (($this->input->post('saveandnew') || $this->input->post('save')) && $this->process_form_data($urldata, $_POST, 'save')) { # Load view base on where the user wants to go if ($this->input->post('saveandnew')) { $view_to_load = 'settings/createemployee_view'; } $data['msg'] = "The employee data was successfully saved."; if (isset($urldata['user'])) { $data['msg'] .= '<br>You will need to log out and log in again to use your profile changes.'; } if (isset($_POST['oldpassword']) && md5($_POST['oldpassword']) != $old_employee_details['password'] && trim($_POST['password']) != '') { $data['msg'] .= '<br>However, the password was not updated because it doesnt match that in the system records.'; } } else { # For each error to be displayed as an error, it should start with "ERROR:" $data['msg'] = "ERROR: The employee data was not saved or may not be saved correctly. Please contact your administrator."; # Check if error is because employee already exists if ($urldata['id'] === FALSE) { $data['msg'] .= $this->Control_check->check_if_already_exists('double_check_employee', $_POST); } # Check if error is because employee was changing their password and old password doesnt match if ($urldata['id'] !== FALSE && isset($urldata['user'])) { if (trim($_POST['password']) == '') { $data['msg'] .= '<br>DETAILS: The new password is not provided.'; } else { $data['msg'] .= '<br>DETAILS: Previous password provided does not match that in the system records.'; } } } if (!isset($view_to_load)) { $query = $this->Query_reader->get_query_by_code('pick_employees', array('companyid' => $this->userdata['companyid'])); $result = $this->db->query($query); $data['employee_result'] = $result->result_array(); $view_to_load = 'settings/employees_view'; } # If non-admin user is making changes to their profile if (isset($_POST['oldpassword'])) { $data['employeedetails'] = $this->Query_reader->get_row_as_array('pick_employee_by_id', array('id' => $urldata['id'])); $view_to_load = 'settings/createemployee_view'; } $data['userdetails'] = $this->session->userdata('alluserdata'); $this->load->view($view_to_load, $data); }
function load_form() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(5, array('action', 'bid_id')); $data = assign_to_data($urldata); # User is editing if ($this->uri->segment(4)) { $this->db->where('bid_request_id', $this->uri->segment(4)); $sqlresult = $this->db->get('bid_requests'); $data['returned'] = $sqlresult->num_rows(); $data['biddetails'] = array_shift($sqlresult->result_array()); } #user session data $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $data['id'] = $id; $this->load->view('userjobs/invitebids', $data); }
function load_form() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(4, array('id', 'ispop', 'layername')); # Pick all assigned data $data = assign_to_data($urldata); # User is editing if ($urldata['id'] !== FALSE && $urldata['id'] != '') { $data['jobdetails'] = $this->Query_reader->get_row_as_array('pick_jobcategory_by_id', array('id' => $urldata['id'])); } if ($urldata['ispop'] !== FALSE) { $view_to_load = 'incl/addons'; $data['area'] = 'searchdetails'; } else { $view_to_load = 'settings/createjob_view'; } $data['userdetails'] = $this->session->userdata('alluserdata'); $this->load->view($view_to_load, $data); }
function load_form() { # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(4, array('action', 'container_id')); $data = assign_to_data($urldata); # User is editing if ($urldata['container_id'] !== FALSE) { $data['container_id'] = $urldata['container_id']; $data['companycargodetails'] = $this->Query_reader->get_row_as_array('pick_container_by_id', array('container_id' => $urldata['container_id'])); } $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $data['id'] = $id; $query = $this->Query_reader->get_query_by_code('pick_all_containers', array('company_id' => $id)); $result = $this->db->query($query); $data['returned'] = $result->num_rows(); $data['cargo_array'] = $result->result_array(); $this->load->view('userprofile/cargo', $data); }
function save_step1() { security($this); $urldata = $this->uri->uri_to_assoc(4, array('m', 'action')); $data = assign_to_data($urldata); $_POST['dateestablished'] = changeDateFromPageToMySQLFormat($_POST['startyear'] . "-" . $_POST['startmonth'] . "-" . $_POST['startday']); # If a file has been uploaded, and there are no errors process it before continuing if (trim($_FILES['companylogo']['name']) != '' && $_FILES['companylogo']['error'] == '' && $this->input->post('editid')) { #The file name $file_stamp = 'companylogo_' . $_POST['editid']; # Upload the file and return the results of the upload $processing_results = $this->acravfile->perfom_file_upload($this->libfileobj, $_FILES['companylogo'], $file_stamp, UPLOAD_DIRECTORY, $this->session->userdata('local_allowed_extensions')); $_FILES['companylogo']['error'] = $processing_results['errors']; # Will be saved in the database as the event's document file name $_POST['companylogo'] = $processing_results['filename']; } # Display appropriate message based on the results if ($this->input->post('save') && (isset($_FILES['companylogo']['error']) && $_FILES['companylogo']['error'] == "" || !isset($_POST['companylogo'])) && $this->process_form_data($urldata, $_POST, 'save')) { $data['msg'] = "The company data was successfully saved."; } else { # For each error to be displayed as an error, it should start with "ERROR:" $data['msg'] = "ERROR: The company data was not saved or may not be saved correctly. Please contact your administrator."; } $data['action'] = 'view'; $data['id'] = $this->input->post('editid'); # User is updating the company profile if (isset($data['id'])) { $data['companydetails'] = $this->Query_reader->get_row_as_array('pick_company_and_user_by_id', array('companyid' => $data['id'])); } $data['curPage'] = 'company'; // notices $this->db->where('to_employee', $data['userdetails']['userid']); $this->db->where('has_read', '0'); $notices = $this->db->get('notice_details'); $data['count_notices'] = $notices->num_rows(); $data['notice_details'] = $notices->result_array(); $data['service'] = $this->reminder->get_reminders(); $data['insurance'] = $this->reminder->insurance_reminder(); $data['license'] = $this->reminder->license_reminder(); $this->load->view('companyprofile/managecompany', $data); }
function view_all_notifications() { # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m')); # Pick all assigned data $data = assign_to_data($urldata); #print_r($data); exit(); $level = $data['level']; if (empty($level)) { $level = 'all'; } # print_r($level); exit(); $userid = base64_decode($data['member']); $data = $this->notification->fetch_notifications($userid, 0, $data, $level); $data['switch'] = 'notifications'; $data['page_title'] = 'Notifications '; $data['current_menu'] = 'user-information'; $data['view_to_load'] = 'notifications/notifications_v'; $data['tabtitle'] = 'All Notifications'; $this->load->view('dashboard_v', $data); }
function load_form() { // Get id for truck updated $truckid = $this->session->userdata('sess_id'); # Get the passed details into the form data array if any $urldata = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); security($this); $this->session->set_userdata('local_allowed_extensions', '.gif,.png,.jpeg,.jpg'); $this->session->set_userdata('local_max_file_size', 1000000); $myid['ourid'] = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); $data = assign_to_data($urldata); $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; # User is editing if ($urldata['truck_id']) { $data['truck_id'] = $urldata['truck_id']; $data['companytruckdetails'] = $this->Query_reader->get_row_as_array('pick_truck_by_id', array('truck_id' => $urldata['truck_id'])); $data['start'] = $urldata['truck_id']; $truckid = $data['start']; $this->session->set_userdata('sess_id', '' . $truckid . ''); //echo $this->session->userdata('sess_id'); $truck['truck'] = $this->session->userdata('sess_id'); //echo $data['start']; //$urldata['truck_id']; $current_tracker = $this->db->query('SELECT id, label, status FROM trackers WHERE id = "' . $data['companytruckdetails']['trackerId'] . '"'); $data['companytruckdetails']['currentTracker'] = $current_tracker->row(); } $trackers = $this->db->query('SELECT label, id, status FROM trackers WHERE companyId = "' . $id . '" AND id NOT IN(SELECT trackerId FROM trucks WHERE company_id ="' . $id . '" AND trackerId >0 )'); $data['trackers'] = $trackers->result_array(); $data['id'] = $id; // $query = $this->Query_reader->get_query_by_code('join_truck_driver', array('company_id'=>$id)); $data['truck'] = $this->session->userdata('sess_id'); $result = $this->db->query('SELECT drivers.company_id,drivers.fname,drivers.lname ,trucks.regnumber,trucks.company_id,drivers.driver_id,trucks.truck_id FROM drivers RIGHT OUTER JOIN trucks ON drivers.driver_id = trucks.driver_id WHERE trucks.company_id = "' . $id . '"'); $data['returned'] = $result->num_rows(); $data['truck_array'] = $result->result_array(); $this->load->view('userprofile/trucks', $data); }
public function register_user_account() { #$data = filter_forwarded_data($this); #check_access($this, 'add_new_school'); $urldata = $this->uri->uri_to_assoc(3, array('m', 'p')); # Pick all assigned data $data = assign_to_data($urldata); #When creating new Account if (isset($_POST['register_account'])) { $data = $this->account->new_account(); if (!empty($data['ERROR'])) { echo $data['ERROR']; $this->load->view('account/register', $data); } elseif ($data['SUCCESS']) { redirect('registration/register_school_account'); //redirect("register_school_account"); } //print_r($result); } else { #load acouunt register form :: $this->load->view('account/register'); } }
function load_form() { $urldata = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); $myid['ourid'] = $this->uri->uri_to_assoc(4, array('action', 'truck_id')); $data = assign_to_data($urldata); $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; # User is editing if ($urldata['truck_id']) { $data['companytruckdetails'] = $this->Query_reader->get_row_as_array('pick_truck_by_id', array('truck_id' => $urldata['truck_id'])); } $data['userdetails'] = $this->session->userdata('alluserdata'); $id = $data['userdetails']['companyid']; $query = $this->Query_reader->get_query_by_code('pick_all_trucks', array('company_id' => $id)); $result = $this->db->query($query); $data['returned'] = $result->num_rows(); $data['truck_array'] = $result->result_array(); $query2 = $this->Query_reader->get_query_by_code('pick_drivers_by_company_id', array('companyid' => $id)); $result2 = $this->db->query($query2); $data['returned'] = $result2->num_rows(); $data['companydriverdetails'] = $result2->result_array(); $this->load->view('userprofile/assign_truck', $data); }
function load_pdetype_form() { 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', 'a')); # Pick all assigned data $data = assign_to_data($urldata); #Get access groups $accessGroupsResult = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array())); // $data['pdetypes'] = $this-> Pdetypes_m -> fetchpdetypes($status='Y'); $data['usergroups'] = $this->Usergroups_m->fetchusergroups(); $data['users'] = $this->users_m->fetchusers(); // users_m #form type $data['formtype'] = 'insert'; $data['page_title'] = 'New PDE '; $data['current_menu'] = 'add_pdetype'; $data['view_data']['form_title'] = $data['page_title']; $data['view_to_load'] = 'pde/pdetype_form_v'; $this->load->view('dashboard_v', $data); }
function delete_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', 't')); # Pick all assigned data $data = assign_to_data($urldata); if (!empty($data['i'])) { $result = deactivate_row($this, 'schoolusers', decryptValue($data['i'])); } if (!empty($result) && $result) { $data['msg'] = "The user data has been successfully deleted."; } else { if (empty($data['msg'])) { $data['msg'] = "ERROR: The user could not be deleted or was not deleted correctly."; } } if (!empty($data['t']) && $data['t'] == 'super') { $tstr = "/t/super"; } else { $tstr = ""; } }
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 delete_miscelleneous() { 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); $save_result = $this->db->query($this->Query_reader->get_query_by_code('delete_row', array('tname' => "miscelleneous", 'id' => decryptValue($data['i'])))); if ($save_result) { $data['msg'] = "The item has been deleted."; //die($data['msg']); $this->session->set_userdata('sres', $data['msg']); redirect(base_url() . "students/manage_miscelleneous/m/sres"); } else { $data['msg'] = "ERROR: The item was not deleted. Please contact your administrator."; die($data['msg']); } }
function delete_word() { access_control($this, array('admin')); # 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'])) { $result = $this->db->query($this->Query_reader->get_query_by_code('delete_word_by_id', array('id' => decryptValue($data['i'])))); } if (!empty($result) && $result) { $msg = "The word has been removed."; } else { $msg = "ERROR: There were problems removing the word."; } $this->session->set_userdata('dmsg', $msg); redirect(base_url() . "search/manage_words/m/dmsg"); }
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 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); }
function register() { $urldata = $this->uri->uri_to_assoc(3, array('m', 'ans')); $data = assign_to_data($urldata); if (isset($data['m']) && $data['ans'] == 'Y') { $data['msg'] = "The email containing your confirmation link has been sent. Please click on the link in the email to login."; } else { if (isset($data['m']) && $data['ans'] == 'N') { $data['msg'] = "ERROR: The email not sent or may not be sent properly. Please try again or <a href='#' class='message'>contact us</a>."; } } $this->load->view('companyprofile/register', $data); }
function update_photo_status() { # 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); if (!empty($data['i'])) { #Delete an image if (!empty($data['a']) && decryptValue($data['a']) == 'delete') { $result = $this->db->query($this->Query_reader->get_query_by_code('delete_image', array('id' => decryptValue($data['i'])))); } #Activate an image if (!empty($data['a']) && decryptValue($data['a']) == 'activate') { $result = $this->db->query($this->Query_reader->get_query_by_code('activate_image', array('status' => 'Y', 'id' => decryptValue($data['i'])))); } #Deactivate an image if (!empty($data['a']) && decryptValue($data['a']) == 'deactivate') { $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_image', array('status' => 'N', 'id' => decryptValue($data['i'])))); } } #Prepare appropriate message if (!empty($result) && $result) { $msg = "The photo has been " . decryptValue($data['a']) . "d."; } else { $msg = "ERROR: The photo could not be " . decryptValue($data['a']) . "d. Please contact your admin."; } $this->session->set_userdata('lmsg', $msg); redirect(base_url() . "photo/album/m/lmsg/i/" . $data['i']); }
function delproviders_ajax() { $urldata = $this->uri->uri_to_assoc(3, array('m', 'i')); # Pick all assigned data $data = assign_to_data($urldata); print_r($data); check_user_access($this, 'del_provider', 'redirect'); //check_user_access($this, 'del_receipts', 'redirect'); $deltype = $this->uri->segment(3); $receiptid = $this->uri->segment(4); $result = $this->Remoteapi_m->remove_restore_provider($deltype, $data['archive']); echo $result; }
function delete_sponsor() { access_control($this); # Get the passed details into the url data array if any $urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't')); # Pick all assigned data $data = assign_to_data($urldata); if (!empty($data['i'])) { $result = deactivate_row($this, 'exams', decryptValue($data['i'])); } if (!empty($result) && $result) { $this->session->set_userdata('dexam', "The exam data has been successfully deleted."); } else { if (empty($data['msg'])) { $this->session->set_userdata('dexam', "ERROR: The exam could not be deleted or was not deleted correctly."); } } if (!empty($data['t']) && $data['t'] == 'super') { $tstr = "/t/super"; } else { $tstr = ""; } redirect("sponsors/manage_exams/m/dexam" . $tstr); }