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


PHP CI::get_instance方法代码示例

本文整理汇总了PHP中CI::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP CI::get_instance方法的具体用法?PHP CI::get_instance怎么用?PHP CI::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CI的用法示例。


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

示例1: __construct

 /**
  *
  */
 function __construct()
 {
     date_default_timezone_set('Asia/Calcutta');
     $ci = CI::get_instance();
     $ci->load->Model('Email_settings/Mdl_email_settings');
     //load email settings model
     $smtp = $ci->Mdl_email_settings->toArray();
     //get object valeus in array
     $config = array();
     $config['protocol'] = 'smtp';
     $config['mailpath'] = '/usr/sbin/sendmail';
     $config['smtp_host'] = $smtp['smtp_host'];
     $config['smtp_pass'] = $smtp['smtp_pass'];
     // email's password    - set smtp values
     $config['smtp_user'] = $smtp['smtp_user'];
     $config['smtp_port'] = $smtp['smtp_port'];
     //gmail port 465 (ssl) and 587 (TSL) required
     $config['smtp_timeout'] = 10;
     //smtp timeout in seconds
     $config['wordwrap'] = TRUE;
     $config['wrapchars'] = 76;
     $config['mailtype'] = 'html';
     $config['charset'] = 'utf-8';
     $config['validate'] = TRUE;
     $config['priority'] = 3;
     $config['crif'] = "\r\n";
     $config['newline'] = "\r\n";
     $config['bcc_batch_mode'] = TRUE;
     $config['bcc_batch_size'] = 200;
     parent::__construct($config);
 }
开发者ID:nkscoder,项目名称:chawri,代码行数:34,代码来源:MY_Email.php

示例2: isGuest

function isGuest()
{
    $ci = CI::get_instance();
    if (checkSession()) {
        return strtolower($ci->session->userdata('user_data')['user_role_name']) == 'guest' ? true : false;
    }
    return false;
}
开发者ID:nkscoder,项目名称:chawri,代码行数:8,代码来源:utility_helper.php

示例3: subjectQuerySend

 public function subjectQuerySend()
 {
     $data = $this->input->post();
     $ci = CI::get_instance();
     /*
       echo $data['upload']; die();*/
     /*  $this->load->view('profile_quote',$data);*/
     $message = $this->load->view('other_subject_send', $data, TRUE);
     $config['upload_path'] = 'uploads/';
     $config['allowed_types'] = 'docx|pdf|ppt|doc|pptx|pdf|jpeg|png';
     $config['max_size'] = 5000;
     $config['encrypt_name'] = TRUE;
     $this->upload->initialize($config);
     if ($_FILES['uploadfile']['name']) {
         if (!$this->upload->do_upload('uploadfile')) {
             $error = array('error' => $ci->upload->display_errors());
             setInformUser('error', $error['error'] . ' please import  file formate only');
             redirect(base_url('users/profile'));
         } else {
             /*$admin_mail='jasbir.eduworkers@gmail.com';*/
             /* $admin_mail='nkscoder@yahoo.in';*/
             $this->email->from(setEmail(), 'Eduworkers');
             $this->email->to($this->adminEmail());
             $path = set_realpath('uploads');
             $file = $this->upload->data();
             /*         echo $file['file_name'];
                     echo $path; die;*/
             $this->email->subject('Order Query');
             $this->email->message($message);
             $this->email->attach($path . $file['file_name']);
             if ($this->email->send()) {
                 $this->email->from(setEmail(), 'Eduworkers');
                 $this->email->to($data['email']);
                 $this->email->subject('Order Query');
                 $this->email->message($message);
                 $this->email->attach($path . $file['file_name']);
                 if ($this->email->send()) {
                     setInformUser('success', "Send  Quote successfully");
                     redirect(base_url('users/profile'));
                 } else {
                     setInformUser('error', "Some Error Occurred.");
                     redirect(base_url('users/profile'));
                 }
             } else {
                 setInformUser('error', "Some Error Occurred.");
                 redirect(base_url('users/profile'));
             }
         }
     } else {
         /*  $admin_mail='nkscoder@yahoo.in';*/
         $this->email->from(setEmail(), 'Eduworkers');
         $this->email->to($this->adminEmail());
         $this->email->subject('Order Query');
         $this->email->message($message);
         /*  echo $data['subject']; die;
         */
         if ($this->email->send()) {
             $this->email->from(setEmail(), 'Eduworkers');
             $this->email->to($data['email']);
             $this->email->subject('Order Query');
             $this->email->message($message);
             if ($this->email->send()) {
                 setInformUser('success', "Send  Quote successfully");
                 redirect(base_url('users/profile'));
             } else {
                 setInformUser('error', "Some Error Occurred.");
                 redirect(base_url('users/profile'));
             }
         } else {
             setInformUser('error', "Some Error Occurred.");
             redirect(base_url('users/profile'));
         }
     }
 }
开发者ID:Scaledesk,项目名称:eduworkers.co.uk,代码行数:74,代码来源:Users.php

示例4: setEmail

function setEmail()
{
    $ci = CI::get_instance();
    $ci->load->Model('users/Mdl_users');
    $email['set_email'] = $ci->Mdl_users->setEmail();
    $email = $email['set_email'][0]['eduworkers_email_settings_smtp_user'];
    return $email;
}
开发者ID:Scaledesk,项目名称:eduworkers.co.uk,代码行数:8,代码来源:utility_helper.php

示例5: uploadReceipt

 public function uploadReceipt($id = null)
 {
     if ($this->session->userdata['user_data'][0]['role'] == 'buyer') {
         if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
             /*$config['upload_path'] = APPPATH.'modules/sellers/upload/';
                             $config['allowed_types'] = 'png|jpeg|gif|jpg|pdf';
                             $config['max_size'] = '2048000';
             
                             print_r($_FILES);
                             die;
                             $attached=time().$_FILES['attached']['name'];
                             $config['upload_path'];
             /*                echo 'dkljlkfjd';
                            die();
             */
             /*$_FILES['attached']['name']=$attached;
             
                             $this->upload->initialize($config);
                             $this->upload->do_upload('attached');*/
             $file = null;
             $ci = CI::get_instance();
             $config['upload_path'] = 'uploads/';
             $config['allowed_types'] = 'gif|jpg|png|txt|pdf';
             $config['max_size'] = 1000;
             $config['max_width'] = 1920;
             $config['max_height'] = 768;
             $config['encrypt_name'] = TRUE;
             //$ci->load->library('upload', $config);
             /* echo "inside uploads";
                print_r($config);*/
             //die;
             $this->upload->initialize($config);
             if (!$ci->upload->do_upload('attached')) {
                 $error = array('error' => $ci->upload->display_errors());
                 print_r($error);
                 /* die;*/
                 return null;
             } else {
                 $data = array('upload_data' => $ci->upload->data());
                 $file = $data['upload_data']['file_name'];
                 $order_id = $this->input->post();
                 $id = $order_id['order_id'];
                 $this->Mdl_users->setData('bank_details', $file, $id);
                 if ($this->Mdl_users->uploadReceipt($id)) {
                     setInformUser('success', 'Receipt Upload Successfully');
                     redirect(base_url('users/home'));
                 } else {
                     setInformUser('error', 'Some error occurred. Try Again');
                     redirect(base_url('users/home'));
                 }
                 /*echo $file;
                   echo "<pre/>";
                   echo $id;
                   print_r($_SESSION);
                   die();*/
             }
             /* print_r($file);*/
             // echo 'dkljlkfjd';
             /*die();*/
         } else {
             //$_SESSION['abcd']=$id;
             /*                print_r($id);
                             die();*/
             // echo "<br/>";
             $this->load->view('header/header_buyer');
             $this->load->view('bank_details', ['id' => $id]);
             $this->load->view('header/footer');
         }
     } else {
         redirect('users/home');
     }
 }
开发者ID:sanchitrathee,项目名称:new_san,代码行数:72,代码来源:Users.php


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