Need advise on a little project.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Need advise on a little project.

Post by Rippie »

social_experiment wrote:The config.php is the main file. I did the scripting object-orientated. Access vendorlist.php.
Should i not be able to add in Vendors from your script ? because right now when using vendorlist.pgp it just say there is no vendors in the list.'

http://www.rippie.dk/techresource/vendorlist.php

Rippie
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Need advise on a little project.

Post by social_experiment »

I wrote it so that if you have nothing in your database you would get a message informing you of this. If you have the db and tables populated with your information it should be showing the vendors as a pulldown menu and the same goes for the products and resources.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Need advise on a little project.

Post by Rippie »

So far i have added 1 vendor and 1 product. Could you please explain more how to check resource is available ? i dont get how i should fill out the resourcetbl.

Rippie
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Need advise on a little project.

Post by social_experiment »

resourcename : The name of the technical person ( Bob, Jane )
dateavailable : Date on which the technical person will be available ( in format YYYY-MM-DD )
productknowledge : This is field holds the 'products' which the technical person is proficient in. It ties in with the 'productcode' that is located inside the product table.

Here's an example :

Lets say you have a product called 'NotOffice'. You then assign this a product code, that goes in the product table. The entry will then look like this :

----------------------------------------------------------------------
product | productcode | vendorcode
----------------------------------------------------------------------
NotOffice | NOF | VC
----------------------------------------------------------------------

Inside your 'resource table' you have the following entry

----------------------------------------------------------------------
resourcename | dateavailable | productknowledge
----------------------------------------------------------------------
Joe Officeguy | 2010-01-01 | NOF
----------------------------------------------------------------------

Once the calendar is displayed, the query (below) selects the resource (technical person) that has a similar productcode (NOF in this case) AND is matches the dateavailable against the dates of the calendar. If those two conditions are met, the name of the resource is displayed on the date which he/she is available.

Code: Select all

 
<?php
$checkQuery = @mysql_query("SELECT resourcename, dateavailable FROM resourcetbl WHERE
                        dateavailable LIKE '%".mysql_real_escape_string($currentYMD)."%' AND productknowledge LIKE '%".mysql_real_escape_string($productCode)."%' ");
                        echo 'Available technical personnel :';
?>
 
Attached is the demonstration information i tested with.
Attachments
devnetdb.sql.zip
Demonstration db.
(764 Bytes) Downloaded 76 times
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Need advise on a little project.

Post by Rippie »

Hmm so how do i go around if lets say Jane is available 2 weeks ahead. do i then create 14 entries in the resource table ?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Need advise on a little project.

Post by social_experiment »

Good question. Currently the query will only select people available on a specific date. Ill see if i can modify it accordingly.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Need advise on a little project.

Post by Rippie »

That is why i was thinking to have a calendar table with dates for a whole year, and then another table where i put in when people are not available. I was then hoping to make a page that shows the next 2 weeks and then somehow look at the table that contains "events" where people is not available and then compare this with the product list and somehow it would show me what is available or not
Post Reply