]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<?php include_once "admin/include/config.php"; $sel_obj= new config(); require 'php_mail/class.phpmailer.php'; /*-------- Best Selling Setting ------*/ $where_con1 = "`email_type`= 'Offer Coupon Email'"; $query1 = $sel_obj->display_rcd("auto_email_control", $where_con1); if (is_array($query1) || !empty($query1)) { foreach ($query1 as $best_selling_data) { } } ?> <!-- =========== Offer Coupon Email ============= --> <?php $best_con_check="`email_type`='Offer Coupon Email'"; $query_bset=$sel_obj->display_rcd_desc('auto_sent_email',$best_con_check); // print_r($query_bset); die(); $last_date_best = date('d-m-Y', strtotime($query_bset[0]['created_at'])); $frequent_day_best = $best_selling_data['frequent_day']; $next_date_best= date('d-m-Y', strtotime($last_date_best. " + $frequent_day_best days")); // echo $query_bset[0]['created_at']."<br>"; // echo $next_date_best; echo "<br>"; // echo $last_date_best; echo "<br>"; // echo date('d-m-Y'); echo "<br>"; /*if ($best_selling_data['status']==1 && ($best_selling_data['monthly_date']==date('d') || $next_date_best!=date("d-m-Y")) && $last_date_best!=date("d-m-Y")) {*/ if ($best_selling_data['status']==1 && ($best_selling_data['monthly_date']==date('d') || $next_date_best==date("d-m-Y")) && $last_date_best!=date("d-m-Y")) { $email_type = "Offer Coupon Email"; $best_con="`email_type`='$email_type'"; $query_bset=$sel_obj->display_rcd('auto_email_control',$best_con); if(is_array($query_bset) || !empty($query_bset)) { $temp_no = 1; foreach($query_bset as $bset_data) { } } $insert_bset_selling=array( 'email_type' => $bset_data['email_type'], 'frequent_day' => $bset_data['frequent_day'], 'monthly_date' => $bset_data['monthly_date'], 'new_email_day' => $bset_data['new_email_day'], 'status' => $bset_data['status'], 'user_ids' => $bset_data['user_ids'], 'product_ids' => $bset_data['product_ids'], 'top_content' => $bset_data['top_content'], 'middle_content' => $bset_data['middle_content'], 'bottom_content' => $bset_data['bottom_content'], 'templete_id' => $bset_data['templete_id'], 'subject' => $bset_data['subject'], 'content' => $bset_data['content'], 'logo' => $bset_data['logo'], 'header_background' => $bset_data['header_background'], 'body_background' => $bset_data['body_background'], 'footer_background' => $bset_data['footer_background'], 'footer' => $bset_data['footer'], 'recipient' => $bset_data['recipient'], 'created_at' => date("Y-m-d H:i:s") ); /*--- Best selling product List ----*/ if (!empty(json_decode($bset_data['product_ids']))) { $u_p_q = json_decode($bset_data['product_ids']); $product_table = ' <table class="table" border="1" cellspacing="0" style="margin: auto; border-color: white;"> <thead> <tr> <th>Image</th> <th>Best Selling Product Name</th> <th>Price</th> </tr> </thead> <tbody> '; foreach ($u_p_q as $best_product) { /*---------- Product Info -------------*/ $where_product = "`status`=1 AND p_id=" . $best_product; $product_query = $sel_obj->display_rcd("product", $where_product); foreach($product_query as $product_data) { $product_table .= ' <tr> <td><img class="img-thumbnail" width="75" height="50" src="https://a4paper.in/admin/upload/'.$product_data['p_img'].'"></td> <td class="td_alignvertical"><span>'.$product_data['p_name'].'</span></td> <td style="padding:10px"><span> ₹'.$product_data['d_price'].'</span></td> </tr> '; } } $product_table .= '</tbody></table>'; } /*------ Send Email ----------------*/ $new_email_day = $bset_data['new_email_day']; $verify_date = date('Y-m-d H:i:s', strtotime("-$new_email_day days")); if ($bset_data['recipient']=="all_users") { $where_user = "`status`=1 AND `RegDate`<'$verify_date'"; $user_query = $sel_obj->display_rcd("tblusers", $where_user); ob_start(); include("mail_template.php"); $welcomeTemplate = ob_get_clean(); // ob_get_clean(); foreach ($user_query as $user_data) { /*----Email Send ----*/ $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'sales@a4paper.in'; $mail->Password = 'Stereo@1879'; $mail->SMTPSecure = 'tls'; $mail->From = "sales@a4paper.in"; $mail->FromName = "a4paper"; $mail->Mailer = "smtp"; // don't change the quotes! // $mail->AddAddress('rohan@vdcpaper.com'); $mail->AddAddress($user_data['UserEmail']); //Adds a "To" address // $mail->AddAddress('udit8prajapati@gmail.com'); //Adds a "To" address $mail->IsHTML(true); $mail->Subject = $bset_data['subject']; $mail->Body = $welcomeTemplate; $mail->Send(); // echo "<br>"; echo $user_data['UserEmail']; /*----------------------------------*/ } }else{ foreach (json_decode($bset_data['user_ids']) as $user_id) { $where_user = "`status`=1 AND `id`='$user_id'"; $user_query = $sel_obj->display_rcd("tblusers", $where_user); ob_start(); include("mail_template.php"); $welcomeTemplate = ob_get_clean(); // ob_get_clean(); foreach ($user_query as $user_data) { /*----Email Send ----*/ $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'sales@a4paper.in'; $mail->Password = 'Stereo@1879'; $mail->SMTPSecure = 'tls'; $mail->From = "sales@a4paper.in"; $mail->FromName = "a4paper"; $mail->Mailer = "smtp"; // don't change the quotes! // $mail->AddAddress('rohan@vdcpaper.com'); $mail->AddAddress($user_data['UserEmail']); //Adds a "To" address // $mail->AddAddress('udit8prajapati@gmail.com'); //Adds a "To" address $mail->IsHTML(true); $mail->Subject = $bset_data['subject']; $mail->Body = $welcomeTemplate; $mail->Send(); // echo "<br>"; echo $user_data['UserEmail']; /*----------------------------------*/ } } } // print_r($user_query); // include "mail_template.php"; /*----- Insert in Database ----*/ $insert_1 = $sel_obj->insert("auto_sent_email", $insert_bset_selling); } ?>