whoami7 - Manager
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
models
/
Upload File:
files >> //proc/thread-self/root/proc/self/root/home/papecmvm/www/application/models/Alldata.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Alldata extends CI_Model { public function insertData($table,$data) { $dates=array('lasttime'=> date("Y-m-d H:i:s")); $this->db->update('lastmodifytime',$dates); $query=$this->db->insert($table, $data); /*if(!$query) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; }*/ } public function getDatamodel($table) { $query=$this->db->get($table); if(!$query) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; } return $query->result_array(); } public function getDatamodelCount($table) { return $this->db->count_all_results($table); } public function DeleteData($table,$where) { $query=$this->db->delete($table, $where); if(!$query) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; } } public function DetailData($table,$where) { $result=$this->db->get_where($table, $where); if(!$result) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; } return $result->result_array(); } public function UpdateData($table,$data,$where) { $dates=array('lasttime'=> date("Y-m-d H:i:s")); $this->db->update('lastmodifytime',$dates); $query=$this->db->update($table, $data,$where); if(!$query) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; } } public function generate_password($length = 8) { $chars = 'abcdefghijklmnopqrstuvwxyz'. '0123456789'; $str = ''; $max = strlen($chars) - 1; for ($i=0; $i < $length; $i++) $str .= $chars[mt_rand(0, $max)]; return $str; } public function decryptdata($sData) { $url_id=base64_decode($sData); $id=(double)$url_id/6752415; return $id; } public function encryptdata($sData) { $id=(double)$sData*6752415; return base64_encode($id); } public function sortingdata($selectdata,$table,$order) { $this->db->select($selectdata); $this->db->from($table); $this->db->order_by($order); return $this->db->get()->result_array(); } //=============== CREATED BY NIKITA PRAJAPATI ============================== public function sortingWheredata($selectdata,$table,$where,$order_id,$order) { //$this->db->_protect_identifiers = FALSE; if($where!="null"){ $this->db->where($where); } $sel=$this->db->select($selectdata,false); $this->db->from($table); $this->db->order_by($order_id,$order); return $this->db->get()->result_array(); } public function sortingWheredata_OR($selectdata,$table,$where,$order_id,$order) { if($where!="null"){ $this->db->or_where($where); } $this->db->select($selectdata,false); $this->db->from($table); $this->db->order_by($order_id,$order); return $this->db->get()->result_array(); } public function LimitWheredata($selectdata,$table,$where,$order_id,$order,$lmt) { if($where!="null"){ $this->db->where($where); } $this->db->select($selectdata); $this->db->from($table); $this->db->order_by($order_id,$order); $this->db->limit($lmt); return $this->db->get()->result_array(); } public function containdetail($where) { $session_data=$this->session->all_userdata(); $lang=$session_data['flang']; $this->db->order_by("menu_position", "asc"); $sel= $this->db->select('*'); $this->db->from($lang.'tblmenu'); $this->db->where($where); $this->db->join($lang.'tblcontent', $lang.'tblmenu.menu_content = '.$lang.'tblcontent.content_id','left'); $this->db->join('tblbanners', 'tblbanners.banner_id ='.$lang.'tblcontent.banner_id','left'); return $this->db->get()->result_array(); /* $query=$this->db->get(); if(!$query) { //redirect('welcome/errorpage'); show_error("ERROR", 500 ); exit; } return $query->result_array(); */ } //page view in backend........... public function pagedetail($where) { $session_data=$this->session->all_userdata(); $lang=$session_data['flang']; $sel= $this->db->select('*'); $this->db->from($lang.'tblcontent'); $this->db->where($where); $this->db->join('tblbanners', 'tblbanners.banner_id ='.$lang.'tblcontent.banner_id','left'); return $this->db->get()->result_array(); } public function portfolio_model($where='NULL'){ if($where!='NULL'){ $this->db->where($where); } $this->db->from('tbl_portfolio_category as p1'); $this->db->join('tbl_port_sub_cat as p2', 'p2.pid = p1.portfolio_cat_id','left'); $this->db->join('tbl_portfolio as p3', 'p3.port_sub_cat = p2.psid','left'); return $this->db->get()->result_array(); } public function people_model($where='NULL'){ $this->db->where($where); $this->db->group_by('p1.port_sub_cat'); $this->db->from('tbl_portfolio as p1'); $this->db->join('tbl_portfolio_category as p2', 'p2.portfolio_cat_id = p1.portfolio_cat_id','left'); $this->db->join('tbl_port_sub_cat as s2', 's2.psid = p1.port_sub_cat','left'); return $this->db->get()->result_array(); } public function people_modelxxx($where='NULL'){ $session_data=$this->session->all_userdata(); $lang=$session_data['flang']; if($where!='NULL'){ $this->db->where($where); } $this->db->select('*, GROUP_CONCAT(p1.portfolio_name) as fname, GROUP_CONCAT(p1.portfolio_image_path) as i, GROUP_CONCAT(p1.prot_desc) as d'); //$this->db->group_concat('p1.portfolio_name'); $this->db->from($lang.'tbl_portfolio as p1'); $this->db->group_by('p1.port_sub_cat'); $this->db->join('tbl_portfolio_category as p2', 'p2.portfolio_cat_id = p1.portfolio_cat_id','left'); $this->db->join('tbl_port_sub_cat as s2', 's2.psid = p1.port_sub_cat','left'); return $this->db->get()->result_array(); } //send Feedback email // /*public function emailsend($to,$sub,$message) { $email_config = Array( 'protocol' => 'smtp', 'smtp_host' => 'mail.paperpush.com', 'smtp_port' => '26', 'smtp_user' => 'noreply@paperpush.com', 'smtp_pass' => '$12noreply34', 'mailtype' => 'html', 'starttls' => true, 'newline' => "\r\n" ); $this->load->library('email', $email_config); $this->email->set_header('MIME-Version', '1.0; charset=utf-8'); $this->email->set_header('Content-type', 'text/html'); $this->email->from('noreply@paperpush.com', 'PAPERPUSH'); $this->email->to($to); //$this->email->cc('nikita.prajapati@staroneweb.co.in'); $this->email->subject($sub); $this->email->message($message); $this->email->send(); } */ public function emailsend($to,$sub,$message) { require_once(APPPATH . 'third_party/phpmailer/class.phpmailer.php'); require_once(APPPATH . 'third_party/phpmailer/class.smtp.php'); try { $mail = new PHPMailer(true); //New instance, with exceptions enabled $mail->IsSMTP(); // tell the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = 'ssl'; $mail->Port = 465; // set the SMTP server port $mail->Host = "paperpush.com"; // SMTP server $mail->Username = "noreply@paperpush.com"; // SMTP server username $mail->Password = "12Noreply34#$"; // SMTP server password //$mail->AddReplyTo($from,$email); $mail->From = "noreply@paperpush.com"; $mail->FromName = "PAPERPUSH"; $mail->AddAddress($to); $mail->Subject = $sub; $mail->WordWrap = 80; // set word wrap $mail->MsgHTML($message); $mail->IsHTML(true); // send as HTML $mail->SMTPDebug = 2; $sentmail = $mail->Send(); if ($sentmail) { echo "email sent"; } else { echo "Not sent" . $mail->ErrorInfo; } $mail->Timeout = 3600; // echo "<meta HTTP-EQUIV='REFRESH' content='0; url=../upload_resume.php?task=sent'>"; } catch (phpmailerException $e) { $e->errorMessage(); } } public function emailsend2($to, $sub, $msg) { echo 'www'; die; require_once(APPPATH . 'third_party/phpmailer/class.phpmailer.php'); require_once(APPPATH . 'third_party/phpmailer/class.smtp.php'); try { $mail = new PHPMailer(true); //New instance, with exceptions enabled $mail->IsSMTP(); // tell the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication //$mail->SMTPSecure = 'ssl'; $mail->Port = 26; // set the SMTP server port $mail->Host = "mail.paperpush.com"; // SMTP server $mail->Username = "noreply@paperpush.com"; // SMTP server username $mail->Password = "$12noreply34"; // SMTP server password //$mail->AddReplyTo($from,$email); $mail->From = "noreply@paperpush.com"; $mail->FromName = "PAPERPUSH"; $mail->AddAddress($to); $mail->Subject = $sub; $mail->WordWrap = 80; // set word wrap $mail->MsgHTML($msg); $mail->IsHTML(true); // send as HTML //$mail->SMTPDebug = 2; $sentmail = $mail->Send(); if ($sentmail) { echo "email sent"; } else { echo "Not sent" . $mail->ErrorInfo; } $mail->Timeout = 3600; // echo "<meta HTTP-EQUIV='REFRESH' content='0; url=../upload_resume.php?task=sent'>"; } catch (phpmailerException $e) { $e->errorMessage(); } } public function pagesesstion() { //----- send link session ----- //set a 404 page if ($this->uri->segment(3) === FALSE){ $id=""; } else{ $id= urldecode($this->uri->segment(3)); } if($id!=""){ $where=array('slug'=>$id); $this->session->set_userdata('flang', ''); } } public function Captchaimage() { $randomnr = rand(1000, 9999); $this->session->set_userdata('ramdom',md5($randomnr)); $im = imagecreatetruecolor(100, 38); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 150, 150, 150); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 200, 35, $grey); //path to font - this is just an example you can use any font you like: $font ='fontcaptcha/arial.ttf'; imagettftext($im, 20, 4, 22, 30, $black, $font, $randomnr); imagettftext($im, 20, 4, 15, 32, $white, $font, $randomnr); //prevent caching on client side: header("Expires: Wed, 1 Jan 2997 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header ("Content-type: image/gif"); imagegif($im); imagedestroy($im); } public function menugroupdata($id){ $where1=array('menushortcode'=>$id); $view=$this->model->DetailData('tblmenugroup',$where1); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $this->db->from('tblmenu'); $where= array('menugroup' => $view[0]['menugroup_id']); $this->db->where($where); $this->db->join('tblcontent', 'tblcontent.content_id = tblmenu.menu_content','left'); $this->db->join('tblbanners', 'tblbanners.banner_id = tblcontent.banner_id','left'); return $qry=$this->db->get()->result_array(); //echo "<pre>"; //print_r($qry); } public function setting_model($where='null',$order_by='null',$order='null'){ if($where!='null'){ $this->db->where($where); } if($order_by!="null"){ $this->db->order_by($order_by,$order); } $this->db->from('tbl_other_detail as o1'); $this->db->join('tblcontent as c', 'o1.other_link = c.content_id','left'); $query=$this->db->get();//->result_array(); if(!$query) { show_error("ERROR", 500 ); exit; }else{ return $query->result_array(); } } public function chklogin_fun($email,$pwd){ return $this->db->query("SELECT `cr_id` AS reg_id , `email_address`,password,activation_code,'tbl_candidate_registration' AS `tbl`,'cr_id' AS `id`,'candidate' AS type FROM `tbl_candidate_registration` where email_address='".$email."' AND password ='".$pwd."' UNION SELECT `r_id` AS reg_id , `email_address`,password,activation_code,'tbl_registation' AS `tbl`,'r_id' AS `id`,'family' AS type FROM tbl_registation where email_address='".$email."' AND password ='".$pwd."'")->result_array(); } }
Copyright ©2021 || Defacer Indonesia