.:: :[ AK-74 Security Team Web-shell ]: ::.
phpinfo()
PHP
<?php include ("include/config.php"); include ("include/connect.php"); $startFunctionDefault = 'no'; include ("include/function.php"); include ("myadmin/banner/config.php"); require_once('PHPMailer/class.phpmailer.php'); header("Content-Type: text/html; charset=utf-8"); //#!/usr/local/bin/php -q $a_month_name = array('', 'มค.', 'กพ.', 'มีค.', 'เมย.', 'พค.', 'มิย.', 'กค.', 'สค.', 'กย.', 'ตค.', 'พย.', 'ธค.'); $a_admin_email = explode(',', $configBannerEmailAdmin); // ==================== Start หาลูกค้าที่ เดือนที่แล้วหมดอายุ เพื่อนำมาส่งเมล์ว่า ต่ออายุหรือเปล่า ===================== // $nowMktime = mktime(0, 0, 0, (@date("m")-1), 1, @date("Y")); $nowDate = @date("Y-m-d"); $sql = " SELECT banner_payment.banner_id AS banner_id, banner.contact_name AS contact_name, banner.link AS link, banner.contact_email AS contact_email, banner.contact_phone AS contact_phone, banner_payment.package_price AS package_price, banner_payment.package_name AS package_name, banner_payment.promotion AS promotion, banner_payment.stop_date AS stop_date, banner.stop_date AS current_stop_date, banner.contact_date AS current_contact_date, banner_payment.total_price AS total_price, banner_payment.bankname_id AS bankname_id, banner_comment, banner_group.group_name AS group_name, banner_group.price_per_month AS price_per_month FROM banner INNER JOIN banner_payment ON banner.banner_id = banner_payment.banner_id AND YEAR(banner_payment.stop_date) = " . @date("Y", $nowMktime) . " AND MONTH(banner_payment.stop_date) = " . @date("n", $nowMktime) . " AND banner.enable = 1 INNER JOIN banner_group ON banner.banner_group_id = banner_group.banner_group_id AND banner_group.enable = 1 ORDER BY banner_payment.stop_date, banner.contact_name "; $query = sql_query($sql); //echo $sql . '<br /><br />'; if (sql_num_rows($query) > 0) { $subject = 'รายงานลูกค้า ต่ออายุ / ไม่ต่ออายุ ประจำเดือน ' . $a_month_name[@date("n", $nowMktime)] . ' ' . substr((@date("Y", $nowMktime)+543), -2); $message = '<strong>' . $subject . '<br /><br /></strong> <table width="700" border="1" cellspacing="2" cellpadding="2"> <tr> <th width="185">ชื่อลูกค้า</th> <th width="92">ตำแหน่ง</th> <th width="82">Package</th> <th width="92" align="right">ยอดชำระ</th> <th width="110">วันหมดอายุ</th> <th width="139">ต่ออายุ</th> </tr> '; while ($rec = sql_fetch_array($query)) { $message .= ' <tr> <td>' . $rec['contact_name'] . '</td> <td>' . $rec['group_name'] . '</td> <td>' . $rec['package_name'] . '</td> <td align="right">' . number_format($rec['total_price'], 2) . '</td> <td>' . format_date_th ($rec['stop_date'], 6) . '</td> <td>' . (($rec['current_stop_date'] > $nowDate) ? 'Yes ' . format_date_th($rec['current_contact_date'], 6) : 'No') . '</td> </tr>'; } // end while ($rec = sql_fetch_array($query)) { $message .= ' </table> '; //echo $message .'<br /><br />'; $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsSMTP(); // telling the class to use SMTP try { $mail->Host = "localhost"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server //$mail->Username = "litecondomthai@gmail.com"; // GMAIL username //$mail->Password = "litecondom323174"; // GMAIL password $mail->Username = $configGmailAccount; // GMAIL username $mail->Password = $configGmailPassword; // GMAIL password $mail->SetFrom($configGmailAccount, $configWebmasterName); $mail->AddReplyTo($configWebmasterMail, $configWebmasterName); $mail->CharSet = "utf-8"; foreach($a_admin_email as $adminEmail) { $mail->AddAddress(trim($adminEmail), ''); } // end foreach($a_admin_email as $adminEmail) { $mail->Subject = $subject; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML($message); $mail->Send(); } catch (phpmailerException $e) { echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); //Boring error messages from anything else! } } // end if (sql_num_rows($query) > 0) { // ==================== Stop หาลูกค้าที่ เดือนที่แล้วหมดอายุ เพื่อนำมาส่งเมล์ว่า ต่ออายุหรือเปล่า ===================== // // ==================== Start หาลูกค้าที่ เดือนนี้กำลังจะหมดอายุ ===================== // $nowYear = @date("Y"); $nowMonth = @date("n"); $sql = " SELECT banner.banner_id AS banner_id, banner.contact_name AS contact_name, banner.link AS link, banner.contact_email AS contact_email, banner.contact_phone AS contact_phone, banner.package_price AS package_price, banner.package_name AS package_name, banner.promotion AS promotion, banner.stop_date AS stop_date, banner.stop_date AS stop_date, banner.contact_date AS contact_date, banner.total_price AS total_price, banner.bankname_id AS bankname_id, banner_comment, banner_group.group_name AS group_name, banner_group.price_per_month AS price_per_month FROM banner INNER JOIN banner_group ON banner.banner_group_id = banner_group.banner_group_id AND banner_group.enable = 1 AND YEAR(banner.stop_date) = " . $nowYear . " AND MONTH(banner.stop_date) = " . $nowMonth . " AND banner.enable = 1 ORDER BY banner.stop_date, banner.contact_name "; $query = sql_query($sql); //echo $sql . '<br /><br />'; if (sql_num_rows($query) > 0) { $subject = 'รายงานลูกค้า หมดอายุ ประจำเดือน ' . $a_month_name[$nowMonth] . ' ' . substr(($nowYear+543), -2); $message = '<strong>' . $subject . '<br /><br /></strong> <table width="561" border="1" cellspacing="2" cellpadding="2"> <tr> <th width="185">ชื่อลูกค้า</th> <th width="92">ตำแหน่ง</th> <th width="82">Package</th> <th width="92" align="right">ยอดชำระ</th> <th width="110">วันหมดอายุ</th> </tr> '; while ($rec = sql_fetch_array($query)) { $message .= ' <tr> <td>' . $rec['contact_name'] . '</td> <td>' . $rec['group_name'] . '</td> <td>' . $rec['package_name'] . '</td> <td align="right">' . number_format($rec['total_price'], 2) . '</td> <td>' . format_date_th ($rec['stop_date'], 6) . '</td> </tr>'; } // end while ($rec = sql_fetch_array($query)) { $message .= ' </table> '; //echo $message .'<br /><br />'; $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsSMTP(); // telling the class to use SMTP try { $mail->Host = "localhost"; // SMTP server //$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server //$mail->Username = "litecondomthai@gmail.com"; // GMAIL username //$mail->Password = "litecondom323174"; // GMAIL password $mail->Username = $configGmailAccount; // GMAIL username $mail->Password = $configGmailPassword; // GMAIL password $mail->SetFrom($configGmailAccount, $configWebmasterName); $mail->AddReplyTo($configWebmasterMail, $configWebmasterName); $mail->CharSet = "utf-8"; foreach($a_admin_email as $adminEmail) { $mail->AddAddress(trim($adminEmail), ''); } // end foreach($a_admin_email as $adminEmail) { $mail->Subject = $subject; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML($message); $mail->Send(); } catch (phpmailerException $e) { echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); //Boring error messages from anything else! } } // end if (sql_num_rows($query) > 0) { // ==================== Stop หาลูกค้าที่ เดือนนี้กำลังจะหมดอายุ ===================== // ?>
Rename:
-