Front end + Back end

Front end + Back end

Postby exista » Tue Mar 10, 2009 10:01 am

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.
http://sun-homes.nl/availabilty_calenda ... ?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?
exista
 
Posts: 2
Joined: Tue Mar 10, 2009 9:53 am

Re: Front end + Back end

Postby chris » Tue Mar 10, 2009 1:01 pm

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 :)

Chris
PS. I presume that you have the admin version protected from public eyes in some way ;)
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Front end + Back end

Postby exista » Tue Mar 10, 2009 5:30 pm

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!
exista
 
Posts: 2
Joined: Tue Mar 10, 2009 9:53 am

Re: Front end + Back end

Postby rcph » Mon Mar 23, 2009 6:56 pm

Thanks... good idea ;)
rcph
 
Posts: 31
Joined: Thu Feb 07, 2008 11:58 am
Location: Czech republic

Re: Front end + Back end

Postby testorp » Tue Jan 05, 2010 12:36 pm

Nice tip, thx

CIAO CIAO
PAOLO
testorp
 
Posts: 2
Joined: Tue Jan 05, 2010 11:12 am


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron