%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php error_reporting(0); defined('BASEPATH') OR exit('No direct script access allowed'); class Blogs extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('blog_model', 'blog'); $this->load->model('department_model', 'department'); $this->load->model('patient_story_model', 'patient_story'); $this->load->model('doctor_model', 'doctor'); $this->load->model('appointment_model', 'appointment'); $this->load->model('enquiry_model', 'enquiry'); $this->load->library('session'); } public function index($id=0) { if(!$id){ $this->view_blog(); } else{ $this->view_blog_article($id); } } public function book_apk(){ extract($_POST); $data = array(); $success = ''; $error_msg = ''; $post=$this->input->post(); $newurl = $post['urlnew']; if((!empty($post['RequestPatientName'])) and (!empty($post['RequestPatientMobile'])) and (!empty($post['RequestDepartment']))) { $this->form_validation->set_rules('RequestPatientName', 'Patient Name', 'required|trim|alpha_numeric_spaces'); $this->form_validation->set_rules('RequestPatientMobile', 'Patient Mobile Number', 'trim|required|numeric|min_length[10]'); $this->form_validation->set_rules('RequestDepartment', 'Department', 'required'); $querys = $this->db->query("select `RequestPatientMobile` from `SH_AppointmentRequests` where `RequestPatientMobile`='".$RequestPatientMobile."'"); $num = $querys->num_rows(); if($num=='0'){ $insert_data = array( 'RequestDoctor' => $post['RequestDoctor'], 'RequestPatientName' => $post['RequestPatientName'], 'RequestPatientMobile' => $post['RequestPatientMobile'], 'RequestDepartment' => $post['RequestDepartment'], 'RequestDate' => date('Y-m-d H:i:s') ); //print_r($insert_data); $success = $this->appointment->insert_appointment_request($insert_data); if($success){ $data['succmsg'] = "<font color='#006600'>Your detail has been submited.</font>"; echo "<font color='#006600'>Your detail has been submited</font>";?> <script> setTimeout(function() { window.location = "<?php echo base_url().'blogs/'.$newurl;?>"; }, 1000 ); </script> <?php } } else { echo "<font color='#990000'>Contact no already exist.</font>"; } } else { echo "<font color='#990000'>Please Fill all Information.</font>"; } } public function get_enquiry(){ $data = array(); $success = ''; $error_msg = ''; $post=$this->input->post(); if((!empty($post['patient_name'])) and (!empty($post['email_id'])) and (!empty($post['phone_no'])) and (!empty($post['enquiry_msg']))) { $this->form_validation->set_rules('EnquiryName', 'Patient Name', 'trim|alpha_numeric_spaces'); $this->form_validation->set_rules('EnquiryEmail', 'Patient EmailID', 'trim|required|valid_email'); $this->form_validation->set_rules('EnquiryPhone', 'Patient Phone No.', 'trim|required|numeric'); $this->form_validation->set_rules('EnquiryMessage', 'Enquiry Message', 'trim|htmlspecialchars|required|alpha_numeric_spaces'); $regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/'; if(preg_match($regex,$post['email_id'])) { $enq_no = $this->db->query("select `EnquiryEmail` from `SH_Enquiries` where EnquiryEmail='".$post['email_id']."'"); $NUM = $enq_no->num_rows(); $newurl = $post['urls']; if($NUM=='0'){ $insert_data = array( 'EnquiryName' => $post['patient_name'], 'EnquiryEmail' => $post['email_id'], 'EnquiryPhone' => $post['phone_no'], 'EnquiryMessage' => $post['enquiry_msg'] ); $success = $this->enquiry->insert_enquiry($insert_data); if($success){ echo "<font color='#006600'>Enquiry has been submited</font>";?> <script> setTimeout(function() { window.location = "<?php echo base_url().'blogs/'.$newurl;?>"; }, 1000 ); </script> <?php unset($newurl); } } else { echo "<font color='#990000'>Email Id already exist.</font>"; } } else { echo "<font color='#990000'>Invalid Email Id.</font>";} } else { echo "<font color='#990000'>Please Fill all Information.</font>"; } } public function view_blog() { $data = array(); $CI = &get_instance(); $this->db2 = $CI->load->database('db2', TRUE); $data['feature_blog'] = $this->db2->query("SELECT * FROM `wp_posts` AS p INNER JOIN `wp_postmeta` AS pm1 ON p.id = pm1.post_id INNER JOIN `wp_postmeta` AS pm2 ON pm1.meta_value = pm2.post_id AND pm2.meta_key = '_wp_attached_file' AND pm1.meta_key = '_thumbnail_id' ORDER BY p.id DESC LIMIT 0,8; ")->result_array(); $data['departments_list'] = $this->db->query("select `DepartmentID`,`DepartmentName` from `SH_Departments` where status='A' order by DepartmentType ASC")->result_array(); $this->load->view('blogs',$data); } public function blogcategory($search) { $data = array(); $CI = &get_instance(); $this->db2 = $CI->load->database('db2', TRUE); $data['category'] = $this->db2->query("select `term_id`,`name`,`slug` from `wp_terms` where name!='Uncategorized' and name!='mymenu'")->result_array(); if(!empty($search)) { $data['feature_blog'] = $this->db2->query("SELECT ID, post_title, post_name, post_date, category_name, category_slug, category_id, CONCAT( '".$uploadDir."','/', thumb.meta_value) as thumbnail, post_type FROM ( SELECT p.ID, p.post_title, p.post_name, p.post_date, p.post_type, MAX(CASE WHEN pm.meta_key = '_thumbnail_id' then pm.meta_value ELSE NULL END) as thumbnail_id, term.name as category_name, term.slug as category_slug, term.term_id as category_id FROM wp_posts as p LEFT JOIN wp_postmeta as pm ON ( pm.post_id = p.ID) LEFT JOIN wp_term_relationships as tr ON tr.object_id = p.ID LEFT JOIN wp_terms as term ON tr.term_taxonomy_id = term.term_id where term.slug='".$search."' GROUP BY p.ID ORDER BY p.post_date DESC ) as post LEFT JOIN wp_postmeta AS thumb ON thumb.meta_key = '_wp_attached_file' AND thumb.post_id = post.thumbnail_id LIMIT 0,9")->result_array(); } $this->load->view('blogcategory',$data); } public function blog_category() { $data = array(); $CI = &get_instance(); $this->db2 = $CI->load->database('db2', TRUE); $data['feature_blog'] = $this->db2->query("select * from `wp_term_relationships` left join wp_posts ON wp_posts.ID=wp_term_relationships.object_id left join wp_terms ON wp_terms.term_id=wp_term_relationships.term_taxonomy_id order by wp_posts.ID DESC limit 0,8")->result_array(); $data['category'] = $this->db2->query("select `term_id`,`name`,`slug` from `wp_terms` where name!='Uncategorized' and name!='mymenu'")->result_array(); $this->load->view('blog-category',$data); } public function view_blog_article($title) { $data = array(); $_SESSION['title'] = $title; if($title){ $CI = &get_instance(); $this->db2 = $CI->load->database('db2', TRUE); $data['blog'] = $this->db2->query("select wp_posts.ID, wp_posts.post_name,wp_posts.post_author,wp_posts.post_date,wp_posts.post_content,wp_posts.post_title,wp_posts.post_status,wp_posts.post_modified,wp_posts.guid,wp_terms.term_id,wp_terms.name,wp_terms.slug, wp_term_relationships.term_taxonomy_id, wp_term_relationships.object_id from `wp_term_relationships` left join wp_posts ON wp_posts.ID=wp_term_relationships.object_id left join wp_terms ON wp_terms.term_id=wp_term_relationships.term_taxonomy_id where wp_posts.post_name='".$title."'")->result_array(); $data['latest_blog'] = $this->db2->query("SELECT * FROM `wp_posts` AS p INNER JOIN `wp_postmeta` AS pm1 ON p.id = pm1.post_id INNER JOIN `wp_postmeta` AS pm2 ON pm1.meta_value = pm2.post_id AND pm2.meta_key = '_wp_attached_file' AND pm1.meta_key = '_thumbnail_id' where pm1.meta_value!='' ORDER BY p.id DESC LIMIT 0,10")->result_array(); $data['ses'] = $_SESSION['title']; $data['departments_list'] = $this->db->query("select `DepartmentID`,`DepartmentName` from `SH_Departments` where status='A' order by DepartmentType ASC")->result_array(); $this->load->view('blog_article',$data); } } }