Jump to content


Auto Invoice?


  • Please log in to reply
3 replies to this topic

#1 Guest_hauntmisery_*

Guest_hauntmisery_*
  • Guests

Posted 11 October 2006 - 02:18 AM

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.

#2 chriscloyd

chriscloyd
  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 11 October 2006 - 03:33 AM

<?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);

}
?>

44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code

#3 Guest_hauntmisery_*

Guest_hauntmisery_*
  • Guests

Posted 11 October 2006 - 03:53 AM

and i dont even have to view the page for it to send out the invoice reminder?

#4 chriscloyd

chriscloyd
  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 12 October 2006 - 06:08 PM

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
44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users