Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest hauntmisery

Auto Invoice?

Recommended Posts

Guest hauntmisery
how can i make a auto invoicer like when  October 6 = Novmber 6  remind invoice and php sends out a email with out me having to run it or use cron.

Share this post


Link to post
Share on other sites
[code]<?php
if(date('F') == "Janurary"){
$month = "February";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "February"){
$month = "March";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "March"){
$month = "April";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "April"){
$month = "May";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "May"){
$month = "June";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "June"){
$month = "July";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "July"){
$month = "August";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "Auguse"){
$month = "September";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "September"){
$month = "October";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "October"){
$month = "November";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "November"){
$month = "December";
$day = date('j');
$duedate = $month.', '.$day;
}
if(date('F') == "December"){
$month = "Janurary";
$day = date('j');
$duedate = $month.', '.$day;
}
$dueinvoice = mysql_query("SELECT * FROM tablename WHERE duedate = '$duedate'");
// then do the mail function for each row found
while($userinvoice = mysql_num_rows($dueinvoice)){
//$message = Type Your Message Here
//$headers = Your HEaders Here
//$subject = Subject Here

mail($userinvoice['email'],$subject,$message,$headers);

}
?>[/code]

Share this post


Link to post
Share on other sites
Guest hauntmisery
and i dont even have to view the page for it to send out the invoice reminder?

Share this post


Link to post
Share on other sites
u could make it a button
then at the bottom of the script right before the ?>
put this in header("Location: pagehere");
that will make it send an invoice to all users but u can just make it and include
on ur main admin page so eveyrtime u go on the admin page it will send but it will not send by its self unless u use cron job

Share this post


Link to post
Share on other sites

×

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.