Page 1 of 1

Front end + Back end

PostPosted: Tue Mar 10, 2009 10:01 am
by exista
I'm trying to do the simplest thing, I need a front end to let visitors/guests view the current availability.
I also need a back end so that the owner of the calendar can edit the reservations.

I tried to copy the index.php naming it admin.php and index.php, admin being the back end and index being the front end.
So I need to adapt the index.php so that no editing can be taken place.
I have not got a clue how to do that, I now did it in a non-fashioned way. ... ?id_item=1
I removed line 124: <script type="text/javascript" src="'.DIR_JS.'update_cal.js"></script>

How can I do this in a good way?

Re: Front end + Back end

PostPosted: Tue Mar 10, 2009 1:01 pm
by chris
Hi there,
If you have 2 versions, admin.php and index.php, all you have to do is disactivate the links.
This is done by changing the last option in the draw_cal() function to "0" rather than it's current "1".
So, in the admin version it would look like this:

draw_cal(ID_ITEM,$val["month"], $val["year"], $booked_days,1)

and in the public version it would be this:

draw_cal(ID_ITEM,$val["month"], $val["year"], $booked_days,0)

However, removing the javascript file as well from the public version is a pretty good idea as it is not needed if there are no links so less is better :)

PS. I presume that you have the admin version protected from public eyes in some way ;)

Re: Front end + Back end

PostPosted: Tue Mar 10, 2009 5:30 pm
by exista
Very good, that was it!
It's working right now, I couldn't find the switch to do that.
I created two area's, public to 0 and admin to 1.
Now I need to create a member area.

Thanks man!

Re: Front end + Back end

PostPosted: Mon Mar 23, 2009 6:56 pm
by rcph
Thanks... good idea ;)

Re: Front end + Back end

PostPosted: Tue Jan 05, 2010 12:36 pm
by testorp
Nice tip, thx