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


PHP set_message函数代码示例

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


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

示例1: send_image_to_client

function send_image_to_client($image_name, $file_alloweds = false)
{
    // $model->screen_model->get_db();
    $ci =& get_instance();
    $session_user = unserialize(get_logged_user());
    // dump($session_user);
    // dump($_FILES[$image_name]);
    $file_name = md5(date("d_m_Y_H_m_s_u")) . "_" . str_replace(" ", "_", stripAccents($_FILES[$image_name]['name']));
    // $file_name = md5(date("Ymds"));
    $filename = $_FILES[$image_name]['tmp_name'];
    $handle = fopen($filename, "r");
    $data = fread($handle, filesize($filename));
    $POST_DATA = array('file' => base64_encode($data), 'name' => $file_name);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $session_user->upload_path . "upload.php");
    curl_setopt($curl, CURLOPT_TIMEOUT, 30);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $POST_DATA);
    curl_setopt($curl, CURLOPT_HEADER, true);
    $response = curl_exec($curl);
    $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    curl_close($curl);
    if ($httpCode != 200) {
        set_message("Erro ao publicar foto: <br/>" . $response, 2);
    }
    // dump($response);
    return $file_name;
}
开发者ID:caina,项目名称:pando,代码行数:29,代码来源:pando_helper.php

示例2: update_portfolio_event_handler

function update_portfolio_event_handler($values, $action)
{
    $portfolio = load_portfolio_array();
    $existing_record = portfolio_record_lookup($portfolio, $values["lookupSymbol"]);
    switch ($action) {
        case "buy":
            if (isset($existing_record)) {
                // Update existing record in portfolio
                $existing_record["quantity"] = $existing_record["quantity"] + $values["quantity"];
                $existing_record["price_paid"] = $values["lookupAsk"];
                save_portfolio($portfolio, $existing_record, $values["lookupSymbol"]);
            } else {
                // Set new record to portfolio
                $portfolio_record = array('symbol' => $values["lookupSymbol"], 'name' => $values["lookupName"], 'quantity' => $values["quantity"], 'price_paid' => $values["lookupAsk"]);
                save_portfolio($portfolio, $portfolio_record);
            }
            set_message(AlertType::Success, "You successfuly bought " . $values["quantity"] . " " . $values["lookupName"] . " shares.");
            break;
        case "sell":
            // Update existing record in portfolio
            $existing_record["quantity"] = $existing_record["quantity"] - $values["quantity"];
            save_portfolio($portfolio, $existing_record, $values["lookupSymbol"]);
            set_message(AlertType::Success, "You successfuly sold " . $values["quantity"] . " " . $values["lookupName"] . " shares.");
            break;
    }
}
开发者ID:epavlov,项目名称:stock-exchange-tool,代码行数:26,代码来源:portfolio_functions.php

示例3: view

 function view($uuid, $extra = null)
 {
     $data = array();
     $data['scene_data'] = $this->simiangrid->get_scene($uuid);
     if ($data['scene_data'] == null) {
         $data['scene_data'] = $this->simiangrid->get_scene_by_name($uuid);
         if ($data['scene_data'] != null) {
             $uuid = $data['scene_data']['SceneID'];
         } else {
             push_message(set_message('sg_region_unknown', $uuid), 'error');
             return redirect('region');
         }
     }
     $data['uuid'] = $uuid;
     $data['tab'] = '';
     if ($extra == "stats") {
         $data['tab'] = 'stats';
     } else {
         if ($extra == "admin_actions") {
             $data['tab'] = 'admin_actions';
         }
     }
     $this->_scene_extra_info($uuid, $data);
     $data['title'] = $data['scene_data']['Name'];
     $data['page'] = 'regions';
     $x = $data['scene_data']['MinPosition']['0'] / 256;
     $y = $data['scene_data']['MinPosition']['1'] / 256;
     $data['meta'] = generate_open_graph(site_url("region/view/{$uuid}"), $this->config->item('grid_name_short') . " region " . $data['scene_data']['Name'], $this->config->item('tile_host') . "map-1-{$x}-{$y}-objects.png", "simulator");
     parse_template('region/view', $data);
 }
开发者ID:QuillLittlefeather,项目名称:mgm-simiangrid,代码行数:30,代码来源:region.php

示例4: modify_constants

 private function modify_constants()
 {
     $res = FALSE;
     $constants = $this->constant_manager_model->get_all();
     foreach ($constants as $cons) {
         $key = $cons['constant_key'];
         //check if user has been deleted
         $delete_string = "delete_" . $key;
         $post_delete = $this->input->post($delete_string);
         if ($post_delete === "on") {
             $this->constant_manager_model->delete($key);
             $res = TRUE;
             continue;
         }
         $changed_string = "changed_" . $key;
         $post_changed = $this->input->post($changed_string);
         if ($post_changed !== "on") {
             continue;
         }
         $value_string = "value_" . $key;
         $post_value = $this->input->post($value_string);
         $value = trim($post_value);
         if ($value) {
             $this->constant_manager_model->set($key, $value);
             $res = TRUE;
         }
     }
     if ($res) {
         set_message($this->lang->line("modified_successfully"));
     }
     return redirect(get_link("admin_constant"));
 }
开发者ID:NaszvadiG,项目名称:BurgeCMF,代码行数:32,代码来源:AE_Constant.php

示例5: delete

 public function delete($id, $company_id = NULL)
 {
     $company_id = $company_id ? $company_id : $this->comp_id;
     $this->db->where('id', $id);
     $this->db->where('company_id', $company_id);
     $this->db->limit(1, 0);
     $this->db->delete('products');
     return $this->db->affected_rows() > 0 ? set_message($this->lang->line('db_deleted_record')) : set_message($this->lang->line('db_delete_error'));
 }
开发者ID:abdulmanan7,项目名称:stms,代码行数:9,代码来源:products_model.php

示例6: email_detail

 function email_detail($id)
 {
     $this->data["email"] = $this->email_model->get_email($id);
     if (!$this->email_model->is_mine()) {
         set_message("Email não encontrado");
         redirect(site_url("dashboard"));
     }
     $this->email_model->read_message($id);
     $this->load_view("../libraries/email/views/email_detail");
 }
开发者ID:caina,项目名称:pando,代码行数:10,代码来源:email.php

示例7: inativar

 function inativar($id)
 {
     if (!$this->financeiro_model->is_mine($id)) {
         set_message("Este cliente não lhe pertence", 2);
     } else {
         $data["status"] = 3;
         $this->financeiro_model->update_data($data);
     }
     redirect(site_url("act/financeiro/clientes/gerenciar"));
 }
开发者ID:caina,项目名称:pando,代码行数:10,代码来源:clientes.php

示例8: edit

 function edit($idx = false)
 {
     if ($idx != $this->my_logged_data['id']) {
         redirect("admin/error");
     }
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         //ion
         $user = $this->ion_auth->user($idx)->row();
         if ($_POST['image_name']) {
             $fix_name = "up_" . $idx . "_" . time() . substr($_POST['image_name'], strrpos($_POST['image_name'], "."));
             $tmp_name = $this->config->item('dir_tmp_pages_image') . $_POST['image_name'];
             $new_name = $this->config->item('dir_pages_image') . $fix_name;
             $avt_name = $this->config->item('dir_pages_image') . "avatar_" . $fix_name;
             if (file_exists($tmp_name)) {
                 if (copy($tmp_name, $new_name)) {
                     $headline_img = $fix_name;
                     $this->utils->imgThumbnail($this->config->item('dir_pages_image'), $fix_name, 74, 74, 'avatar_', 'resize');
                     unlink($tmp_name);
                     if ($_POST['image_name_old']) {
                         unlink($this->config->item('dir_pages_image') . $_POST['image_name_old']);
                         unlink($this->config->item('dir_pages_image') . "avatar_" . $_POST['image_name_old']);
                     }
                 }
             }
         }
         $_data["first_name"] = $_POST['first_name'];
         $_data["last_name"] = $_POST['last_name'];
         $_data["email"] = $_POST['email'];
         $_data["phone"] = $_POST['phone'];
         if ($_POST['password']) {
             $_data["password"] = $_POST['password'];
             $pass_change_msg = " Password changed..  (affected in next login)";
         }
         $ion_update = $this->ion_auth->update($user->id, $_data);
         //print_r($_data);
         //exit;
         //debug();
         //echo $update;
         if ($ion_update) {
             if ($headline_img) {
                 $avatar["image"] = $headline_img;
                 $update = $this->model->UpdateData($avatar, "id='" . $_POST['idx'] . "'");
             }
             set_message("success", "Profile Saved." . $pass_change_msg);
             redirect("admin/user_profile/edit/" . $_POST['idx'] . "?tab=1");
         }
     } else {
         $arrDB = $this->model->GetRecordData("id='{$idx}'");
         $data["data"] = $arrDB;
     }
     $data["acc_active"] = "content";
     $data["module"] = $this->module;
     $data_layout["content"] = $this->load->view("user_profile/edit", $data, true);
     $this->load->view($this->admin_layout, $data_layout);
 }
开发者ID:TrinataBhayanaka,项目名称:damkar,代码行数:55,代码来源:user_profile.php

示例9: delete

 public function delete($id)
 {
     if ($id > 0) {
         $this->db->where('id', $id);
         $this->db->limit(1, 0);
         $this->db->delete('tblpayment_methods');
         return $this->db->affected_rows() > 0 ? set_message($this->lang->line('db_deleted_record')) : set_message($this->lang->line('db_delete_error'));
     } else {
         return set_message($this->lang->line('db_correct_id'), 'info');
     }
 }
开发者ID:abdulmanan7,项目名称:stms,代码行数:11,代码来源:payment_method_model.php

示例10: auth_user

 function auth_user()
 {
     $ci =& get_instance();
     // getting the CI instance
     $auth = $ci->session->userdata('auth');
     if ($auth == 1) {
         return true;
     } else {
         set_message("You are not logged in.", $type = 'info');
         redirect('/');
     }
 }
开发者ID:francomaaanz,项目名称:learningci,代码行数:12,代码来源:global_helper.php

示例11: add_new_people

 function add_new_people($p_id = false)
 {
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
     $this->form_validation->set_rules('first_name', 'Name', 'required|min_length[1]|max_length[100]');
     $this->form_validation->set_rules('last_name', 'Name', 'required|min_length[1]|max_length[100]');
     $this->form_validation->set_rules('company_name', 'company name', 'min_length[1]|max_length[100]');
     $this->form_validation->set_rules('mobile', 'Mobile', 'regex_match[/^[0-9]{10}$/]');
     $this->form_validation->set_rules('email', 'Email', 'valid_email');
     $this->form_validation->set_rules('address1', 'Address', 'required|min_length[1]|max_length[200]');
     $this->form_validation->set_rules('city', 'city', 'required');
     if ($this->form_validation->run() == FALSE) {
         set_message(validation_errors());
         redirect_back();
         return 0;
     } else {
         $first_name = strtoupper($this->input->post('first_name'));
         $last_name = strtoupper($this->input->post('last_name'));
         $company_name = strtoupper($this->input->post('company_name'));
         $email = $this->input->post('email');
         $sec_email = $this->input->post('sec_email');
         $mobile = $this->input->post('mobile');
         $phone = $this->input->post('phone');
         $website = $this->input->post('website');
         $skype = $this->input->post('skype');
         $industry = $this->input->post('industry');
         $address1 = $this->input->post('address1');
         $address2 = $this->input->post('address2');
         $city = $this->input->post('city');
         $state = $this->input->post('state');
         $country = $this->input->post('country');
         $note = $this->input->post('note');
         if ($this->session->userdata('role') != 'admin') {
             $companyid = $this->session->userdata('companyid');
         } else {
             $companyid = $this->input->post('companyid');
         }
         $people_data = array('company_name' => $company_name, 'first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'sec_email' => $sec_email, 'mobile' => $mobile, 'phone' => $phone, 'website' => $website, 'skype' => $skype, 'industry' => $industry, 'address1' => $address1, 'address2' => $address2, 'city' => $city, 'state' => $state, 'country' => $country, 'note' => $note);
         if ($p_id) {
             $updated_at = date('Y-m-d H:i:s');
             $people_data['updated_at'] = $updated_at;
             $this->db->where('people_id', $p_id);
             $res = $this->db->update('people', $people_data);
             return $res;
         } else {
             $created_at = date('Y-m-d H:i:s');
             $people_data['created_at'] = $created_at;
             $this->db->insert('people', $people_data);
             $people_id = $this->db->insert_id();
             return $people_id;
         }
     }
 }
开发者ID:shripadv,项目名称:leadmgt,代码行数:53,代码来源:people_model.php

示例12: register

 function register()
 {
     $post_client = $this->input->post('client', TRUE);
     $post_sample = $this->input->post('samples', TRUE);
     if (empty($post_sample["client_id"])) {
         if ($this->client_model->create($post_client)) {
             $post_sample["client_id"] = $this->client_model->object->id;
         }
     }
     $this->amostra_model->create_or_edit($post_sample);
     set_message("Operação realizada com sucesso");
     redirect(site_url("act/amostras/amostra/index"));
 }
开发者ID:caina,项目名称:pando,代码行数:13,代码来源:amostra.php

示例13: delete_expense

 public function delete_expense($id)
 {
     // delete all expense by id
     $this->expense_model->_table_name = "tbl_expense";
     // table name
     $this->expense_model->_primary_key = "expense_id";
     // $id
     $this->expense_model->delete($id);
     $type = "success";
     $message = "Expense Information Successfully Delete!";
     set_message($type, $message);
     redirect('admin/expense/add_expense');
     //redirect page
 }
开发者ID:qumarr,项目名称:Project,代码行数:14,代码来源:expense.php

示例14: delete

 public function delete($id, $company_id = NULL)
 {
     $company_id = $company_id ? $company_id : $this->comp_id;
     if ($id > 0) {
         $this->db->where('id', $id);
         $this->db->where('is_system !=', '1');
         $this->db->where('company_id', $company_id);
         $this->db->limit(1, 0);
         $this->db->delete($this->table['name']);
         return $this->db->affected_rows() > 0 ? set_message($this->lang->line('db_deleted_record')) : set_message($this->lang->line('db_delete_error'));
     } else {
         return set_message($this->lang->line('db_delete_error'), 'info');
     }
 }
开发者ID:abdulmanan7,项目名称:stms,代码行数:14,代码来源:invoice_type_model.php

示例15: openid_check

function openid_check($ci, $callback_url, &$data)
{
    if (!isset($data)) {
        $data = array();
    }
    $ci->lang->load('openid');
    $ci->config->load('openid');
    $ci->openid->set_request_to($callback_url);
    $response = $ci->openid->getResponse();
    switch ($response->status) {
        case Auth_OpenID_CANCEL:
            push_message($ci->lang->line('openid_cancel'), 'error', $ci);
            break;
        case Auth_OpenID_FAILURE:
            push_message(set_message('openid_failure', $response->message), 'error', $ci);
            break;
        case Auth_OpenID_SUCCESS:
            $openid = $response->getDisplayIdentifier();
            $esc_identity = htmlspecialchars($openid, ENT_QUOTES);
            $data['openid_identifier'] = $openid;
            $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);
            $sreg = $sreg_resp->contents();
            $ax_resp = new Auth_OpenID_AX_FetchResponse();
            $ax = $ax_resp->fromSuccessResponse($response);
            if (isset($sreg['email'])) {
                $data['email'] = $sreg['email'];
            }
            if ($ax) {
                if (isset($ax->data['http://axschema.org/contact/email'])) {
                    $data['email'] = $ax->getSingle('http://axschema.org/contact/email');
                }
                if (isset($ax->data['http://axschema.org/namePerson/first'])) {
                    $first_name = $ax->getSingle('http://axschema.org/namePerson/first');
                } else {
                    $first_name = "Sample";
                }
                if (isset($ax->data['http://axschema.org/namePerson/last'])) {
                    $last_name = $ax->getSingle('http://axschema.org/namePerson/last');
                } else {
                    $last_name = "Avatar";
                }
                if ($first_name != null && $last_name != null) {
                    $data['username'] = "{$first_name} {$last_name}";
                }
            }
            return true;
    }
    return false;
}
开发者ID:QuillLittlefeather,项目名称:mgm-simiangrid,代码行数:49,代码来源:simian_openid_helper.php


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