OverLord Shell
<?php
/*
@Purpose: Add Company Reviews
@Author: Rajahree
@CreatedOn: 5 may 2016
@ModifiedOn: 5 may 2016
*/
error_reporting(0);
session_start();
include_once("db/conn.php");
$company_name=$_POST['company_name'];
$review =htmlentities(trim($_POST['review']),ENT_QUOTES);
$email=$_POST['email'];
$patterns = array();
$patterns[0] = '/([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/';
$patterns[1] = '/([0-9]+[\- ]?[0-9]{9}+)/';
$patterns[2] = '/([0-9]{2,}-[0-9]{0,}-[0-9]{0,})/';
$patterns[3] = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
$replacements = array();
$replacements[0] = '';
$replacements[1] = '';
$replacements[2] = '';
$replacements[3] = '';
//should use just one call of preg_replace for perfomance issues
$string = preg_replace($patterns, $replacements, $review);
$data = array(
'company_id' =>$_POST['company_id'],
'my_company_id' =>$_POST['my_company_id'],
'my_company_name' =>$_POST['company_name'],
'product_id' =>$_POST['product_id'],
'product_name' =>$_POST['product_name'],
'name' => $_POST['name'],
'mobile' => $_POST['mobile'],
'email' => $_POST['email'],
'review' => $string,
'review_date' => date('Y-m-d H:i:s'),
'createdby' => $_SESSION['company_id'],
'createdon' => date('Y-m-d H:i:s'),
'approved' =>'0',
'active'=> 'y'
);
//print_r($data);exit;
/* $to=$_POST['company_email'];
$subject="'".$_POST['product_name']."' product review ";
$headers = 'From: business.maccia.org.in' . "\r\n" .
'Reply-To: "'.$_POST['email'].'" ' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message="New Product Review, ";
$message.="<br><br>
".$string."
<br>
<br>".$_POST['name']."<br>" .$_POST['mobile']."<br>(".$_POST['email'].")<br><br>"."http://business.maccia.org.in/";
$mresponse = mail($to,$subject,$message,$headers);*/
$insertresult = dbRowInsert('busdir_mst_product_review', $data);
$insertresultarr = explode("-",$insertresult);
if(trim($insertresultarr[0])=='success'){
$from= "business.maccia.org.in";
$to = $_POST['company_email'];
//$to= "support@ultraliant.com";
$subject="MACCIA Business Network - Product Review ";
// $headers = 'From:'. $from. "\r\n" .
$headers = 'From: <no-reply@business.maccia.org.in>' . "\r\n" .
'Reply-To:'.$email . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$body = '<html><body>';
$body .='<div class="gmail_quote"><div dir="ltr">On '.date('Y-m-d H:i:s'). ' <b> '.$_POST['company_name'].' </b> Product Review <<a href="mailto:'. $email. '" target="_blank"><wbr>'. $email. '</a> <wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div align="left">
<table border="0" cellpadding="" cellspacing="0" width="654">
<tbody><tr>
<td valign="top" align="left" colspan="2" width="652"><img border="1" style=" background: #f9f7f7;"
src="http://macciabusiness.ultraliant.com/images/logo3.png" width="650" height="105" class="CToWUd"></td>
</tr>
<tr>
<td width="231" valign="top" align="left" bgcolor="#CCCCCC">
<div align="left">
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tbody><tr>
<td width="100%" ><font face="Arial" size="5" color="#808080"><b>'. $subject. '</b></font>
<p><font face="Arial" size="2">
<i><b>Date Referral Given:</b></i><br>'.date('Y/m/d ').'<br><br>
</font></p>
</td>
</tr>
</tbody></table>
</div>
</td>
<td width="419" valign="top" align="left">
<div align="left">
<table border="0" cellpadding="20" cellspacing="0">
<tbody><tr>
<td>
<p><font size="2" face="Arial"> <b>Congratulations! <br>You have Recived a new Product Review at <b>'.$_POST['company_name'].'</b> for '.$_POST['product_name'].' !</b></font></p>Be sure to follow up on this Product Review right away! <br><p><b>Product Review:</b><br/>'.$string.' </p><p><font size="2" face="Arial">For additional information and to follow up with your Product Review,please log in to '.$from.'.<br><p><font size="2" face="Arial">Happy Connecting!</font><br>
</p></td>
</tr>
</tbody></table>
</div>
</td>
</tr>
</tbody></table>
</div>
<p><font face="Arial" size="4"> </font></p>
<p><font face="Arial" size="4"><br>
</font>
</p><div class="yj6qo"></div><div align="left">
<p>Regards,<br/>
'.$_POST['name'].'<br/>
</div>';
$body .= "</body></html>";
$mresponse = mail($to,$subject,$body,$headers);
}
echo $insertresultarr[0];
$connection->close();
?>
xRyukZ - Copyright 2k19