balkan7 Posted February 2, 2008 Share Posted February 2, 2008 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"); } } }?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.