当前位置: 首页>>代码示例>>PHP>>正文


PHP assign_to_data函数代码示例

本文整理汇总了PHP中assign_to_data函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_to_data函数的具体用法?PHP assign_to_data怎么用?PHP assign_to_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assign_to_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_form

    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);
    }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:28,代码来源:companycargo.php

示例2: save_company

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:31,代码来源:companyprofile.php

示例3: manage_drivers

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:7,代码来源:companydrivers.php

示例4: save_step1

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:30,代码来源:payments.php

示例5: load_form

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:30,代码来源:invitebids.php

示例6: send_cron_mail

 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'] = 'admin@acrav.com';
                 $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.");
     }
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:35,代码来源:cronmail.php

示例7: load_form

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:34,代码来源:assign_driver.php

示例8: index

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:9,代码来源:dbbackup.php

示例9: update_school_info

 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);
 }
开发者ID:nwtug,项目名称:academia,代码行数:53,代码来源:schoolinfo.php

示例10: manage_settings

 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);
 }
开发者ID:nwtug,项目名称:academia,代码行数:12,代码来源:schoolsettings.php

示例11: save_employee

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:50,代码来源:employees.php

示例12: load_form

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:18,代码来源:invitebids.php

示例13: load_form

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:19,代码来源:jobcategories.php

示例14: load_form

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:19,代码来源:companycargo.php

示例15: save_step1

 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);
 }
开发者ID:Bakyenga,项目名称:kyengs,代码行数:41,代码来源:profile.php


注:本文中的assign_to_data函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。