Log in

View Full Version : PHP mysql - Help/Idea's



crobinson42
05-08-2010, 07:08 PM
I am trying to build a php site to build a weekly schedule for my employee's and i'm running out of ways to do it.

I have these tables:

-employee
-location
-shift


each table has an 'id' so i can call on employee's and location's with an $id variable.

I am thinking I will make a page to add 'shifts' and that page will insert the 'employee' and the 'location' into a row on the 'shift' table with the date and time.

Where I could use some help/idea's is creating the page to view a calendar, then be able click on a week(goes to new page) and view the scheduled shifts.
I'm not sure how to do a few things this would require:

1)call on date's appropriate to the month/year/day of week
2)only put shifts in the column that match the date at the top of the column

here's what i'm thinking for a format:

<table border="1" cellpadding="0">
<tr>
<td width="75">&nbsp;</td>
<td >11MAY10</td>
<td >12MAY10</td>
<td >13MAY10</td>
<td >14MAY10</td>
<td >15MAY10</td>
<td >16MAY10</td>
<td >16MAY10</td>
</tr>

<tr>

<td><strong>location</strong></td>
<td><p><strong>shift:<br />
-</strong>employee<br />
-time
</p>
<p><strong>shift:<br />
-</strong>employee<br />
-time </p></td>
<td><strong>shift:<br />
-</strong>employee<br />
-time </td>
<td><strong>shift:<br />
-</strong>employee<br />
-time </td>
<td><p><strong>shift:<br />
-</strong>employee<br />
-time </p>
<p><strong>shift:<br />
-</strong>employee<br />
-time </p></td>
<td><strong>shift:<br />
-</strong>employee<br />
-time </td>
<td><strong>shift:<br />
-</strong>employee<br />
-time </td>
<td><p><strong>shift:<br />
-</strong>employee<br />
-time </p>
<p><strong>shift:<br />
-</strong>employee<br />
-time </p></td>

</tr>
</table>[/COLOR]

djr33
05-08-2010, 07:26 PM
Going through the tutorials at http://php-mysql-tutorial.com should help clear this up. There are a lot of variables/problems in what you're talking about above and by clearing up some of them with those tutorials you can focus on what is really confusing you, and we can help. It may be easier to start with a smaller practice site/database to get a feel for working with mysql. What you're doing isn't particularly hard, but it's on a larger scale than what I'd recommend for a first project.