• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: login_user

function login_user()
{
    if (isset($_POST['submit'])) {
        $username = escape_string($_POST['username']);
        $password = escape_string($_POST['password']);
        $query = query("SELECT * FROM user WHERE username = '{$username}' AND password = '{$password}'");
        confirm($query);
        if (mysqli_num_rows($query) == 0) {
            set_message("Contrasena y usuario no es valida.");
            redirect("index.php");
        } else {
            redirect("public/main.php");
        }
    }
}
开发者ID:kellzzlopez,项目名称:vallhallabar,代码行数:15,代码来源:functions.php


示例17: send

 public function send()
 {
     if ($_SERVER['REQUEST_METHOD'] == "POST") {
         $this->_valid();
         $this->load->model('contact_model');
         //die($message);
         $this->contact_model->save();
         $msg = set_message(json_decode(EMAIL_CONTACT_MESSAGE), 'txtConsult', 'sin codigo');
         $this->email->from($this->input->post('txtEmail'), $this->input->post('txtName'));
         $this->email->to(EMAIL_CONTACT_TO);
         $this->email->subject(EMAIL_CONTACT_SUBJECT);
         //$this->email->message(json_decode(EMAIL_CONTACT_MESSAGE), 'txtConsult', 'sin codigo');
         $this->email->message($msg);
         die(json_encode($this->email->send()));
     }
 }
开发者ID:jsuarez,项目名称:mydesignArg,代码行数:16,代码来源:contact.php


示例18: vincular_facebook

 function vincular_facebook()
 {
     $this->load->model("user_model");
     $data = $this->get_facebook_login_link();
     if (!empty($data["user_profile"])) {
         $data_ = array();
         $data_["name"] = $data["user_profile"]['name'];
         $data_["facebook_id"] = $data["user_profile"]['id'];
         $this->user_model->vinculate_facebook($data_);
         $this->user_model->login($user_insert->username, false, $data["user_profile"]['id']);
         set_message("Vinculado com sucesso");
     } else {
         set_message("Falha ao vincular", 2);
     }
     redirect(site_url("profile"));
 }
开发者ID:caina,项目名称:pando,代码行数:16,代码来源:profile.php


示例19: save_role

 function save_role()
 {
     if (check_if_post()) {
         $actual_string = $this->input->post('role-name');
         $role_name = preg_replace('/[^a-zA-Z0-9]/', '_', $actual_string);
         $role_name = strtolower($role_name);
         $this->load->model('rolepermission_m', 'rm');
         $role_added = $this->rm->add_new_role($actual_string, $role_name);
         if ($role_added) {
             set_message('Role added: ' . $actual_string);
         } else {
             set_message('Role already exist.');
         }
         redirect('rolepermission/role/add_role');
     }
 }
开发者ID:francomaaanz,项目名称:learningci,代码行数:16,代码来源:role.php


示例20: auth

 public function auth()
 {
     $user = $this->input->post("uid", true);
     $pass = $this->input->post("pwd", true);
     $user = $user ? $user : "";
     $pass = $pass ? $pass : "";
     set_flash("uid", $user);
     set_flash("pass", $pass);
     if (empty($user)) {
         set_message("error", "User Name tidak boleh kosong!!");
         redirect("login");
     }
     if (empty($pass)) {
         set_message("error", "Password tidak boleh kosong!!");
         redirect("login");
     }
     /*
     if(empty($cap)):
     	set_message("error","Isi captcha sesuai dengan gambar!!");
     	redirect("login");
     endif;
     */
     /*
     $code=$_SESSION["captcha"]["code"];
     if(strtolower($code)!=strtolower($cap)):
     	set_message("error","Isi captcha sesuai dengan gambar!!");
     	redirect("login");
     endif;
     */
     //$password = $this->ion_auth_model->hash_password($this->input->post('pwd'));
     $ret = $this->lauth->login($user, b64encode($pass));
     // $ret=$this->login_model->check_login($user,$pass);
     if ($ret) {
         // echo "asd";exit;
         session_regenerate_id();
         $userSess = $_SESSION[$this->lauth->appname]["userdata"]["user"];
         // pre($userSess);exit;
         //$_SESSION[$this->lauth->appname]["groupdata"]=$this->conn->GetRow("select * from b_tb_group where idx=".$_SESSION[$this->lauth->appname]["userdata"]["user"]["group_id"]);
         //$_SESSION[$this->lauth->appname]["leveldata"]=$this->conn->GetRow("select * from tb_user_level where kd_level=".$userSess["user_level_id"]);
     }
     if (!$this->lauth->logged_in()) {
         redirect("login");
     } else {
         redirect("admin/dashboard");
     }
 }
开发者ID:TrinataBhayanaka,项目名称:damkar,代码行数:46,代码来源:login.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_message_error函数代码示例发布时间:2022-05-15
下一篇:
PHP set_medias函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap