Jump to content

[SOLVED] After expire send mail


balkan7

Recommended Posts

after banner expire set status to '0' and send msg to mail.

 

this code wont work.

<?php $result = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_state='1'");
     while ($data = dbarray($result)) {
     $time = date("Y-m-d H:i:s");
		if ($data['banner_expire'] < $time) {
			$expires = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_state='0' WHERE banner_id='".$data['banner_id']."'");
			$result = dbquery("SELECT * FROM ".$db_prefix."btr_banners LEFT JOIN ".$db_prefix."users ON ".$db_prefix."btr_banners.client_id = ".$db_prefix."users.user_id");
			while ($data1 = mysql_fetch_assoc($result)) {
			 $bannerXtra = explode(".", $data1['banner_clicks']);
		   $bannerClicks = number_format($bannerXtra[0]);
		   $bannerViews = number_format($bannerXtra[1]);
		   if($bannerViews == 0) {
    	    $percent = 0;
         } else {
    	    $percent = substr(100 * $data1['banner_clicks'] / $bannerViews, 0, 5);
         }
      $to = $data1['user_email'];
      $subject = $locale['M_10'];
    $message = $locale['M'] .$data1['user_name'].$locale['M_2'].$data1['banner_date']."<br />".$locale['M_3']."<br />".$locale['M_4']. $data1['banner_name']"<br />".$locale['M_5']. $data1['banner_clicks']"<br />".$locale['M_6']. $bannerViews"<br />".$locale['M_7']. $data1['banner_date']"<br />".$locale['M_8']. $data1['banner_expire']"<br /><br /><br /><br />".$locale['M_9'];
    $from = "test@gmail.com";
    mail($to,$subject,$msg, "From: test@gmail.com");
			}
		    }
                        }?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.