Re: [PHP-DB] Enhancement of script

2002-09-09 Thread leo g. divinagracia iii

start with the easy part.  to display 3 months at a time, just do a 3 
cell table where each cell contains a month.  assuming you can write 
code to do one month, how is 2, 3 or even more months that difficult?

as for doing multiple days, either draw a month with check boxes on 
them.  or have a pull down tool that can you do mutiple selections.

Ray Healy (Data Net Services) wrote:
 Dear All
 
 I have recently downloaded a calendar from CST (which is no longer
 supported ) and I have made a few changes to the script.
 
 The calendar will be used to see when something is booked and you can assign
 messages to it as well which the general user cannot see. In this respects I
 have created 2 pages - welcome .php for the general viewer and admin_welcome
 for the updating of the calendar.
 
 What I would like to do is to be able to enter multiple dates in at the same
 time - either saying from a start date for so many days or from a start date
 to an end date.
 
 After spending hours looking at the code and in this forum I cannot seem to
 get it right - basically I cannot do it.
 
 I was wondering if someone could have a look and tell me where I am going
 wrong.
 
 I have attached the files to this email along with the mySQL table file in
 case another column needs to be added.
 
 You can see the script running at
 www.matrix-hosting.co.uk/prestige/welcome.php for the general view and
 www.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side.
 
 Any help would be appreciated
 
 
 Ray
 
 P.S. if any one also knows how to get it to display a 2 or 3 months at a
 time or even a year this would also be a bonus as I have tried to do this as
 well.
 
 



-- 
Leo G. Divinagracia III
[EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Enhancement of script

2002-09-07 Thread Ray Healy \(Data Net Services\)



Dear 
All
(Here is the message again as I noticed that the attachments 
where not sent)

I have recently 
downloaded a calendar from CST (which is no longersupported ) and I have 
made a few changes to the script.The calendar will be used to see when 
something is booked and you can assignmessages to it as well which the 
general user cannot see. In this respects Ihave created 2 pages - welcome 
.php for the general viewer and admin_welcomefor the updating of the 
calendar.What I would like to do is to be able to enter multiple dates 
in at the sametime - either saying from a start date for so many days or 
from a start dateto an end date.After spending hours looking at the 
code and in this forum I cannot seem toget it right - basically I cannot do 
it.I was wondering if someone could have a look and tell me where I am 
goingwrong.I have attached the files to this email along with the 
mySQL table file incase another column needs to be added.You can see 
the script running atwww.matrix-hosting.co.uk/prestige/welcome.php for the general view andwww.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side.Any help would be 
appreciatedRayP.S. if any one also knows how to get it to 
display a 2 or 3 months at atime or even a year this would also be a bonus 
as I have tried to do this aswell.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Enhancement of script

2002-09-07 Thread Ray Healy \(Data Net Services\)

Dear All

The calendar will be used to see when something is booked and you can assign
messages to it as well which the general user cannot see. In this respects I
have created 2 pages - welcome .php for the general viewer and admin_welcome
for the updating of the calendar.

What I would like to do is to be able to enter multiple dates in at the same
time - either saying from a start date for so many days or from a start date
to an end date.

After spending hours looking at the code and in this forum I cannot seem to
get it right - basically I cannot do it.

I was wondering if someone could have a look and tell me where I am going
wrong. (scripts at bottom of page)

ng at
www.matrix-hosting.co.uk/prestige/welcome.php for the general view and
www.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side.

Any help would be appreciated

Ray

P.S. if any one also knows how to get it to display a 2 or 3 months at a
time or even a year this would also be a bonus as I have tried to do this as
well.

The Scipts:

mySQL Database File
CREATE TABLE tablename (
id int(11) DEFAULT '0' NOT NULL auto_increment,
username varchar(255),
stamp datetime,
subject varchar(255),
description blob,
PRIMARY KEY (id)
);


welcome.php (this is what the end user sees)
?
$mysql_hostname = 'localhost';
$mysql_username = '';
$mysql_password = '';
$mysql_database = '';
$mysql_tablename = '';
$currentday = date(j, time());
$currentmonth = date(m, time());
$currentyear = date(Y, time());
$lastday = 1;
$database = mysql_connect($mysql_hostname, $mysql_username,
$mysql_password);
if (!$month)
{
$month = date(m, time());
$year = date(Y, time());
}

mysql_select_db($mysql_database, $database);
echo centerfont face=Arial size=2b;
echo date('F', mktime(0,0,0,$month,1,$year));
echo  $yearpfont size=3/bp;

$firstday = date( 'w', mktime(0,0,0,$month,1,$year));
while (checkdate($month,$lastday,$year))
{
$lastday++;
}

$nextmonth = $month+1;
$nextyear = $year;
if ($nextmonth == 13)
{
$nextmonth = 1;
$nextyear = $year + 1;
}
$lastmonth = $month-1;
$lastyear = $year;
if ($lastmonth == 0)
{
$lastmonth = 12;
$lastyear = $year-1;
}
echo tabletr;
echo tdform method=post action=welcome.phpinput type=submit
value=''
input type=hidden name=month value=$lastmonth
input type=hidden name=year value=$lastyear/form/td;
echo tdform method=post action=welcome.phpinput type=submit
value=''
input type=hidden name=month value=$nextmonth
input type=hidden name=year value=$nextyear/form/td/tr/table;

echo table width=175 cellpadding=1 cellspacing=1 border=1;
echo trtd width=25font size=2bSun/b/font/tdtd width=25font
size=2bMon/b/font/td
td width=25font size=2bTue/b/font/tdtd width=25font
size=2bWed/b/font/td
td width=25font size=2bThu/b/font/tdtd width=25font
size=2bFri/b/font/td
td width=25font size=2bSat/b/font/td/b/font/tr;
for ($i=0; $i7; $i++)
{
if ($i  $firstday)
{
echo td/td;
}
else
{
$thisday = ($i+1)-$firstday;
if ($currentyear  $year)
{
echo td valign=top align=center bgcolor=dd;
}
else if ($currentmonth  $month  $currentyear == $year)
{
echo td valign=top align=center bgcolor=dd;
}
else if ($currentmonth == $month  $currentday  $thisday  $currentyear
== $year)
{
echo td valign=top align=center bgcolor=dd;
}
else
{
echo td valign=top align=center bgcolor=white;
}
echo font size=2b$thisday/b/fontbr
font size=3;
$query2 = mysql_query(SELECT subject FROM $mysql_tablename WHERE stamp =
\$year-$month-$thisday 00:00:00\ and stamp = \$year-$month-$thisday
23:59:59\ ORDER BY stamp);
for ($j = 0; $jmysql_num_rows($query2); $j++)
{
$results = mysql_fetch_array($query2);
if ($results[subject])
{
echo font color=redb$results[subject]/b/font;
}
}
if (mysql_num_rows($query2)  4)
{
for ($j=0; $j(4-mysql_num_rows($query2)); $j++)
echo ;
}
echo /td;
}
}
echo /tr\n;
$nextday = ($i+1)-$firstday;
for ($j = 0; $j5; $j++)
{
echo tr;
for ($k = 0; $k7; $k++)
{
if ($nextday  $lastday)
{
if ($currentyear  $year)
{
echo td valign=top align=center bgcolor=dd;
}
else if ($currentmonth  $month  $currentyear == $year)
{
echo td valign=top bgcolor=dd;
}
else if ($currentmonth == $month  $currentday  $nextday  $currentyear
== $year)
{
echo td valign=top align=center bgcolor=dd;
}
else
{
echo td valign=top align=center bgcolor=white;
}
echo font size=2b$nextday/b/fontbr
font size=3;
$query3 = mysql_query(SELECT subject FROM $mysql_tablename WHERE stamp =
\$year-$month-$nextday 00:00:00\ AND stamp = \$year-$month-$nextday
23:59:59\ ORDER BY stamp);
for ($i = 0; $imysql_num_rows($query3)+4; $i++)
{
$results2 = mysql_fetch_array($query3);
if ($results2[subject])
{
echo font color=redb$results2[subject]/b/font;
}
else if ($i  4)
{
echo ;
}
}
echo /td;
$nextday++;
}
}
echo /tr\n;
}
echo /tablefont size=3;
?


admin_welcome.php  (this is what the admin uses)
?
$mysql_hostname = 'localhost';
$mysql_username = '';
$mysql_password = '';
$mysql_database = '';
$mysql_tablename = '';
$currentday = date(j, time());
$currentmonth = date(m, time());
$currentyear = date(Y, 

[PHP-DB] Enhancement of script

2002-09-06 Thread Ray Healy \(Data Net Services\)

Dear All

I have recently downloaded a calendar from CST (which is no longer
supported ) and I have made a few changes to the script.

The calendar will be used to see when something is booked and you can assign
messages to it as well which the general user cannot see. In this respects I
have created 2 pages - welcome .php for the general viewer and admin_welcome
for the updating of the calendar.

What I would like to do is to be able to enter multiple dates in at the same
time - either saying from a start date for so many days or from a start date
to an end date.

After spending hours looking at the code and in this forum I cannot seem to
get it right - basically I cannot do it.

I was wondering if someone could have a look and tell me where I am going
wrong.

I have attached the files to this email along with the mySQL table file in
case another column needs to be added.

You can see the script running at
www.matrix-hosting.co.uk/prestige/welcome.php for the general view and
www.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side.

Any help would be appreciated


Ray

P.S. if any one also knows how to get it to display a 2 or 3 months at a
time or even a year this would also be a bonus as I have tried to do this as
well.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php