?
Current Path : /home1/savoy/www/unova.in/test/application/models/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/unova.in/test/application/models/mastermodel.php |
<?php class Mastermodel extends CI_Model { function __construct() { parent::__construct(); } function htmlmail($to,$subject,$content,$from) { $theboundary = "-----" . md5(uniqid("EMAIL")); $headers = "Date: " . date("r", time()) . "\r\n" . "From: $from" . "\r\n"; $baseContentType = "multipart/mixed"; $headers .= "X-Mailer: " . "PHP-EMAIL, Samplephpcodes.com" . "\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-Type: $baseContentType; " . "boundary=\"$theboundary\"" . "\r\n" . "\r\n"; $theemailtype = "text/html"; $Charset = "iso-8859-1"; $thebody = "--$theboundary" . "\r\n" . "Content-Type: $theemailtype; charset=$Charset" . "\r\n" . "Content-Transfer-Encoding: 8bit" . "\r\n" . "\r\n" . $content . "\r\n" . "\r\n"; $thebody .= "--$theboundary--"; return mail($to, $subject, $thebody, $headers); } function getdatas($table,$sortfield="",$sorttype="asc",$pagenum="") { $data = array(); $count= $this->db->count_all_results($table); $arr=$this->fpaginate->paginate($pagenum,$count); $data['startpage']=$arr[0]; $data['endpage']=$arr[1]; $start=$arr[2]; $perpage=$arr[3]; $data['count']=$count; if(!empty($pagenum)) $this->db->limit($perpage, $start); if(!empty ($sortfield)) { $this->db->order_by($sortfield, $sorttype); } $data['results'] = $this->db->get($table); return $data; } function get_data($table,$id,$field,$sortfield="",$sorttype="asc",$pagenum="") { $data = array(); $this->db->where($field,$id); $this->db->get($table); $count= $this->db->count_all_results(); $arr=$this->fpaginate->paginate($pagenum,$count); $data['startpage']=$arr[0]; $data['endpage']=$arr[1]; $start=$arr[2]; $perpage=$arr[3]; $data['count']=$count; $this->db->where($field,$id); if(!empty($sortfield)) { $this->db->order_by($sortfield, $sorttype); } $data['results'] = $this->db->get($table); return $data; } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function get_data_srow($table,$id,$field,$sortfield="") { $data = array(); $this->db->where($field,$id); if(!empty($sortfield)) { $this->db->order_by($sortfield,'asc'); } $Q= $this->db->get($table); $row=$Q->row(); return $row; } function deletedata($table,$field,$id) { $this->db->where($field,$id); $res=$this->db->delete($table); return $res; } function get_num_rows($table,$field,$value) { $this->db->where($field,$value); $Q= $this->db->get($table); return $Q->num_rows(); } function insert_contact($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q3_name']['first'].$postdata['q3_name']['last']; $organization = $postdata['q6_organization']; $contact_no = $postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone']; $email = $postdata['q4_email4']; $website = $postdata['q7_website']; $type = $postdata['q8_inWhat']; $reference = $postdata['q9_howDid']; $tbl1Values=array('name'=>$postdata['q3_name']['first'].$postdata['q3_name']['last'], 'organization'=>$postdata['q6_organization'], 'contact_no'=>$postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone'], 'email'=>$postdata['q4_email4'], 'website'=>$postdata['q7_website'], 'type'=>$postdata['q8_inWhat'], 'reference'=>$postdata['q9_howDid'], 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('contact', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in feedback form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Organization:</td><td>'.$organization.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Website:</td><td>'.$website.'</td></tr> <tr><td>Type:</td><td>'.$type.'</td></tr> <tr><td>Reference:</td><td>'.$reference.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$organization")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$website")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$type")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$reference")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $organization = preg_replace($pattern, "", $organization); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $website = preg_replace($pattern, "", $website); $type = preg_replace($pattern, "", $type); $reference = preg_replace($pattern, "", $reference); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $organization = preg_replace($find, "$SpamReplaceText", $organization); $email = preg_replace($find, "$SpamReplaceText", $email); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $website = preg_replace($find, "$SpamReplaceText", $website); $type = preg_replace($find, "$SpamReplaceText", $type); $reference = preg_replace($find, "$SpamReplaceText", $reference); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($organization, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($website, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($type, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($reference, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","Website Contact Form Filled",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com ","Website Contact Form Filled",$content,$email); $this->mastermodel->htmlmail("bharat.haladi@gmail.com","Website Contact Form Filled",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } function insert_feedback($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q15_name']['first'].$postdata['q15_name']['last']; $contact_no = $postdata['q20_contactNo']; $email = $postdata['q16_email']; $subject = $postdata['q19_subject']; $message = $postdata['q17_yourMessage']; $datetime = date("Y-m-d H:i:s"); $tbl1Values=array('name'=>$name, 'contact_no'=>$contact_no, 'email'=>$email, 'subject'=>$subject, 'message'=>$message, 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('feedback', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in feedback form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Subject:</td><td>'.$subject.'</td></tr> <tr><td>Message:</td><td>'.$message.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$subject")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$message")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $subject = preg_replace($pattern, "", $subject); $message = preg_replace($pattern, "", $message); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $email = preg_replace($find, "$SpamReplaceText", $email); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $subject = preg_replace($find, "$SpamReplaceText", $subject); $message = preg_replace($find, "$SpamReplaceText", $message); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($subject, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($message, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","Website Feedback form Filled",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com","Website Feedback form Filled",$content,$email); $this->mastermodel->htmlmail("bharat.haladi@gmail.com","Website Feedback form Filled",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } function insert_training_registration($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q3_name']['first'].$postdata['q3_name']['last']; $organization = $postdata['q6_organization']; $contact_no = $postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone']; $email = $postdata['q4_email4']; $location = $postdata['q17_location']; $website = $postdata['q7_website']; $type = $postdata['q8_inWhat']; $reference = $postdata['q9_howDid']; $training_title = $postdata['q11_trainingService']; $tbl1Values=array('name'=>$postdata['q3_name']['first'].$postdata['q3_name']['last'], 'organization'=>$postdata['q6_organization'], 'contact_no'=>$postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone'], 'email'=>$postdata['q4_email4'], 'location'=>$postdata['q17_location'], 'website'=>$postdata['q7_website'], 'type'=>$postdata['q8_inWhat'], 'reference'=>$postdata['q9_howDid'], 'training_id'=>$postdata['q12_trainingService_id'], 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('training_registration', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in feedback form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Organization:</td><td>'.$organization.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Location:</td><td>'.$location.'</td></tr> <tr><td>Website:</td><td>'.$website.'</td></tr> <tr><td>Type:</td><td>'.$type.'</td></tr> <tr><td>Reference:</td><td>'.$reference.'</td></tr> <tr><td>Training Service:</td><td>'.$training_title.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$organization")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$location")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$website")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$type")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$reference")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$training_title")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $organization = preg_replace($pattern, "", $organization); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $location = preg_replace($pattern, "", $location); $website = preg_replace($pattern, "", $website); $type = preg_replace($pattern, "", $type); $reference = preg_replace($pattern, "", $reference); $training_title = preg_replace($pattern, "", $training_title); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $organization = preg_replace($find, "$SpamReplaceText", $organization); $email = preg_replace($find, "$SpamReplaceText", $email); $location = preg_replace($find, "$SpamReplaceText", $location); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $website = preg_replace($find, "$SpamReplaceText", $website); $type = preg_replace($find, "$SpamReplaceText", $type); $reference = preg_replace($find, "$SpamReplaceText", $reference); $training_title = preg_replace($find, "$SpamReplaceText", $training_title); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($organization, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($location, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($website, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($type, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($reference, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($training_title, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","Training Registration Received",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com","Training Registration Received",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } function insert_coaching_registration($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q3_name']['first'].$postdata['q3_name']['last']; $organization = $postdata['q6_organization']; $contact_no = $postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone']; $email = $postdata['q4_email4']; $location = $postdata['q17_location']; $website = $postdata['q7_website']; $type = $postdata['q8_inWhat']; $reference = $postdata['q9_howDid']; $coaching_title = $postdata['q11_coachingService']; $tbl1Values=array('name'=>$postdata['q3_name']['first'].$postdata['q3_name']['last'], 'organization'=>$postdata['q6_organization'], 'contact_no'=>$postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone'], 'email'=>$postdata['q4_email4'], 'location'=>$postdata['q17_location'], 'website'=>$postdata['q7_website'], 'type'=>$postdata['q8_inWhat'], 'reference'=>$postdata['q9_howDid'], 'coaching_id'=>$postdata['q12_coachingService_id'], 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('coaching_registration', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in feedback form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Organization:</td><td>'.$organization.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Location:</td><td>'.$location.'</td></tr> <tr><td>Website:</td><td>'.$website.'</td></tr> <tr><td>Type:</td><td>'.$type.'</td></tr> <tr><td>Reference:</td><td>'.$reference.'</td></tr> <tr><td>Coaching Service:</td><td>'.$coaching_title.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$organization")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$location")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$website")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$type")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$reference")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$coaching_title")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $organization = preg_replace($pattern, "", $organization); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $location = preg_replace($pattern, "", $location); $website = preg_replace($pattern, "", $website); $type = preg_replace($pattern, "", $type); $reference = preg_replace($pattern, "", $reference); $coaching_title = preg_replace($pattern, "", $coaching_title); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $organization = preg_replace($find, "$SpamReplaceText", $organization); $email = preg_replace($find, "$SpamReplaceText", $email); $location = preg_replace($find, "$SpamReplaceText", $location); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $website = preg_replace($find, "$SpamReplaceText", $website); $type = preg_replace($find, "$SpamReplaceText", $type); $reference = preg_replace($find, "$SpamReplaceText", $reference); $coaching_title = preg_replace($find, "$SpamReplaceText", $coaching_title); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($organization, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($location, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($website, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($type, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($reference, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($coaching_title, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","coaching Registration Received",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com","coaching Registration Received",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } function insert_programme_registration($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q3_name']['first'].$postdata['q3_name']['last']; $organization = $postdata['q6_organization']; $contact_no = $postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone']; $email = $postdata['q4_email4']; $location = $postdata['q17_location']; $website = $postdata['q7_website']; $type = $postdata['q8_inWhat']; $reference = $postdata['q9_howDid']; $programme_id = $postdata['q11_eventSelected']; $programme_title = $postdata['q11_programmeSelected']; $tbl1Values=array('name'=>$postdata['q3_name']['first'].$postdata['q3_name']['last'], 'organization'=>$postdata['q6_organization'], 'contact_no'=>$postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone'], 'email'=>$postdata['q4_email4'], 'location'=>$postdata['q17_location'], 'website'=>$postdata['q7_website'], 'type'=>$postdata['q8_inWhat'], 'reference'=>$postdata['q9_howDid'], 'programme_id'=>$postdata['q11_eventSelected'], 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('programme_registration', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in feedback form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Organization:</td><td>'.$organization.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Location:</td><td>'.$location.'</td></tr> <tr><td>Website:</td><td>'.$website.'</td></tr> <tr><td>Type:</td><td>'.$type.'</td></tr> <tr><td>Reference:</td><td>'.$reference.'</td></tr> <tr><td>Programme Name:</td><td>'.$programme_title.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$organization")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$location")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$website")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$type")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$reference")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$programme_title")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $organization = preg_replace($pattern, "", $organization); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $location = preg_replace($pattern, "", $location); $website = preg_replace($pattern, "", $website); $type = preg_replace($pattern, "", $type); $reference = preg_replace($pattern, "", $reference); $programme_title = preg_replace($pattern, "", $programme_title); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $organization = preg_replace($find, "$SpamReplaceText", $organization); $email = preg_replace($find, "$SpamReplaceText", $email); $location = preg_replace($find, "$SpamReplaceText", $location); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $website = preg_replace($find, "$SpamReplaceText", $website); $type = preg_replace($find, "$SpamReplaceText", $type); $reference = preg_replace($find, "$SpamReplaceText", $reference); $programme_title = preg_replace($find, "$SpamReplaceText", $programme_title); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($organization, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($location, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($website, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($type, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($reference, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($programme_title, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","Programme Registration Received",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com","Programme Registration Received",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } function insert_workshop_registration($postdata) { $SpamCheck = "Y"; // Y or N $SpamReplaceText = "*content removed*"; $data=array(); $this->db->trans_begin(); $name = $postdata['q3_name']['first'].$postdata['q3_name']['last']; $organization = $postdata['q6_organization']; $contact_no = $postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone']; $email = $postdata['q4_email4']; $location = $postdata['q17_location']; $website = $postdata['q7_website']; $type = $postdata['q8_inWhat']; $reference = $postdata['q9_howDid']; $workshop_title = $postdata['q11_workshopService']; $tbl1Values=array('name'=>$postdata['q3_name']['first'].$postdata['q3_name']['last'], 'organization'=>$postdata['q6_organization'], 'contact_no'=>$postdata['q5_contactNumber']['area'].$postdata['q5_contactNumber']['phone'], 'email'=>$postdata['q4_email4'], 'location'=>$postdata['q17_location'], 'website'=>$postdata['q7_website'], 'type'=>$postdata['q8_inWhat'], 'reference'=>$postdata['q9_howDid'], 'workshop_id'=>$postdata['q12_workshopService_id'], 'datetime'=>date("Y-m-d H:i:s")); $this->db->insert('workshop_registration', $tbl1Values); $content='<table> <tr><td colspan="2">Unova.in workshop registration form was submitted with the following information:</td></tr> <tr><td>Name :</td><td>'.$name.'</td></tr> <tr><td>Organization:</td><td>'.$organization.'</td></tr> <tr><td>Contact No:</td><td>'.$contact_no.'</td></tr> <tr><td>Email:</td><td>'.$email.'</td></tr> <tr><td>Location:</td><td>'.$location.'</td></tr> <tr><td>Website:</td><td>'.$website.'</td></tr> <tr><td>Type:</td><td>'.$type.'</td></tr> <tr><td>Reference:</td><td>'.$reference.'</td></tr> <tr><td>Workshop Service:</td><td>'.$workshop_title.'</td></tr> </table>'; if ($SpamCheck == "Y") { // Check for Website URL's in the form input boxes as if we block website URLs from the form, // then this will stop the spammers wastignt ime sending emails if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$organization")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$contact_no")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$location")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$website")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$type")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$reference")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$workshop_title")) {echo "$SpamErrorMessage"; exit();} // Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer $pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string $name = preg_replace($pattern, "", $name); $organization = preg_replace($pattern, "", $organization); $contact_no = preg_replace($pattern, "", $contact_no); $email = preg_replace($pattern, "", $email); $location = preg_replace($pattern, "", $location); $website = preg_replace($pattern, "", $website); $type = preg_replace($pattern, "", $type); $reference = preg_replace($pattern, "", $reference); $workshop_title = preg_replace($pattern, "", $workshop_title); // Check for the injected headers from the spammer attempt // This will replace the injection attempt text with the string you have set in the above config section $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $name = preg_replace($find, "$SpamReplaceText", $name); $organization = preg_replace($find, "$SpamReplaceText", $organization); $email = preg_replace($find, "$SpamReplaceText", $email); $location = preg_replace($find, "$SpamReplaceText", $location); $contact_no = preg_replace($find, "$SpamReplaceText", $contact_no); $website = preg_replace($find, "$SpamReplaceText", $website); $type = preg_replace($find, "$SpamReplaceText", $type); $reference = preg_replace($find, "$SpamReplaceText", $reference); $workshop_title = preg_replace($find, "$SpamReplaceText", $workshop_title); // Check to see if the fields contain any content we want to ban if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($organization, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($email, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($location, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($contact_no, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($website, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($type, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($reference, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} if(stristr($workshop_title, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();} } if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); return 0; } else { $this->mastermodel->htmlmail("jessicasajan@gmail.com","Workshop Registration Received",$content,$email); $this->mastermodel->htmlmail("sajansummers@gmail.com","Workshop Registration Received",$content,$email); $this->db->trans_commit(); $data['res']=1; return $data; } } } ?>