403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/xtreme/webadmin/email/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/xtreme/webadmin/email/sendmsg_20130830.php
<?
//require_once("../configure.php");


$dbh = mysql_connect("219.76.191.21", "xtremesa", "xtdbone1q"); // 192.168.11.90
if(!$dbh){
	die('Could not connect: '.mysql_errno()." - ".mysql_error());
}
$db_selected = mysql_select_db("xtreme_db");
if(!$db_selected){
	die('Can\'t select DB: '.mysql_error());
}
mysql_query("SET NAMES UTF8");


//require($INCLUDE_DIR . "class.phpmailer.php");
//require("class.phpmailer.php");
require("../mail/class.phpmailer.php");
error_reporting(E_ALL);

$todayDate = date("Y-m-d");// current date
//echo "Today: ".$todayDate."<br>";
//Add one day to today
$date = strtotime(date("Y-m-d", strtotime($todayDate)) . " +1 day");
//echo "After adding one day: ".date('l dS \o\f F Y', $date)."<br>";
//echo date('Y-m-d', $date)."<br>";


$sql = "SELECT
		oil_alert.cust_id,
		oil_alert.staff_id,
		oil_alert.alert_date,
		oil_alert_item.name,
		oil_alert.detail,
		oil_alert.remark,
		`user`.email,
		oil_alert.id,
		oil_cust.co_name
		FROM
		oil_alert
		Inner Join `user` ON oil_alert.staff_id = `user`.id
		Inner Join oil_alert_item ON oil_alert.alert_item = oil_alert_item.id
		Inner Join oil_cust ON oil_alert.cust_id = oil_cust.id
		where oil_alert.status = 1
		and oil_alert.alert_date <= '".date('Y-m-d', $date)."'";
//echo $sql;
if(!$result = mysql_query($sql)){
	echo mysql_errno()." - ".mysql_error();
	exit();
}
while($row = mysql_fetch_assoc($result)){
	$id = $row['id'];
	$alertdate = $row['alert_date'];
	$co_name = $row['co_name'];
	$itemname = $row['name'];
	$detail = $row['detail'];
	$remark = $row['remark'];
	$email = $row['email'];

	$body = '<HTML>';
	$body .= '<HEAD>';
	$body .= '<TITLE></TITLE>';
	$body .= '<META http-equiv=Content-Type content=text/html; charset=big5>';
	$body .= '</HEAD>';
	$body .= '<body LINK=#0000ff VLINK=#800080 bgcolor=#FFFFFF leftMargin=10 topMargin=20 marginheight=0 marginwidth=0>';
	$body .= 'Alert Date: '.$alertdate;
	$body .= '<br>Company: '.$co_name;
	$body .= '<br>Detail: '.$detail;
	$body .= '<br>Remark: '.$remark;

	$body .= '</BODY>';
	$body .= '</HTML>';
	
	$x_mail = new PHPMailer();
	$x_mail->IsSMTP();	
	$x_mail->Host = "localhost";
	$x_mail->CharSet = "UTF-8";
	$x_mail->From = "info@kawadapc.com";
	$x_mail->FromName = "Kawadapc";
	$x_mail->AddAddress($email);
	$x_mail->AddAddress("ray.lau@kawadapc.com");
	$x_mail->AddAddress("manfok@onesolution.com.hk");
	$x_mail->WordWrap = 50;
	$x_mail->IsHTML(true);
	$x_mail->Subject = "Alert from CRM System for ". $co_name;
	$x_mail->Body = $body;
	$x_mail->Send();

	echo "<br>Done";

	$sql2 = "update oil_alert set status = 2 where id = '".$id."' ";
	mysql_query($sql2);

}
mysql_free_result($result);

echo 'Done';

?>

Youez - 2016 - github.com/yon3zu
LinuXploit