Advertisement

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - darkhelmet

Pages: 1 ... 55 56 [57]
841
Computer & Technology / Re: php recurring events
« on: September 01, 2010, 12:22:14 PM »
yeah, i'm finally finished with the calendar!  ;D
turned out pretty well.

842
Computer & Technology / Re: php recurring events
« on: August 31, 2010, 11:21:48 PM »
Thanks for the suggestion.  I'm trying to keep my tables as few as possible since the calendar is just one component of the whole project.
I decided to just use one table for the calendar.

My table fields are like this:

CALENDAR_TBL
//the general fields below

id
name
address
city
state
zip
phone
website
description
contact_firstn ame
contact_lastna me
contact_email
start_datetime
end_datetime

//the recurring fields below

type - Type of recurring event (daily, weekly, monthly, etc...)
dates - Recurring dates (dates that repeat)
countdates - Number of days total (total # days)
days - The days by week (weekly days that repeat... sun, mon, tues...etc...)


If I was to implement this; my table would look like this:


EVENT
-------------
uid
name
description
lft
rgt

EVENTDATE_REL
--------------
eventuid
eventdateuid

EVENTDATE
-------------
uid
day
month
year
hour

RECURRING_EVEN TDATE_REL
-----------------------
eventdateuid
recurringuid


RECURRING
-------------
uid
day
month
year
hour


This will allow me to have Events that have the ability to have multiple childrens events and each of those (parent and childrens) events could use the same event date setting and recurring time frame.




843
Computer & Technology / Re: malware and spybot
« on: August 31, 2010, 01:56:37 PM »

844
Computer & Technology / Re: php recurring events
« on: August 30, 2010, 02:58:06 PM »
I just did some testing on my initial code above and it doesn't work.  It's skipping to the next week once a date is found.
I'm redoing it based on an open source program I'm dissecting from.

Code: [Select]
$valid = true;                        
for($x=0;$x < $frequency*7;$x++){
$occurance = date('Y-m-d  H:i:s', mktime(date('H', strtotime($startDate)), date('i', strtotime($startDate)), 0, date('m', strtotime($startDate)) , date('d', strtotime($startDate))+(($x*7)*$interval), date('y', strtotime($startDate)) ) );

$lastweek=sprintf("%02d", (strftime('%W',strtotime($occurance))-0));
$year = strftime('%Y',strtotime($occurance));
for ($i=0;$i<=6;$i++){
$thisDOW = strftime('%w',strtotime("+{$i} day",strtotime($occurance)));
    $occDate = strftime('%Y-%m-%d', strtotime("+{$i} day",strtotime($occurance)));
   
   //-- Check if the date is one of the assigned and less than the end date
   if(in_array($thisDOW, $onwd) && strtotime($occDate) <= strtotime($endDate)){
$ar_Recur[] = $occDate;
   }
   
   //-- If the date is past the end date end the loop
   if(strtotime($occDate) >= strtotime($endDate)){
$valid = false; //-- End the loop
break;
   }
}
if(!$valid) break;
   }
echo implode('<br/>', $ar_Recur);

845
Computer & Technology / Re: php recurring events
« on: August 29, 2010, 04:16:26 PM »
jetter,
i came up with this function for the day of the week range.  is there a better way?

Code: [Select]
$sd = "08/01/2010";  //start date
$ed = "08/31/2010";  //end date
$thedays = "1,5";  //the days, e.g. sun=0, mon=1, tue=2 ...

echo dayoftheweek($sd,$ed,$thedays);

function dayoftheweek($sd,$ed,$thedays){
$start = strtotime($sd);
$end = strtotime($ed);
$calcdate = strtotime("sunday", $start);
while($calcdate <= $end) {
for ($x=0;$x<=6;$x++){
if ((in_array($x,explode(',',$thedays)))and($calcdate<=$end)){
$output .= date("D n/j/Y", strtotime("+$x days", $calcdate)) . "<br/>";
$calcdate = strtotime("+1 weeks", $calcdate);
}
}
}
return $output;
}

846
Computer & Technology / php recurring events
« on: August 26, 2010, 10:53:30 AM »
Hi,
I'm starting to work on a php based calendar (events) and I would like to implement a recurring events option.

Does anyone have any snippet or class that can calculate the dates if I provide the starting date, end date and occurrence? e.g. daily, weekly (s, m, t, w, th, f, s), monthly, annually.

Also, if you have any suggestion on sql/db setup, I'd appreciate your input.
I was thinking of doing the straight forward approach - every event having their own record.
So I'd set up two tables, one to store all the event records and one to store info on recurring events.
That way each record can be edited and old events are still accessible.


Thanks!

847
Computer & Technology / Re: do you programmers ever get tired...
« on: June 24, 2010, 04:21:00 PM »
man you work too hard, what you need to do is work smarter.  As long as you make progress by killing task or moving towards your goal, there is very little your superior or employer can say about it.  When working for employer who likes to keep track of every minute using some sort of project management software, all you do is kill x amount of task in 2-4 hours, and then split those throughout the day.


jetter, we have a little freaking timer widget on our desktop that we are always pushing start/pause.  i know what you mean by being able to finish task earlier so you can sit around.  however, we have estimates that the boss gives us based on what it should take.  and we are expected to finish by that deadline.   some might take more, some take less.. . in the end it's a push.

848
Computer & Technology / Re: do you programmers ever get tired...
« on: June 24, 2010, 08:45:27 AM »
I frequent youtube, read the news, watch the market and visit ph most of my days.  I spend about 2 hours of actual programming and the rest research and reading.



I have to put in minimum 6 hours of "real work" per day so I can't goof off.  We keep track of every minute because that's how we bill clients.  Wish I could surf the net too but I'm only allocated 2 hours per day for "research".

849
Computer & Technology / do you programmers ever get tired...
« on: June 17, 2010, 02:19:09 PM »
of staring at the computer all day long? 
i have been putting 50 hours a week, staring at the computer and i'm sick of it.  i don't think i could stand this year in and out.
how do you guys maintain it?

850
Computer & Technology / anybody use CMS called ModX?
« on: May 06, 2010, 11:13:21 PM »
i'm learning oop in php right now but we have some clients using ModX and I don't know where to start.  Any help from you guys would be appreciated if you have used this cms before.

851
Computer & Technology / recommendation for test server
« on: May 06, 2010, 11:11:59 PM »
hi, our company want to get a test server so we can implement and run test on products that we work on.  we mainly do web design, cms implementation and customization, and other web stuff.   we also mainly work on php for now.
you guys got any ideas?  i'm not really a hardware or network guy.  my boss said we could purchase space from rackspace or get cloud servers, or whatever there is out there.  but i'm not sure what to recommend.  any inputs would be appreciated from you guys.

852
Automotive Discussion / Re: What Car Do You Own? (Make Into Sticky?)
« on: April 22, 2008, 09:50:29 AM »
Ride: White 91 Mits Galant VR4
Mods:

JDM motor
1G big rod
2G pistons
Mits metal HG
All OEM gaskets, bearings, etc
New lifters
Remove bs
Front axle
Centerforce DF clutch
Water pump
Timing belt

Lotek pod
Autometer boost gauge
Autometer EGT probe, gauge
Autometer air/fuel gauge
1G ported 02 housing
2G ported manifold
2.5" Certified stainless turbo back
OBX bullet muffler
Denso 190 FP
Mits 16G ported hot/cold no clip
AGX with Ground Control
Joe P MBC
Extreme short shifter
White gauge


Pages: 1 ... 55 56 [57]
Advertisements