本文整理汇总了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);
}
示例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;
}
示例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'));
}
}
}
示例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;
}
示例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');
}
}