Welcome Guest, Not a member yet? Register   Sign In
calendar advice
#11

[eluser]jdfwarrior[/eluser]
Well I dont know if you noticed but I changed the function name from showCalendar to getCal. That will prob fix the bottom error if you fix your code/the way your calling it.

And I think I see the other problem. I was trying to fix an error I was getting and forgot to change something. These lines:

Code:
//If month is not specified, set $month variable to the current month, otherwise, use the specified month
        $this->current['month'] = ($month ? $month : date('n e'));
        //If month is not specified, set $year variable to the current year, otherwise, use the specified year
        $this->current['year'] = ($year ? $year : date('Y e'));

Should be this: edited....
Code:
//If month is not specified, set $month variable to the current month, otherwise, use the specified month
        $this->current['month'] = ($month ? $month : date('n'));
        //If month is not specified, set $year variable to the current year, otherwise, use the specified year
        $this->current['year'] = ($year ? $year : date('Y'));

I must be having a bad morning.. I cant think right today

in the constructor
#12

[eluser]tim1965[/eluser]
Hi

Many thanks again for your help. Ok all previouse issues fixed. However i am still getting this displayed in html
Quote:

1
2
5
6
7
8
9
12
13
14
15
16
19
20
21
22
23
26
27
28
Quote:

Not no 3 or 4 in above list ( problem displaying above it actually reads 1,2,5,6,7,8,9,10,11,etc thru to 28 not 1,25,67, as preview is showing me)

I have double check everything but...(as a double check) my controller is

<?php

class test extends Controller {

function index()
{
parent::Controller();
$this->load->helper(array('form', 'url'));

$this->load->library('phpcalendar');

$cal = new phpCalendar(2,2006); //or whatever month,year you want
$code = $cal->getCal();


echo $code;

$this->load->view('calendar/test');
}
}
?>
#13

[eluser]tim1965[/eluser]
Sorry

Main problem no dates being shown obviously
#14

[eluser]jdfwarrior[/eluser]
Not showing 3 & 4 because its set to be a 5 day calendar, not a 7 day, so its skipping the weekends.

Its its showing the dates in a vertical list, then they arent getting the css applied and therefor arent getting thier sizes set, and arent being aligned properly. Check to make sure the css is being applied.
#15

[eluser]tim1965[/eluser]
Aaagh sorry my stupidity didnt pick up on the other missing days !! Changed to 7 days now.
Will check the css.
Thanks very much for your help on this.

If you are feeling excessively generous today (and you have already helped me a great deal), could i ask 1 further question just to point me in the right direction.

My ultimate aim is to have individual dates highlighted based on a value stored in a db. So it will be "start data" "end date" "value" in db. Pull these from the db and highlight these dates when displayng the calendar. So is the best way to do this is to turn $calendar into a array of dates and then merge it with a query array from my db and then loop thru to highlight dates basend on key values ?

Anyway thanks for yuor hlep and if you are ever in Spain i owe you a "refresco"
#16

[eluser]jdfwarrior[/eluser]
I would....

#1. Get a list of all items in the database for the given month.
#2. With that list, populate an array, with an index for each day of that month. So for a month with 31 days, make it create an array with 31 items, and let each item represent a day. Can initialize them all to "free"
#3. Go through database results. Get the date of the item you found, and set the array item corresponding to that date, to the status of that database item.
#4. Modify the getCal function to accept to accept the array as a parameter
#5. In the loop, where the calendar is creating the days, make it check the array for the entry for the current day its creating. Check the status, if that day is free/busy/etc, apply a style to that day dependent upon its status.
#17

[eluser]tim1965[/eluser]
Gracias mi amigo !!




Theme © iAndrew 2016 - Forum software by © MyBB