Jump to content

Auto Invoice?


Guest hauntmisery

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.
Link to comment
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]
Link to comment
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
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.