Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Create A 3,6,9 And 12 Monthly Schedule


In MYSQL would like to produce a field for 3,6,9 or 12 months just
containing the dates of every 7 days from the current date. I think I
need a mixture of PHP and MYSQL to achieve this.




View Complete Forum Thread with Replies

Related Forum Messages:
Shortest Script To Create Monthly Calendar Using Smarty
Here is a script to create monthly calendar using smarty. Probably its the shortest one...

<?
include_once("libs/Smarty.class.php");
$month = 07+1; //calendar for july, 06
$year = 2006;
$total_days = date("t",strtotime("{$month}/0/{$year}"));
$dates = array_fill(1, date("w", strtotime("{$month}/01/{$year}"))+1,"&");
$week_days = array( "<b>sun</b>",
"<b>mon</b>", "<b>tue</b>",
"<b>wed</b>",
"<b>thu</b>","<b>fri</b>",
"<b>sat</b>");
$days=array_merge($week_days, $dates);
$days = array_merge($days, range(1, $total_days));
$smarty = new smarty();
$smarty->assign("dates", $days);
$smarty->display("calendar.tpl");
?>

calendar.tpl

{html_table loop=$dates cols=7 table_attr='border="1" cellpadding="5" cellspacing="1"'}

View Replies !
Schedule A Mysql Db To Create A Csv File
Is there a way that I can schedule a mysql db to create a csv file every night and save it on my local computer?

View Replies !
Monthly Totals
I have a table with some records. Only one record per day, but maybe none or lots per month. The values entered are valid for every day from the date of record to next record or today. The user enters a date, And i need two totals: the total for just the chosen month, and the balance (total of all records upto the chosen month). Code:

View Replies !
Monthly Count
I have two tables:

t1 and t2

t1 has the following fields: t1.itemID, t1.issueID, t1.userID

t2 has the following fields: t2.issueID, t2.issueDate

Also t1.issueID == t2.issueID

What I need is to count by month, how many times t1.itemID appears per month for each t1.userID. I guess I could do something like:

$january = $db->get_var("SELECT count(t1.itemID) FROM t1
                        LEFT JOIN t2 ON (t1.issueID = t2.issueID)
                        WHERE t2.issueDate = &#3901;' ");

or something similar, but it just doesn't sound right to do that way twelve times... Any suggestions on how should I tackle this one?

Also the t2.issueDate field type is data and has the following format: 0000-00-00 (eg. 2005-02-15). I guess I need date function to get the month, right?

View Replies !
Send A Monthly Newsletter From My Webpage
I'm using PHP to send a monthly newsletter from my webpage to my entire mailinglist (not too big). Until now I just do all the db queries and stuff in the script, then put the necessary info into variables and include these in one big variable. PHP Code:

View Replies !
Blog - Making A Monthly Archive
I am in the middle of making a simple blog system. Anyway, I'm having trouble figuring out a way to make an archive list of months since the first blog article was submitted. I need it to be much like how WordPress has it:

>> August 2006
>> September 2006
>> October 2006
etc. etc.

How would I go about doing this? Do I determine the earliest article date, extract the month/year from that, and then list until I get to todays month/year? I really don't know how I would do that.

View Replies !
Monthly Calendar Form With Checkboxes
I have been trying to adapt a script found in Learning PHP5 from OReilly, for displaying a monthly calendar, with 2 comboboxes and a Display button, which allow to select & display a monthly calendar by setting a month and a year.

i added the code that displays a checkbox for every day in the month, so that the user can select multiple dates, then i would like to save these dates to a database.
my code for detecting the checked days is not working. Code:

View Replies !
Tracking Monthly And Weekly Stats
I have a site where members can host mp3's. I am trying to track total play stats for each song in monthly, weekly, and all-time form.

My current setup is working but extremely slow. Basically what I have is one table for monthly stats, one for weekly, and the song table itself has a column for all-time, weekly and monthly stats.

When a member clicks play on a song,..it inserts the songid, bandid, and playdate (now()) into the monthly and weekly charts. It then adds one to the alltime play column in the song table. Code:

View Replies !
How To Show Weekly Monthly Data In A Report.
Currently I display the data in a daily format. I have a form that the
users submits the date range (from say 20061224 to 20070530) and the
data is displayed daily.

I like to know how I can show the data in weekly and monthly way.so
that for the range shown above I would have the monthly or weekly
only.

Unfortunatly the date format in the db has the type text and is stored
as yyyymmdd.

i.e table.

date, sales, product and I can show daily only.

View Replies !
Credit Card Monthly Balance Calculator
I want to make a calculator that shows what your interest rate would be.
The key is that it would output a new row per month with the interest charge, the next payment, etc. Not the single line, generic ones that are all over the web.

Sample:
User inputs:
- Loan amount
- Interest rate
- minimum payment rate (usually between 1-3%)
- monthly payment desired

Here is the meat:
The output would return anywhere from 1-400 rows, each explaining the current balance and the interest accrued for that month.

View Replies !
Schedule
Currently, I have a database that stores a course schedule. For
example:

Course Title, Start Time (datetime), End Time (datetime), Mon (T/F),
Tues (T/F), Wed (T/F) Thurs (T/F), Fri (T/F)

I want to take this data and graph it as a visual calendar using
tables.

For example:

Time Monday Tuesday Wednes ...
10:00AM WS1093
10:30AM WS1093
11:00AM WS1093
11:30AM
12:00PM EH2312
12:30PM EH2312
1:00PM EH2312

Something like that. What's the best way to do this? Clearly, I
could make a an html calendar and load it up with a bunch of if
statements but is there a more elegant way to fill in the calendar?

Are there any classes available to easily do this?

Code examples are very much welcomed!

View Replies !
TV Schedule?
I've seen this on a number of TV sites, where on the front page they
tell you what's playing at the time you're browsing, what's coming up
next, etc. I want to do this for a site I'm working on, but I have no
idea where to start.

View Replies !
Schedule And Php.exe
i am making an installer for a shoutcast control panel i have designed
http://sourceforge.net/projects/cast-control
it runs on both windows and linux

I have made a bitrate controller that runs a batch file or cron job (depending on the operating system) which will run a php file with php.

In the batch file i have
c:/php/php.exe "D:/pathto/shoutcast_cpanel/bitrate/bitrate.php"

The problem is that i cannot include the database.php file which is in the same directory as bitrate.php.

I was wondering how to make this possible or at least include the database settings from the file somehow. The reason im not just running http://serverurl/bitrate/bitrate.php is because under windows it opens up a new windows in explorer for every time.

View Replies !
Schedule Job
i need to schule a php script to run once a month in apache/windows environment. what would be the easiest best way to accomplish this task?

View Replies !
Creating A Schedule
I am building a diet/weight loss website where a customer would
subscribe for 1,3,6 or 12 months. I am using Paypal IPN to handle the
subscription payments. I would like to create a schedule when the
customer first logs on, from the date they signed up to the date when
the subscription ends and every 7 days is highlighted as the weigh in
day.

Basically I would like to generate a list of dates from one date to
another with every 7th day highlighted.

View Replies !
Schedule Emails
Has anybody every attempting scheduling emails or trigering any event from a php site? for example, everyday at 10:00am call function x(); ?

View Replies !
Schedule Script Run
I need to schedule a php script to be run daily at 12.30am. What command can I place in my crontab to do this? I'm confused because a web browser is required to run a typical php script. I thought about lynx, but I'm not sure how to run it, and then exit after it runs.

View Replies !
Schedule My Classes
if it`s a good idea try to do a class scheduler in php HorarioEX.htm this is the visual part of what i want to do. the idea is the user insert the code of the class it`s called CRN, then appears on the table with some color and thats all. So do u think its a good idea to try with php ? or i should try javascript or another source?

View Replies !
Schedule Script
Is there a way to get my script to run on regularly scheduled intervals without using cron? My hosting provider sucks. cannot use cron. I was thinking perhaps I could create a file every hour in a certain directory and then fire the script when the file count reaches a certain number, and then clear out the directory or something like that.

View Replies !
Simple Calendar/schedule
I'm looking to develop a simple php calendar/schedule - similar to outlook calendar - that does not rely on a database but rather writes to a file. I need to be able to add to/delete from the schedule. As I am only starting out with php I am a little confused by the codes which links to databases and how to adapt them to only write to a flat file.

View Replies !
Wrong Dates In A Schedule
I am using the following code (many thanks for the code folks BTW) to
generate 3 schedules in three tables one is a schedule with 7 day
intervals and two are daily schedules.

The two daily schedules seem to have out of sync dates at the start of
each schedule. The dates look as if they may be dates from the
preceding loop.

I am presuming that I need to reset something after the completion of
each loop but I am not sure what.

$now = time();
$day = $now + 7*24*60*60;
$cutoff = strtotime("+$months months");
while ($day <= $cutoff) {
$date = date('Y-m-d', $day);
$insert = "INSERT INTO daily_data SET subscr_id='$subscr_id',
date='$date'";
mysql_query($insert);
$day = $day + 7*24*60*60;
}
//then create a daily schedule in the excercise table
for($i=0;$i<=($sched);$i++)
mysql_query("INSERT INTO exercise_data SET subscr_id='$subscr_id',
date=date_add(now(),INTERVAL
LAST_INSERT_ID() DAY)");
//then create a daily schedule in the food and diet table
for($i=0;$i<=($sched);$i++)
mysql_query("INSERT INTO food_data SET subscr_id='$subscr_id',
date=date_add(now(),INTERVAL
LAST_INSERT_ID() DAY)");

View Replies !
Calculate A Firefighters Schedule In PHP
I need to calculate the following schedule in php. What I need out of the script is what shift is working “today” E.G. $shift = d;.  There are 4 shifts working 24hr days starting at 7 am. The days rotate on 28 day cycles. E.G.  ‘C shift’  is working on July 1 (Sunday) the next Sunday they work is the 29th. I found some code that works with 3 shifts on a different cycle but I have 4 shifts. Code:

View Replies !
Calender Script/Schedule
Does anyone have any recommendations or tips on where I can go to find a good scheduling script or a tutorial to make one? I'd perfer to make my own for security reasons so I know the code and for later addons.

Basically I need to re-create something like http://radio.virtualdj.com/schedule/schedule.php where djs can login to book a time on the online radio and then it blocks the slot off.

View Replies !
Allow A User To Schedule A Stay
I am trying to code a program in PHP that would allow a user to schedule a stay at this place, it would save that to a database. If a particular day has 5 people booking it, it is no longer able to be scheduled. I can't get the scheduler page to check how many people have booked or my calendar to display a day in red if it is booked.

View Replies !
Schedule Php Script Within Cron
If I wanted to schedule a cron job for every Sunday @ 1:00AM what would the syntax be?

View Replies !
How To Schedule Tasks On Website.
I am trying to figure out how to schedule tasks on my website. For example, PAGE1 should perform a different task in the morning than in the afternoon.

And at the end of the day, I have to extract some data from the database and put them into a file. This should be done automatically.

View Replies !
Schedule Mail Sending
I need to send an newsletter as an email that is scheduled. The user will prepare the newsletter and save it in database. He will also input the scheduling option i.e date and time the newsletter has to be sent. I have a table Newsletter_T where newsletter contents are being saved and Contacts_T where the email address resides. I am using PHP 5.2.3, Apache and MySQL.

View Replies !
Send Email With Schedule
I want to create an option to the user to suscribe to a service that sends an automatic mails everyday with information taken from a database created in MySQL. I have the form and the access with PHP to the database and I can send an automatic mail at the moment that the users press a button to activate the action, but I do not know how to do it everyday (or the period of time chosen by the user).

View Replies !
Creating A Schedule Script
I have a league based web site and I'm looking to make a script that can make a schedule of matches. Last year I did alot of hard coding with a ton of if statements (not very fun). There are 2 vars. how many weeks you play number of teams.

View Replies !
How To Set Up Multiple Dates For Schedule?
I have a question about how to set up dates in my mysql database. I am setting up a show schedule database for a friend at a local college tv station. This would normally be pretty straight forward and easy. The problem lies in the fact that their show lineup is not huge, therefore they air most of their shows that the students produce up to 5 times a day and also some of these shows -not all- come on all week long (Sunday thru Saturday) and some only come on one or two days out of the week.

My database (so far) contains the following tables: ...

View Replies !
Schedule A Cron Job With Php Script
Is it at all possible to schedule a cron job from a php script? Perhaps cron isn't my best option.

I need to have a script run automatically at one specific time and not repeat. The way I was thinking of doing this is to schedule a cron job, then when it runs remove it from crontab. Is this possible, or even the right solution?

View Replies !
How To Schedule Jobs On A Host?
I'm using a php hosting company for my website. It seems most php pages are user-event triggered, so it is difficult to schedule something to run regularly.

For example, user puts something in discussion board, and I need to update my search index to include it. Since building index is pretty IO intensive and takes long time, I hope to do it once a day when traffic is very low or zero so it doesn't impact server performance. I can't really rely on user events to trigger such things.

For example, user won't expect his click would trigger a 20 minute delay so I can piggy bag an index-build at the page handler, and there might not even be user clicking my site at the time I desire.

Is scheduling for jobs (or something similar) achievable using regular PHP? (I don't have shell login, etc. for the typical PHP hosting service).

View Replies !
Setting Up A Time Schedule?
I have a php script that needs to run 6 times a day, the documents that came with it suggest that it should be setup as a cron job, but where my site is hosted, I'm unable to do this.

so I thought that maybe I could setup a php time schedule, so that the script will run inbetween these times when a users hits the site:

12am-1am
4am-5am
8am-9am
12pm-1pm
4pm-5pm
8pm-9pm

but also I'm wondering how the script could keep track if the script has already been ran for a particular time period.

View Replies !
Table With Weekly Schedule From A Database?
I'm designing a site for a community radio station and the schedule needs to be generated from the list of programs that are in the database the shows table has the following colums show_id, show_name, day, start_time, end_time (i didn't list the non-relevant ones for this portion of the site)

because a table has to be built left to right instead of top to bottom (cell for monday 8am then tuesday 8am instead of all the monday then tuesday etc) and not all the programs are the same length (i think i can use row span="x" depending on the length of the show)

I'm quite lost. should i have other colums? how do i query the database to pull the data out in the proper order and build the table?

View Replies !
Examples To Display Day Calendar Schedule?
I am trying to find some code to help me along with dsiplaying a day
schedule. For example, a linear time-line with appointments blocked out or
colored differently.

View Replies !
Write A Script To Show A Radio Schedule On My Website.
Right, basically im looking to write a script to show a radio schedule on my website. I've already created my database with the following fields: Code:

View Replies !
How Would Watchers Know, Without A Cyclic Check On MySQL Schedule Table About Task Validity?
I have developed a PHP-based website where a "planner" user can make
up schedules of activities to be performed, storing them into MySQL
tables. Afterwards, other "watcher" users can connect to the website
and retrieve closest task due time, and keep retrieving next task
after each one has been performed.
The problem arises if the planner asynchronously changes the schedule,
e.g. deleting the task "watcher" users consider to be the next one, or
inserting a closer one. How would watchers know, without a cyclic
check on MySQL schedule table about task validity? I would need a sort
of asynchronous server-pushing tecnhique towards watcher's browser
when any schedule modification occurs.
Would you say this could be done with PHP alone?

View Replies !
SELECT Error: No Database Selectedin Query: SELECT * FROM Schedule
I got the above error message after reading FAQ #10 which applied to my first error. The thing is, I thought I had selected a database. This script is copied from a tutorial, and I'm just too new at this to spot my error. PHP Code:

View Replies !
Create Rss Xml
I'm currently working on creating the xml feed since I had data ready
in my database after web data extraction. However, it has errors for
this line:

<xml version="1.0" encoding="ISO-8859-1">

I was unable to solve this.

<html>
<head>
<title>MMU RSS FEED</title>
</head>
<body>

header("Content-type: application/xml");

<xml version="1.0" encoding="ISO-8859-1">

<rss version ="2.0">

<channel>
<title>MMU RSS FEED Today: <?php echo date("D, d-M-Y H:i:s")?></
title>
<link>http://bulletin.mmu.edu.my/</link>
<description>MMU RSS FEED</description>
<ttl>60<ttl>

<?php

//connect to database
$db = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("bulletin", $db) or die(mysql_error());

$day = date("Y-n-j");

//select queries
$sql = "SELECT * FROM `bul_data` WHERE `DATE` LIKE '{$day}%' ORDER by
`DEPARTMENT`";
echo "sql=".$sql;

$res = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($res)>0)
{

while($row=mysql_fetch_assoc($res))
{
$date = $row['DATE'];
$title = $row['TITLE'];
$department = $row['DEPARTMENT'];
$link = $row['LINK'];

//output to browser

echo "<item>";
echo "<title>$title</title>";
echo "<category>$department</category>";
echo "<link><a href="$link">$link</a></link>";
echo "</item>";

}

echo "</table>";

}

?>

</channel>
</rss>
</body>
</html>

View Replies !
Create Php.ini
The support of hosting contracted indicates that I
must create a file php.ini in the folder wwwroot/in
which I indicate the new directors for the values of
upload_max_size, memory_limit, post_max_size,
max_input_time, max_execution_time to me which I need.
Using the function ini_set. The truth I have proven of
many forms and it does not manage to do it if somebody
knows to use this function or similar configuration I
thank for them.

View Replies !
Help Need To Create Pdf
I want to create pdf files on fly. Is there any class is available?

View Replies !
Create Pdf
who have used the r&os module for creating pdf?? i cant create a simple hello world bcoz i always get this message == file does not begin with '%PDF-' here is my code: PHP Code:

// make a new pdf object
$pdf = new Cpdf();
// select the font
$pdf->selectFont('./fonts/Helvetica');
$pdf->addText(30,400,30,'Hello World');
$pdf->stream();

View Replies !
Create Dir On The Fly
Is it possible to create a directory on a server on the fly based on a form which inputs into a database. Basically the form inputs the value "test" into the db and the folder at website.com/test is created. Also is it possible that within the folder some php pages are included, so that lets say contact.php and sample.php are included in the test folder?

View Replies !
Create PDF's
Just a query on this one, has anyone had any experience in creating PDF's on the fly, what I mean is dyamic PDF's.

I'm creating a quote engine, so it would be nice to give the user a PDF version of the quote.

View Replies !
Create Dir
I need a script that will create a directory (which will be named whatever is entered into a text box) and once a directory is created, it needs to have the ability to copy some folders/files into that directory.

View Replies !
XML Create
I need to create an XML string using PHP5. The examples I have followed seem to be using out dated libary calls. I tried new_xmldoc() and new DomDocument.

Both get undefined errors. How do I create an XML string where it will look something like this: Code:

View Replies !
Wat Is An *.inc For? How To Create It?
include('hello.inc')eg like this code
how can i create a *.inc
and wat purpose of an *.inc for?

View Replies !
Can I Create Dll
we are using dll files like lib_mysql.dll to access the built-in functions to access mysql database in php. is there anyway so that i can make my dll and put my functions in dll and then access them so it protects my function source code.

View Replies !
Can Php Create A New Txt File?
I'm trying to build an e-card page for a client using php, but they don't want to use a mySQL database, so I was wondering if PHP can create new text files when someone enters their information into a form and then the recipient gets an email with that txt file reference in a link and can then go to a page that populates with that particular text.

Does it sound like I'm on the right path?

View Replies !
PHP Create .htaccess
Can PHP create a .htaccess file?

View Replies !
Using Php To Create Subdomains
Hi i was interested in knowing if php can be to create subdomains and if so can someone point me in that direction.

View Replies !
Create Oop Applications Using Php?
does anyone here create oop applications using php? can you direct to a good place to start? i'd like to learn how.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved