Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records.
I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head.
I imagine in order to point me in the right direction you will need some information about my database.
View Complete Forum Thread with Replies
Related Forum Messages:
Using Events In Calendar
In an array I have the events stored wich come from a database, now I want to display them in the calendar (with a different color). The Array contains ca_title, ca_startdate & ca_enddate. Code:
View Replies !
Wordpress Calendar Of Events
I want to make a "calendar of events" in a side bar of a blog. When the mouse hover on it, it will show the users the events of that days in a pop up window. "The pop up window" may contains links to other sites, so it should be wait certain time to let the user click the link....
View Replies !
Displaying Events In A Calendar
I have a calendar that I would like to display some events on. The events are stored in a database but I do not think I am getting the information in the right place and displaying like it should be. I cannot seem to get an event to display on the exact date that it should be displayed on. I can get one event for a whole week but that, of course, is not right. Code:
View Replies !
Calendar Highlight Events
I have the attached code but I would like to modify it slightly so if any events occur on each day, they are hightlighted. Could I create the query as a function? Code:
View Replies !
Events Calendar Script
Does anybody know of a simple easily customisable events calendar script. Preferably something without lots of complicated calendar view stuff.
View Replies !
Events Calendar Software
I want to use an events calendar module for my project please suggest me , i want to display calendar on the front screen and when i click on the date i should able to add/edit and delete events for my application. Please suggest me open source
View Replies !
Events Calendar Using MySQL Database
I have a mySQL table listing all the regular events that happen each month for a group according to schedules like, every Sunday or every other Saturday*. How can I make a visual monthly calendar out of this? Basically, I need to produce a list of dates for each of the events happening in a given month. That's where I'm stumped.
View Replies !
Using A Calendar To Display Events From A Database
I have been able to produce the calendar (month at a glance), but I cannot query a date from the calendar from its corresponding date in the SQL database to display events from that day. If it works properly, it should show all events for the month on the appropriate day. Variables used: $year // example: 2005 $month // example: 8 $day_counter // example: 11 - this is looped to increment until month is done $thisdate = mkdate(0, 0, 0, $month, $day_counter, $year); $sql = "SELECT * FROM `school_year0506` WHERE Date LIKE '$thisdate'";
View Replies !
Web Calendar Group/individual View Events?
There seem to be a lot of web calendars out there and I am having a tough time sorting out which ones to even try - a lot of the more popular ones were created 2 or 3 years ago. Can anyone recommend a good one that uses php and mysql preferably? One of the main uses would be for family to indicate their holidays so all in the family can see. Thus, it would require a group/public feature that allows users to see all "public" holidays or just their own holidays.
View Replies !
Sample Month At A Time Code For Events Calendar
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data dates only, this code is intended to use more thrifty event descriptions (3rd saturday, last tuesday, etc.) as well as traditional one-of dates. The core here here is quite spartan, no table logic or or db cruft included <?php //sample code to generate american calendar format for a given month // i,e. start of sunday on or before the 1st end on te saturday on or after the last day. // makes use of mktime's cool liberal calculation of dates. // Set sample month and year values: $mn = date("m"); $yr = date("Y"); // Start calendar logic: $firstday = date("w",mktime(0,0,0,$mn,1,$yr));// Get first day of target month (0=sum 6=set) $numdays = date("t",mktime(0,0,0,$mn,1,$yr));// Number of days in target month $daystop = $numdays+(6-date("w",mktime(0,0,0,$mn+1,0,$yr)));// Adjusted last saturday of calendar page (on or after last day of month //start with american first sunday on or before start of month of calendar page and end on daystop (saturday) for($daynum = 1 - $firstday; $daynum <= $daystop; $daynum++) { //need working date timestamp to work out details of the calendar $wkdate = mktime(0,0,0,$mn,$daynum,$yr);//the first of the month - unix value $wdy = date("w",$wkdate);//day of the week (0 sun - 6 sat) $wmn = date("m",$wkdate);//month $wdt = date("d",$wkdate);//date $wdte = date("D, m/d/Y",$wkdate);//date string of current date "Day, mm/dd/yyyy"
View Replies !
Building Multi-city Events Calendar W/ User Input
my PHP experience so far : for a site i built, i started with a newsletter signup, and eventually made more complex forms with lots of different field types and lots of validation. So i havent got into "strings" yet. ( i can hear the laughter from here). But i'll do it. my question is, i want ot build a site for someone that would somewhat resemble www.Craigslist.com - no images. It would be an events calendar, formatted similarly. A list of cities, each linking to a calendar with events posted for that city. Code:
View Replies !
Delete Past Events
There was a post similar to this one but I can't find it right now. All this is to do is get rid of past concerts if it is before today. I do have DELETE privelege for the user $today = date("Y-m-d"); // Delete past events $sql = "DELETE FROM tbl_events WHERE eventDate < '$today')"; $query = mysql_query($sql); no clue why it doesnt work
View Replies !
Intranet-based Calendar?
I'm interested in creating an Intranet-based calendar which will contain company information such as holidays, special events, etc. I was wondering how this could be done. I was originally thinking of using an ActiveX control of some sort but would rather use DHTML w/ Perl/PHP instead.
View Replies !
Showing Events By Date
I'm using "select * from calendar where datum >= current_date ORDER BY datum ASC" in my code to show every event listed in my database where the date = or is greater than today's date. I have a field (datum) in my table, with the type date (2006-02-23). The browser is showing this great in Europe, but in the US he is not showing the event of today. Does anybody know why he is not showing events from the current date in the US, and how I can solve this ?
View Replies !
Events Calander And Date Conversion
I have been working on an events calander program that needs to be in chronological order by date. The fields I have are id, date, event and event discription. The problem I have is that the event date needs to be displayed in this format 09/21/03. However, when I simply sort by date 02/21/04 would display before 03/21/01. How could I sort by date and display the date in the 00/00/00 format.
View Replies !
MySQL Grouping Events By Date
I am using MySQL with a flat table exported from another dB to create a simple event calendar in Dreamweaver MX 2004. I would like to have the events grouped by date and ordered by date and time. I have been unable to figure out how to group by date while preserving all the records. I have tried using GROUP BY in my SQL statement, but this reduces the number of records returned. I have also been trying, without success, to use loops and if statements to suppress the date from repeating after the first record. A sample of my SQL statement and code, along with what my current return looks like and what I would like it to look like are provided. Code:
View Replies !
Auto Delete
This script was meant to delete a file after X days...in this case I wanted it to delete files that were older than 1 day except .htaccess. what the script is doing is deleting everything in the specified folders except htaccess even though the files are less than a day old. any suggestions? Code:
View Replies !
How To Auto Delete Table Row?
I Have A Page On My Site That The Database Outputs To. There Is A User That I Dont Want To Ban Yet , But I Do Want To Block Or auto Delete His Data. Now When Everyone Post New Data The Only Table That Would identify Them Is The Username Table, There Is No Member ID Table. Now I Would Like To querry The Database And Auto Delete Table (Username) BOBBY And The Row BOBBY Posted , So There Is No Data Output To My Site Page For BOBBY. Can Someone Give Me A Couple Codes To Try, And I Would Think The Code Would Need To Be On A New Page That I Need To Make Up Right?
View Replies !
Auto Refresh Based On DB Modify
This scenario involves 3 PC's. PC #1 is the Order Supervisor, charged with updating the DB. PC #2 is the PC displaying the table echoing out the query results to a wall mount plasma. PC #3 is the PHP/Apache/MySQL server. PC #1 user will be updating the DB with open orders as they come in and clearing the open orders as they are completed. Simple stuff so far. What I want is for PC #2 to refresh everytime PC #1 posts an update to MySQL. My thinking is instead of just doing an auto-refresh on PC #2 every 10 seconds (unnecessarily hammering SQL) to only refresh if the DB gets modified. The tricky part is how do I initiate the refresh on PC #2 when the DB gets modified? (Nobody sits at PC #2) Can this be done? I don't see how to tell PC #2 about the update... but you guys are pretty smart.
View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles. To give the ID i simply use the Auto count of the DB. But what happens when i delete a record? i am now missing an ID. How can i insert a row and give it the first available number? For example ID 1, 2, 4, 5, 6 i would Insert and set the ID number to 3.
View Replies !
Auto Delete Record/Send Email After X Hours
What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc. I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script. A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?
View Replies !
Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?
I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases. Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:
View Replies !
Date Calendar
At present i have reports that when added include the DATETIME stamp, which are placed in a column called date_booked. I have also setup search functions for when certain columns equal a certain variable show them etc. What i want to do is have a calender, and have it so i can select the date on the calender and it will search all the date_booked, and show any results.
View Replies !
Delete Files From Server Based On Filename...
I need to open a folder on my server, then look at the files in the folder.... then if I find a file that meets a criteria - i want to delete it. for example, I have a file list such as 1_hello.jpg 1_boo.gif 2_raaaa.gif 4_mad.jpg etc etc The numbers at the beginning indicate the userid and an image they have uploaded... I need to open the folder, tell the script that anything starting with a "1_" should be deleted.
View Replies !
Calendar/Date Picker
I have searched for hours on end trying to find the perfect calendar. I would like one that: 1. Displays the selected date into drop-down boxes e.g 1 for day, 1 for month and 1 for year. 2. These drop down boxes can then be saved to database 3. Anything else goes really, as long as it looks good.
View Replies !
Selet Date From Calendar
To give you the background, this is a page for booking jobs. It ranges from client name, to location, to machine , then i need the date when the job is to be carried out. So i want to be able to have a little calendar, and be able to go through select the date and it will then input that into the database when i submit the book job form. So pretty much everyday is linkable to a value that is in the format of DATETIME. Possible?
View Replies !
Select Date From Calendar
I'm creating a simple form to collect some information from visitors, however i'd like to use a small calendar where the visitors can select a specific day.
View Replies !
Problem Changing Date In Calendar
It's a calendar. You see the current date and when clicking on an other day of the week it should change the date, this works, BUT if you change the date again you don't geet the right day. Code:
View Replies !
Calendar To Pass Date As Variable / Address Bar
I'm looking for a calendar where I can simply browse the next | Previous months, and then when I click on a date in the calendar it simply passes the date clicked on to the address bar so if I clicked on today's date it would pass something like:- Code:
View Replies !
Writing And Searching Calendar Date With Mysql
i am trying to write an appartment booking script I have this form with two text fields with a date in it and write this to a database for example: my appartment is booked for 01-01-2005 till 01-02-2005 how can someone search the database for dates that are booked or not booked so if someone searches for 01-01-2005 till 01-02-2005 or parts of this period then the text "appartment is booked" must appear else the text "appatment is free" must appair what should the code look like for writing the dates to the database and what should te code look like for searching the database.
View Replies !
Date Auto-Update
Something to the effect of: <?php $saved_date = '<!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate -->' ?> <?php $saved_date = ' ?> <!-- #BeginDate format:Am1 -->April 4, 2006<!-- #EndDate --> <?php ' ?>
View Replies !
Stoping Auto Updates Of The Date Field
I have a table with a field using the "timestamp" type. When I update another field, the "timestamp" field also updates to the time the other field was updated. I don't want this. I'm using this to update the table. PHP Code:
View Replies !
Auto Changing Link Depending On Date
I want to have a special link on my site. The link is to a text file located on a distributor's website and is named with a specific filename in the same format every week. In other words it's guaranteed predictable. Here is what the file would look like, shipping_032107.txt which means, shipping_(month)(day)(year).txt How could I use something to make the link the right name without modifying my page weekly? The one tricky part is that it's updated once a week and it would be Wednesdays date each time. So it actually has to predict the next date. Perhaps if the script couldn't do that it could figure out todays date, check it to the days of the week and add a number to equal the proper day, I have no idea what to start with for this.
View Replies !
Auto Fill Date Dropdown List
How would I modify this code to display the years in the dropdown list like so: current year 2006 2005 back 50 years <select name="year" id="year"> <?PHP for($i=date("Y"); $i<=date("Y")+2; $i++) if($year == $i) echo "<option value='$i' selected>$i</option>"; else echo "<option value='$i'>$i</option>"; ?> </select>
View Replies !
Get Date Based On Weekday?
I have this: Mon, Tue, Wed, Thu, Fri, Sat, Sun created as links. What I would like to do is to associate days with its current week dates, for example: Mon (05.01.2004); Tue (06.01.2004); and so on.
View Replies !
Record Based On Date
We're using Calendarix, a PHP based calendar. It does not use PHP's DATE() function to store the date of future events, but instead uses 3 fields that display the date of the event, a field for month, day, and year (those are the filed names as well).
View Replies !
Query Based On Date
i was wondering if this was possible as I cant quite think how (maybe too early in the morning) I need to run a query based on the last 6 months of entries. In my table i have the usual headers e.g. name and body of text etc, but also a date_created column with stuff like 2005-12-20 15:44:37 in it.
View Replies !
Cost Based On Date
What I would like to do is produce a quote for a customer based on the dates they input. For example if someone wanted a 3 night stay beginning 23/08/05 the cost would be £25 per night. If they wanted 2 nights in December it would only be £15 a night. I am presuming this would be based on some sort of date range function, except the other problem is bank holiday dates are also a different rates to normal.
View Replies !
SELECT Based On Date
I'm trying to use: SELECT *, DAYOFMONTH(Date) AS d, MONTH(Date) AS m, YEAR(Date) AS y FROM Events WHERE m = 10 AND y = 2007 ORDER BY Date But I get 'Unknown Column m in WHERE' error. I assume it's because it is just defined. Can I use a defined value in WHERE?
View Replies !
Delete MySql Row By Date
Can someone help me with the following problem: I have a table that includes a column for "last application date", let's simply call it "date". Now the problem is how to automatically delete rows where the information in the "date" column has gone old, let's say by -86400 (1 day). Example: today's date is April 11th, which means that all rows with the info April 10th in the date column would get deleted.
View Replies !
Add To Date Based On User Selection
I have a form with Radio buttons that when selected should add "$howMuch" amount of hours to the current date and time and put the output into a field called "ExpireTime". The code I'm using for the hour adding: PHP Code:
View Replies !
Calculate Age Based On Date Of Birth
I am trying to validate whether or not a date of birth entered in dd/mm/yyyy format is between 16 and 69 years old. Suppose we have todaysdate = 18/04/2007 The minimum allowed date of birth would be 18/04/1991 and the maximum allowed date of birth would be 18/04/1938. I have looked at using strtotime but this only does dates from 1970 (I think)
View Replies !
Clause Based On Date/time
I have a database that returns a field with a date and time that looks like this: 12/04/2007 07:45:03 I need a simple clause that says if the time is before noon then A else if the time is after noon then B I could split the date from the time in a string then split the time by the : but there is a much easier way, right?
View Replies !
Query Based On Date Range?
I'm using php/mysql, and I want to write a query that will continually return results for records that fall within 7-day dates ranges. So, I want a query that will print out records for: 12/1/05 - 12/8/05 12/9/05 - 12/16/05 12/17/05 - 12/25/05 .... infinity Can I accomplish this using a mysql query, or do I need to do something fancy with php, or both?
View Replies !
Search By Date Based On Time()
i am modifying a website where i want to make a search facility e.g i want to search the users who signed up between 2006-10-25 and 2006-10-27. but the previous developer has used time() function to insert joining date of the user sign up and also the field type is BIGINT(20) so now when i use the following code it doesnt give me the accurate results, PHP Code:
View Replies !
Calculating A % Based On Date Range
I want to get the percentages for the 2 possiable values in TransResult and I want this done by date, so I can go backwards to compare what was done in the past months to what is done in current month. This is what i have come up with so far, however my _total is giving me ALL records in the table not this months records, so my percentages are off, aside from the total the values it is calculating are correct. SELECT TransResult, COUNT(*) AS HowMany, (COUNT(*) / _total ) * 100 AS Percent FROM tbltranslog, (SELECT COUNT(*) AS _total FROM tbltranslog) AS myTotal WHERE MONTH(Date) = MONTH(NOW()) +0 GROUP BY transresult.
View Replies !
Displaying 'new' Icon Based On Date?
I'd like to display a little "new" icon next to all products in a directory which are, funnily enough, new! I've got a date (timestamp) for each product which is inserted on adding a new product and updating a product. I'd like to do a conditional region using the timestamo but I'm not sure what to use - I could do === [current date] but that would only show the icon for that day and I'd like it to be there for about a week or so.
View Replies !
How To Total, Based On Per Day Without Selecting Each Date Individually
I have an sql select statement with a date(between) in it. What my boss wants is to take this date range and then total the number of hours for each day base on a status, ie, work, vacation, etc. I can get the date range fine, but i don't know how to total based on per day without selecting each date individually. I know how to do it for the entire range but not individual day.
View Replies !
|