Spade

Mini Shell

Directory:~$ /proc/self/root/tmp/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/tmp/phpsowfTp

<?xml version="1.0" encoding="utf-8" ?>
<access component="com_reservation">
	<section name="component">
		<action name="core.admin" title="JACTION_ADMIN"
description="JACTION_ADMIN_COMPONENT_DESC" />
		<action name="core.options"
title="JACTION_OPTIONS"
description="JACTION_OPTIONS_COMPONENT_DESC" />
		<action name="core.manage" title="JACTION_MANAGE"
description="JACTION_MANAGE_COMPONENT_DESC" />
		<action name="core.export"
title="COM_RESERVATION_EXPORT_DATA"
description="COM_RESERVATION_EXPORT_DATA_DESC" />
		<action name="core.import"
title="COM_RESERVATION_IMPORT_DATA"
description="COM_RESERVATION_IMPORT_DATA_DESC" />
		<action name="core.batch"
title="COM_RESERVATION_USE_BATCH"
description="COM_RESERVATION_USE_BATCH_DESC" />
		<action name="core.version"
title="COM_RESERVATION_EDIT_VERSIONS"
description="COM_RESERVATION_EDIT_VERSIONS_DESC" />
		<action name="core.create" title="JACTION_CREATE"
description="JACTION_CREATE_COMPONENT_DESC" />
		<action name="core.delete" title="JACTION_DELETE"
description="JACTION_DELETE_COMPONENT_DESC" />
		<action name="core.edit" title="JACTION_EDIT"
description="JACTION_EDIT_COMPONENT_DESC" />
		<action name="core.edit.state"
title="JACTION_EDITSTATE"
description="JACTION_ACCESS_EDITSTATE_DESC" />
		<action name="core.edit.own"
title="JACTION_EDITOWN"
description="JACTION_EDITOWN_COMPONENT_DESC" />
		<action name="core.edit.created_by"
title="COM_RESERVATION_EDIT_CREATED_BY"
description="COM_RESERVATION_EDIT_CREATED_BY_DESC" />
		<action name="core.edit.created"
title="COM_RESERVATION_EDIT_CREATED_DATE"
description="COM_RESERVATION_EDIT_CREATED_DATE_DESC" />
		<action name="appointment.access"
title="COM_RESERVATION_APPOINTMENTS_ACCESS"
description="COM_RESERVATION_APPOINTMENTS_ACCESS_DESC" />
		<action name="appointment.batch"
title="COM_RESERVATION_APPOINTMENTS_BATCH_USE"
description="COM_RESERVATION_APPOINTMENTS_BATCH_USE_DESC" />
		<action name="appointment.dashboard_list"
title="COM_RESERVATION_APPOINTMENTS_DASHBOARD_LIST"
description="COM_RESERVATION_APPOINTMENTS_DASHBOARD_LIST_DESC"
/>
		<action name="appointment.version"
title="COM_RESERVATION_APPOINTMENTS_EDIT_VERSION"
description="COM_RESERVATION_APPOINTMENTS_EDIT_VERSION_DESC"
/>
		<action name="appointment.export"
title="COM_RESERVATION_APPOINTMENTS_EXPORT"
description="COM_RESERVATION_APPOINTMENTS_EXPORT_DESC" />
		<action name="appointment.import"
title="COM_RESERVATION_APPOINTMENTS_IMPORT"
description="COM_RESERVATION_APPOINTMENTS_IMPORT_DESC" />
		<action name="appointment.submenu"
title="COM_RESERVATION_APPOINTMENTS_SUBMENU"
description="COM_RESERVATION_APPOINTMENTS_SUBMENU_DESC" />
		<action name="bbbclass.access"
title="COM_RESERVATION_BBBCLASSES_ACCESS"
description="COM_RESERVATION_BBBCLASSES_ACCESS_DESC" />
		<action name="bbbclass.batch"
title="COM_RESERVATION_BBBCLASSES_BATCH_USE"
description="COM_RESERVATION_BBBCLASSES_BATCH_USE_DESC" />
		<action name="bbbclass.dashboard_list"
title="COM_RESERVATION_BBBCLASSES_DASHBOARD_LIST"
description="COM_RESERVATION_BBBCLASSES_DASHBOARD_LIST_DESC"
/>
		<action name="bbbclass.version"
title="COM_RESERVATION_BBBCLASSES_EDIT_VERSION"
description="COM_RESERVATION_BBBCLASSES_EDIT_VERSION_DESC" />
		<action name="bbbclass.export"
title="COM_RESERVATION_BBBCLASSES_EXPORT"
description="COM_RESERVATION_BBBCLASSES_EXPORT_DESC" />
		<action name="bbbclass.import"
title="COM_RESERVATION_BBBCLASSES_IMPORT"
description="COM_RESERVATION_BBBCLASSES_IMPORT_DESC" />
		<action name="bbbclass.submenu"
title="COM_RESERVATION_BBBCLASSES_SUBMENU"
description="COM_RESERVATION_BBBCLASSES_SUBMENU_DESC" />
		<action name="capital.access"
title="COM_RESERVATION_CAPITALS_ACCESS"
description="COM_RESERVATION_CAPITALS_ACCESS_DESC" />
		<action name="capital.batch"
title="COM_RESERVATION_CAPITALS_BATCH_USE"
description="COM_RESERVATION_CAPITALS_BATCH_USE_DESC" />
		<action name="capital.dashboard_list"
title="COM_RESERVATION_CAPITALS_DASHBOARD_LIST"
description="COM_RESERVATION_CAPITALS_DASHBOARD_LIST_DESC" />
		<action name="capital.version"
title="COM_RESERVATION_CAPITALS_EDIT_VERSION"
description="COM_RESERVATION_CAPITALS_EDIT_VERSION_DESC" />
		<action name="capital.export"
title="COM_RESERVATION_CAPITALS_EXPORT"
description="COM_RESERVATION_CAPITALS_EXPORT_DESC" />
		<action name="capital.import"
title="COM_RESERVATION_CAPITALS_IMPORT"
description="COM_RESERVATION_CAPITALS_IMPORT_DESC" />
		<action name="capital.submenu"
title="COM_RESERVATION_CAPITALS_SUBMENU"
description="COM_RESERVATION_CAPITALS_SUBMENU_DESC" />
		<action name="comment.access"
title="COM_RESERVATION_COMMENTS_ACCESS"
description="COM_RESERVATION_COMMENTS_ACCESS_DESC" />
		<action name="comment.batch"
title="COM_RESERVATION_COMMENTS_BATCH_USE"
description="COM_RESERVATION_COMMENTS_BATCH_USE_DESC" />
		<action name="comment.dashboard_list"
title="COM_RESERVATION_COMMENTS_DASHBOARD_LIST"
description="COM_RESERVATION_COMMENTS_DASHBOARD_LIST_DESC" />
		<action name="comment.version"
title="COM_RESERVATION_COMMENTS_EDIT_VERSION"
description="COM_RESERVATION_COMMENTS_EDIT_VERSION_DESC" />
		<action name="comment.export"
title="COM_RESERVATION_COMMENTS_EXPORT"
description="COM_RESERVATION_COMMENTS_EXPORT_DESC" />
		<action name="comment.import"
title="COM_RESERVATION_COMMENTS_IMPORT"
description="COM_RESERVATION_COMMENTS_IMPORT_DESC" />
		<action name="comment.submenu"
title="COM_RESERVATION_COMMENTS_SUBMENU"
description="COM_RESERVATION_COMMENTS_SUBMENU_DESC" />
		<action name="consultant.access"
title="COM_RESERVATION_CONSULTANTS_ACCESS"
description="COM_RESERVATION_CONSULTANTS_ACCESS_DESC" />
		<action name="consultant.batch"
title="COM_RESERVATION_CONSULTANTS_BATCH_USE"
description="COM_RESERVATION_CONSULTANTS_BATCH_USE_DESC" />
		<action name="consultant.dashboard_list"
title="COM_RESERVATION_CONSULTANTS_DASHBOARD_LIST"
description="COM_RESERVATION_CONSULTANTS_DASHBOARD_LIST_DESC"
/>
		<action name="consultant.version"
title="COM_RESERVATION_CONSULTANTS_EDIT_VERSION"
description="COM_RESERVATION_CONSULTANTS_EDIT_VERSION_DESC" />
		<action name="consultant.export"
title="COM_RESERVATION_CONSULTANTS_EXPORT"
description="COM_RESERVATION_CONSULTANTS_EXPORT_DESC" />
		<action name="consultant.import"
title="COM_RESERVATION_CONSULTANTS_IMPORT"
description="COM_RESERVATION_CONSULTANTS_IMPORT_DESC" />
		<action name="consultant.submenu"
title="COM_RESERVATION_CONSULTANTS_SUBMENU"
description="COM_RESERVATION_CONSULTANTS_SUBMENU_DESC" />
		<action name="doctor.access"
title="COM_RESERVATION_DOCTORS_ACCESS"
description="COM_RESERVATION_DOCTORS_ACCESS_DESC" />
		<action name="doctor.batch"
title="COM_RESERVATION_DOCTORS_BATCH_USE"
description="COM_RESERVATION_DOCTORS_BATCH_USE_DESC" />
		<action name="doctor.dashboard_list"
title="COM_RESERVATION_DOCTORS_DASHBOARD_LIST"
description="COM_RESERVATION_DOCTORS_DASHBOARD_LIST_DESC" />
		<action name="doctor.version"
title="COM_RESERVATION_DOCTORS_EDIT_VERSION"
description="COM_RESERVATION_DOCTORS_EDIT_VERSION_DESC" />
		<action name="doctor.export"
title="COM_RESERVATION_DOCTORS_EXPORT"
description="COM_RESERVATION_DOCTORS_EXPORT_DESC" />
		<action name="doctor.import"
title="COM_RESERVATION_DOCTORS_IMPORT"
description="COM_RESERVATION_DOCTORS_IMPORT_DESC" />
		<action name="doctor.submenu"
title="COM_RESERVATION_DOCTORS_SUBMENU"
description="COM_RESERVATION_DOCTORS_SUBMENU_DESC" />
		<action name="message.access"
title="COM_RESERVATION_MESSAGES_ACCESS"
description="COM_RESERVATION_MESSAGES_ACCESS_DESC" />
		<action name="message.batch"
title="COM_RESERVATION_MESSAGES_BATCH_USE"
description="COM_RESERVATION_MESSAGES_BATCH_USE_DESC" />
		<action name="message.dashboard_list"
title="COM_RESERVATION_MESSAGES_DASHBOARD_LIST"
description="COM_RESERVATION_MESSAGES_DASHBOARD_LIST_DESC" />
		<action name="message.version"
title="COM_RESERVATION_MESSAGES_EDIT_VERSION"
description="COM_RESERVATION_MESSAGES_EDIT_VERSION_DESC" />
		<action name="message.export"
title="COM_RESERVATION_MESSAGES_EXPORT"
description="COM_RESERVATION_MESSAGES_EXPORT_DESC" />
		<action name="message.import"
title="COM_RESERVATION_MESSAGES_IMPORT"
description="COM_RESERVATION_MESSAGES_IMPORT_DESC" />
		<action name="message.submenu"
title="COM_RESERVATION_MESSAGES_SUBMENU"
description="COM_RESERVATION_MESSAGES_SUBMENU_DESC" />
		<action name="plan.access"
title="COM_RESERVATION_PLANS_ACCESS"
description="COM_RESERVATION_PLANS_ACCESS_DESC" />
		<action name="plan.batch"
title="COM_RESERVATION_PLANS_BATCH_USE"
description="COM_RESERVATION_PLANS_BATCH_USE_DESC" />
		<action name="plan.dashboard_list"
title="COM_RESERVATION_PLANS_DASHBOARD_LIST"
description="COM_RESERVATION_PLANS_DASHBOARD_LIST_DESC" />
		<action name="plan.version"
title="COM_RESERVATION_PLANS_EDIT_VERSION"
description="COM_RESERVATION_PLANS_EDIT_VERSION_DESC" />
		<action name="plan.export"
title="COM_RESERVATION_PLANS_EXPORT"
description="COM_RESERVATION_PLANS_EXPORT_DESC" />
		<action name="plan.import"
title="COM_RESERVATION_PLANS_IMPORT"
description="COM_RESERVATION_PLANS_IMPORT_DESC" />
		<action name="plan.submenu"
title="COM_RESERVATION_PLANS_SUBMENU"
description="COM_RESERVATION_PLANS_SUBMENU_DESC" />
		<action name="reserve.access"
title="COM_RESERVATION_RESERVES_ACCESS"
description="COM_RESERVATION_RESERVES_ACCESS_DESC" />
		<action name="reserve.batch"
title="COM_RESERVATION_RESERVES_BATCH_USE"
description="COM_RESERVATION_RESERVES_BATCH_USE_DESC" />
		<action name="reserve.dashboard_list"
title="COM_RESERVATION_RESERVES_DASHBOARD_LIST"
description="COM_RESERVATION_RESERVES_DASHBOARD_LIST_DESC" />
		<action name="reserve.version"
title="COM_RESERVATION_RESERVES_EDIT_VERSION"
description="COM_RESERVATION_RESERVES_EDIT_VERSION_DESC" />
		<action name="reserve.export"
title="COM_RESERVATION_RESERVES_EXPORT"
description="COM_RESERVATION_RESERVES_EXPORT_DESC" />
		<action name="reserve.import"
title="COM_RESERVATION_RESERVES_IMPORT"
description="COM_RESERVATION_RESERVES_IMPORT_DESC" />
		<action name="reserve.submenu"
title="COM_RESERVATION_RESERVES_SUBMENU"
description="COM_RESERVATION_RESERVES_SUBMENU_DESC" />
		<action name="session.access"
title="COM_RESERVATION_SESSIONS_ACCESS"
description="COM_RESERVATION_SESSIONS_ACCESS_DESC" />
		<action name="session.batch"
title="COM_RESERVATION_SESSIONS_BATCH_USE"
description="COM_RESERVATION_SESSIONS_BATCH_USE_DESC" />
		<action name="session.dashboard_list"
title="COM_RESERVATION_SESSIONS_DASHBOARD_LIST"
description="COM_RESERVATION_SESSIONS_DASHBOARD_LIST_DESC" />
		<action name="session.version"
title="COM_RESERVATION_SESSIONS_EDIT_VERSION"
description="COM_RESERVATION_SESSIONS_EDIT_VERSION_DESC" />
		<action name="session.export"
title="COM_RESERVATION_SESSIONS_EXPORT"
description="COM_RESERVATION_SESSIONS_EXPORT_DESC" />
		<action name="session.import"
title="COM_RESERVATION_SESSIONS_IMPORT"
description="COM_RESERVATION_SESSIONS_IMPORT_DESC" />
		<action name="session.submenu"
title="COM_RESERVATION_SESSIONS_SUBMENU"
description="COM_RESERVATION_SESSIONS_SUBMENU_DESC" />
		<action name="sick.access"
title="COM_RESERVATION_SICKS_ACCESS"
description="COM_RESERVATION_SICKS_ACCESS_DESC" />
		<action name="sick.batch"
title="COM_RESERVATION_SICKS_BATCH_USE"
description="COM_RESERVATION_SICKS_BATCH_USE_DESC" />
		<action name="sick.dashboard_list"
title="COM_RESERVATION_SICKS_DASHBOARD_LIST"
description="COM_RESERVATION_SICKS_DASHBOARD_LIST_DESC" />
		<action name="sick.version"
title="COM_RESERVATION_SICKS_EDIT_VERSION"
description="COM_RESERVATION_SICKS_EDIT_VERSION_DESC" />
		<action name="sick.export"
title="COM_RESERVATION_SICKS_EXPORT"
description="COM_RESERVATION_SICKS_EXPORT_DESC" />
		<action name="sick.import"
title="COM_RESERVATION_SICKS_IMPORT"
description="COM_RESERVATION_SICKS_IMPORT_DESC" />
		<action name="sick.submenu"
title="COM_RESERVATION_SICKS_SUBMENU"
description="COM_RESERVATION_SICKS_SUBMENU_DESC" />
	</section>
	<section name="reserve">
		<action name="reserve.version"
title="COM_RESERVATION_RESERVES_EDIT_VERSION"
description="COM_RESERVATION_RESERVES_EDIT_VERSION_DESC" />
	</section>
	<section name="bbbclass">
		<action name="bbbclass.version"
title="COM_RESERVATION_BBBCLASSES_EDIT_VERSION"
description="COM_RESERVATION_BBBCLASSES_EDIT_VERSION_DESC" />
	</section>
	<section name="doctor">
		<action name="doctor.version"
title="COM_RESERVATION_DOCTORS_EDIT_VERSION"
description="COM_RESERVATION_DOCTORS_EDIT_VERSION_DESC" />
	</section>
	<section name="appointment">
		<action name="appointment.version"
title="COM_RESERVATION_APPOINTMENTS_EDIT_VERSION"
description="COM_RESERVATION_APPOINTMENTS_EDIT_VERSION_DESC"
/>
	</section>
	<section name="capital">
		<action name="capital.version"
title="COM_RESERVATION_CAPITALS_EDIT_VERSION"
description="COM_RESERVATION_CAPITALS_EDIT_VERSION_DESC" />
	</section>
	<section name="comment">
		<action name="comment.version"
title="COM_RESERVATION_COMMENTS_EDIT_VERSION"
description="COM_RESERVATION_COMMENTS_EDIT_VERSION_DESC" />
	</section>
	<section name="session">
		<action name="session.version"
title="COM_RESERVATION_SESSIONS_EDIT_VERSION"
description="COM_RESERVATION_SESSIONS_EDIT_VERSION_DESC" />
	</section>
	<section name="sick">
		<action name="sick.version"
title="COM_RESERVATION_SICKS_EDIT_VERSION"
description="COM_RESERVATION_SICKS_EDIT_VERSION_DESC" />
	</section>
	<section name="plan">
		<action name="plan.version"
title="COM_RESERVATION_PLANS_EDIT_VERSION"
description="COM_RESERVATION_PLANS_EDIT_VERSION_DESC" />
	</section>
	<section name="consultant">
		<action name="consultant.version"
title="COM_RESERVATION_CONSULTANTS_EDIT_VERSION"
description="COM_RESERVATION_CONSULTANTS_EDIT_VERSION_DESC" />
	</section>
	<section name="message">
		<action name="message.version"
title="COM_RESERVATION_MESSAGES_EDIT_VERSION"
description="COM_RESERVATION_MESSAGES_EDIT_VERSION_DESC" />
	</section>
	<section name="category.doctors">
		<action name="core.create" title="JACTION_CREATE"
description="JACTION_CREATE_COMPONENT_DESC" />
		<action name="core.delete" title="JACTION_DELETE"
description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
		<action name="core.edit" title="JACTION_EDIT"
description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
		<action name="core.edit.state"
title="JACTION_EDITSTATE"
description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
		<action name="core.edit.own"
title="JACTION_EDITOWN"
description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
	</section>
	<section name="category.consultants">
		<action name="core.create" title="JACTION_CREATE"
description="JACTION_CREATE_COMPONENT_DESC" />
		<action name="core.delete" title="JACTION_DELETE"
description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
		<action name="core.edit" title="JACTION_EDIT"
description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
		<action name="core.edit.state"
title="JACTION_EDITSTATE"
description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
		<action name="core.edit.own"
title="JACTION_EDITOWN"
description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
	</section>
</access>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		admin.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */
.no-click {
	pointer-events: none;
}

/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointments.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclass.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclasses.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capitals.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comment.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comments.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultants.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		dashboard.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */

.dashboard-container {
    margin-left: 10px;
    margin-top: 10px;
    width: 100%;
}
.dashboard-container [class*="span"] {
    display: block;
    float: none;
    margin-left: 0;
    width: auto;
}
.dashboard-container:before, .dashboard-container:after {
    content: "";
    display: table;
}
.dashboard-container:after {
    clear: both;
}
.dashboard-container [class*="span"] {
    box-sizing: border-box;
    display: block;
    float: left;
    min-height: 145px;
    min-width: 96px;
    width: 100%;
}
.dashboard-container [class*="span"]:first-child {
    margin-left: 0;
}
.dashboard-wraper {
    background: none repeat scroll 0 0 hsl(0, 0%, 93%);
    border-radius: 5px;
    float: left;
    margin: 1%;
    padding: 3px;
    width: 17%;
    min-height: 194px;
    min-width: 96px;
}
.dashboard-content a {
    background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%,
96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
    border: 1px solid hsl(0, 0%, 85%);
    border-radius: 4px;
    box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
    color: hsl(0, 0%, 20%);
    display: block;
    min-height: 89px;
    padding: 10px;
    text-align: center;
    text-decoration: none;
}
.dashboard-content a:hover {
    background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%,
100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
    color: hsl(200, 100%, 30%);
    text-decoration: none;
}
.dashboard-title {
    display: block;
    padding-top: 5px;
}
.dashboard-info {
    background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%,
96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
    border: 1px solid hsl(0, 0%, 85%);
    border-radius: 4px;
    box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
    color: hsl(0, 0%, 20%);
    display: block;
    font-size: 12px;
    padding: 10px;
    text-align: center;
}
.dashboard-info span {
    display: block;
    text-align: center;
}
.dashboard-info img {
    margin: 0 auto;
}
.dashboard-table {
    border-top: 1px solid hsl(0, 0%, 87%);
    margin-top: 5px;
    width: 100%;
}
.dashboard-info h5 {
    font-size: 11px;
    font-weight: bold;
}
.dashboard-block {
    background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%,
86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
    border: 1px solid hsl(0, 0%, 76%);
    border-radius: 3px;
    box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset;
    margin-bottom: 20px;
}
.dashboard-block .dashboard-block-head {
    background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%,
86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
    border-bottom: 1px solid hsl(0, 0%, 76%);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%);
    height: 40px;
    position: relative;
}
.dashboard-block .dashboard-block-head h5 {
    font-size: 12px;
    margin: 0;
    padding-left: 10px;
    padding-top: 11px;
    text-transform: uppercase;
}
.dashboard-block .dashboard-block-content {
    background: none repeat scroll 0 0 hsl(0, 0%, 93%);
    border-radius: 0 0 3px 3px;
}
.dashboard-block .dashboard-block-box {
    background: none repeat scroll 0 0 hsl(0, 0%, 100%);
    border-top: 1px solid hsl(0, 0%, 82%);
    box-shadow: 0 0 5px hsl(0, 0%, 87%) inset;
}
.dashboard-block .dashboard-block-content .dashboard-block-box {
    margin-top: 0 !important;
}
.dashboard-block .dashboard-block-content .dashboard-block-box
.dashboard-block-table {
    margin-bottom: 0 !important;
}
.dashboard-block-table {
    background-color: hsla(0, 0%, 0%, 0);
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 20px;
    max-width: 100%;
    width: 100%;
}
.dashboard-block-table th, .dashboard-block-table td {
    border-top: 1px solid hsl(0, 0%, 87%);
    line-height: 20px;
    padding: 5px;
    text-align: left;
    vertical-align: middle;
}
.dashboard-badge {
    background-color: hsl(0, 0%, 60%);
    border-radius: 9px;
    color: hsl(0, 0%, 100%);
    font-size: 11.844px;
    font-weight: bold;
    line-height: 14px;
    padding: 1px 9px 2px;
    text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25);
    vertical-align: baseline;
    white-space: nowrap;
}/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctors.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


<html><body
bgcolor="#FFFFFF"></body></html>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		message.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		messages.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		order.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		orders.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plans.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserve.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserves.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		session.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sessions.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sicks.css
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* CSS Document */


<html><body
bgcolor="#FFFFFF"></body></html>GIF89a���Ft���\z����4^����Lr����|��Df�4Z�������$N|l�����<^����$J|����Tr����Dj����t�����<b������!�NETSCAPE2.0!�		,���`'�di�h��l�p,�tm�x��|��pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~����������������������������������������������������������������������������?
������
����
����������������s�!
�|�8@vD*Ǐ@�H�5@8�7,�p�Z��!�		!,���Ft������Tv����t��Tr��������$N|���d��J|��������|��������F|���\z����t��������,R����l�������������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~������������������������������������������������������������������������������������������|�
��	���
����
����*�3k@|���s�\���uxe�_‡^I���;B���#9t+CB��0��@!��D�7��(�
T�����5J�%�)��P�J�J��իX�j�ʵ��EA!�		#,���Ft���Tv����4^����,R����t��$N|����$J|l��Ln�����J|���d~����<^����F|���\z�������4Z����|���������<b�������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~��������������������������������������������������������������|��	��������
�����˯
����������������ݮ��'.�+���[�*�q�.L��b6pbi����Y"D�����P���B�2�I��͛8s��ɳ�(ϟ@�
J��ѣH�*]ʴ�ӧP�J�J��իX�j�ʵ�WEA!�		4,���Ft������Tv�<^�������t�����,R����Dj����d����Ԅ�����$N|��Tr�J|���\~�Df�|�����4Z����Lr������̼��F|������\z�<b�������t�����,V����Ln����l�����������������@�pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~���������������������������������������������
(�M)!��I����1�F)úķ�E�����B��·�4����0����)��������ø
���	�Hؖk�o4,�#(�B�	@(DF�t�L�8F�
!B.h�	s%S�\ɲ�˗0cʜI��͛8s��ɳ��ϟ@�
J��ѣH�*]ʴ�ӧP�J�J�j�HP1@�	�H
�CI��ij��@h��[b�g�k0
���⚀[�?��l��a��E�k/D�ki1jP�i�qI�u�Af�!H"\!���Wt�w���J�,����
!�		6,���Ft������Tv�4^������t��,R����Dj����ܤ�Ą��$N|d�����$J|Df�����J|������<^�|��4Z����Lr������ܬ�̌��l��F|������\~������t��,V����Ln���ܤ�̄��l��������<b��������@�pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~�����������������������[(%�c##'�_,����*�\����-�Z0����*�W%��ɣ!�V/����4�U,��ѡ�S4�ٷ+�R
��ҭ1�Q"�и�Q���"�Q4��	��`�vo���Q���*�(:�{�!`@a`�ŏ
C�I��ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ��ϟ@�
J��ѣH�*]ʴ�ӧP�J�J5h	 x|�
V#,h8�2{��`�a�[#��
-�(2RSVw���E
�9��F�@��!2d�N~�.�I_`��R���Q��nd�,�u��Տ]1+;ކ]0W�!������N�����!�		3,���Ft���Tv����4^�������t��,R�Ln���ܤ��d������$N|Df����$J|�����J|���\~����<^�4Z���ܬ��l����쌢�F|���\z���������|��,V�Tr���ܤ��l������Dj��������<b�������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~������������D)�n
�	�j*���� �g$��� *�d����%�b!���
�a(��ij.�`�����_é��^2�̗��\+�ũ�\0�ԣ�[-2��
-�[,���\'�2=�׏K��FUx� 0
prH��ŋ3j�ȱ�Ǐ
C�I��ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ��$
<pB	��e�Ѡet�&�,
M֥R�8k�)',�DJ���D�$�l�,�@��,<sO���J̖e2��]�~�L��+94�t�K�^�`�ed
pq@��ӨS�^ͺ��װc˞M���۸s��ͻ����N���
!�		7,���Ft���Tv����4^�����t��,R����Ln�d����ܤ���$N|Df�������$J|d~����Ԍ��J|���\~����<^�4Z����Tr�l����ܬ�̄��F|���\z���������,V����Lr�l����ܤ����Dj�������<b����������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~��9��B)4�x(�$���t����3�r�����p!�����n
����
�m*����$�l��$��k����j���5�i�ґ6�h+��$2�h6���h0���jʶ$�k2%
55
�
H����*\Ȱ�Ç#J�H��ŋ3j�ȱ�Ǐ C�I��
.�D��/%`��b-C1T�Dс��J�h���"]0������mb1�F���0��u�)	";��Z)ȡ���W6C�DV
0�W-q#OeVb�f���L�'��ChDX�@
��#K�L���˘3k�̹��ϠC�M���ӨS�^�ze�d`0���j@<`Y\%%
���IGi�8���7�!#|��#Z�c��Tp��
GՕ�Bd	�ʝ�,�|����*�+�����������3�P]����N�m`�.�ڃF(�e!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n��pc�t��Z�|u���(6z�N4�~�	/��H����B	���~(89�����~��8����#��
���8�z6���(0�y
�����q8�����p��ן;�p7�ɖ5�q����p,ؖ��y
�(:�-;)x�
H����*\Ȱ�Ç#J�H��ŋ���0��2^i� �,
DR�
"էTJQ�[��2��X����NE)&P%-\FK�㨒����4Ɏ��	��DAMe�q-����k4�q�U
��1`�-V�y��%��`�'���H���/i���
ɘ3k�̹��ϠC�M���ӨS�^ͺ��װc˞M���۸s��ͻ����N�8��@�0��O�
�:������W4�
H@`�9j�
��l_3���?$����^�B
�����2Q�����6�H�[�$�f�wM��5
�{�ķY��uf
��⋝!�		6,���Ft���Tv����4^�����t��,R�Ln�������܄��$N|���d��Df�$J|������􌢼J|���\~����<^�|��4Z�Tr�������܄�����F|���\z�������t��,V�Lr������ܤ��l��Dj��<b�������������@�pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���Z;8tH�$���@bv�X
zp{�2���Ry��}$��N�}�z5��I����p��E0��z{��6������o�����+�Ĉ*��%���/ȟ(��ϟ���)֠/�$p+3ݠ��
�(%204���������
H�����,p���&$3@E�=*(L�2B�2C6na�0�j"�@H���WP��I�*#\ѤY�&��|�Z�S
�[���(*��N��\0������p�M�BcڭS[��
��	a�((	�EZ),,#A���) �@
#�ƻ�L���È+^̸��ǐ#K�L���˘3k�̹��ϠC�M������������u�@��1
A%!D��o9[|��N؈�v`�&�X,m��=�?2��XF�b2C�.��b
�g�U�<�!�g�H�G��4����
*

�f�&��6��F(�Vh�fxD!�		:,���Ft���Tv����4^�������t�����,R����Ln�������d������$N|Df����$J|������J|���d~����<^���|�����4Z����Tr�������l��������F|���\z���������t�����,V����Lr����l��Dj����<b�������������@�pH,�Ȥr�l:�ШtJ�Z�جv��z��kI50��h�����$M�E����t|y{z��_+{|�y'0��Z�����U.���,��P(�z��'��L��y���w��{2��D���|.����'8��$��n��,��o6��0�z/f��5�o��
7$6$7
���������h��Ƃv���*	*2�bX�$�
Aۣ�4ҩ M�&�hpT���0*�)ۃ�eFâ"a�
u2����%f2�7�z��F���J�tȖs[T/5.�Ԗ㪗Z
�J���l��,�'�tp�LȺx���˷�߿�L���È+^̸��ǐ#K�L���˘3k�|��/hhU�a076�F��a�]!���3��OU
Fr8=��p�U�T���	\�P��[�|�]@;8Ɓ;�؍H/����k@U��<
l.>-&�@����P�v�@���(�h`T
��
�c��GB
�����EV�{�oD@�c�I3L��p�0�5��V��]c0LWR
�U�*�56Az[Ѩ���xY�
rc!9�s�d0�󂃐��B�A
��Ѝe,��)h�h���l���p�)'�A!�		7,���Ft���Tv����4^������t��Ln����,R�������d��$N|���Df�������$J|�􌢼J|���d~�<^����|��Tr�����������l��F|���\z���������t��Lr����4Z����l�����Dj��������<b�������������pH,�Ȥr�l:�ШtJ�Z�جv˥~80��1u�h.(u��#(M�CA�@�#v��F"nz{��)���&��}{#��h}�����Z���{��Wm�����S�����O4������Jp�����E&��#f��C)��"��7��0s������2���u-0"���

mon,P�C�->+������t�	��\�2Hj	���:DLHP'&���뤥
G�j�х��TԼT�S�L>vZ2�����TP�i#,���Qé%JG�1g�
��е�ٳhӪ]˶�۷p�ʝK��ݻx���˷�߿��=a��Q�Nj@�����LX�i�J������Ù�d-�'�W
4���$�o��ܙEl�Zc?؈Ӗi����ۂ�RAM�X%����/�Q�[�q^��Y�
ڋ00
B��f�_Ͼ�����˟O��������Ͽ���(�h�&��6�`u�	@�^�$�@
�p��H����;����.<�@u3�-�ņ32��h4�i�,CM��bp��@s�`�i�I%G�4#�g�ȴ�Uņ���
�heex�@Q+�g	.؀�'!�		8,���Ft���Tv����4^�������t��,R����d�����Ln���Ą��$N|���$J|d~�Df������J|���\~����|��4Z����l�����Tr������̄�����F|���\z����<b�������t��,V����l�����Lr����Dj�������������@�pH,�Ȥr�l:�Ш����d��v��BQ�`\�8��j��𷠲����>>��Qo�{o���H
���n+���!b�{pn2��z%�qc��k$�����^.���n���S+���&��Q1�n�%��M$c�����J�{�ՖV*Q�n�܌�P�,�'��%P
	&6��V/P
��+X�è�n�0��!R�C
&VkCN_�542s�b2��N{x��a>t�rW���J�k��J}p��(�gnh����+S�
[�Bf.��V�8z�E��V�
�سhӪ]˶�۷p�ʝK��ݻx���˷�߿F
�sA�����(
����������XgTυp����Dh&
$@lu�tV�����
E�}�J_v�.�`p7��i��%�ʇl0u|Ft#�j�U�u#2�����(��@���aO��������Ͽ���(�h�&��6��F(�V��(��
�p@Ha����!b���s%�Q
��L"�!�-�Gi��^2�2�w4��)�g�j�`{+���U߽�ʍ_��9��}[�V�K�5
����'�S�p��~4Ȱ�@��x��|��矀Y!�		9,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ��$N|������$J|d~�Dj�����J|������\~�<^����4Z����l��Tr������̌�����F|������\z�������|�����,V����l��Lr���̄������<b������������pH,�Ȥr�l:�Ш�%�A�6�z���0��.Dx�n;W�Yn6�|�7��&z��Qr�r)���Gut��f/���8���g2������3��n2s��&���`���e���S
��g���-(N��sī��K4��4ң'�~�L-�&ߢ#���K�e��ڸ�.\L
pa��D����D‡E*pf"ċ9~�K��C�(�����z�(�p?��X���V<���p�	���4@�db�@�	
(����,���@����
�ׯ`ÊK��ٳhӪ]˶�[U"�8�����Dd���E�x�4HA�L�����H�m���l�q�cB�/7\����.
���㳗��94=E�KT���J�hul(&slq[������EGK��Ka�X#�˝���:1<�Pc�
'�vO�����ӫ_Ͼ�����˟O��������Ͽ�����
]ٷ	��t6�p�e�$ ��=�
,�x��o�T�[[PU�7A��;䰅HH��j<��wiY@�'���ch�T.�V<�$�3�eg�s�q
@A��l��
,��OX�!,2���H��`ɍk]���4�@Q��a�Z����Q�!rg���
٥VT�N�9��E�N<��"�y����U�(/��Z+�E�
ذ��`,5�0߁C�A��ͧA-���k��&���6���F+��Vk�ت!�		8,���Ft���Tv����4^�����t��,R����d��Dj���ܤ�Ą��$N|���$J|d~�Df�����J|���\~����<^����|��4Z����l��Lr������ܬ�̌��F|���\z���������t��,V����l��Ln���ܤ�̄������<b��������@�pH,��d�&�9RʨtJ�Z�S�5l�xL._�.��V����zC��x�|��c�^�ja}��X-\x�l���J
�lxk����w�2�������'��R$%2*R%��j���E)�k
4���k��82��#I���ʼ���H֨\$ح��&&67H7�孶�&I5��&��#eCM*A
��(A�Y1��
)78`�!F�V4�[c��ǓF��h��!6p3���{��4��F�CO��|C��Æ�\Q1P7�6d���T�*��0��կ`ÊK��ٳh��
q@��;�*aѢ	�b0��z�҅��%Qjt���đ�idC"�5��ⲡ�z��O�jż<.�'d�TX�!0�D�{N��T��6ߙ���A��3���`���1��q�r1����ËO�����ӫ_Ͼ�����˟O��������+���
C��2A�J~ ����Aj]�Ё}
�)&�x3��UT�|}	��D�
^Ň`c%%_M�fB��r	(�ɗ�8+��}
l��W���@�~*`c2�g�w�pB���0�e�)�d�i�h���l���p�)�t�i�4�
�Gaja�	`�c}"H0Ԁ�dF":h|+�Ɔ	%�Ǥ1\@�|4J�:��gr�@�|�VɅ��(.�r�r��G��k\��|�:�k
��W�6k,�h|
���'�s��`���Փ'!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ���j��dI�Z�جvh��̅�-���%@��n\+M�۩���
��rw��u*o}�()���X
}|�_0����E)`�n�m
��Z n
J.���o��T
{}7H3���4��G$"��8�F�|�{;��C���G;��m
��Μ_�E9l��������G��(1��5��(H��C+_���}If$Eq	f�ء7ݐ�A�O'ʒ��*
^�)M�8_#X�<�"��Cg��@�6.v
2��������
J��H!�:VF�ʵ�ׯ`ÊmÁ�8r�e�cY=*B�
6�d's�si��<���I�`Q|_�{���m�2$m̨�;�(�Rf���3�7R�dьhl��IjF�:ED�
�o1�=��$882�^tA����-�P#A�&�N����سk�ν����ËO�����ӫ_�H
&B�?B��&�iP�b�
�C1�`�l���5�do,��	?��>��Fi|�0+`(�0��b�3�Ga�`�^�U��&x�y�Z�<��g�
�����F�P��LVi�Xf��\v��`�)�d�i�h���l���KL�+hI�gu�y1i�>}L�BB���_�@�r����\��!憃~^$
�G��A�}ɇ�Y�c�y�!�J���V+A͗Ð���~+��['�M��,�1��bɁ#�pAmpVk��!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥrh�@��賬Z�جv;dEP�pu�q��z����0�����U���Tx��v9}|�a4���,+U'�p�8��v~849I�}�(1��gpcafG���;��X��5$�b��`/��J��bG�(��p
��F*Ԗ(F�o�	��B-㦊F90���zο�.G��0
�w$:~��p-
�Ɗ��DC�["�8�fc�D?��Ё㍀���f
���0�@���`̛I\܂�@#�ΟCr�	&AC�H��
p	��I�"Hq��YQ�j��b[�&l:A�G7��T{�e0G���R�uh�cAP�b[�����5`yO@�l1�*���2��U��,�)�nPlଌ��aB����XW�b���E�yݐ1�
���nm��2T�!���УK�N����سk�ν����Ë7�`�5]a-(~>KO�j�m�BI�
^ү2#�'�-1�N�� .��A!Am~���	(�
sM(��H��C�PX?H���'��E�sT�4dv
�-!
h(0�#4|q�x�
xPh��PF)�TVi�Xf��\v��`�)�d�i�h���F
`���(�
xLi��A�-ڇ���n���P`�5"�I`&�W5�؟��Ӣ����'�N����=��`d	6ڂ��
�E
Di�J5��X�9�`gpp�)h���k6���F+��Vk�^!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ�غ�"(���Z�جv;|@(���q��z���aȼ���K��=��rx��G-)�J
|p}a4����`
Jzo{�(��k1��n#�Fq�q�-��[-��H|��+��W��nG"�ͯ��I��2G#Ǡ���Eξp�E4��8��B���/F7_�(��3��oʌ��
V��y��#.‰@'��}�����X(j������4�%�$�i�
h1s.�!�!��8t
UB�A0:���qaA�#4��R��8�F#��1
.��@ËrZ�5�u���p��|����F@k7f��mS�ՙ`[F1)�l��A�$-���d���v9��q�Q���GI���[�l�8*��6��B1��m�6�3#���ȓ+_μ���УK�N��u�7��QC��)р�UL�S��1��
����L�@|5-"�>f���>�2�g�B�30�����X���p!54K�fQ�f����L(�#b�Ё����7�v|��Dr��H6f��_���<=i�H&��L6��PF)�TVi�Xf��\v�`+@�W��@a���^��w`1D�B5G�B�J��H�`l�d�Af�8Lh�M6p�8!59Ah�$��
�4���Q(��L:0<���O��BK����1نD(�0%�}��V"p�#�0���+��k��&���6���F+��Vk�!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ2�c1j����Z�جv;\��p�-���j
�b��F#M��?��(p��؀�p#v��I"�l8J7
`m��(�����I4�����t'��mHpp�n9��\���nG_���6��X���a.��΂1��K��o(Ga�s��F����D»m8��D0֜�TE��(4�8��xP�lA�~.�����d�"8o@�r�
$iK�h
}���$*P@��mɎ
*���@"d�	*	�t�<o2�����MC6T�b��H��$0z�	+%5=B
)nT�7b�3JZ�@0ql���1pK�Ț|�Pd�U�n٨�u���.;�-�uO�U^%rU��`�m�`�$=�l���rm>����>�V�m�"�$e�mA��uN����ȓ+_μ���!c<�p
��Ѝ)�+��DՆ�L"��!E
G�p_�"P8���q`V
t��Q�fK`���
�xK=���f�A�fzQx�
�Ҟ�\�v�
'�ȅC�����e4��>߱x5�R�P2�a�,��@)�Di�H&��L6��PF)�T���
UQ�RÊQڰ�75��d�,�B%6	_h�0�$#.�X�^�\M�W'089K|�8��9�d�d
�-R��%d�NrH^%m.�AT���x`^��H`JY��
EeY�*무�j뭸�뮼���+��k��&���6���!�		;,���Ft���Tv����4^�����t�����,R����Ln�d��������$N|���Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b���������������pH,�Ȥr)\!P��I�Z�ج5TxO�GK.���H�1�Tux.�����ԡ�GSJr��rz��K9�`^I8�_�6���(^��'`*H,�~�`��z0���78G���7��f���'�F�út
��X
ɐ�#G�t�+��L+��~�F�����I׳`G2���4�E6��^�F�tB��������;C�2�1#�J.��wb��]�!Q�	���@�d��}�bz)Q�<$����VA��d�U#��ēk�0>�
I/��*+t�@a���<��4f�@y_r0��G���!i�)�?(,W�*޿E>ES�a!%�%x��];Cn���h)���Rl��;�jr��ʓy�o
rN�
�p��N@0P�q9F�`�����ȓ+_μ���T�y^�B��sbܡ~o��`b(���EQ�o�%��‹d�z��ಮ@�;��<�U~Nި"V
�q��F�
W�z_Mr,��"8P���L�HS�AB��x����������x4��e'���"(��G�͸�
:����Di�H&��L6��PF)�TVi�q+�
PܕF�p�.�p�C�d^��
����~�Ve�	dH�S���5�Q�`�}8%�A��甏]���Rb
�#DU�M��v�'p���8
�%��������8D�J��(�i�����+��k��&���6���F+��Vk��f���v���+��!�		;,���Ft������Tv�4^�������t�����,R����d��Ln������Ĵ��$N|���$J|d~�Dj��􌢼���J|������\~�<^�|�����4Z����l��Tr���������̼��F|������\z�������t�����,V����l��Lr��������<b���������������pH,�Ȥry$1�Шtm}h4�T��P�ŋJ.���C�F�ϖ�MG�l�^���Q~J
#~mN{��Lt��(�I2������C���H���������m-G2��~.��f$k���4G0���7��[u��"F8�Ǫ��O'ȸG��m0��I/��_�F0���-**xI-��)G���^'�#�Y�P�2�۱�P�тEE0T����$̸�3D+@�-S�ZHp����zjDP���95�D���D��(4�0?���
���1�ƍ�N5�Ca�Q�r"H!�
�kYư
1Z޿L�;�a$^�b�c!�:B�����(R�c�1Ź�u��!�1-�������-㸐Q��-��!bł�sN�����l�80����
��K��Y6��Z�Y��G'���tH�&�����>ۯ��v�_B������bȴ`+5(Qc�B@|#�!U���a�aQ�J�DDGe~"����+/��4pb/6�Еk3��"31��<���@)�Di�H&��p1�pŽK���Б�xE�D
��i�D��E�w�`�Zj��@��O�F�@�,��Y����~
Q�d�SC�C�p��Y�	_<#%����v'����{��Q�;��!*��*D؎�B�0�U��/8
�oP���+��k��&���6���F+��Vk��f���v���+��k�	覫��!�		9,���Ft������Tv�4^�����t��,R������d��Ln���Ą��$N|���$J|d~�Dj�������܌��J|������\~�<^����4Z�������l��Tr������̄��F|������\z������|��,V������l��Lr��������<b�������������pH,�Ȥr�l:�Ш��!�����43wJ.����n�B�Ģ
dZ��~_\�l�kK�ml)|��J4�l�I%������u��u*H4t��1��|�t�l/G-�����e0���3G���-��QǴ�8F+�Ո2��M3��k�E	ݹuڮ	&W-�H
�ϲ�E4ºk�$���)� C0YkN�2�B��\��""

��(*�$8:<qA"�#g�2�J�4�Ԁ�ll&��0�1�/#�;�A����`���#�I�l`0��%G�Y]��j�Y����
Op��c �2.f�k��

(Pp��||�
N�u.��/1�U�Ő����N�Ș�`��*j��*O"����u-(m�6N�
p
A�۸�x@�N�?sG����/������@���}���(���
K��=�d���(o�RZ1��!=���H�+���p#�C��6d�$'�p�9�pyj#�SktPW���`
@�q(QPA6�,���0�(�4�h�8��6��B<2Rm
�A=A�Q�51�I�R`�P@%�ϕO�
r�ą�ᙘI|0�Sl���
�U͛J�"�*�щ���a��H�F�<�Z�
�	�R��Et`�(-�y��&1M�h��5
6�0Cr���ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v�J!�		:,���Ft���Tv����4^�����t��,R����Ln����������d��$N|Df�������$J|�􌢼J|���d~����<^�|��4Z����Tr������������l�����F|���\z���������t��,V����Lr���ܤ��l��Dj�����<b�������������@�pH,��d��9RʨtJ�Z�Ә�5l�xL._�.��~�����L��o��z���Dz,sv��Iz^�jaQ#lj���-\{�lQ�z���u%l���&I)��k0��c���z1Iy�j�3��!+'+J
��]'H£��Ɨ7�\oG��{�G+�Ҽ�ۇ*i�l3*G����H'�ڭ���V�^�#�@��V����w���u��d”]�v�H���F.�0��
��7�ܘᒕ%
[�2�Oe��{(z�qD��],D���0|����dG$7,8dC^jR�!��N�*���D�����ք��d�
�H�
��%�[F���^�Ҁ�
�.�41'k�R�$u�COiz@Ѩ�������c��Ռ�7{h#�3%.��Ж�0��8Q��s!8(~)�<7H�^���:��F��>Pu
�\@��/z�@�����bܬ�װ�V��'�z��㑀R�M'�
��y���xY�`v�Q(��b��p��x�@+
��Tp�	dv�0�(�4�h�8��<rG
k\�A��x���PiGt�]p��eH��-�D�7t��>
l9FI�
��bVer�M�&
.¦��Y	J�dB�vNaNU��g0|�J�VA�X��h�yL�Ra�&ԳV:�a��@��N�(�@�
$(V꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k��[i!�		9,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ�Ԅ��$N|Df�$J|d~��������J|������\~�<^�|�����4Z����l�������̌�����F|������\z�������t�����,V����l��Tr���̄��Dj��<b������������pH,�Ȥ2��h�eI�Z�جvh�`I�-���%�0��n�*M�۩����h7w��u)}|n�'X
(22��v
p��.�T+	`&0/��f'�~�n
T/~|*��nJ,���K���8��
�o5H0}��&2K��m��u"1�}6�E$��{�I%��$�u���G8؊�h��@�}l�K�!�;��`�`?%42tCp�}��p�@�����C/��e2��Z�L[b#Q��e�`f	�Q��DN`ș@@9��Zf%���XA
H�<0�pX�[\�f*�-^^�a�(s�fQ�nm�S��K�S/��uz�E�m2��'�6,��X��A��eBh$
F'g
����h3:����0h���s�'�
@c��چQ�9��K<$>
�k�؇�x,�W��)��D�s�a
c����|���An�_C@x����6����5��&AY��
h��D�	)Mh_E��P���ɐ1D�dt����݉�1�4�h�8��<jX�!�C��H�l�3�gd%�@
Y=)H�ds������e�0�e��_c��ŀk��fu�wH�oVe�O��X�2QG{�1C�']h�C���j
�{0��5�%�yMZF�
������@ܹ��|���ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k�覫n�A!�		;,���Ft���Tv����4^�����t�����,R����Ln�d��������$N|���Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b���������������pH,�Ȥrh�@'�賬Z�جv;dAN�p�t�q��z����0h����U���Rx��v8}|�a���,*U&�p�7��vba78I~c{~0Z6*&*t���}fG���:X�T����Q$����.W��c��u��G�'��`
V-����k)p�qF�o�	V�n��h+���YT�z�.XY0�h������(�xѠ����Np�ȅ/g
ɱ�
rU4L�5��
-�H�!�.����r�B�Yj�F��n�`
�Lw�E���Ƣ'jhғl߉~\��DyH��_N��Z�+��IT��'r��b�yw%����T�on�E�BF\��D
p脌��j<���@Zߐ�0��"���C��#f�đ++/YaĈ��mӧ9���KOb���8[�k72#������3U��{j����+��	
8��ۏQ~:ٹ�dҟv8�6�>U
���9�G
��Q8n�Z�¹pP2�t��x0p�
1�؇(���,���G���20r��z�@@P�!�|��	䁑׈@�s�1�H6י����8
�;'x�� �l��H_
�u�DY��F�	'�Yss�����Ԁ-K�G^E��'
���	zG����x<@�!��
5����v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��2!�		:,���Ft������Tv�4^�������t�����,R����Ln�������d�����$N|Df����$J|�􌢼���J|������d~�<^�|�����4Z�����������l�����F|������\z�������t�����,V����Tr����l��Dj�����<b�������������@�pH,�ȤYˤf�EC��Z�جv;T%`@L
q��z)���YeM�۫��X��F+'7V5.}{zc%��v�cU1�n||��i/p�$�I$n����Y+�pbJc��zT��K��oI3��}��G��I��&&+X
3),-�j�}z�G��6W5��c3�g����;��Z�n�@�ò~Zdcg���0�!�Jɍa�J��
P�B��4�t:�kFI,P1|SC	��K��؈i�FJTb�ݬR#�DO��
�›�#���
�R+��t�G��Tp�P�P+�Q>aL��v��GH�=��0^kiH/�t����"I�{��u�;]1��X��Q%4dh�NZo�Țv����1����@pC�A7����5
ciO.�#������{��3��`���w��D@�~)t>�}"@�<5�!�}�g�s��7�<a�W�t`��-�_�edB.���$�`��)p�$4`�(���,��(��f�(]|��$�X�yKe>BB�)�'I����1)M��gBbR��aP�@@����K{��
����9��$��n�q�<)EW'%9��J�{
r�CT���P�~	!J�Օ�����`*�QZ�1tpH4��*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k�
覫��H!�		:,���Ft���Tv����4^�����t�����,R����Ln�d����Ԅ��$N|���Df����$J|d~�����J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr9�"�R�I�Z�ج����A�-��h��5���&M�c=��(P�*
om�&v��E!�p6U#3���#��u+�n�T���_��f%^p�L������W5��o&Kl�����L��`,K��n��H��&&K��o��Dl���o
J(��`3��.��dI�`���l�#gIۚ�0�5�j���$AJ��נ�L�+�
(i�e�v�|u��a��
�(X��E���$�@�J#4����
'D08��L1,ȇ����%��ȯM�9�$h�\$H��H�p(�hXn@B{oH
�*]�$*Z
(�Q�_�0p�"�D�����L��ja�Y	��ހJEXa:����W
s*��
�;	��E�"<p���Eh&U7S��"/³�R/S)P���t$8{�KV�Fǿ90���T�C��#7X�7�D5MC�}H�@@?L��
�Q�H*�B |֨A�D[� �(�$�P@
�H�P����bl#�V
T5cf#|:��Z�yr���J�o���<�]�
O��m�(X%.d�ȇ[�y�8�`�xԆ�g�‰xo��f.
|ä�͙�E����ɀ�UQo������4��3��^�Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+�䖻i!�		9,���Ft���Tv����4^�������t�����,R�Ln�������d�����$N|���Df�$J|d~�����쌢����J|���\~����<^�|�����4Z�Tr����������F|���\z���������t�����,V�Lr����l�����Dj�����<b���������������pH,�Ȥr�l:�Шtʤ!4�nj��z��Ȫ�p�Z��T���)�v�K����
(r��C7~jvjP1��~��_&k�%v�M4��%0��S/���56M���w�������%M
�����J®���K*���.��EЭ�w5L/�k�%2��9��vL��j��3�ы�L-ٶx���5��Q�Q,�}y#B
J.��u�I�����K	��!@�c�D�
	bG)"�`7Ap�d��@^NI�ώ�#2��`��r��"4J�}��1�������`���U��H@�$�(�)��Җ�qj��L�݉�0��%2a�	
�]��J�?�7N��E44_z�8p	\��p`{����)�H}D���~p�2���`�F�F
��
5J�I	\�
e�"�D�@�5.D4'��%����Y`{���9��
7R�5/C����+�>�k�����M��
Ƞ�u�D�ݱH�T	��`�X��	M�I4��
6��m�i@��!�v).�9�Q!h�c52���%�	�E�@[��1[��V�7AA�!�dG
V^)P^\v�bSFS���� X-%�&*6�d/���
i'���v�bYi��g��5(h*�@b
$y�1|=*餔Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+�O!�		9,���Ft������Tv����<^����t��,R�������d��������Dj����$N|���$J|d~��􌢼Tr����J|������\~�|��4Z����l�����������Lr����F|������\z����<b����t��,V�������l�����Ln������������������pH,�Ȥr�l:�ШԨ:���b��z��@�ȳ�׆z��p(aF6����FZ�-nq��B6u�w&.4P#x���o2���O��x��S6�xg��K���[��M��g�L)��f��J#���L4��d{��D���&-L�����8�Ɍ�K'�e�7�o*((5L*��d�J�����\jX@0i�%Tus�D�u
�R�
�3B$I��9�0�
�	�@(�*�F$2��Z��Gl4S:�!)��sH
D�f��m�0OgM���0U�‚F �A���N��
�O��&��B0aj�6y��!�in,X��C>�L��7�a%�L"�p�1�;
�uL���M�Rn��^�a�Cs�9+nh�!�4c����6,\n�@���*d�H�����˱p�(�|`�@�o�]B�,�g�.%.lrq�t/*��,6��x�]���V�
%��k^���lc'�ҏ6�=�B7
��Q)d{.�@|J��D=��N�I��pT�4�TTg��(f�]L@@"u�xrb8�3�dI8dҊ3&QAG#^��*@�d&��#c؈CN��*&4��	
��DN(� 0^y7u`"7`��
��i�$��cM_���G��Pu,�����I�wz��'h𜡐F*餔Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��^!�		:,���Ft���Tv����4^����t��������,R�d�����Ln������Ĵ��$N|Df����$J|d~��􌢼���J|���\~�<^�|�����4Z�l����섞������̼��F|���\z������t��������,V�l�����Tr����Dj�����<b�������������@�pH,��dҢ���rJ�Z�����&p�Ӛ��4�f���`�������Q�͏�
qo�n2���f,p_q}���J�&p�`)g,3
-��S7�����Y]�q��E�|�Y3�|���Y����Y"	3�T9���0X��`
�W#
̑RJھ�`3Y�`��Sp� Vh%���K
I�Ν8%@�{^P��P�,*�E�b^�;��G��d�H�DI�G,���J��l�0Ӣ�=8pa�)�W�8Q��DF������ĥ�ѧ]�|�yV.^�"J[�i�>�A8�G]""�-�Y
£h7�	��)�:ޤ��b"�r��@����i���Шu8��O��ԩ�������s����06�����(^���,��=���]DPxv�ԝ����"4�x˔_�i0��#k��W|��P4�A=~\2����Y-�W(W�5�w�`�X�rA���$��:\0C�`�p���P�}*�2�@|̠B���ė��q������0�Q)�~�A�J��Bc˘�]�w��$�ai�Lf�B��ih�'��FM��j�7R!0©E��ҥ�i�	i.(�g50@P3h��e�k��QC��uF�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���V!�		9,���Ft���Tv����4^�����t��,R����Ln����d�����$N|���Df�������$J|d~���J|���\~����<^�|��4Z����Tr����l�����������F|���\z���������t��,V����Lr����l��������Dj�����<b������������pH,�Ȥrh�:�Y��Z�جv;T=J�p�t�q��zi���p'����Յ��Nx��v7}|�a���Y$�p�6���G~c{~-������8��I"*&#*
Yb�pq/��C7�#"W��}�	��)�%o3tUƣcv)��V'�}.�K
,�|~#j/o.7�H��%�U*��,�g"0���@C��
�l`�
[�l�Ҡ�8
2��!M��`���ig�q�`����g%EoP�������ԫ�Aވ����h(�,��x����,�G�-D(�E�	ACe3.b
�
G=g��1�d-NU�9��a#�s
1���F��B��W�KLI��"���rJt��Q�K��	$9������^(8�Є�Y�v����(��
!l�`B��{�0S�z��o�t�^���Zι�m@RfS��	w��lpz�z�^��U����7H��@���Pp�x�AW��I_n�YPנA~�Bxʃ��8�X�V`�	��(���,���0�(�4�h�8��<���@)�D�CC�0�8|X�"8P-��$��q]�D򕂙�I��Y=,8I��ІU�k�Rc��xE�w1ASS�A@�C4�ZB���M��}jF�*zNYm���B�PN�n$ʩ	tUMjrzi��AH�&1���j뭸�뮼���+��k��&���6���F+��Vk��f���v���+n�A!�		:,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ�Ԅ��$N|Df����$J|d~����Ԍ��J|������\~�<^����4Z����l�������̄�����F|������\z�������|�����,V����l��Tr����Dj�����<b�������������@�pH,�ȤYӤfD��Z�جv;T%`@q��zI���eM�۫��X��u.|z�&%���Y2p�||��\!3.'sX0{�}b
��Un�2X��{T��F+�{,W��}p`��B7�¢c�Ụz+�Ə��`�K��6�ƚ��*U+��o��̢!V��7�(���\���D�Rm���@+7X�caBT5�̓S���0q��(Yd���r-ؼ�f*����	3%oH@���L��0��ia|��Q��OW�g���:hd����lt��������F	3f`��_6�
Ōh&��EAAHyP]�UZ���a�!�P�����Q�S!������%�5
*7�4v�Pò�`�YI}}'A]��g:9�s�I�lc2��_m�Տ����;ނa�
���U�^g!��L�+iq��,2�4����E9#�	/��	ǵ�
K2��N9L
,���!f��h�(���,���0�(�4�h�8��<���@)�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�9eoY�p�,&d0%R��Sn��U�@Ys�E	Bꡄ������Q�s�29��kz�eM��i֓�5���1ق`ٸ�d����eMF
)>�B!6A���І�	R��I�p��9��6pP@Nf&���6���F+��Vk��f�-�A!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr�l:�Шt�$A�CIA�z�`%�@�˂Wx�n+s�y^���k˥B��^%f�r�(;x�T4	rt-S
���g0$��N�fg(R��sfv��H���89Q������D
t��(P-�����,��s8P6����ʺq���6O9��2׺*���O2����*�͠jO��f����q�R#��
�Vap���5("�3�F�M9p�k`��d��X`��a��4����:@0�낶9	"}���M]42�����+�ܸPC�DFM��!QUQ�6!pc��Z�ɱ��>ŊMq�^E�j-Tx�\�&���q7숆�P���7���z��Y�nô�v5��hd�6�2��Ȱ��.��,�	#@�2@(�O�Z7�qn��.�С�qZw�	{RL��[gR����_
0��C�.ӗ����&���P�t��.
���~���)ѯ�
���X�I�)�en2�+� � +��%
��&�5�)�\��
i^��8D��,�T�0�(�4�h�8��<���@)�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�i'�7
B�0sR�҆`���X2�H��0��$�R��-y��*=���f4��<ʵ٨7)w��@j��G.�G1�s�ْ��W�>��>8&%����SޠC
f$��lp!�		:,���Ft���Tv����<^�����t��,R�������d��Dj�������$N|������$J|d~���Tr�������J|���\~����Df�|��4Z�������l��Lr���������̼��F|���\z����<b����t��,V�������l��Ln�������������������@�pH,�Ȥr�l:�ШtJ�Z�X]��r�$ٰx�<P4Z#�*��{~ťx42'Dw,$t�O)xwz(h+Xvy�}��H0w��,7V"��i���B���(Uj��-�����"T6���x��-���,T����džѵ�T.�ĝՆ6�z�(T���9�,е���x1�t�h���i�.O�}nZ@�mD�ޖ�نpN�e�
԰2�U�4*҉��-	�p(�Qj"�$����L␃E��4p�4r�;D؄b#B
��p`��C����XYu�����!�j�&90��r���m�1�yD���
JD��pX���8�
�V�*2�07���WQ��ò��FM��W3���/�p`[m�n���=4A�"�%μ���УK�N����سk�ν���HN<�+�9J�^$�y11�SA��,+��s꾕�ѣMh�Aa�I�@C�S$�'0(�QU���Q@Вd�B�^�u��e��2��NаX)!��	zt���E22�MD��G(��c5��)
	\�
()�TVi�Xf��\v��`�)�d�i�h���l��fX���\���$���i�d��0�pV�$}}Z���y��P��
�JV0�<(\��
���
<�I�W��
��r�
z�G�WW�9xYY�~��Ö\z�5Z�?��e��0�}b�oF+��Vk��f���v���+�sA!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr�l:�Ш��J�jb��z���@��x�n;
2�l6G8����(06{��Q4ugt���G9
���u1����et�y
+��&���fl98�#j�����.k5�d,��;���(`
Ľ��{-���[_����yŭ0`����n
�`��r��E-4����(&��
f��m�	i�������5�=\!�Bjg(tkrC�E(F�a#�����j6�A�/Z�񠍟�
jUG��!+�R�Ab�_�>�!Ca
��wF�V82{e��'��������#��
���ao1�g�ؠ�A
kgs�-�ip��H<H�
C̠�؈�4P�Ш�`��JE��<vL�)��-<�P�`�m�
^�����ȓ+_μ���УK�N����سk�ν����ËO�����ӫ_Ͼ����+`!b|'����!�$p�$�	�aA�ȑI1\�_�14�W[
�H�f��`X�f@�<�TG�SG@N���da$�a(}58Mi���`a�4�B�Ў�C)�+��J��3����Q�x
��4f9D��oD�0eg���\%�/$h�5��Z;YV`����]
��^5�����e����8���5�����X`��B
b$�p�=5�I�
/-E��*yC
�$�b���>���+��k��&���6���F+��Vk��f���!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�ȤRؠ	p��絬Z�جv;\�`�2p��zi���d[���+��q$y��v9pr�a)���Yqc�����G:�}�1���3r~�o;�����}���x��~`��k;���	��;.55T[9��~:á
5c�![��`7Ә+	�q	�Zݓ(�-0�0-[,�0+��<p���pjh��Qv�Pd�а"��B��G"
z�裑��
p`��7ʹ`�ȺRa6�E���74ji�q���&H�&(�)�!
j�Ɵ(j�a@_@S3�pu
E��!e�C�'.o����,
U42�CT���u�2�c�����ѡ�[0�e�[Ld�L�(�R���/��p�
lh�k��8�o�g
±�w��ٳ��ЁC��sN����ȓ+_μ���У/��BD
Ko�⯟ldb/�ǯ�
X[�k�1�>�1�i��fS̵��e��䒀YXvf"x�8��jQ�7	Sa
�Dp0�l�EZ����ZU�;(j��K��;-na�zeVC_5��@�=)�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�%/PC0�RN��e��
8&ML�
��`�dgeM"���J�p�yo��Mm��{G�7�"�9�Z��i��\�QKF�Q�D
��
8!'<*��W�h�1ȠQfqE�����C|��f!�		;,���Ft������Tv�4^�������t�����,R����Ln�������d�����$N|Df����$J|�􌢼���J|������\~�<^�|�����4Z����Tr����������l�����F|������\z�������t�����,V����Lr����l��Dj�����<b���������������pH,�Ȥr�X���I�Z�ج�N��-��h�
�z���|N�"�o�>S��"yn`�5��W+mzx`q���F3���7���7��n�8��;"+(+i���`,��8	o^"g4�����,�z4�e-��a4Œ*���1�Z)'��|ӈ��'fΎ�`/���o/�Z/��x�.A0�"(Q	\�#c�Y���@L��AM��rj�pH#����}Aa��
U"pI�}�ث�s����d����7Q���a��ڔ��a�
�R��ЁB���`ÊK�l)

��jV����Dh���	:x�n�
qcbP�7��Rd�2Cޣ
[ѡ��~V�=�Q�v��a)�l��Q0��,�In1k"�$��F��'`�>��Th̃���!��7r�����n0</�q��L�8�Vb;��w�*����_�ba�<�L`:%r�Fح��+��Zy�	��Q�T5K$$HDƩ�{U����–�,�#7�d!�x�7Եb6���:9�8c��B	%�
�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�i�x��s�
	��%�ɥ��@:|	,�0S��v�6p�Yz���eh�鳚��9*�	*^��7�yAݕ�5�G�Z6�Y#/p�ۋ��%�	sͬX�p#!�p��˦[�0��	
@����+��k��^!�		:,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ�Ԅ��$N|Df����$J|d~�����J|������\~�<^�|�����4Z����l�������̌�����F|������\z�������t�����,V����l��Tr���̄��Dj�����<b����������@�pH,�Ȥr�l:�ШtJ�Z�ج��"��EK.���`mbGd��H�x6�4�"kwzmw�D!^.acd'z��m78�j�_pZ�y�y*�}+��&Y
���,�r8���w�V��w�q2���
W�����f^��&�V5´w��d��!X7ܔ�d(ɲ�X׭.��Y��w�W
n���._���1��E
��0H�?Zm
h���/�X���s'>-964!���dpH�8j̛Mj����ΟIVi�P�H8��*!ހP�(;
`
��W"�ș����~�>��i�N%xV��9	c��so��
��0��0HZ�0L�n%�1X�4��r$F�38�>&p�s1��a�`:��"�n����x0̰Af�*��N����ȓ+_μ���УK�N����سk�ν����ËO����:H@c����L�0�>����
��
��(���B��l��'��3�5j��b��L=���yg��B����8�܀�$0����XJ�C8�/7(��$�B�'�G@V���uV�
|Y�B$��P�Pw@�\F�[}y_	���B���(���S?��]�y��ACa|
�Ǜ:�X)F�M�
B�:�dR��N�l��C�7��B����ꪬ��꫰�*무�j뭸�뮼���+��k��&���!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr�l:�ШtJ�Z�X3he�����HP�����M?j�~�D�iuh8y|��D$�v�g���4v�����o���h#�$,'
�b���{-fv7�X���z/
��8�V$�u�g�oʕ(0^�T˻i*o7����T��h4o�(/�D7
L!���n��Xl��&B�J4�›�.�a���m�6XH�@�
pl�r�1�XёpI��s#��38�m�i����)f�H1��F*�L�A�ME�	����F���H�T!12���M*��i���ˆ 㙭�v<���ԓ/�B
�TV���p���	xP�)��0���Ƙ����F��:�2��s��+]���d(.��m#�8\(4�����N����ȓ+_μ���УK�N����سk�ν����ËO����1��|
�E�`�0�~I���
�W�"��쇄
�H#}
�GV���3$֎��2��A�B�%ZD�<8�Sq��!�V��փ���iZ@>����<�P`)�8
�Tr��C(P�6DE�cu&.)�TVi�Xf��\v��`�)�d�i�h���l�����dR�,��^K�Vjx���`�l>^�b2+�]u��9A����(�HG�.p�GJ
����a
��W��(�>jehg>��ͬ�,i�c��'�9�0c
(0�ޔ@@������F+�&A!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,��$�4`q�ШtJ�Z��Q@e��xL._=\T��\��zX��]�|��C�xj�\;}��b9x�ii5���J���iO������4�����w\)��R!&4-P)l����G+v]6I'���(��B4�x	/H
��x9ͽɩ�F:��](�ݮ	��8�F$8�v����iH6X��F>W8�0"I�Px
q�U�s��bCÈ#h����~�`�\i�#�v6��)�^0U]�,�C�
4��ڗS��Ch�`�%��R7�)��TH�S�X
�1PF�l�`� �Xd
�*��p�`C6�Z�z�LW-v��0��[�C1�p7�f�u��C�livQ�F��ɛ��x����,�|��n�"�a�Y
���Z@.5�ywS�)m�9�����УK�N���H-4̨��A��8��I�i�,���&��T���<�9,3]#����p��Ӂ:G%�E���f��2ZAX��a�����H5
Oqx�7]��a"^a�T(\��)��Bq	"�<1�1���0�U�cܐ����Q@��%��PF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�i�x��|���Յ
֘9��^T@M�!$��
|���i���9`��0n��o�d�b�	]��fY�W*�<�%�5ބO��
�i�L���%0�ϖ�L�r����e2��
�v�46�`�@�8,0h��k.�A!�		:,���Ft���Tv����4^�����t��,R����Ln����������d��$N|Df�������$J|�􌢼J|���\~����<^�|��4Z����Tr������������l�����F|���\z���������t��,V����Lr���ܤ��l��Dj�����<b�������������@�pH,�Ȥ�X��l��Z�جv;�u&�XP�����h����DM�۫�6ܽ��t!-o�z&���Yyaz��6���G,���`4��Vq
X({�bm0��G�b5V���&��B!��6�K��{�����oU{ʑͰ�֐9K�|��٠ϛ�bӪ�m�3��`V8o�p��.A���	-���0�%R�܅apE��	d��ԋn�Zt�䄺jzH�\yDŅU�z��9�&w`X��)���0/���B0
�*UqB�
3p4TJ��իX�j�ʵ�ׯ`ÊK��ٳ��P�
�^
�f	r�x�NO���\�U�L&`;��0�(o���N�q�Ĝ���	��
%��&��&p�F�#��61V�a!��0SegهS;�fT
���3	�ru��'	Pn.�A
b��"�
62८�F��b�%�����`Pd��0���bR���!qC]�(ԂPBd����W�=x��f��G�x6�mT�!0��s#1�Dn�!R�E�`�"�8D��f�$�!(���0�J5i�'`��tJF)�TVi�Xf��\v��`�)�d�if�	��ࠔ
��)Y�0�	
d����JJ�0aho�8�����b6C���JJ���iH
Q2�3}q�Ӑ :Y����RސK7 8�
8�f�VҀ�-
0	�)��k��&���6���F+��V[f!�		;,���Ft������Tv�4^�������t�����,R����Ln�������d�����$N|Df����$J|�􌢼���J|������d~�<^�|�����4Z����Tr����������l�����F|������\z�������t�����,V����Lr����l��Dj�����<b���������������pH,�Ȥr�l:�ШtJ�Z��lRq��R8�xLV^h��	�ʄ��(%0�q5`��Xq�M)}cy}k|''��G#�z+Z}����B���Y��}"��+��{'0W|������z��W���z9�q.��k�U2�؍%�p(iٷ'V����e
��{�U5��j��c���k2W1��Pٸ7���o�\\��l_:�b�C�ፕ��ݐQL	}�Fe��m
��Ű��OύIZd�HE!̔b`���(r�p�2@i�)9J�(�C�ӫX�j�ʵ�ׯ`�BԐ#���ZC�7�4�mj�EC5.�M�@�9_t�%h�/d��᰻����R���g���S�����왔䉍��&��^jW�����
٥j`�|N�R:v7B��7),�:�l|�7
���97�ֳk�ν����ËO�����ӫ_Ͼ�����˟O��������Ͽ���.@�4`Om�rCl���AIi`�[~"D��#���7��CC~;�ܧB�="R}&�#��A�w�8��e�P}8$������$`Q}+��G0�	
܈�����s�1�
,�@@�'�d�i�g*�B(
P���b	5�7dc/h��#bA����
31�7C;̔h���͎�p8*�wڅ�|h/�S�3TLq�1�!3rݧ��jl��A�`�S������*��BQ���
(���&���6���F+�Ԗ!�		9,���Ft������Tv�4^������t�����Ln����,R�������d��$N|Df�������$J|�􌢼J|������d~�<^����|�����Tr������������l��F|������\z������t�����Lr����4Z����l��Dj��������<b�������������pH,�Ȥr�l:�ШtJ�Z�جv˥z:2�E�9u�hnhu��%R(M�CC�@�'v��F$nz{��+���'��}{%��h}�����Z���{�'',�Ym����1��U�����|&�S6����u&��n8�Qp���i��{3�O��%u�׈2�O+��$u���%�M��2s�P��}�:�pP�����	��8`&��C����B�
2H`X�ȌQ�h�A�7n^�lY��o�
b0 >x��W���
�3tP���ʽyQ�7��
��*d�h}�hC]�#ɦ�G�A�F$�0�,H
a!��0�i��]�!77L+����覘b�p��-��s��|A5M�Ƌ�nd�`�j{$�����=1�N����ȓ+_μ���УK�N����سk�ν����Ë��"U��Sn8�Ɇ��LȨ���J�x�yϋ�!q�h
%`/5��N���<Р/��/LX�T��hH�OF��B$�ˉ%�Cb�V�g$���h{��b0I\7��`'7��o�P0B�F0`�`-0|HF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�Y�08��HV�P"�pW�3����
��M�A>7�P!A}��"Z� �Z���+�S�M�X�@�"4�RB�+F�N
��#6o�b
�D���ݨB����
7�c���@��R��	1ࠂa�!�		;,���Ft������Tv�4^�������t�����,R����Ln�d����Ĵ�Ԅ��$N|Df����$J|d~�����J|������\~�<^�|�����4Z����Tr�l�������̄�����F|������\z�������t�����,V����Lr�l�����Dj�����<b���������������pH,�Ȥr�l:�Ш����f��v��BS`|�8����������>N��Qo�{o���H���n,���#b�{pn3��z'�qc"��k&�����^.���n���S,���(��Q1�n�'��Mc�����J�{�ՖV+5Q"�n�܌	�P3�-�5*��'P
:":��V/�	��+XOĨ�n�0�"R�C&VkCN�	842s�b2��T{xH�a>t�rW���Nب�K��J}p��(�gnh���+S�
S�Bf.��X�8z�E��X� �سhӪ]{��� 8
�Ԍu�0�[Wш@�ї�S_�-\�@��2B�/'�v*�vh!f5&r�p�3Ǣm�6���|QY�i�is����0��9A��^R�B
p4s����
1d�y��ln�A��4�V'�a\�+�����
��㍰0�E8%�m��aB�-�f�
�M�acV�N�r�w'Ǡ3�I$�M�D�+�!���K
��poH�
`Wق'&�q���b8u�('�0c�6�';6��@�ABQ�U��IF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�^���ea���D�)|��P�e
�vBY�@���$�e��BؕIWZ
S+�Q��pÕ5$H��W&ڡ�M)�c��������]�U�p��e��O�385�|i�����i��f���v���6!�		9,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ��$N|������$J|d~�Dj�����J|������\~�<^����4Z����l��Tr������̌�����F|������\z�������|�����,V����l��Lr���̄������<b������������pH,�Ȥr�l:�Ш�%�A�6�z���0��.Dx�n;W�Yn6�|�7��&z��Qr�r)���Gut��f/���8���g2������3��n2s��&���`���e���S
��g���-(N��sī��K4��4ң'�~�L-�&ߢ#���K�e��ڸ�.\L
pa��D����D‡E*pf"ċ9~�K��C�(�����z�(�p?��X���V<���p�	���4@�db�@�	
(����,���@����
�ׯ`ÊK��ٳhӪ]˶�[U"�8�����Dd���E�x�4HA�L�����H�m���l�q�cB�/7\����.
���㳗��94=E�KT���J�hul(&slq[������EGK��Ka�X#�˝���:1<�Pc�
'�vO�����ӫ_Ͼ�����˟O��������Ͽ�����
]ٷ	��t6�p�e�$ ��=�
,�x��o�T�[[PU�7A��;䰅HH��j<��wiY@�'���ch�T.�V<�$�3�eg�s�q
@A��l��
,��OX�!,2���H��`ɍk]���4�@Q��a�Z����Q�!rg���
٥VT�N�9��E�N<��"�y����U�(/��Z+�E�
ذ��`,5�0߁C�A��ͧA-���k��&���6���F+��Vk�ت!�		8,���Ft���Tv����4^�����t��,R����d��Dj���ܤ�Ą��$N|���$J|d~�Df�����J|���\~����<^����|��4Z����l��Lr������ܬ�̌��F|���\z���������t��,V����l��Ln���ܤ�̄������<b��������@�pH,��d�&�9RʨtJ�Z�S�5l�xL._�.��V����zC��x�|��c�^�ja}��X-\x�l���J
�lxk����w�2�������'��R$%2*R%��j���E)�k
4���k��82��#I���ʼ���H֨\$ح��&&67H7�孶�&I5��&��#eCM*A
��(A�Y1��
)78`�!F�V4�[c��ǓF��h��!6p3���{��4��F�CO��|C��Æ�\Q1P7�6d���T�*��0��կ`ÊK��ٳh��
q@��;�*aѢ	�b0��z�҅��%Qjt���đ�idC"�5��ⲡ�z��O�jż<.�'d�TX�!0�D�{N��T��6ߙ���A��3���`���1��q�r1����ËO�����ӫ_Ͼ�����˟O��������+���
C��2A�J~ ����Aj]�Ё}
�)&�x3��UT�|}	��D�
^Ň`c%%_M�fB��r	(�ɗ�8+��}
l��W���@�~*`c2�g�w�pB���0�e�)�d�i�h���l���p�)�t�i�4�
�Gaja�	`�c}"H0Ԁ�dF":h|+�Ɔ	%�Ǥ1\@�|4J�:��gr�@�|�VɅ��(.�r�r��G��k\��|�:�k
��W�6k,�h|
���'�s��`���Փ'!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ���j��dI�Z�جvh��̅�-���%@��n\+M�۩���
��rw��u*o}�()���X
}|�_0����E)`�n�m
��Z n
J.���o��T
{}7H3���4��G$"��8�F�|�{;��C���G;��m
��Μ_�E9l��������G��(1��5��(H��C+_���}If$Eq	f�ء7ݐ�A�O'ʒ��*
^�)M�8_#X�<�"��Cg��@�6.v
2��������
J��H!�:VF�ʵ�ׯ`ÊmÁ�8r�e�cY=*B�
6�d's�si��<���I�`Q|_�{���m�2$m̨�;�(�Rf���3�7R�dьhl��IjF�:ED�
�o1�=��$882�^tA����-�P#A�&�N����سk�ν����ËO�����ӫ_�H
&B�?B��&�iP�b�
�C1�`�l���5�do,��	?��>��Fi|�0+`(�0��b�3�Ga�`�^�U��&x�y�Z�<��g�
�����F�P��LVi�Xf��\v��`�)�d�i�h���l���KL�+hI�gu�y1i�>}L�BB���_�@�r����\��!憃~^$
�G��A�}ɇ�Y�c�y�!�J���V+A͗Ð���~+��['�M��,�1��bɁ#�pAmpVk��!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥrh�@��賬Z�جv;dEP�pu�q��z����0�����U���Tx��v9}|�a4���,+U'�p�8��v~849I�}�(1��gpcafG���;��X��5$�b��`/��J��bG�(��p
��F*Ԗ(F�o�	��B-㦊F90���zο�.G��0
�w$:~��p-
�Ɗ��DC�["�8�fc�D?��Ё㍀���f
���0�@���`̛I\܂�@#�ΟCr�	&AC�H��
p	��I�"Hq��YQ�j��b[�&l:A�G7��T{�e0G���R�uh�cAP�b[�����5`yO@�l1�*���2��U��,�)�nPlଌ��aB����XW�b���E�yݐ1�
���nm��2T�!���УK�N����سk�ν����Ë7�`�5]a-(~>KO�j�m�BI�
^ү2#�'�-1�N�� .��A!Am~���	(�
sM(��H��C�PX?H���'��E�sT�4dv
�-!
h(0�#4|q�x�
xPh��PF)�TVi�Xf��\v��`�)�d�i�h���F
`���(�
xLi��A�-ڇ���n���P`�5"�I`&�W5�؟��Ӣ����'�N����=��`d	6ڂ��
�E
Di�J5��X�9�`gpp�)h���k6���F+��Vk�^!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ�غ�"(���Z�جv;|@(���q��z���aȼ���K��=��rx��G-)�J
|p}a4����`
Jzo{�(��k1��n#�Fq�q�-��[-��H|��+��W��nG"�ͯ��I��2G#Ǡ���Eξp�E4��8��B���/F7_�(��3��oʌ��
V��y��#.‰@'��}�����X(j������4�%�$�i�
h1s.�!�!��8t
UB�A0:���qaA�#4��R��8�F#��1
.��@ËrZ�5�u���p��|����F@k7f��mS�ՙ`[F1)�l��A�$-���d���v9��q�Q���GI���[�l�8*��6��B1��m�6�3#���ȓ+_μ���УK�N��u�7��QC��)р�UL�S��1��
����L�@|5-"�>f���>�2�g�B�30�����X���p!54K�fQ�f����L(�#b�Ё����7�v|��Dr��H6f��_���<=i�H&��L6��PF)�TVi�Xf��\v�`+@�W��@a���^��w`1D�B5G�B�J��H�`l�d�Af�8Lh�M6p�8!59Ah�$��
�4���Q(��L:0<���O��BK����1نD(�0%�}��V"p�#�0���+��k��&���6���F+��Vk�!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥ2�c1j����Z�جv;\��p�-���j
�b��F#M��?��(p��؀�p#v��I"�l8J7
`m��(�����I4�����t'��mHpp�n9��\���nG_���6��X���a.��΂1��K��o(Ga�s��F����D»m8��D0֜�TE��(4�8��xP�lA�~.�����d�"8o@�r�
$iK�h
}���$*P@��mɎ
*���@"d�	*	�t�<o2�����MC6T�b��H��$0z�	+%5=B
)nT�7b�3JZ�@0ql���1pK�Ț|�Pd�U�n٨�u���.;�-�uO�U^%rU��`�m�`�$=�l���rm>����>�V�m�"�$e�mA��uN����ȓ+_μ���!c<�p
��Ѝ)�+��DՆ�L"��!E
G�p_�"P8���q`V
t��Q�fK`���
�xK=���f�A�fzQx�
�Ҟ�\�v�
'�ȅC�����e4��>߱x5�R�P2�a�,��@)�Di�H&��L6��PF)�T���
UQ�RÊQڰ�75��d�,�B%6	_h�0�$#.�X�^�\M�W'089K|�8��9�d�d
�-R��%d�NrH^%m.�AT���x`^��H`JY��
EeY�*무�j뭸�뮼���+��k��&���6���!�		;,���Ft���Tv����4^�����t�����,R����Ln�d��������$N|���Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b���������������pH,�Ȥr)\!P��I�Z�ج5TxO�GK.���H�1�Tux.�����ԡ�GSJr��rz��K9�`^I8�_�6���(^��'`*H,�~�`��z0���78G���7��f���'�F�út
��X
ɐ�#G�t�+��L+��~�F�����I׳`G2���4�E6��^�F�tB��������;C�2�1#�J.��wb��]�!Q�	���@�d��}�bz)Q�<$����VA��d�U#��ēk�0>�
I/��*+t�@a���<��4f�@y_r0��G���!i�)�?(,W�*޿E>ES�a!%�%x��];Cn���h)���Rl��;�jr��ʓy�o
rN�
�p��N@0P�q9F�`�����ȓ+_μ���T�y^�B��sbܡ~o��`b(���EQ�o�%��‹d�z��ಮ@�;��<�U~Nި"V
�q��F�
W�z_Mr,��"8P���L�HS�AB��x����������x4��e'���"(��G�͸�
:����Di�H&��L6��PF)�TVi�q+�
PܕF�p�.�p�C�d^��
����~�Ve�	dH�S���5�Q�`�}8%�A��甏]���Rb
�#DU�M��v�'p���8
�%��������8D�J��(�i�����+��k��&���6���F+��Vk��f���v���+��!�		;,���Ft������Tv�4^�������t�����,R����d��Ln������Ĵ��$N|���$J|d~�Dj��􌢼���J|������\~�<^�|�����4Z����l��Tr���������̼��F|������\z�������t�����,V����l��Lr��������<b���������������pH,�Ȥry$1�Шtm}h4�T��P�ŋJ.���C�F�ϖ�MG�l�^���Q~J
#~mN{��Lt��(�I2������C���H���������m-G2��~.��f$k���4G0���7��[u��"F8�Ǫ��O'ȸG��m0��I/��_�F0���-**xI-��)G���^'�#�Y�P�2�۱�P�тEE0T����$̸�3D+@�-S�ZHp����zjDP���95�D���D��(4�0?���
���1�ƍ�N5�Ca�Q�r"H!�
�kYư
1Z޿L�;�a$^�b�c!�:B�����(R�c�1Ź�u��!�1-�������-㸐Q��-��!bł�sN�����l�80����
��K��Y6��Z�Y��G'���tH�&�����>ۯ��v�_B������bȴ`+5(Qc�B@|#�!U���a�aQ�J�DDGe~"����+/��4pb/6�Еk3��"31��<���@)�Di�H&��p1�pŽK���Б�xE�D
��i�D��E�w�`�Zj��@��O�F�@�,��Y����~
Q�d�SC�C�p��Y�	_<#%����v'����{��Q�;��!*��*D؎�B�0�U��/8
�oP���+��k��&���6���F+��Vk��f���v���+��k�	覫��!�		9,���Ft������Tv�4^�����t��,R������d��Ln���Ą��$N|���$J|d~�Dj�������܌��J|������\~�<^����4Z�������l��Tr������̄��F|������\z������|��,V������l��Lr��������<b�������������pH,�Ȥr�l:�Ш��!�����43wJ.����n�B�Ģ
dZ��~_\�l�kK�ml)|��J4�l�I%������u��u*H4t��1��|�t�l/G-�����e0���3G���-��QǴ�8F+�Ո2��M3��k�E	ݹuڮ	&W-�H
�ϲ�E4ºk�$���)� C0YkN�2�B��\��""

��(*�$8:<qA"�#g�2�J�4�Ԁ�ll&��0�1�/#�;�A����`���#�I�l`0��%G�Y]��j�Y����
Op��c �2.f�k��

(Pp��||�
N�u.��/1�U�Ő����N�Ș�`��*j��*O"����u-(m�6N�
p
A�۸�x@�N�?sG����/������@���}���(���
K��=�d���(o�RZ1��!=���H�+���p#�C��6d�$'�p�9�pyj#�SktPW���`
@�q(QPA6�,���0�(�4�h�8��6��B<2Rm
�A=A�Q�51�I�R`�P@%�ϕO�
r�ą�ᙘI|0�Sl���
�U͛J�"�*�щ���a��H�F�<�Z�
�	�R��Et`�(-�y��&1M�h��5
6�0Cr���ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v�J!�		:,���Ft���Tv����4^�����t��,R����Ln����������d��$N|Df�������$J|�􌢼J|���d~����<^�|��4Z����Tr������������l�����F|���\z���������t��,V����Lr���ܤ��l��Dj�����<b�������������@�pH,��d��9RʨtJ�Z�Ә�5l�xL._�.��~�����L��o��z���Dz,sv��Iz^�jaQ#lj���-\{�lQ�z���u%l���&I)��k0��c���z1Iy�j�3��!+'+J
��]'H£��Ɨ7�\oG��{�G+�Ҽ�ۇ*i�l3*G����H'�ڭ���V�^�#�@��V����w���u��d”]�v�H���F.�0��
��7�ܘᒕ%
[�2�Oe��{(z�qD��],D���0|����dG$7,8dC^jR�!��N�*���D�����ք��d�
�H�
��%�[F���^�Ҁ�
�.�41'k�R�$u�COiz@Ѩ�������c��Ռ�7{h#�3%.��Ж�0��8Q��s!8(~)�<7H�^���:��F��>Pu
�\@��/z�@�����bܬ�װ�V��'�z��㑀R�M'�
��y���xY�`v�Q(��b��p��x�@+
��Tp�	dv�0�(�4�h�8��<rG
k\�A��x���PiGt�]p��eH��-�D�7t��>
l9FI�
��bVer�M�&
.¦��Y	J�dB�vNaNU��g0|�J�VA�X��h�yL�Ra�&ԳV:�a��@��N�(�@�
$(V꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k��[i!�		9,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ�Ԅ��$N|Df�$J|d~��������J|������\~�<^�|�����4Z����l�������̌�����F|������\z�������t�����,V����l��Tr���̄��Dj��<b������������pH,�Ȥ2��h�eI�Z�جvh�`I�-���%�0��n�*M�۩����h7w��u)}|n�'X
(22��v
p��.�T+	`&0/��f'�~�n
T/~|*��nJ,���K���8��
�o5H0}��&2K��m��u"1�}6�E$��{�I%��$�u���G8؊�h��@�}l�K�!�;��`�`?%42tCp�}��p�@�����C/��e2��Z�L[b#Q��e�`f	�Q��DN`ș@@9��Zf%���XA
H�<0�pX�[\�f*�-^^�a�(s�fQ�nm�S��K�S/��uz�E�m2��'�6,��X��A��eBh$
F'g
����h3:����0h���s�'�
@c��چQ�9��K<$>
�k�؇�x,�W��)��D�s�a
c����|���An�_C@x����6����5��&AY��
h��D�	)Mh_E��P���ɐ1D�dt����݉�1�4�h�8��<jX�!�C��H�l�3�gd%�@
Y=)H�ds������e�0�e��_c��ŀk��fu�wH�oVe�O��X�2QG{�1C�']h�C���j
�{0��5�%�yMZF�
������@ܹ��|���ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k�覫n�A!�		;,���Ft���Tv����4^�����t�����,R����Ln�d��������$N|���Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b���������������pH,�Ȥrh�@'�賬Z�جv;dAN�p�t�q��z����0h����U���Rx��v8}|�a���,*U&�p�7��vba78I~c{~0Z6*&*t���}fG���:X�T����Q$����.W��c��u��G�'��`
V-����k)p�qF�o�	V�n��h+���YT�z�.XY0�h������(�xѠ����Np�ȅ/g
ɱ�
rU4L�5��
-�H�!�.����r�B�Yj�F��n�`
�Lw�E���Ƣ'jhғl߉~\��DyH��_N��Z�+��IT��'r��b�yw%����T�on�E�BF\��D
p脌��j<���@Zߐ�0��"���C��#f�đ++/YaĈ��mӧ9���KOb���8[�k72#������3U��{j����+��	
8��ۏQ~:ٹ�dҟv8�6�>U
���9�G
��Q8n�Z�¹pP2�t��x0p�
1�؇(���,���G���20r��z�@@P�!�|��	䁑׈@�s�1�H6י����8
�;'x�� �l��H_
�u�DY��F�	'�Yss�����Ԁ-K�G^E��'
���	zG����x<@�!��
5����v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��2!�		:,���Ft������Tv�4^�������t�����,R����Ln�������d�����$N|Df����$J|�􌢼���J|������d~�<^�|�����4Z�����������l�����F|������\z�������t�����,V����Tr����l��Dj�����<b�������������@�pH,�ȤYˤf�EC��Z�جv;T%`@L
q��z)���YeM�۫��X��F+'7V5.}{zc%��v�cU1�n||��i/p�$�I$n����Y+�pbJc��zT��K��oI3��}��G��I��&&+X
3),-�j�}z�G��6W5��c3�g����;��Z�n�@�ò~Zdcg���0�!�Jɍa�J��
P�B��4�t:�kFI,P1|SC	��K��؈i�FJTb�ݬR#�DO��
�›�#���
�R+��t�G��Tp�P�P+�Q>aL��v��GH�=��0^kiH/�t����"I�{��u�;]1��X��Q%4dh�NZo�Țv����1����@pC�A7����5
ciO.�#������{��3��`���w��D@�~)t>�}"@�<5�!�}�g�s��7�<a�W�t`��-�_�edB.���$�`��)p�$4`�(���,��(��f�(]|��$�X�yKe>BB�)�'I����1)M��gBbR��aP�@@����K{��
����9��$��n�q�<)EW'%9��J�{
r�CT���P�~	!J�Օ�����`*�QZ�1tpH4��*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��k�
覫��H!�		:,���Ft���Tv����4^�����t�����,R����Ln�d����Ԅ��$N|���Df����$J|d~�����J|���\~����<^�|�����4Z����Tr�l�����������F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr9�"�R�I�Z�ج����A�-��h��5���&M�c=��(P�*
om�&v��E!�p6U#3���#��u+�n�T���_��f%^p�L������W5��o&Kl�����L��`,K��n��H��&&K��o��Dl���o
J(��`3��.��dI�`���l�#gIۚ�0�5�j���$AJ��נ�L�+�
(i�e�v�|u��a��
�(X��E���$�@�J#4����
'D08��L1,ȇ����%��ȯM�9�$h�\$H��H�p(�hXn@B{oH
�*]�$*Z
(�Q�_�0p�"�D�����L��ja�Y	��ހJEXa:����W
s*��
�;	��E�"<p���Eh&U7S��"/³�R/S)P���t$8{�KV�Fǿ90���T�C��#7X�7�D5MC�}H�@@?L��
�Q�H*�B |֨A�D[� �(�$�P@
�H�P����bl#�V
T5cf#|:��Z�yr���J�o���<�]�
O��m�(X%.d�ȇ[�y�8�`�xԆ�g�‰xo��f.
|ä�͙�E����ɀ�UQo������4��3��^�Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+�䖻i!�		9,���Ft���Tv����4^�������t�����,R�Ln�������d�����$N|���Df�$J|d~�����쌢����J|���\~����<^�|�����4Z�Tr����������F|���\z���������t�����,V�Lr����l�����Dj�����<b���������������pH,�Ȥr�l:�Шtʤ!4�nj��z��Ȫ�p�Z��T���)�v�K����
(r��C7~jvjP1��~��_&k�%v�M4��%0��S/���56M���w�������%M
�����J®���K*���.��EЭ�w5L/�k�%2��9��vL��j��3�ы�L-ٶx���5��Q�Q,�}y#B
J.��u�I�����K	��!@�c�D�
	bG)"�`7Ap�d��@^NI�ώ�#2��`��r��"4J�}��1�������`���U��H@�$�(�)��Җ�qj��L�݉�0��%2a�	
�]��J�?�7N��E44_z�8p	\��p`{����)�H}D���~p�2���`�F�F
��
5J�I	\�
e�"�D�@�5.D4'��%����Y`{���9��
7R�5/C����+�>�k�����M��
Ƞ�u�D�ݱH�T	��`�X��	M�I4��
6��m�i@��!�v).�9�Q!h�c52���%�	�E�@[��1[��V�7AA�!�dG
V^)P^\v�bSFS���� X-%�&*6�d/���
i'���v�bYi��g��5(h*�@b
$y�1|=*餔Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+�O!�		9,���Ft������Tv����<^����t��,R�������d��������Dj����$N|���$J|d~��􌢼Tr����J|������\~�|��4Z����l�����������Lr����F|������\z����<b����t��,V�������l�����Ln������������������pH,�Ȥr�l:�ШԨ:���b��z��@�ȳ�׆z��p(aF6����FZ�-nq��B6u�w&.4P#x���o2���O��x��S6�xg��K���[��M��g�L)��f��J#���L4��d{��D���&-L�����8�Ɍ�K'�e�7�o*((5L*��d�J�����\jX@0i�%Tus�D�u
�R�
�3B$I��9�0�
�	�@(�*�F$2��Z��Gl4S:�!)��sH
D�f��m�0OgM���0U�‚F �A���N��
�O��&��B0aj�6y��!�in,X��C>�L��7�a%�L"�p�1�;
�uL���M�Rn��^�a�Cs�9+nh�!�4c����6,\n�@���*d�H�����˱p�(�|`�@�o�]B�,�g�.%.lrq�t/*��,6��x�]���V�
%��k^���lc'�ҏ6�=�B7
��Q)d{.�@|J��D=��N�I��pT�4�TTg��(f�]L@@"u�xrb8�3�dI8dҊ3&QAG#^��*@�d&��#c؈CN��*&4��	
��DN(� 0^y7u`"7`��
��i�$��cM_���G��Pu,�����I�wz��'h𜡐F*餔Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���v���+��^!�		:,���Ft���Tv����4^����t��������,R�d�����Ln������Ĵ��$N|Df����$J|d~��􌢼���J|���\~�<^�|�����4Z�l����섞������̼��F|���\z������t��������,V�l�����Tr����Dj�����<b�������������@�pH,��dҢ���rJ�Z�����&p�Ӛ��4�f���`�������Q�͏�
qo�n2���f,p_q}���J�&p�`)g,3
-��S7�����Y]�q��E�|�Y3�|���Y����Y"	3�T9���0X��`
�W#
̑RJھ�`3Y�`��Sp� Vh%���K
I�Ν8%@�{^P��P�,*�E�b^�;��G��d�H�DI�G,���J��l�0Ӣ�=8pa�)�W�8Q��DF������ĥ�ѧ]�|�yV.^�"J[�i�>�A8�G]""�-�Y
£h7�	��)�:ޤ��b"�r��@����i���Шu8��O��ԩ�������s����06�����(^���,��=���]DPxv�ԝ����"4�x˔_�i0��#k��W|��P4�A=~\2����Y-�W(W�5�w�`�X�rA���$��:\0C�`�p���P�}*�2�@|̠B���ė��q������0�Q)�~�A�J��Bc˘�]�w��$�ai�Lf�B��ih�'��FM��j�7R!0©E��ҥ�i�	i.(�g50@P3h��e�k��QC��uF�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰�*무�j뭸�뮼���+��k��&���6���F+��Vk��f���V!�		9,���Ft���Tv����4^�����t��,R����Ln����d�����$N|���Df�������$J|d~���J|���\~����<^�|��4Z����Tr����l�����������F|���\z���������t��,V����Lr����l��������Dj�����<b������������pH,�Ȥrh�:�Y��Z�جv;T=J�p�t�q��zi���p'����Յ��Nx��v7}|�a���Y$�p�6���G~c{~-������8��I"*&#*
Yb�pq/��C7�#"W��}�	��)�%o3tUƣcv)��V'�}.�K
,�|~#j/o.7�H��%�U*��,�g"0���@C��
�l`�
[�l�Ҡ�8
2��!M��`���ig�q�`����g%EoP�������ԫ�Aވ����h(�,��x����,�G�-D(�E�	ACe3.b
�
G=g��1�d-NU�9��a#�s
1���F��B��W�KLI��"���rJt��Q�K��	$9������^(8�Є�Y�v����(��
!l�`B��{�0S�z��o�t�^���Zι�m@RfS��	w��lpz�z�^��U����7H��@���Pp�x�AW��I_n�YPנA~�Bxʃ��8�X�V`�	��(���,���0�(�4�h�8��<���@)�D�CC�0�8|X�"8P-��$��q]�D򕂙�I��Y=,8I��ІU�k�Rc��xE�w1ASS�A@�C4�ZB���M��}jF�*zNYm���B�PN�n$ʩ	tUMjrzi��AH�&1���j뭸�뮼���+��k��&���6���F+��Vk��f���v���+n�A!�		:,���Ft������Tv�4^�������t�����,R����d��Ln���Ĵ�Ԅ��$N|Df����$J|d~����Ԍ��J|������\~�<^����4Z����l�������̄�����F|������\z�������|�����,V����l��Tr����Dj�����<b�������������@�pH,�ȤYӤfD��Z�جv;T%`@q��zI���eM�۫��X��u.|z�&%���Y2p�||��\!3.'sX0{�}b
��Un�2X��{T��F+�{,W��}p`��B7�¢c�Ụz+�Ə��`�K��6�ƚ��*U+��o��̢!V��7�(���\���D�Rm���@+7X�caBT5�̓S���0q��(Yd���r-ؼ�f*����	3%oH@���L��0��ia|��Q��OW�g���:hd����lt��������F	3f`��_6�
Ōh&��EAAHyP]�UZ���a�!�P�����Q�S!������%�5
*7�4v�Pò�`�YI}}'A]��g:9�s�I�lc2��_m�Տ����;ނa�
���U�^g!��L�+iq��,2�4����E9#�	/��	ǵ�
K2��N9L
,���!f��h�(���,���0�(�4�h�8��<���@)�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�9eoY�p�,&d0%R��Sn��U�@Ys�E	Bꡄ������Q�s�29��kz�eM��i֓�5���1ق`ٸ�d����eMF
)>�B!6A���І�	R��I�p��9��6pP@Nf&���6���F+��Vk��f�-�A!�		<,���Ft���Tv����4^�������t�����,R����Ln�d�������Ĵ��$N|Df����$J|d~��􌢼���J|���\~����<^�|�����4Z����Tr�l����������̼��F|���\z���������t�����,V����Lr�l�����Dj�����<b�������������@�pH,�Ȥr�l:�Шt�$A�CIA�z�`%�@�˂Wx�n+s�y^���k˥B��^%f�r�(;x�T4	rt-S
���g0$��N�fg(R��sfv��H���89Q������D
t��(P-�����,��s8P6����ʺq���6O9��2׺*���O2����*�͠jO��f����q�R#��
�Vap���5("�3�F�M9p�k`��d��X`��a��4����:@0�낶9	"}���M]42�����+�ܸPC�DFM��!QUQ�6!pc��Z�ɱ��>ŊMq�^E�j-Tx�\�&���q7숆�P���7���z��Y�nô�v5��hd�6�2��Ȱ��.��,�	#@�2@(�O�Z7�qn��.�С�qZw�	{RL��[gR����_
0��C�.ӗ����&���P�t��.
���~���)ѯ�
���X�I�)�en2�+� � +��%
��&�5�)�\��
i^��8D��,�T�0�(�4�h�8��<���@)�Di�H&��L6��PF)�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�i'�7
B�0sR�҆`���X2�H��0��$�R��-y��*=���f4��<ʵ٨7)w��@j��G.�G1�s�ْ��W�>��>8&%����SޠC
f$��lp!�		9,���Ft������\z�<^�����t��,R�������l��Dj���Ą��$N|������$J|d����Tr����J|������d~�Df����4Z�������t��Lr������̌�����F|������\~�<b����|��,V�������l��Ln���̄����������������pH,�Ȥr�l:�ШtJ�Z��hv�$ٰx�4N4:�"�*��{~��x4"'bw+#t�O(xwz'h)Xvy�}��H/w��+7V1��i���B-���'Uj��,�����1T6���x-��,���+T����džѵ�T�ĝՆ6�z�'T���8�+е���x0�t%�h���i�.O�}nX@�MDޖ�نp�e�
԰"�U�4*ҁ��-	�h(�Qj"�$�ე�LҐ�E��4p�4r��;b؄b#
��h`��DC����XYsࠡb��!��j�&	1��r���m�1�yD���*
JD��pX���8��V�*2-07���WQ
��FM��W3��P.��`[-�n���=4

1:�%μ���УK�N����سk�ν���HL8�+�9�^�y10�SA��,)��s꾕�ѣMh�Aa�I�0C�S$�'0(�QU���Q@Вd�B�^�u��e��"��N̰X)!���zt���E22�MD��G'��c5��
)
	���()�TVi�Xf��\v��`�)�d�i�h���l���p�)�t�i�x��|��矀*蠄j衈&�袌6�(�A!�		;,���Ft���Tv����4^�����t��,R����Ln����d��������$N|Df�������$J|d~��􌢼J|���\~����<^�|��4Z����Tr����l����������̼��F|���\z���������t��,V����Lr����l�����Dj�����<b���������������pH,�Ȥr�l:�ШԸB�h
�b��z�N�@�Ȋx�n;
��l6C6����'.5{��Q3ugt���G8���u/����et�y	*��%���fl87�"j�����-k4�d,��:���'`
Ľ�&�{+���[_����yŭ.`����n	�`��r��E+2����(%��
F��m�	i�������5
�=T!�Bjg(tkb#��E'D�a#�����j6�A��1V�頍���jUG��!*�R�Ab�_�>�Ca
��
w&��82{e��'�����������#�l
�غao1�g�Ԙс
�q�-�ip��H:H�C̠�Ԁ�4�Ш���*E��;t��)��6:�4sB��۰Ĉa���ȓ+_μ���УK�N����سk�ν����ËO�����ӫ_Ͼ�����˟O��������Ͽ���(��
3�c��_��o��
eg����\~1l#��w�Z;YV�m��]�}3f�p_��s�}6��cS��0����}���	����P��}*���4���
������ـ0�@a+��l���p�)�t�i�x��|��矀*蠄j衈�!�		:,���Ft���Tv����4^�����t�����,R����d��Dj�������$N|������$J|d~�Df��􌢼���J|���\~����<^�|�����4Z����l��Lr����������F|���\z���������t�����,V����l��Ln��������<b�������������@�pH,�ȤR؈l�ǵ�Z�جv;T���*p��z9���D[��+��m$y��v7pr�a(���Yqc�����G8�}�0���1r~�o9�����}���x��~`��k9���	��9-T[7��~8á
c�![��`5Ә*	�q	�Zݓ'�+/�/+[,�/*��<h�e��ph��Qv�Nd�а"��:�G"
z�裑��
p`��7ʹ`�ȺRa6����7ji�q����$H�&(�(�!
J�Ɵ'�Q@_@S3�pu�D��!e�C�'.o�����	U2�;T���u�*�c����ѡ�[0�e�[Ld�L�'�R�����p�
lh�kߎ8�O��
±�w�[ٳ�aC��sN����ȓ+_μ���УK�N����سk�ν����ËO�����ӫ_Ͼ�����˟O��������Ͽ���(�h�&��6��F(�Vh�"��w@�(
_)\����cb���
�\��uV�$�wHL�
�
��A�
�T�j���>)�dz��	D���U�^T-uX�5�Nd�՞^y�b|0��Qfq͗���`C"f�`!�		6,���Ft������Tv�4^�������t�����,R�Ln������Ԅ��$N|���Df����$J|l������J|���<^�|�����4Z�Tr�����������F|������\z�������t�����,V�Lr���섞����Dj����l���<b����������@�pH,�Ȥri��V�I�Z�ج�SD^��-��h���
{���|N�"��<S��n`mx0��W&n��`q���Fx�z3���3���4��6&#
&i���'��4	o^
g/z�����'�y/�e(��_/Œ%��+�Z$��`|ӈϏ"
f(�o�*���*�Y*��_"��i`��
����B�̙�1X� �1�3B�
L�(���FDc�2�K%>r���#�d	KP����A�It���J]JCC�/1�--Z㠛&�j¢ƈ$��K��ٳhӪ]˶��9H
��m�]�P�g��:���t4(���8sa�D9�Y�����\�#�}�
p��@r�o���th�9�}�ul<�A��†�����|g�$~����1�S!�-�OOc�
1\H�N�����ӫ_Ͼ�����˟O��������Ͽ���(�h�&��6��F(�Vh�f��v��
�(�$�h�(���,���0j!�		6,���Ft������Tv����<^����t��,R����d����Ԥ��Dj�$N|������$J|d~�����J|������\~�Df���Ԅ��4Z����l�������ܬ��Tr�F|������\z����<b����|��,V����l����ܤ��Ln��������������@�pH,�Ȥr�l:�ШtJ�Z�ج1�p�EK.���`Mb?`��@�x6�4�
zw���D!^,acd%�mk�)5�j�_pZyx�w*�}(��$+Y�����r5��yw�V!�z��q0���W������f^��x�V3�ǔ��d�τX)��w$�d&�Dž1X֫�,��Y��w�,8��:v�����LO9,-���!!���1�eF�{�,b1��}Z^d8G"��Аq���8��UI�o9�&A1�	B�*���f(�J��իX�j�ʵ�ׯ`ÊK��ٳhӪ]˶�۷p�ʝK��ݻx���˷�߿�L���È+^̸���pC����(G�`�R�<�����(�#d!���fPB�c-7���Y���n���BÂy���7!>�QĎ:�q�R,�`A#u��5����0P�N4
˟O��������Ͽ���(�h�&��6��F(�Vh�f��!�		8,���Ft������Tv�4^�������t�����,R����Dj���Ĵ�Ԅ��$N|d�����$J|Df�����J|������d~�<^�|�����4Z����Lr������̄�����F|������\z�������t�����,V����Ln����l������<b�������������@�pH,�Ȥr�l:�ШtJ�Z�X\�"Pe����HJ�V��`�M?�~�@�iuh4y|��D!�v�g���0v�����o/���h1�!)$
�b���{*fv3�X���z,��4�V!�u�g�oʕ%-^�T˻i(o3�����S��h0o�h,�R.��o4��g�R�Y*��
O��-�'eD�J����
M�R
��Cǃ=3�U��q�
1b���gc#�g"��y��6e�
��9d^�=K-����,��
L�N�J�l�ԫ'S��z��ׯ`ÊK��ٳhӪ]˶�۷p�ʝK��ݻx���˷�߿�L���È+^̸��ǐ#K�L���˘3k�̹��ϠC�M���ӨS�^ͺ��װc˞M���۸s�kƃ2]6�)����XfG�d	�p
 y�#�H!�yɹcs��m�!�3�8�@R��ajs�؄Q�h�͊�1�������O�#�
�sr��`g�W�e�,�ۇ
�(�kA!�		3,���Ft������\z����4^����t�����,R���������Ln����l��$N|Df������$J|���d��������4Z��������������J|������\~����<b����|�����,V�������Tr����t��Dj������������pH,��$�#(��ШtJ�Z�)H�
]XװxL���ht�Sn���Wz�E��<�Η�a1|t0���J�|O����t+����s"��y"�i��o2�h��d[�1��a.����T&����R�
��Prt(��J+�+�������T
"+���+*s	��'0��
�����X�Je"�)
��<2��_B�1�IH*�	��x	U�#9X'�@�K�Dm<	)F�MX^r@��>��Ա[���q",,�I��ѣH�*]ʴ�ӧP�J�J��իX�j�ʵ�ׯ`ÊK��ٳhӪ]˶�۷p�ʝK��ݻx���˷�߿�L���È+^̸��ǐ#K�L���˘3k�̹��ϛ�!�		,,���Ft������Tv�����t��4^����d��Lr������܄��,R���Df����\~���������l����쌢�4Z�������\z������t��<b����l��Tr���܄��,V��Dj��������@�pH,�Ȥ��
,�Ш��Z�جv;�h�0`@����2#n4+�|N�~����+'xn~��Yw�m!���G
�nq����mT��~��a��u�a���h����g�����Z�{��W&����J�m)���GP'����������������������������������������
H�����!����	��E�[�@X�h��ETp�4$	�0fTQ1�	^K�#
$ʙ"L�����p�S9A6�	��Jd�N�"�R!2Mx*�E*P��@�A��
a�C�hӪ]˶�۷p�ʝK��ݻx���˷�߿�L���È+^̸��ǐ#K�L���˘3k�̹��CA!�		4,���Ft���Tv����4^������t��,R������܄��Ln��$N|���d��������$J|���J|������Dj�����|��4Z���섞�Tr����l��F|���d~����<b����t��,V�������Lr����l������������������@�pH,�Ȥr�l:�ШtJ�Z��l2�y�J3�xLVj0�������u�Q�w�
�uxk�"
��By�yi��}x�v""
��c���"��X'���k2��T���!��P���v��L���k���H,Ǣw1��E+�����B���&���!�����)�"���+#2#���
H����*\Ȱ�Ç#J�H��ŋ3j�ȱ�Ǐ
C�I��ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ��ϟ@�
J��ѣH�*]ʴ�ӧP�J�J��իMX0BA��'L�Z��.�(!���U̾L`��0]��g������REں�H�,���#.�5>���w���y��3_.��Q�ܹ�/[�ŔB�{טPA��c#\�,``��X�N����ȓ+_�\H!�		#,���Ft������Tv����4^�t���������$N|���$J|������Ln�J|���l�����Df�|�����F|������d~����<b�t�������������������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���x5����ՈDq
x�M}}���G��~�!��#���������������}�w
~���
�r�����q�����o�����n
|��� �o�ʼn�o	Ĝ	�o��
�p���qv�
H����*\Ȱ�Ç#J�H��ŋ3j�ȱ�Ǐ
C�I��ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ�3ϟ@�
J��ѣH�*]ʴ�ӧP�J�J��իX�j�ʵ�ׯ`ÊK��ٳh9!�		#,���Ft������Lr����4Z����l�����,R����$J|���d��������J|��̼��Dj�t�����F|������Tv����<^�t����ܬ�����l�����������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~����������������������������������Z	���T���
�S!�����N���
�O�����K����K�Ѭ��J������H���H����H
��	D�;"
��\�	`���I$����$��@�"�$
�汤ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ�2ϟ@�
J��ѣH�*]ʴ�ӧP�J�J��իX�j�ʵ�ׯ`ÊK��ٳ�!�		!,���Ft������Tv����<b����t�����,V�����$N|��Ԅ��$J|���d���Tr�������F|���������Dj����|��������l��������pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���~�������������������������������������������������������������������������������������D

�	�������������������q��ۂW���+���w��v�q��
�D��,�U@aD`]�X�ހX&�<�R���I<8K�)o�4�����M[ʴ�ӧP�J�J��իX�j�ʵ�ׯÂ;<html><body
bgcolor="#FFFFFF"></body></html><html><body
bgcolor="#FFFFFF"></body></html>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		admin.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

/* JS Document */

/***[JCBGUI.joomla_component.javascript.28.$$$$]***/
jQuery(document).ready(function($) {
  $(window).on('load', function() {
    var token = Joomla.optionsStorage['csrf.token'];
    var url = $('#jform_serverurl').val();
    var secret = $('#jform_serversecret').val();
    $.ajax({
      url: '/administrator/index.php?option=com_reservation',
      method: 'post',
      dataType: 'json',
      data: {[token] : '1', task:'ajax.isRegistered',
format: 'json' , raw: 'true' , url: url, secret:
secret},
      success: function (msg) {
        if(msg.status) {
         
$('#wlists').parent().addClass('alert-success')
          $('#wlists').text('connected!');
        }
        else {
         
$('#wlists').parent().addClass('alert-error')
          $('#wlists').text('not connected!');
        }
      },
      error: function(err) {
      }
    });
  });
  var url = $('#jform_serverurl').val();
  var secret = $('#jform_serversecret').val();
  jsprovider = jQuery('#jform_adminjsprovider');
  jsprovider.parent().parent().remove();
  saltcode = $('#jform_serversecret');
  p = saltcode.parent();
  disable = url && secret ? '' :
'disabled="disabled"';
  p.append(`<button class="btn btn-small"
type="button" id="connectwebhook"
${disable}><span>Create WebHook</span></button>`);
  jQuery(document).on('keyup', '#jform_serversecret',
function(e) {
    if(this.value && $('#jform_serverurl').val())
     
jQuery('#connectwebhook').removeAttr('disabled');
  });
  jQuery(document).on('keyup', '#jform_serverurl',
function(e) {
    if(this.value && $('#jform_serversecret').val())
     
jQuery('#connectwebhook').removeAttr('disabled');
  });
  $('#connectwebhook').click(function(e) {
    url = $('#jform_serverurl').val();
    secret = $('#jform_serversecret').val();
    token = Joomla.optionsStorage['csrf.token'];
    
    $.ajax({
      url: '/administrator/index.php?option=com_reservation',
      method: 'post',
      dataType: 'json',
      data: {[token] : '1', task:'ajax.setWebHook',
format: 'json' , raw: 'true' , url: url, secret:
secret},
      success: function (msg) {
        if(msg.status) {
          Joomla.JText.load({success: "Success"});
          Joomla.renderMessages({'success':
['Created']});
          $('#wlists').text('connected!');
         
$('#wlists').parent().removeClass('alert-error')
         
$('#wlists').parent().addClass('alert-success')
        }
        else {
          Joomla.JText.load({error: "Error"});
          Joomla.renderMessages({'error': ['Not
created']});
         
$('#wlists').parent().removeClass('alert-success')
         
$('#wlists').parent().addClass('alert-error')
          $('#wlists').text('not connected!');
        }
      },
      error: function(err) {
        Joomla.JText.load({error: "Error"});
        Joomla.renderMessages({'error': ['Not
created']});
       
$('#wlists').parent().removeClass('alert-success')
        $('#wlists').parent().addClass('alert-error')
        $('#wlists').text('not connected!');
      }
    });
    event.preventDefault();
  });
})/***[/JCBGUI$$$$]***/
<html><body
bgcolor="#FFFFFF"></body></html><?xml
version="1.0" encoding="utf-8"?>
<config>
	<fieldset
		addrulepath="/administrator/components/com_reservation/models/rules"
		addfieldpath="/administrator/components/com_reservation/models/fields"
		name="global_config"
		label="COM_RESERVATION_CONFIG_GLOBAL_LABEL"
		description="COM_RESERVATION_CONFIG_GLOBAL_DESC">
		<field
			name="check_in"
			type="list"
			default="0"
			label="COM_RESERVATION_CONFIG_CHECK_TIMER_LABEL"
			description="COM_RESERVATION_CONFIG_CHECK_TIMER_DESC">
			<option
				value="-5
hours">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_ONE</option>
			<option
				value="-12
hours">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_TWO</option>
			<option
				value="-1
day">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_THREE</option>
			<option
				value="-2
day">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_FOUR</option>
			<option
				value="-1
week">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_FIVE</option>
			<option
				value="0">COM_RESERVATION_CONFIG_CHECK_TIMER_OPTION_SIX</option>
		</field>
		<field type="spacer" name="spacerAuthor"
hr="true" />
		<field
			name="save_history"
			type="radio"
			class="btn-group btn-group-yesno"
			default="1"
			label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
			description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>
		<field
			name="history_limit"
			type="text"
			filter="integer"
			label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
			description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
			default="10"
		/>
		<field type="spacer" name="spacerHistory"
hr="true" />
		<field name="autorTitle"
			type="spacer"
			label="COM_RESERVATION_CONFIG_AUTHOR"
		/>
		<field name="autorName"
			type="text"
			label="COM_RESERVATION_CONFIG_AUTHOR_NAME_LABEL"
			description="COM_RESERVATION_CONFIG_AUTHOR_NAME_DESC"
			size="60"
			default="farhad shahbazi"
			readonly="true"
			class="readonly"
		/>
		<field name="autorEmail"
			type="email"
			label="COM_RESERVATION_CONFIG_AUTHOR_EMAIL_LABEL"
			description="COM_RESERVATION_CONFIG_AUTHOR_EMAIL_DESC"
			size="60"
			default="farhad.shahbazi0010@gmail.com"
			readonly="true"
			class="readonly"
		/>
	</fieldset>
	<fieldset
		name="usergroup_custom_config"
		label="COM_RESERVATION_CONFIG_USERGROUP">

		<!--  Consultantgroup Field. Type: Usergroup. (joomla) -->
	<field type="usergroup"
               name="consultantgroup"
              
label="COM_RESERVATION_CONFIG_CONSULTANTGROUP_LABEL"
              
description="COM_RESERVATION_CONFIG_CONSULTANTGROUP_DESCRIPTION"
               multiple="true" />
		<!--  Doctorgroup Field. Type: Usergroup. (joomla) -->
	<field type="usergroup"
               name="doctorgroup"
               label="COM_RESERVATION_CONFIG_DOCTORGROUP_LABEL"
              
description="COM_RESERVATION_CONFIG_DOCTORGROUP_DESCRIPTION"
               multiple="true" />
		<!--  Sickgroup Field. Type: Usergroup. (joomla) -->
	<field type="usergroup"
               name="sickgroup"
               label="COM_RESERVATION_CONFIG_SICKGROUP_LABEL"
              
description="COM_RESERVATION_CONFIG_SICKGROUP_DESCRIPTION"
               multiple="true" />
	</fieldset>
	<fieldset
		name="check_out_custom_config"
		label="COM_RESERVATION_CONFIG_CHECK_OUT">

		<!--  Checkout Field. Type: Subform. (joomla) -->
	<field type="subform"
               name="checkout"
               label="COM_RESERVATION_CONFIG_CHECKOUT_LABEL"
              
layout="joomla.form.field.subform.repeatable-table"
               multiple="true"
               buttons="add,remove,move"
               default=""
               icon="list"
               max="50"
               >
                <form hidden="true"
                      name="list_checkout_modal"
                      repeat="true">
                        <!-- Reservetemplate Field. Type: Filelist.
(joomla)-->
                        <field type="filelist"
                               name="reservetemplate"
                              
label="COM_RESERVATION_CONFIG_RESERVETEMPLATE_LABEL"
                              
directory="/components/com_reservation/views/reserve_appointment/tmpl"
                               default=""
                               filter="\.php$"
                               stripext="\.php$"
                               hide_none="true"
                               hide_default="true" />
                        <!-- Checkout_navber Field. Type: Text.
(joomla)-->
                        <field type="text"
                               name="checkout_navber"
                              
label="COM_RESERVATION_CONFIG_CHECKOUT_NAVBER_LABEL"
                               size="10"
                               maxlength="100"
                               default=""
                              
description="COM_RESERVATION_CONFIG_CHECKOUT_NAVBER_DESCRIPTION"
                               class="text_area"
                               readonly="false"
                               disabled="false"
                               required="true"
                               filter="STRING"
                              
message="COM_RESERVATION_CONFIG_CHECKOUT_NAVBER_MESSAGE" />
                </form>
        </field>
	</fieldset>
	<fieldset
		name="appointment_custom_config"
		label="COM_RESERVATION_CONFIG_APPOINTMENT">

		<!--  Full_price Field. Type: Text. (joomla) -->
	<field type="text"
               name="full_price"
               label="COM_RESERVATION_CONFIG_FULL_PRICE_LABEL"
               size="10"
               maxlength="100"
               default=""
              
description="COM_RESERVATION_CONFIG_FULL_PRICE_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="true"
               filter="UINT"
               validate="number"
              
message="COM_RESERVATION_CONFIG_FULL_PRICE_MESSAGE"
               autocomplete="on" />
		<!--  Doctor_quota Field. Type: Text. (joomla) -->
	<field type="text"
               name="doctor_quota"
               label="COM_RESERVATION_CONFIG_DOCTOR_QUOTA_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="COM_RESERVATION_CONFIG_DOCTOR_QUOTA_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="true"
               filter="UINT"
               validate="number"
              
message="COM_RESERVATION_CONFIG_DOCTOR_QUOTA_MESSAGE"
               autocomplete="on" />
		<!--  System_quota Field. Type: Text. (joomla) -->
	<field type="text"
               name="system_quota"
               label="COM_RESERVATION_CONFIG_SYSTEM_QUOTA_LABEL"
               size="10"
               maxlength="50"
               default=""
              
description="COM_RESERVATION_CONFIG_SYSTEM_QUOTA_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="true"
               filter="UINT"
               validate="number"
              
message="COM_RESERVATION_CONFIG_SYSTEM_QUOTA_MESSAGE"
               autocomplete="on" />
	</fieldset>
	<fieldset
		name="chat_custom_config"
		label="COM_RESERVATION_CONFIG_CHAT">

		<!--  Imgext Field. Type: Text. (joomla) -->
	<field type="text"
               name="imgext"
               label="COM_RESERVATION_CONFIG_IMGEXT_LABEL"
               size="250"
               maxlength="250"
              
default="jpg,jpeg,png,gif,bmp,jfif,pjpeg,webp,tif,tiff"
              
description="COM_RESERVATION_CONFIG_IMGEXT_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
               message="COM_RESERVATION_CONFIG_IMGEXT_MESSAGE"
               hint="COM_RESERVATION_CONFIG_IMGEXT_HINT"
               autocomplete="off" />
	</fieldset>
	<fieldset
		name="bigbluebutton_custom_config"
		label="COM_RESERVATION_CONFIG_BIGBLUEBUTTON">

		<!--  Adminjsprovider Field. Type: Adminjsprovider. (custom) -->
	<field type="adminjsprovider"
               name="adminjsprovider"
              
label="COM_RESERVATION_CONFIG_ADMINJSPROVIDER_LABEL"
              
description="COM_RESERVATION_CONFIG_ADMINJSPROVIDER_DESCRIPTION"
/>
		<!--  Serverurl Field. Type: Text. (joomla) -->
	<field type="text"
               name="serverurl"
               label="COM_RESERVATION_CONFIG_SERVERURL_LABEL"
               size="255"
               maxlength="255"
               default=""
              
description="COM_RESERVATION_CONFIG_SERVERURL_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
               message="COM_RESERVATION_CONFIG_SERVERURL_MESSAGE"
               hint="COM_RESERVATION_CONFIG_SERVERURL_HINT"
               autocomplete="on" />
		<!--  Serversecret Field. Type: Text. (joomla) -->
	<field type="text"
               name="serversecret"
               label="COM_RESERVATION_CONFIG_SERVERSECRET_LABEL"
               size="255"
               maxlength="255"
               default=""
              
description="COM_RESERVATION_CONFIG_SERVERSECRET_DESCRIPTION"
               class="text_area"
               readonly="false"
               disabled="false"
               required="false"
               filter="STRING"
              
message="COM_RESERVATION_CONFIG_SERVERSECRET_MESSAGE"
               autocomplete="on" />
		<!--  Webhooks Field. Type: Note. A None Database Field. (joomla)
-->
	<field type="note"
               name="webhooks"
               label="COM_RESERVATION_CONFIG_WEBHOOKS_LABEL"
              
description="COM_RESERVATION_CONFIG_WEBHOOKS_DESCRIPTION"
               heading="h4"
               class="alert webhooks"
               close="false" />
	</fieldset>
	<fieldset
		name="permissions"
		label="JCONFIG_PERMISSIONS_LABEL"
		description="JCONFIG_PERMISSIONS_DESC">
		<field
			name="rules"
			type="rules"
			label="JCONFIG_PERMISSIONS_LABEL"
			class="inputbox"
			validate="rules"
			filter="rules"
			component="com_reservation"
			section="component"
		/>
	</fieldset>
</config><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		controller.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * General Controller of Reservation component
 */
class ReservationController extends JControllerLegacy
{
	/**
	 * Constructor.
	 *
	 * @param   array  $config  An optional associative array of configuration
settings.
	 * Recognized key values include 'name',
'default_task', 'model_path', and
	 * 'view_path' (this list is not meant to be comprehensive).
	 *
	 * @since   3.0
	 */
	public function __construct($config = array())
	{
		// set the default view
		$config['default_view'] = 'reservation';

		parent::__construct($config);
	}

	/**
	 * display task
	 *
	 * @return void
	 */
	function display($cachable = false, $urlparams = false)
	{
		// set default view if not set
		$view   = $this->input->getCmd('view',
'reservation');
		$data	= $this->getViewRelation($view);
		$layout	= $this->input->get('layout', null,
'WORD');
		$id    	= $this->input->getInt('id');

		// Check for edit form.
		if(ReservationHelper::checkArray($data))
		{
			if ($data['edit'] && $layout == 'edit'
&&
!$this->checkEditId('com_reservation.edit.'.$data['view'],
$id))
			{
				// Somehow the person just went to the form - we don't allow that.
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID',
$id));
				$this->setMessage($this->getError(), 'error');
				// check if item was opend from other then its own list view
				$ref 	= $this->input->getCmd('ref', 0);
				$refid 	= $this->input->getInt('refid', 0);
				// set redirect
				if ($refid > 0 && ReservationHelper::checkString($ref))
				{
					// redirect to item of ref
					$this->setRedirect(JRoute::_('index.php?option=com_reservation&view='.(string)$ref.'&layout=edit&id='.(int)$refid,
false));
				}
				elseif (ReservationHelper::checkString($ref))
				{

					// redirect to ref
					$this->setRedirect(JRoute::_('index.php?option=com_reservation&view='.(string)$ref,
false));
				}
				else
				{
					// normal redirect back to the list view
					$this->setRedirect(JRoute::_('index.php?option=com_reservation&view='.$data['views'],
false));
				}

				return false;
			}
		}

		return parent::display($cachable, $urlparams);
	}

	protected function getViewRelation($view)
	{
		// check the we have a value
		if (ReservationHelper::checkString($view))
		{
			// the view relationships
			$views = array(
				'reserve' => 'reserves',
				'bbbclass' => 'bbbclasses',
				'doctor' => 'doctors',
				'appointment' => 'appointments',
				'capital' => 'capitals',
				'comment' => 'comments',
				'session' => 'sessions',
				'sick' => 'sicks',
				'plan' => 'plans',
				'consultant' => 'consultants',
				'message' => 'messages'
					);
			// check if this is a list view
			if (in_array($view, $views))
			{
				// this is a list view
				return array('edit' => false, 'view' =>
array_search($view,$views), 'views' => $view);
			}
			// check if it is an edit view
			elseif (array_key_exists($view, $views))
			{
				// this is a edit view
				return array('edit' => true, 'view' => $view,
'views' => $views[$view]);
			}
		}
		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		ajax.json.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Ajax Controller
 */
class ReservationControllerAjax extends JControllerLegacy
{
	public function __construct($config)
	{
		parent::__construct($config);
		// make sure all json stuff are set
		JFactory::getDocument()->setMimeEncoding( 'application/json'
);
		JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"');
		JResponse::setHeader("Access-Control-Allow-Origin",
"*");
		// load the tasks 
		$this->registerTask('setWebHook', 'ajax');
		$this->registerTask('isRegistered', 'ajax');
		$this->registerTask('getCity', 'ajax');
	}

	public function ajax()
	{
		$user 		= JFactory::getUser();
		$jinput 	= JFactory::getApplication()->input;
		// Check Token!
		$token 		= JSession::getFormToken();
		$call_token	= $jinput->get('token', 0, 'ALNUM');
		if($jinput->get($token, 0, 'ALNUM') || $token ===
$call_token)
		{
			$task = $this->getTask();
			switch($task)
			{
				case 'setWebHook':
					try
					{
						$returnRaw = $jinput->get('raw', false,
'BOOLEAN');
						$urlValue = $jinput->get('url', NULL,
'STRING');
						$secretValue = $jinput->get('secret', NULL,
'STRING');
						if($urlValue && $user->id != 0 && $secretValue)
						{
							$result =
$this->getModel('ajax')->setWebHook($urlValue,
$secretValue);
						}
						else
						{
							$result = false;
						}
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback . "(".json_encode($result).");";
						}
						elseif($returnRaw)
						{
							echo json_encode($result);
						}
						else
						{
							echo "(".json_encode($result).");";
						}
					}
					catch(Exception $e)
					{
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback."(".json_encode($e).");";
						}
						else
						{
							echo "(".json_encode($e).");";
						}
					}
				break;
				case 'isRegistered':
					try
					{
						$returnRaw = $jinput->get('raw', false,
'BOOLEAN');
						$urlValue = $jinput->get('url', NULL,
'STRING');
						$secretValue = $jinput->get('secret', NULL,
'STRING');
						if($urlValue && $user->id != 0 && $secretValue)
						{
							$result =
$this->getModel('ajax')->isRegistered($urlValue,
$secretValue);
						}
						else
						{
							$result = false;
						}
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback . "(".json_encode($result).");";
						}
						elseif($returnRaw)
						{
							echo json_encode($result);
						}
						else
						{
							echo "(".json_encode($result).");";
						}
					}
					catch(Exception $e)
					{
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback."(".json_encode($e).");";
						}
						else
						{
							echo "(".json_encode($e).");";
						}
					}
				break;
				case 'getCity':
					try
					{
						$returnRaw = $jinput->get('raw', false,
'BOOLEAN');
						$capitalidValue = $jinput->get('capitalid', NULL,
'INT');
						$result =
$this->getModel('ajax')->getCity($capitalidValue);
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback . "(".json_encode($result).");";
						}
						elseif($returnRaw)
						{
							echo json_encode($result);
						}
						else
						{
							echo "(".json_encode($result).");";
						}
					}
					catch(Exception $e)
					{
						if($callback = $jinput->get('callback', null,
'CMD'))
						{
							echo $callback."(".json_encode($e).");";
						}
						else
						{
							echo "(".json_encode($e).");";
						}
					}
				break;
			}
		}
		else
		{
			if($callback = $jinput->get('callback', null,
'CMD'))
			{
				echo $callback."(".json_encode(false).");";
			}
			else
			{
				echo "(".json_encode(false).");";
			}
		}
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Appointment Controller
 */
class ReservationControllerAppointment extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Appointments'; // safeguard for setting
the return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('appointment.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.appointment.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.appointment.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Appointment', '',
array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=appointments'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointments.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Appointments Controller
 */
class ReservationControllerAppointments extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_APPOINTMENTS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Appointment', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('appointment.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Appointments');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Appointments_'.$date->format('jS_F_Y'),'Appointments
exported ('.$date->format('jS F,
Y').')','appointments');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=appointments',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('appointment.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Appointments');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('appointment_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT',
'appointments');
				$session->set('dataType_VDM_IMPORTINTO',
'appointment');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_APPOINTMENTS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=appointments',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclass.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Bbbclass Controller
 */
class ReservationControllerBbbclass extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Bbbclasses'; // safeguard for setting
the return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('bbbclass.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.bbbclass.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.bbbclass.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Bbbclass', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=bbbclasses'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclasses.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Bbbclasses Controller
 */
class ReservationControllerBbbclasses extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_BBBCLASSES';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Bbbclass', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('bbbclass.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Bbbclasses');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Bbbclasses_'.$date->format('jS_F_Y'),'Bbbclasses
exported ('.$date->format('jS F,
Y').')','bbbclasses');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=bbbclasses',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('bbbclass.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Bbbclasses');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('bbbclass_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT',
'bbbclasses');
				$session->set('dataType_VDM_IMPORTINTO',
'bbbclass');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_BBBCLASSES');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=bbbclasses',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Capital Controller
 */
class ReservationControllerCapital extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Capitals'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('capital.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.capital.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.capital.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Capital', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=capitals'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capitals.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Capitals Controller
 */
class ReservationControllerCapitals extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_CAPITALS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Capital', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('capital.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Capitals');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Capitals_'.$date->format('jS_F_Y'),'Capitals
exported ('.$date->format('jS F,
Y').')','capitals');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=capitals',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('capital.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Capitals');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('capital_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'capitals');
				$session->set('dataType_VDM_IMPORTINTO',
'capital');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_CAPITALS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=capitals',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Comment Controller
 */
class ReservationControllerComment extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Comments'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('comment.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.comment.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.comment.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Comment', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=comments'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comments.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Comments Controller
 */
class ReservationControllerComments extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_COMMENTS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Comment', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('comment.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Comments');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Comments_'.$date->format('jS_F_Y'),'Comments
exported ('.$date->format('jS F,
Y').')','comments');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=comments',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('comment.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Comments');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('comment_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'comments');
				$session->set('dataType_VDM_IMPORTINTO',
'comment');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_COMMENTS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=comments',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Consultant Controller
 */
class ReservationControllerConsultant extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Consultants'; // safeguard for setting
the return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('consultant.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		// Access check.
		$access = ($user->authorise('consultant.access',
'com_reservation.consultant.' . (int) $recordId) &&
$user->authorise('consultant.access',
'com_reservation'));
		if (!$access)
		{
			return false;
		}

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.consultant.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.consultant.' . $recordId))
				{
					// Fallback on edit.own. Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then do the test.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Consultant', '',
array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=consultants'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultants.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Consultants Controller
 */
class ReservationControllerConsultants extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_CONSULTANTS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Consultant', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('consultant.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Consultants');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Consultants_'.$date->format('jS_F_Y'),'Consultants
exported ('.$date->format('jS F,
Y').')','consultants');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=consultants',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('consultant.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Consultants');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('consultant_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT',
'consultants');
				$session->set('dataType_VDM_IMPORTINTO',
'consultant');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_CONSULTANTS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=consultants',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Doctor Controller
 */
class ReservationControllerDoctor extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Doctors'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('doctor.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		// Access check.
		$access = ($user->authorise('doctor.access',
'com_reservation.doctor.' . (int) $recordId) &&
$user->authorise('doctor.access',
'com_reservation'));
		if (!$access)
		{
			return false;
		}

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.doctor.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.doctor.' . $recordId))
				{
					// Fallback on edit.own. Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then do the test.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Doctor', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=doctors'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctors.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Doctors Controller
 */
class ReservationControllerDoctors extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_DOCTORS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Doctor', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('doctor.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Doctors');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Doctors_'.$date->format('jS_F_Y'),'Doctors
exported ('.$date->format('jS F,
Y').')','doctors');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=doctors',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('doctor.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Doctors');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('doctor_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'doctors');
				$session->set('dataType_VDM_IMPORTINTO',
'doctor');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_DOCTORS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=doctors',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		import.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Import Controller
 */
class ReservationControllerImport extends JControllerLegacy
{
	/**
	 * Import an spreadsheet.
	 *
	 * @return  void
	 */
	public function import()
	{
		// Check for request forgeries
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		$model = $this->getModel('import');
		if ($model->import())
		{
			$cache = JFactory::getCache('mod_menu');
			$cache->clean();
			// TODO: Reset the users acl here as well to kill off any missing bits
		}

		$app = JFactory::getApplication();
		$redirect_url =
$app->getUserState('com_reservation.redirect_url');
		if (empty($redirect_url))
		{
			$redirect_url =
JRoute::_('index.php?option=com_reservation&view=import',
false);
		}
		else
		{
			// wipe out the user state when we're going to redirect
			$app->setUserState('com_reservation.redirect_url',
'');
			$app->setUserState('com_reservation.message',
'');
			$app->setUserState('com_reservation.extension_message',
'');
		}
		$this->setRedirect($redirect_url);
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.30
	@build			6th March, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		import_reserves.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Import_reserves Controller
 */
class ReservationControllerImport_reserves extends JControllerLegacy
{
	/**
	 * Import an spreadsheet.
	 *
	 * @return  void
	 */
	public function import()
	{
		// Check for request forgeries
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		$model = $this->getModel('Import_reserves');
		if ($model->import())
		{
			$cache = JFactory::getCache('mod_menu');
			$cache->clean();
			// TODO: Reset the users acl here as well to kill off any missing bits
		}

		$app = JFactory::getApplication();
		$redirect_url =
$app->getUserState('com_reservation.redirect_url');
		if (empty($redirect_url))
		{
			$redirect_url =
JRoute::_('index.php?option=com_reservation&view=import_reserves',
false);
		}
		else
		{
			// wipe out the user state when we're going to redirect
			$app->setUserState('com_reservation.redirect_url',
'');
			$app->setUserState('com_reservation.message',
'');
			$app->setUserState('com_reservation.extension_message',
'');
		}
		$this->setRedirect($redirect_url);
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		message.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Message Controller
 */
class ReservationControllerMessage extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Messages'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('message.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.message.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.message.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Message', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=messages'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		messages.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Messages Controller
 */
class ReservationControllerMessages extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_MESSAGES';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Message', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('message.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Messages');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Messages_'.$date->format('jS_F_Y'),'Messages
exported ('.$date->format('jS F,
Y').')','messages');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=messages',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('message.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Messages');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('message_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'messages');
				$session->set('dataType_VDM_IMPORTINTO',
'message');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_MESSAGES');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=messages',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		order.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Order Controller
 */
class ReservationControllerOrder extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Orders'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('order.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.order.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.order.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Order', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=orders'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL
variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData =
array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		orders.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Orders Controller
 */
class ReservationControllerOrders extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_ORDERS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Order', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('order.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Orders');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Orders_'.$date->format('jS_F_Y'),'Orders
exported ('.$date->format('jS F,
Y').')','orders');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=orders',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('order.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Orders');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('order_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'orders');
				$session->set('dataType_VDM_IMPORTINTO',
'order');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_ORDERS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=orders',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Plan Controller
 */
class ReservationControllerPlan extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Plans'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('plan.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.plan.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.plan.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Plan', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=plans'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{

/***[JCBGUI.admin_view.php_postsavehook.112.$$$$]***/
		$id = $model->getState()->{'plan.id'};
		$validData['id'] = $id;
		JPluginHelper::importPlugin('reservation');
		$dispatcher = JEventDispatcher::getInstance();
		$dispatcher->trigger('onReservationPlanCreated',
array($validData));/***[/JCBGUI$$$$]***/


		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plans.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Plans Controller
 */
class ReservationControllerPlans extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_PLANS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Plan', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('plan.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Plans');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Plans_'.$date->format('jS_F_Y'),'Plans
exported ('.$date->format('jS F,
Y').')','plans');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=plans',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('plan.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Plans');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('plan_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'plans');
				$session->set('dataType_VDM_IMPORTINTO',
'plan');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_PLANS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=plans',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reservation.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation Controller
 */
class ReservationControllerReservation extends JControllerAdmin
{

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserve.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reserve Controller
 */
class ReservationControllerReserve extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Reserves'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('reserve.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.reserve.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.reserve.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Reserve', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=reserves'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserves.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reserves Controller
 */
class ReservationControllerReserves extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_RESERVES';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Reserve', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('reserve.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Reserves');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Reserves_'.$date->format('jS_F_Y'),'Reserves
exported ('.$date->format('jS F,
Y').')','reserves');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=reserves',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('reserve.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Reserves');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('reserve_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'reserves');
				$session->set('dataType_VDM_IMPORTINTO',
'reserve');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_RESERVES');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=reserves',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		session.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Session Controller
 */
class ReservationControllerSession extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Sessions'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('session.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.session.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.session.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Session', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sessions'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sessions.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Sessions Controller
 */
class ReservationControllerSessions extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_SESSIONS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Session', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('session.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Sessions');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Sessions_'.$date->format('jS_F_Y'),'Sessions
exported ('.$date->format('jS F,
Y').')','sessions');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sessions',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('session.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Sessions');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('session_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'sessions');
				$session->set('dataType_VDM_IMPORTINTO',
'session');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_SESSIONS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sessions',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Sick Controller
 */
class ReservationControllerSick extends JControllerForm
{
	/**
	 * Current or most recently performed task.
	 *
	 * @var    string
	 * @since  12.2
	 * @note   Replaces _task.
	 */
	protected $task;

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A named array of configuration variables.
	 *
	 * @since   1.6
	 */
	public function __construct($config = array())
	{
		$this->view_list = 'Sicks'; // safeguard for setting the
return view listing to the main view.
		parent::__construct($config);
	}

        /**
	 * Method override to check if you can add a new record.
	 *
	 * @param   array  $data  An array of input data.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowAdd($data = array())
	{
		// Get user object.
		$user = JFactory::getUser();
		// Access check.
		$access = $user->authorise('sick.access',
'com_reservation');
		if (!$access)
		{
			return false;
		}

		// In the absense of better information, revert to the component
permissions.
		return parent::allowAdd($data);
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param   array   $data  An array of input data.
	 * @param   string  $key   The name of the key for the primary key.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// get user object.
		$user = JFactory::getUser();
		// get record id.
		$recordId = (int) isset($data[$key]) ? $data[$key] : 0;


		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit',
'com_reservation.sick.' . (int) $recordId);
			if (!$permission)
			{
				if ($user->authorise('core.edit.own',
'com_reservation.sick.' . $recordId))
				{
					// Now test the owner is the user.
					$ownerId = (int) isset($data['created_by']) ?
$data['created_by'] : 0;
					if (empty($ownerId))
					{
						// Need to do a lookup from the model.
						$record = $this->getModel()->getItem($recordId);

						if (empty($record))
						{
							return false;
						}
						$ownerId = $record->created_by;
					}

					// If the owner matches 'me' then allow.
					if ($ownerId == $user->id)
					{
						if ($user->authorise('core.edit.own',
'com_reservation'))
						{
							return true;
						}
					}
				}
				return false;
			}
		}
		// Since there is no permission, revert to the component permissions.
		return parent::allowEdit($data, $key);
	}

	/**
	 * Gets the URL arguments to append to an item redirect.
	 *
	 * @param   integer  $recordId  The primary key id for the item.
	 * @param   string   $urlVar    The name of the URL variable for the id.
	 *
	 * @return  string  The arguments to append to the redirect URL.
	 *
	 * @since   1.6
	 */
	protected function getRedirectToItemAppend($recordId = null, $urlVar =
'id')
	{
		// get the referral options (old method use return instead see parent)
		$ref = $this->input->get('ref', 0, 'string');
		$refid = $this->input->get('refid', 0, 'int');

		// get redirect info.
		$append = parent::getRedirectToItemAppend($recordId, $urlVar);

		// set the referral options
		if ($refid && $ref)
                {
			$append = '&ref=' . (string)$ref .
'&refid='. (int)$refid . $append;
		}
		elseif ($ref)
		{
			$append = '&ref='. (string)$ref . $append;
		}

		return $append;
	}

	/**
	 * Method to run batch operations.
	 *
	 * @param   object  $model  The model.
	 *
	 * @return  boolean   True if successful, false otherwise and internal
error is set.
	 *
	 * @since   2.5
	 */
	public function batch($model = null)
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Set the model
		$model = $this->getModel('Sick', '', array());

		// Preset the redirect
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sicks'
. $this->getRedirectToListAppend(), false));

		return parent::batch($model);
	}

	/**
	 * Method to cancel an edit.
	 *
	 * @param   string  $key  The name of the primary key of the URL variable.
	 *
	 * @return  boolean  True if access level checks pass, false otherwise.
	 *
	 * @since   12.2
	 */
	public function cancel($key = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');

		$cancel = parent::cancel($key);

		if (!is_null($return) &&
JUri::isInternal(base64_decode($return)))
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view='.(string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $cancel;
	}

	/**
	 * Method to save a record.
	 *
	 * @param   string  $key     The name of the primary key of the URL
variable.
	 * @param   string  $urlVar  The name of the URL variable if different
from the primary key (sometimes required to avoid router collisions).
	 *
	 * @return  boolean  True if successful, false otherwise.
	 *
	 * @since   12.2
	 */
	public function save($key = null, $urlVar = null)
	{
		// get the referral options
		$this->ref = $this->input->get('ref', 0,
'word');
		$this->refid = $this->input->get('refid', 0,
'int');

		// Check if there is a return value
		$return = $this->input->get('return', null,
'base64');
		$canReturn = (!is_null($return) &&
JUri::isInternal(base64_decode($return)));

		if ($this->ref || $this->refid || $canReturn)
		{
			// to make sure the item is checkedin on redirect
			$this->task = 'save';
		}

		$saved = parent::save($key, $urlVar);

		// This is not needed since parent save already does this
		// Due to the ref and refid implementation we need to add this
		if ($canReturn)
		{
			$redirect = base64_decode($return);

			// Redirect to the return value.
			$this->setRedirect(
				JRoute::_(
					$redirect, false
				)
			);
		}
		elseif ($this->refid && $this->ref)
		{
			$redirect = '&view=' . (string)$this->ref .
'&layout=edit&id=' . (int)$this->refid;

			// Redirect to the item screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		elseif ($this->ref)
		{
			$redirect = '&view=' . (string)$this->ref;

			// Redirect to the list screen.
			$this->setRedirect(
				JRoute::_(
					'index.php?option=' . $this->option . $redirect, false
				)
			);
		}
		return $saved;
	}

	/**
	 * Function that allows child controller access to model data
	 * after the data has been saved.
	 *
	 * @param   JModel  &$model     The data model object.
	 * @param   array   $validData  The validated data.
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	protected function postSaveHook(JModelLegacy $model, $validData = array())
	{
		return;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sicks.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Sicks Controller
 */
class ReservationControllerSicks extends JControllerAdmin
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $text_prefix = 'COM_RESERVATION_SICKS';

	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JModelLegacy  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Sick', $prefix =
'ReservationModel', $config = array('ignore_request'
=> true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	public function exportData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if export is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('sick.export',
'com_reservation') &&
$user->authorise('core.export', 'com_reservation'))
		{
			// Get the input
			$input = JFactory::getApplication()->input;
			$pks = $input->post->get('cid', array(),
'array');
			// Sanitize the input
			$pks = ArrayHelper::toInteger($pks);
			// Get the model
			$model = $this->getModel('Sicks');
			// get the data to export
			$data = $model->getExportData($pks);
			if (ReservationHelper::checkArray($data))
			{
				// now set the data to the spreadsheet
				$date = JFactory::getDate();
				ReservationHelper::xls($data,'Sicks_'.$date->format('jS_F_Y'),'Sicks
exported ('.$date->format('jS F,
Y').')','sicks');
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_EXPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sicks',
false), $message, 'error');
		return;
	}


	public function importData()
	{
		// Check for request forgeries
		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
		// check if import is allowed for this user.
		$user = JFactory::getUser();
		if ($user->authorise('sick.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
		{
			// Get the import model
			$model = $this->getModel('Sicks');
			// get the headers to import
			$headers = $model->getExImPortHeaders();
			if (ReservationHelper::checkObject($headers))
			{
				// Load headers to session.
				$session = JFactory::getSession();
				$headers = json_encode($headers);
				$session->set('sick_VDM_IMPORTHEADERS', $headers);
				$session->set('backto_VDM_IMPORT', 'sicks');
				$session->set('dataType_VDM_IMPORTINTO',
'sick');
				// Redirect to import view.
				$message =
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_FOR_SICKS');
				$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=import',
false), $message);
				return;
			}
		}
		// Redirect to the list screen with error.
		$message = JText::_('COM_RESERVATION_IMPORT_FAILED');
		$this->setRedirect(JRoute::_('index.php?option=com_reservation&view=sicks',
false), $message, 'error');
		return;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		headercheck.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

class reservationHeaderCheck
{
	function js_loaded($script_name)
	{
		// UIkit check point
		if (strpos($script_name,'uikit') !== false)
		{
			$app            	= JFactory::getApplication();
			$getTemplateName  	=
$app->getTemplate('template')->template;
			
			if (strpos($getTemplateName,'yoo') !== false)
			{
				return true;
			}
		}
		
		$document 	= JFactory::getDocument();
		$head_data 	= $document->getHeadData();
		foreach (array_keys($head_data['scripts']) as $script)
		{
			if (stristr($script, $script_name))
			{
				return true;
			}
		}

		return false;
	}
	
	function css_loaded($script_name)
	{
		// UIkit check point
		if (strpos($script_name,'uikit') !== false)
		{
			$app            	= JFactory::getApplication();
			$getTemplateName  	=
$app->getTemplate('template')->template;
			
			if (strpos($getTemplateName,'yoo') !== false)
			{
				return true;
			}
		}
		
		$document 	= JFactory::getDocument();
		$head_data 	= $document->getHeadData();
		
		foreach (array_keys($head_data['styleSheets']) as $script)
		{
			if (stristr($script, $script_name))
			{
				return true;
			}
		}

		return false;
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		batch_.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_PLATFORM') or die;

/**
 * Utility class to render a list view batch selection options
 *
 * @since  3.0
 */
abstract class JHtmlBatch_
{
	/**
	 * ListSelection
	 *
	 * @var    array
	 * @since  3.0
	 */
	protected static $ListSelection = array();

	/**
	 * Render the batch selection options.
	 *
	 * @return  string  The necessary HTML to display the batch selection
options
	 *
	 * @since   3.0
	 */
	public static function render()
	{
		// Collect display data
		$data                 = new stdClass;
		$data->ListSelection  = static::getListSelection();

		// Create a layout object and ask it to render the batch selection
options
		$layout    = new JLayoutFile('batchselection');
		$batchHtml = $layout->render($data);

		return $batchHtml;
	}

	/**
	 * Method to add a list selection to the batch modal
	 *
	 * @param   string  $label      Label for the menu item.
	 * @param   string  $name       Name for the filter. Also used as id.
	 * @param   string  $options    Options for the select field.
	 * @param   bool    $noDefault  Don't the label as the empty option
	 *
	 * @return  void
	 *
	 * @since   3.0
	 */
	public static function addListSelection($label, $name, $options,
$noDefault = false)
	{
		array_push(static::$ListSelection, array('label' => $label,
'name' => $name, 'options' => $options,
'noDefault' => $noDefault));
	}

	/**
	 * Returns an array of all ListSelection
	 *
	 * @return  array
	 *
	 * @since   3.0
	 */
	public static function getListSelection()
	{
		return static::$ListSelection;
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reservation.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

/**
 * Reservation component helper.
 */
abstract class ReservationHelper
{
	/**
	 * Composer Switch
	 * 
	 * @var      array
	 */
	protected static $composer = array();

	/**
	 * The Main Active Language
	 * 
	 * @var      string
	 */
	public static $langTag;

/***[JCBGUI.joomla_component.php_helper_both.28.$$$$]***/
 public static function getConsultant($coid= null, $userid= null)
    {
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        $query->select('*, co.id as id');
       
$query->from($db->quoteName('#__reservation_consultant',
'co'));
       
$query->join('inner',$db->quoteName('#__users',
'u'). ' on '.
$db->quoteName('co.userid').' = '.
$db->quoteName('u.id'));
       
$query->join('inner',$db->quoteName('#__categories',
'c'). ' on '.
$db->quoteName('c.id').' = '.
$db->quoteName('co.catid'));
        if ($coid)
           
$query->where($db->quoteName('co.id').'='.$db->quote($coid));
        elseif ($userid)
           
$query->where($db->quoteName('u.id').'='.$db->quote($userid));

        $db->setQuery($query);
        $result = $db->loadObject();
        return $result;
    }
    public static function setExpireTime()
    {
        $app= JFactory::getApplication();
        date_default_timezone_set('asia/tehran');
        $expire= date("M d, Y  H:i:s", strtotime(date("M d,
Y  H:i:s"))+(3*60));
        $app->setUserState('expire',$expire );
        JFactory::getDocument()->addScriptOptions('expire',
$expire);
    }
    public static function setVerifyCode()
    {
        $app= JFactory::getApplication();
        $verify= rand(1000, 9999);
        $app->setUserState('verify',$verify );
        return $verify;
    }/***[/JCBGUI$$$$]***/


	/**
	 * Load the Composer Vendors
	 */
	public static function composerAutoload($target)
	{
		// insure we load the composer vendor only once
		if (!isset(self::$composer[$target]))
		{
			// get the function name
			$functionName = self::safeString('compose' . $target);
			// check if method exist
			if (method_exists(__CLASS__, $functionName))
			{
				return self::{$functionName}();
			}
			return false;
		}
		return self::$composer[$target];
	}

	/**
	 * Load the Component xml manifest.
	 */
	public static function manifest()
	{
		$manifestUrl =
JPATH_ADMINISTRATOR."/components/com_reservation/reservation.xml";
		return simplexml_load_file($manifestUrl);
	}

	/**
	 * Joomla version object
	 */	
	protected static $JVersion;

	/**
	 * set/get Joomla version
	 */
	public static function jVersion()
	{
		// check if set
		if (!self::checkObject(self::$JVersion))
		{
			self::$JVersion = new JVersion();
		}
		return self::$JVersion;
	}

	/**
	 * Load the Contributors details.
	 */
	public static function getContributors()
	{
		// get params
		$params	= JComponentHelper::getParams('com_reservation');
		// start contributors array
		$contributors = array();
		// get all Contributors (max 20)
		$searchArray = range('0','20');
		foreach($searchArray as $nr)
 		{
			if ((NULL !== $params->get("showContributor".$nr))
&& ($params->get("showContributor".$nr) == 1 ||
$params->get("showContributor".$nr) == 3))
			{
				// set link based of selected option
				if($params->get("useContributor".$nr) == 1)
         		{
					$link_front = '<a
href="mailto:'.$params->get("emailContributor".$nr).'"
target="_blank">';
					$link_back = '</a>';
				}
				elseif($params->get("useContributor".$nr) == 2)
				{
					$link_front = '<a
href="'.$params->get("linkContributor".$nr).'"
target="_blank">';
					$link_back = '</a>';
				}
				else
				{
					$link_front = '';
					$link_back = '';
				}
				$contributors[$nr]['title']	=
self::htmlEscape($params->get("titleContributor".$nr));
				$contributors[$nr]['name']	=
$link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back;
			}
		}
		return $contributors;
	}

	/**
	 *	Can be used to build help urls.
	 **/
	public static function getHelpUrl($view)
	{
		return false;
	}

	/**
	 * Configure the Linkbar.
	 */
	public static function addSubmenu($submenu)
	{
		// load user for access menus
		$user = JFactory::getUser();
		// load the submenus to sidebar
		JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_DASHBOARD'),
'index.php?option=com_reservation&view=reservation', $submenu
=== 'reservation');
		if ($user->authorise('reserve.access',
'com_reservation') &&
$user->authorise('reserve.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_RESERVES'),
'index.php?option=com_reservation&view=reserves', $submenu
=== 'reserves');
		}
		if ($user->authorise('bbbclass.access',
'com_reservation') &&
$user->authorise('bbbclass.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_BBBCLASSES'),
'index.php?option=com_reservation&view=bbbclasses', $submenu
=== 'bbbclasses');
		}
		if ($user->authorise('doctor.access',
'com_reservation') &&
$user->authorise('doctor.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_DOCTORS'),
'index.php?option=com_reservation&view=doctors', $submenu ===
'doctors');
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_DOCTOR_DOCTORS_CATEGORIES'),
'index.php?option=com_categories&view=categories&extension=com_reservation',
$submenu === 'categories');
		}
		if ($user->authorise('appointment.access',
'com_reservation') &&
$user->authorise('appointment.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_APPOINTMENTS'),
'index.php?option=com_reservation&view=appointments',
$submenu === 'appointments');
		}
		if ($user->authorise('capital.access',
'com_reservation') &&
$user->authorise('capital.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_CAPITALS'),
'index.php?option=com_reservation&view=capitals', $submenu
=== 'capitals');
		}
		if ($user->authorise('comment.access',
'com_reservation') &&
$user->authorise('comment.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_COMMENTS'),
'index.php?option=com_reservation&view=comments', $submenu
=== 'comments');
		}
		if ($user->authorise('session.access',
'com_reservation') &&
$user->authorise('session.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_SESSIONS'),
'index.php?option=com_reservation&view=sessions', $submenu
=== 'sessions');
		}
		if ($user->authorise('sick.access',
'com_reservation') &&
$user->authorise('sick.submenu', 'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_SICKS'),
'index.php?option=com_reservation&view=sicks', $submenu ===
'sicks');
		}
		if ($user->authorise('plan.access',
'com_reservation') &&
$user->authorise('plan.submenu', 'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_PLANS'),
'index.php?option=com_reservation&view=plans', $submenu ===
'plans');
		}
		if ($user->authorise('consultant.access',
'com_reservation') &&
$user->authorise('consultant.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_CONSULTANTS'),
'index.php?option=com_reservation&view=consultants', $submenu
=== 'consultants');
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_CONSULTANT_CONSULTANTS_CATEGORIES'),
'index.php?option=com_categories&view=categories&extension=com_reservation',
$submenu === 'categories');
		}
		if ($user->authorise('message.access',
'com_reservation') &&
$user->authorise('message.submenu',
'com_reservation'))
		{
			JHtmlSidebar::addEntry(JText::_('COM_RESERVATION_SUBMENU_MESSAGES'),
'index.php?option=com_reservation&view=messages', $submenu
=== 'messages');
		}
	}

	/**
	* Prepares the xml document
	*/
	public static function xls($rows, $fileName = null, $title = null,
$subjectTab = null, $creator = 'fdsh', $description = null,
$category = null,$keywords = null, $modified = null)
	{
		// set the user
		$user = JFactory::getUser();
		// set fileName if not set
		if (!$fileName)
		{
			$fileName =
'exported_'.JFactory::getDate()->format('jS_F_Y');
		}
		// set modified if not set
		if (!$modified)
		{
			$modified = $user->name;
		}
		// set title if not set
		if (!$title)
		{
			$title = 'Book1';
		}
		// set tab name if not set
		if (!$subjectTab)
		{
			$subjectTab = 'Sheet1';
		}

		// make sure we have the composer classes loaded
		self::composerAutoload('phpspreadsheet');

		// Create new Spreadsheet object
		$spreadsheet = new Spreadsheet();

		// Set document properties
		$spreadsheet->getProperties()
			->setCreator($creator)
			->setCompany('fdsh')
			->setLastModifiedBy($modified)
			->setTitle($title)
			->setSubject($subjectTab);
		// The file type
		$file_type = 'Xls';
		// set description
		if ($description)
		{
			$spreadsheet->getProperties()->setDescription($description);
		}
		// set keywords
		if ($keywords)
		{
			$spreadsheet->getProperties()->setKeywords($keywords);
		}
		// set category
		if ($category)
		{
			$spreadsheet->getProperties()->setCategory($category);
		}

		// Some styles
		$headerStyles = array(
			'font'  => array(
				'bold'  => true,
				'color' => array('rgb' =>
'1171A3'),
				'size'  => 12,
				'name'  => 'Verdana'
		));
		$sideStyles = array(
			'font'  => array(
				'bold'  => true,
				'color' => array('rgb' =>
'444444'),
				'size'  => 11,
				'name'  => 'Verdana'
		));
		$normalStyles = array(
			'font'  => array(
				'color' => array('rgb' =>
'444444'),
				'size'  => 11,
				'name'  => 'Verdana'
		));

		// Add some data
		if (($size = self::checkArray($rows)) !== false)
		{
			$i = 1;

			// Based on data size we adapt the behaviour.
			$xls_mode = 1;
			if ($size > 3000)
			{
				$xls_mode = 3;
				$file_type = 'Csv';
			}
			elseif ($size > 2000)
			{
				$xls_mode = 2;
			}

			// Set active sheet and get it.
			$active_sheet = $spreadsheet->setActiveSheetIndex(0);
			foreach ($rows as $array)
			{
				$a = 'A';
				foreach ($array as $value)
				{
					$active_sheet->setCellValue($a.$i, $value);
					if ($xls_mode != 3)
					{
						if ($i == 1)
						{
							$active_sheet->getColumnDimension($a)->setAutoSize(true);
							$active_sheet->getStyle($a.$i)->applyFromArray($headerStyles);
							$active_sheet->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
						}
						elseif ($a === 'A')
						{
							$active_sheet->getStyle($a.$i)->applyFromArray($sideStyles);
						}
						elseif ($xls_mode == 1)
						{
							$active_sheet->getStyle($a.$i)->applyFromArray($normalStyles);
						}
					}
					$a++;
				}
				$i++;
			}
		}
		else
		{
			return false;
		}

		// Rename worksheet
		$spreadsheet->getActiveSheet()->setTitle($subjectTab);

		// Set active sheet index to the first sheet, so Excel opens this as the
first sheet
		$spreadsheet->setActiveSheetIndex(0);

		// Redirect output to a client's web browser (Excel5)
		header('Content-Type: application/vnd.ms-excel');
		header('Content-Disposition: attachment;filename="' .
$fileName . '.' . strtolower($file_type) .'"');
		header('Cache-Control: max-age=0');
		// If you're serving to IE 9, then the following may be needed
		header('Cache-Control: max-age=1');

		// If you're serving to IE over SSL, then the following may be
needed
		header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in
the past
		header ('Last-Modified: '.gmdate('D, d M Y
H:i:s').' GMT'); // always modified
		header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
		header ('Pragma: public'); // HTTP/1.0

		$writer = IOFactory::createWriter($spreadsheet, $file_type);
		$writer->save('php://output');
		jexit();
	}

	/**
	* Get CSV Headers
	*/
	public static function getFileHeaders($dataType)
	{
		// make sure we have the composer classes loaded
		self::composerAutoload('phpspreadsheet');
		// get session object
		$session = JFactory::getSession();
		$package = $session->get('package', null);
		$package = json_decode($package, true);
		// set the headers
		if(isset($package['dir']))
		{
			// only load first three rows
			$chunkFilter = new PhpOffice\PhpSpreadsheet\Reader\chunkReadFilter(2,1);
			// identify the file type
			$inputFileType = IOFactory::identify($package['dir']);
			// create the reader for this file type
			$excelReader = IOFactory::createReader($inputFileType);
			// load the limiting filter
			$excelReader->setReadFilter($chunkFilter);
			$excelReader->setReadDataOnly(true);
			// load the rows (only first three)
			$excelObj = $excelReader->load($package['dir']);
			$headers = array();
			foreach ($excelObj->getActiveSheet()->getRowIterator() as $row)
			{
				if($row->getRowIndex() == 1)
				{
					$cellIterator = $row->getCellIterator();
					$cellIterator->setIterateOnlyExistingCells(false);
					foreach ($cellIterator as $cell)
					{
						if (!is_null($cell))
						{
							$headers[$cell->getColumn()] = $cell->getValue();
						}
					}
					$excelObj->disconnectWorksheets();
					unset($excelObj);
					break;
				}
			}
			return $headers;
		}
		return false;
	}

	/**
	* Load the Composer Vendor phpspreadsheet
	*/
	protected static function composephpspreadsheet()
	{
		// load the autoloader for phpspreadsheet
		require_once JPATH_SITE .
'/libraries/phpspreadsheet/vendor/autoload.php';
		// do not load again
		self::$composer['phpspreadsheet'] = true;

		return  true;
	}

	/**
	 * Get a Variable 
	 *
	 * @param   string   $table        The table from which to get the
variable
	 * @param   string   $where        The value where
	 * @param   string   $whereString  The target/field string where/name
	 * @param   string   $what         The return field
	 * @param   string   $operator     The operator between $whereString/field
and $where/value
	 * @param   string   $main         The component in which the table is
found
	 *
	 * @return  mix string/int/float
	 *
	 */
	public static function getVar($table, $where = null, $whereString =
'user', $what = 'id', $operator = '=', $main
= 'reservation')
	{
		if(!$where)
		{
			$where = JFactory::getUser()->id;
		}
		// Get a db connection.
		$db = JFactory::getDbo();
		// Create a new query object.
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array($what)));
		if (empty($table))
		{
			$query->from($db->quoteName('#__'.$main));
		}
		else
		{
			$query->from($db->quoteName('#__'.$main.'_'.$table));
		}
		if (is_numeric($where))
		{
			$query->where($db->quoteName($whereString) . '
'.$operator.' '.(int) $where);
		}
		elseif (is_string($where))
		{
			$query->where($db->quoteName($whereString) . '
'.$operator.' '. $db->quote((string)$where));
		}
		else
		{
			return false;
		}
		$db->setQuery($query);
		$db->execute();
		if ($db->getNumRows())
		{
			return $db->loadResult();
		}
		return false;
	}

	/**
	 * Get array of variables
	 *
	 * @param   string   $table        The table from which to get the
variables
	 * @param   string   $where        The value where
	 * @param   string   $whereString  The target/field string where/name
	 * @param   string   $what         The return field
	 * @param   string   $operator     The operator between $whereString/field
and $where/value
	 * @param   string   $main         The component in which the table is
found
	 * @param   bool     $unique       The switch to return a unique array
	 *
	 * @return  array
	 *
	 */
	public static function getVars($table, $where = null, $whereString =
'user', $what = 'id', $operator = 'IN', $main
= 'reservation', $unique = true)
	{
		if(!$where)
		{
			$where = JFactory::getUser()->id;
		}

		if (!self::checkArray($where) && $where > 0)
		{
			$where = array($where);
		}

		if (self::checkArray($where))
		{
			// prep main <-- why? well if $main='' is empty then $table
can be categories or users
			if (self::checkString($main))
			{
				$main = '_'.ltrim($main, '_');
			}
			// Get a db connection.
			$db = JFactory::getDbo();
			// Create a new query object.
			$query = $db->getQuery(true);

			$query->select($db->quoteName(array($what)));
			if (empty($table))
			{
				$query->from($db->quoteName('#__'.$main));
			}
			else
			{
				$query->from($db->quoteName('#_'.$main.'_'.$table));
			}
			// add strings to array search
			if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS'
=== $operator)
			{
				$query->where($db->quoteName($whereString) . ' ' .
str_replace('_STRINGS', '', $operator) . '
("' . implode('","',$where) .
'")');
			}
			else
			{
				$query->where($db->quoteName($whereString) . ' ' .
$operator . ' (' . implode(',',$where) .
')');
			}
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				if ($unique)
				{
					return array_unique($db->loadColumn());
				}
				return $db->loadColumn();
			}
		}
		return false;
	}

	public static function jsonToString($value, $sperator = ", ",
$table = null, $id = 'id', $name = 'name')
	{
		// do some table foot work
		$external = false;
		if (strpos($table, '#__') !== false)
		{
			$external = true;
			$table = str_replace('#__', '', $table);
		}
		// check if string is JSON
		$result = json_decode($value, true);
		if (json_last_error() === JSON_ERROR_NONE)
		{
			// is JSON
			if (self::checkArray($result))
			{
				if (self::checkString($table))
				{
					$names = array();
					foreach ($result as $val)
					{
						if ($external)
						{
							if ($_name = self::getVar(null, $val, $id, $name, '=',
$table))
							{
								$names[] = $_name;
							}
						}
						else
						{
							if ($_name = self::getVar($table, $val, $id, $name))
							{
								$names[] = $_name;
							}
						}
					}
					if (self::checkArray($names))
					{
						return (string) implode($sperator,$names);
					}	
				}
				return (string) implode($sperator,$result);
			}
			return (string) json_decode($value);
		}
		return $value;
	}

	public static function isPublished($id,$type)
	{
		if ($type == 'raw')
		{
			$type = 'item';
		}
		$db = JFactory::getDbo();
		$query = $db->getQuery(true);
		$query->select(array('a.published'));
		$query->from('#__reservation_'.$type.' AS a');
		$query->where('a.id = '. (int) $id);
		$query->where('a.published = 1');
		$db->setQuery($query);
		$db->execute();
		$found = $db->getNumRows();
		if($found)
		{
			return true;
		}
		return false;
	}

	public static function getGroupName($id)
	{
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select(array('a.title'));
		$query->from('#__usergroups AS a');
		$query->where('a.id = '. (int) $id);
		$db->setQuery($query);
		$db->execute();
		$found = $db->getNumRows();
		if($found)
  		{
			return $db->loadResult();
		}
		return $id;
	}

	/**
	 * Get the action permissions
	 *
	 * @param  string   $view        The related view name
	 * @param  int      $record      The item to act upon
	 * @param  string   $views       The related list view name
	 * @param  mixed    $target      Only get this permission (like edit,
create, delete)
	 * @param  string   $component   The target component
	 * @param  object   $user        The user whose permissions we are loading
	 *
	 * @return  object   The JObject of permission/authorised actions
	 * 
	 */
	public static function getActions($view, &$record = null, $views =
null, $target = null, $component = 'reservation', $user =
'null')
	{
		// load the user if not given
		if (!self::checkObject($user))
		{
			// get the user object
			$user = JFactory::getUser();
		}
		// load the JObject
		$result = new JObject;
		// make view name safe (just incase)
		$view = self::safeString($view);
		if (self::checkString($views))
		{
			$views = self::safeString($views);
 		}
		// get all actions from component
		$actions = JAccess::getActionsFromFile(
			JPATH_ADMINISTRATOR . '/components/com_' . $component .
'/access.xml',
			"/access/section[@name='component']/"
		);
		// if non found then return empty JObject
		if (empty($actions))
		{
			return $result;
		}
		// get created by if not found
		if (self::checkObject($record) && !isset($record->created_by)
&& isset($record->id))
		{
			$record->created_by = self::getVar($view, $record->id,
'id', 'created_by', '=', $component);
		}
		// set actions only set in component settings
		$componentActions = array('core.admin',
'core.manage', 'core.options',
'core.export');
		// check if we have a target
		$checkTarget = false;
		if ($target)
		{
			// convert to an array
			if (self::checkString($target))
			{
				$target = array($target);
			}
			// check if we are good to go
			if (self::checkArray($target))
			{
				$checkTarget = true;
			}
		}
		// loop the actions and set the permissions
		foreach ($actions as $action)
		{
			// check target action filter
			if ($checkTarget && self::filterActions($view, $action->name,
$target))
			{
				continue;
			}
			// set to use component default
			$fallback = true;
			// reset permission per/action
			$permission = false;
			$catpermission = false;
			// set area
			$area = 'comp';
			// check if the record has an ID and the action is item related (not a
component action)
			if (self::checkObject($record) && isset($record->id)
&& $record->id > 0 && !in_array($action->name,
$componentActions) &&
				(strpos($action->name, 'core.') !== false ||
strpos($action->name, $view . '.') !== false))
			{
				// we are in item
				$area = 'item';
				// The record has been set. Check the record permissions.
				$permission = $user->authorise($action->name, 'com_' .
$component . '.' . $view . '.' . (int) $record->id);
				// if no permission found, check edit own
				if (!$permission)
				{
					// With edit, if the created_by matches current user then dig deeper.
					if (($action->name === 'core.edit' || $action->name
=== $view . '.edit') && $record->created_by > 0
&& ($record->created_by == $user->id))
					{
						// the correct target
						$coreCheck = (array) explode('.', $action->name);
						// check that we have both local and global access
						if ($user->authorise($coreCheck[0] . '.edit.own',
'com_' . $component . '.' . $view . '.' .
(int) $record->id) &&
							$user->authorise($coreCheck[0]  . '.edit.own',
'com_' . $component))
						{
							// allow edit
							$result->set($action->name, true);
							// set not to use global default
							// because we already validated it
							$fallback = false;
						}
						else
						{
							// do not allow edit
							$result->set($action->name, false);
							$fallback = false;
						}
					}
				}
				elseif (self::checkString($views) && isset($record->catid)
&& $record->catid > 0)
				{
					// we are in item
					$area = 'category';
					// set the core check
					$coreCheck = explode('.', $action->name);
					$core = $coreCheck[0];
					// make sure we use the core. action check for the categories
					if (strpos($action->name, $view) !== false &&
strpos($action->name, 'core.') === false )
					{
						$coreCheck[0] = 'core';
						$categoryCheck = implode('.', $coreCheck);
					}
					else
					{
						$categoryCheck = $action->name;
					}
					// The record has a category. Check the category permissions.
					$catpermission = $user->authorise($categoryCheck, 'com_'
. $component . '.' . $views . '.category.' . (int)
$record->catid);
					if (!$catpermission && !is_null($catpermission))
					{
						// With edit, if the created_by matches current user then dig deeper.
						if (($action->name === 'core.edit' || $action->name
=== $view . '.edit') && $record->created_by > 0
&& ($record->created_by == $user->id))
						{
							// check that we have both local and global access
							if ($user->authorise('core.edit.own', 'com_'
. $component . '.' . $views . '.category.' . (int)
$record->catid) &&
								$user->authorise($core . '.edit.own', 'com_'
. $component))
							{
								// allow edit
								$result->set($action->name, true);
								// set not to use global default
								// because we already validated it
								$fallback = false;
							}
							else
							{
								// do not allow edit
								$result->set($action->name, false);
								$fallback = false;
							}
						}
					}
				}
			}
			// if allowed then fallback on component global settings
			if ($fallback)
			{
				// if item/category blocks access then don't fall back on global
				if ((($area === 'item') && !$permission) || (($area
=== 'category') && !$catpermission))
				{
					// do not allow
					$result->set($action->name, false);
				}
				// Finally remember the global settings have the final say. (even if
item allow)
				// The local item permissions can block, but it can't open and
override of global permissions.
				// Since items are created by users and global permissions is set by
system admin.
				else
				{
					$result->set($action->name,
$user->authorise($action->name, 'com_' . $component));
				}
			}
		}
		return $result;
	}

	/**
	 * Filter the action permissions
	 *
	 * @param  string   $action   The action to check
	 * @param  array    $targets  The array of target actions
	 *
	 * @return  boolean   true if action should be filtered out
	 * 
	 */
	protected static function filterActions(&$view, &$action,
&$targets)
	{
		foreach ($targets as $target)
		{
			if (strpos($action, $view . '.' . $target) !== false ||
				strpos($action, 'core.' . $target) !== false)
			{
				return false;
				break;
			}
		}
		return true;
	}

	/**
	 * Get any component's model
	 */
	public static function getModel($name, $path =
JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Reservation',
$config = array())
	{
		// fix the name
		$name = self::safeString($name);
		// full path to models
		$fullPathModels = $path . '/models';
		// load the model file
		JModelLegacy::addIncludePath($fullPathModels, $Component .
'Model');
		// make sure the table path is loaded
		if (!isset($config['table_path']) ||
!self::checkString($config['table_path']))
		{
			// This is the JCB default path to tables in Joomla 3.x
			$config['table_path'] = JPATH_ADMINISTRATOR .
'/components/com_' . strtolower($Component) .
'/tables';
		}
		// get instance
		$model = JModelLegacy::getInstance($name, $Component . 'Model',
$config);
		// if model not found (strange)
		if ($model == false)
		{
			jimport('joomla.filesystem.file');
			// get file path
			$filePath = $path . '/' . $name . '.php';
			$fullPathModel = $fullPathModels . '/' . $name .
'.php';
			// check if it exists
			if (File::exists($filePath))
			{
				// get the file
				require_once $filePath;
			}
			elseif (File::exists($fullPathModel))
			{
				// get the file
				require_once $fullPathModel;
			}
			// build class names
			$modelClass = $Component . 'Model' . $name;
			if (class_exists($modelClass))
			{
				// initialize the model
				return new $modelClass($config);
			}
		}
		return $model;
	}

	/**
	 * Add to asset Table
	 */
	public static function setAsset($id, $table, $inherit = true)
	{
		$parent = JTable::getInstance('Asset');
		$parent->loadByName('com_reservation');
		
		$parentId = $parent->id;
		$name     = 'com_reservation.'.$table.'.'.$id;
		$title    = '';

		$asset = JTable::getInstance('Asset');
		$asset->loadByName($name);

		// Check for an error.
		$error = $asset->getError();

		if ($error)
		{
			return false;
		}
		else
		{
			// Specify how a new or moved node asset is inserted into the tree.
			if ($asset->parent_id != $parentId)
			{
				$asset->setLocation($parentId, 'last-child');
			}

			// Prepare the asset to be stored.
			$asset->parent_id = $parentId;
			$asset->name      = $name;
			$asset->title     = $title;
			// get the default asset rules
			$rules = self::getDefaultAssetRules('com_reservation', $table,
$inherit);
			if ($rules instanceof JAccessRules)
			{
				$asset->rules = (string) $rules;
			}

			if (!$asset->check() || !$asset->store())
			{
				JFactory::getApplication()->enqueueMessage($asset->getError(),
'warning');
				return false;
			}
			else
			{
				// Create an asset_id or heal one that is corrupted.
				$object = new stdClass();

				// Must be a valid primary key value.
				$object->id = $id;
				$object->asset_id = (int) $asset->id;

				// Update their asset_id to link to the asset table.
				return
JFactory::getDbo()->updateObject('#__reservation_'.$table,
$object, 'id');
			}
		}
		return false;
	}

	/**
	 * Gets the default asset Rules for a component/view.
	 */
	protected static function getDefaultAssetRules($component, $view, $inherit
= true)
	{
		// if new or inherited
		$assetId = 0;
		// Only get the actual item rules if not inheriting
		if (!$inherit)
		{
			// Need to find the asset id by the name of the component.
			$db = JFactory::getDbo();
			$query = $db->getQuery(true)
				->select($db->quoteName('id'))
				->from($db->quoteName('#__assets'))
				->where($db->quoteName('name') . ' = ' .
$db->quote($component));
			$db->setQuery($query);
			$db->execute();
			// check that there is a value
			if ($db->getNumRows())
			{
				// asset already set so use saved rules
				$assetId = (int) $db->loadResult();
			}
		}
		// get asset rules
		$result =  JAccess::getAssetRules($assetId);
		if ($result instanceof JAccessRules)
		{
			$_result = (string) $result;
			$_result = json_decode($_result);
			foreach ($_result as $name => &$rule)
			{
				$v = explode('.', $name);
				if ($view !== $v[0])
				{
					// remove since it is not part of this view
					unset($_result->$name);
				}
				elseif ($inherit)
				{
					// clear the value since we inherit
					$rule = array();
				}
			}
			// check if there are any view values remaining
			if (count((array) $_result))
			{
				$_result = json_encode($_result);
				$_result = array($_result);
				// Instantiate and return the JAccessRules object for the asset rules.
				$rules = new JAccessRules($_result);
				// return filtered rules
				return $rules;
			}
		}
		return $result;
	}

	/**
	 * xmlAppend
	 *
	 * @param   SimpleXMLElement   $xml      The XML element reference in
which to inject a comment
	 * @param   mixed              $node     A SimpleXMLElement node to append
to the XML element reference, or a stdClass object containing a comment
attribute to be injected before the XML node and a fieldXML attribute
containing a SimpleXMLElement
	 *
	 * @return  null
	 *
	 */
	public static function xmlAppend(&$xml, $node)
	{
		if (!$node)
		{
			// element was not returned
			return;
		}
		switch (get_class($node))
		{
			case 'stdClass':
				if (property_exists($node, 'comment'))
				{
					self::xmlComment($xml, $node->comment);
				}
				if (property_exists($node, 'fieldXML'))
				{
					self::xmlAppend($xml, $node->fieldXML);
				}
				break;
			case 'SimpleXMLElement':
				$domXML = dom_import_simplexml($xml);
				$domNode = dom_import_simplexml($node);
				$domXML->appendChild($domXML->ownerDocument->importNode($domNode,
true));
				$xml = simplexml_import_dom($domXML);
				break;
		}
	}

	/**
	 * xmlComment
	 *
	 * @param   SimpleXMLElement   $xml        The XML element reference in
which to inject a comment
	 * @param   string             $comment    The comment to inject
	 *
	 * @return  null
	 *
	 */
	public static function xmlComment(&$xml, $comment)
	{
		$domXML = dom_import_simplexml($xml);
		$domComment = new DOMComment($comment);
		$nodeTarget = $domXML->ownerDocument->importNode($domComment,
true);
		$domXML->appendChild($nodeTarget);
		$xml = simplexml_import_dom($domXML);
	}

	/**
	 * xmlAddAttributes
	 *
	 * @param   SimpleXMLElement   $xml          The XML element reference in
which to inject a comment
	 * @param   array              $attributes   The attributes to apply to
the XML element
	 *
	 * @return  null
	 *
	 */
	public static function xmlAddAttributes(&$xml, $attributes = array())
	{
		foreach ($attributes as $key => $value)
		{
			$xml->addAttribute($key, $value);
		}
	}

	/**
	 * xmlAddOptions
	 *
	 * @param   SimpleXMLElement   $xml          The XML element reference in
which to inject a comment
	 * @param   array              $options      The options to apply to the
XML element
	 *
	 * @return  void
	 *
	 */
	public static function xmlAddOptions(&$xml, $options = array())
	{
		foreach ($options as $key => $value)
		{
			$addOption = $xml->addChild('option');
			$addOption->addAttribute('value', $key);
			$addOption[] = $value;
		}
	}

	/**
	 * get the field object
	 *
	 * @param   array      $attributes   The array of attributes
	 * @param   string     $default      The default of the field
	 * @param   array      $options      The options to apply to the XML
element
	 *
	 * @return  object
	 *
	 */
	public static function getFieldObject(&$attributes, $default =
'', $options = null)
	{
		// make sure we have attributes and a type value
		if (self::checkArray($attributes) &&
isset($attributes['type']))
		{
			// make sure the form helper class is loaded
			if (!method_exists('JFormHelper', 'loadFieldType'))
			{
				jimport('joomla.form.form');
			}
			// get field type
			$field = JFormHelper::loadFieldType($attributes['type'],
true);
			// get field xml
			$XML = self::getFieldXML($attributes, $options);
			// setup the field
			$field->setup($XML, $default);
			// return the field object
			return $field;
		}
		return false;
	}

	/**
	 * get the field xml
	 *
	 * @param   array      $attributes   The array of attributes
	 * @param   array      $options      The options to apply to the XML
element
	 *
	 * @return  object
	 *
	 */
	public static function getFieldXML(&$attributes, $options = null)
	{
		// make sure we have attributes and a type value
		if (self::checkArray($attributes))
		{
			// start field xml
			$XML = new SimpleXMLElement('<field/>');
			// load the attributes
			self::xmlAddAttributes($XML, $attributes);
			// check if we have options
			if (self::checkArray($options))
			{
				// load the options
				self::xmlAddOptions($XML, $options);
			}
			// return the field xml
			return $XML;
		}
		return false;
	}

	/**
	 * Render Bool Button
	 *
	 * @param   array   $args   All the args for the button
	 *                             0) name
	 *                             1) additional (options class) // not used
at this time
	 *                             2) default
	 *                             3) yes (name)
	 *                             4) no (name)
	 *
	 * @return  string    The input html of the button
	 *
	 */
	public static function renderBoolButton()
	{
		$args = func_get_args();
		// check if there is additional button class
		$additional = isset($args[1]) ? (string) $args[1] : ''; // not
used at this time
		// button attributes
		$buttonAttributes = array(
			'type' => 'radio',
			'name' => isset($args[0]) ? self::htmlEscape($args[0]) :
'bool_button',
			'label' => isset($args[0]) ?
self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool
Button', // not seen anyway
			'class' => 'btn-group',
			'filter' => 'INT',
			'default' => isset($args[2]) ? (int) $args[2] : 0);
		// set the button options
		$buttonOptions = array(
			'1' => isset($args[3]) ? self::htmlEscape($args[3]) :
'JYES',
			'0' => isset($args[4]) ? self::htmlEscape($args[4]) :
'JNO');
		// return the input
		return self::getFieldObject($buttonAttributes,
$buttonAttributes['default'], $buttonOptions)->input;
	}

	/**
	 * Check if have an json string
	 *
	 * @input	string   The json string to check
	 *
	 * @returns bool true on success
	 */
	public static function checkJson($string)
	{
		if (self::checkString($string))
		{
			json_decode($string);
			return (json_last_error() === JSON_ERROR_NONE);
		}
		return false;
	}

	/**
	 * Check if have an object with a length
	 *
	 * @input	object   The object to check
	 *
	 * @returns bool true on success
	 */
	public static function checkObject($object)
	{
		if (isset($object) && is_object($object))
		{
			return count((array)$object) > 0;
		}
		return false;
	}

	/**
	 * Check if have an array with a length
	 *
	 * @input	array   The array to check
	 *
	 * @returns bool/int  number of items in array on success
	 */
	public static function checkArray($array, $removeEmptyString = false)
	{
		if (isset($array) && is_array($array) && ($nr =
count((array)$array)) > 0)
		{
			// also make sure the empty strings are removed
			if ($removeEmptyString)
			{
				foreach ($array as $key => $string)
				{
					if (empty($string))
					{
						unset($array[$key]);
					}
				}
				return self::checkArray($array, false);
			}
			return $nr;
		}
		return false;
	}

	/**
	 * Check if have a string with a length
	 *
	 * @input	string   The string to check
	 *
	 * @returns bool true on success
	 */
	public static function checkString($string)
	{
		if (isset($string) && is_string($string) &&
strlen($string) > 0)
		{
			return true;
		}
		return false;
	}

	/**
	 * Check if we are connected
	 * Thanks https://stackoverflow.com/a/4860432/1429677
	 *
	 * @returns bool true on success
	 */
	public static function isConnected()
	{
		// If example.com is down, then probably the whole internet is down,
since IANA maintains the domain. Right?
		$connected = @fsockopen("www.example.com", 80); 
                // website, port  (try 80 or 443)
		if ($connected)
		{
			//action when connected
			$is_conn = true;
			fclose($connected);
		}
		else
		{
			//action in connection failure
			$is_conn = false;
		}
		return $is_conn;
	}

	/**
	 * Merge an array of array's
	 *
	 * @input	array   The arrays you would like to merge
	 *
	 * @returns array on success
	 */
	public static function mergeArrays($arrays)
	{
		if(self::checkArray($arrays))
		{
			$arrayBuket = array();
			foreach ($arrays as $array)
			{
				if (self::checkArray($array))
				{
					$arrayBuket = array_merge($arrayBuket, $array);
				}
			}
			return $arrayBuket;
		}
		return false;
	}

	// typo sorry!
	public static function sorten($string, $length = 40, $addTip = true)
	{
		return self::shorten($string, $length, $addTip);
	}

	/**
	 * Shorten a string
	 *
	 * @input	string   The you would like to shorten
	 *
	 * @returns string on success
	 */
	public static function shorten($string, $length = 40, $addTip = true)
	{
		if (self::checkString($string))
		{
			$initial = strlen($string);
			$words = preg_split('/([\s\n\r]+)/', $string, null,
PREG_SPLIT_DELIM_CAPTURE);
			$words_count = count((array)$words);

			$word_length = 0;
			$last_word = 0;
			for (; $last_word < $words_count; ++$last_word)
			{
				$word_length += strlen($words[$last_word]);
				if ($word_length > $length)
				{
					break;
				}
			}

			$newString	= implode(array_slice($words, 0, $last_word));
			$final	= strlen($newString);
			if ($initial != $final && $addTip)
			{
				$title = self::shorten($string, 400 , false);
				return '<span class="hasTip"
title="'.$title.'"
style="cursor:help">'.trim($newString).'...</span>';
			}
			elseif ($initial != $final && !$addTip)
			{
				return trim($newString).'...';
			}
		}
		return $string;
	}

	/**
	 * Making strings safe (various ways)
	 *
	 * @input	string   The you would like to make safe
	 *
	 * @returns string on success
	 */
	public static function safeString($string, $type = 'L', $spacer
= '_', $replaceNumbers = true, $keepOnlyCharacters = true)
	{
		if ($replaceNumbers === true)
		{
			// remove all numbers and replace with english text version (works well
only up to millions)
			$string = self::replaceNumbers($string);
		}
		// 0nly continue if we have a string
		if (self::checkString($string))
		{
			// create file name without the extention that is safe
			if ($type === 'filename')
			{
				// make sure VDM is not in the string
				$string = str_replace('VDM', 'vDm', $string);
				// Remove anything which isn't a word, whitespace, number
				// or any of the following caracters -_()
				// If you don't need to handle multi-byte characters
				// you can use preg_replace rather than mb_ereg_replace
				// Thanks @Łukasz Rysiak!
				// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])",
'', $string);
				$string = preg_replace("([^\w\s\d\-_\(\)])", '',
$string);
				// http://stackoverflow.com/a/2021729/1429677
				return preg_replace('/\s+/', ' ', $string);
			}
			// remove all other characters
			$string = trim($string);
			$string = preg_replace('/'.$spacer.'+/', '
', $string);
			$string = preg_replace('/\s+/', ' ', $string);
			// Transliterate string
			$string = self::transliterate($string);
			// remove all and keep only characters
			if ($keepOnlyCharacters)
			{
				$string = preg_replace("/[^A-Za-z ]/", '',
$string);
			}
			// keep both numbers and characters
			else
			{
				$string = preg_replace("/[^A-Za-z0-9 ]/", '',
$string);
			}
			// select final adaptations
			if ($type === 'L' || $type === 'strtolower')
			{
				// replace white space with underscore
				$string = preg_replace('/\s+/', $spacer, $string);
				// default is to return lower
				return strtolower($string);
			}
			elseif ($type === 'W')
			{
				// return a string with all first letter of each word uppercase(no
undersocre)
				return ucwords(strtolower($string));
			}
			elseif ($type === 'w' || $type === 'word')
			{
				// return a string with all lowercase(no undersocre)
				return strtolower($string);
			}
			elseif ($type === 'Ww' || $type === 'Word')
			{
				// return a string with first letter of the first word uppercase and
all the rest lowercase(no undersocre)
				return ucfirst(strtolower($string));
			}
			elseif ($type === 'WW' || $type === 'WORD')
			{
				// return a string with all the uppercase(no undersocre)
				return strtoupper($string);
			}
			elseif ($type === 'U' || $type === 'strtoupper')
			{
					// replace white space with underscore
					$string = preg_replace('/\s+/', $spacer, $string);
					// return all upper
					return strtoupper($string);
			}
			elseif ($type === 'F' || $type === 'ucfirst')
			{
					// replace white space with underscore
					$string = preg_replace('/\s+/', $spacer, $string);
					// return with first caracter to upper
					return ucfirst(strtolower($string));
			}
			elseif ($type === 'cA' || $type === 'cAmel' || $type
=== 'camelcase')
			{
				// convert all words to first letter uppercase
				$string = ucwords(strtolower($string));
				// remove white space
				$string = preg_replace('/\s+/', '', $string);
				// now return first letter lowercase
				return lcfirst($string);
			}
			// return string
			return $string;
		}
		// not a string
		return '';
	}

	public static function transliterate($string)
	{
		// set tag only once
		if (!self::checkString(self::$langTag))
		{
			// get global value
			self::$langTag =
JComponentHelper::getParams('com_reservation')->get('language',
'en-GB');
		}
		// Transliterate on the language requested
		$lang = Language::getInstance(self::$langTag);
		return $lang->transliterate($string);
	}

	public static function htmlEscape($var, $charset = 'UTF-8',
$shorten = false, $length = 40)
	{
		if (self::checkString($var))
		{
			$filter = new JFilterInput();
			$string = $filter->clean(html_entity_decode(htmlentities($var,
ENT_COMPAT, $charset)), 'HTML');
			if ($shorten)
			{
                                return self::shorten($string,$length);
			}
			return $string;
		}
		else
		{
			return '';
		}
	}

	public static function replaceNumbers($string)
	{
		// set numbers array
		$numbers = array();
		// first get all numbers
		preg_match_all('!\d+!', $string, $numbers);
		// check if we have any numbers
		if (isset($numbers[0]) && self::checkArray($numbers[0]))
		{
			foreach ($numbers[0] as $number)
			{
				$searchReplace[$number] = self::numberToString((int)$number);
			}
			// now replace numbers in string
			$string = str_replace(array_keys($searchReplace),
array_values($searchReplace),$string);
			// check if we missed any, strange if we did.
			return self::replaceNumbers($string);
		}
		// return the string with no numbers remaining.
		return $string;
	}

	/**
	 * Convert an integer into an English word string
	 * Thanks to Tom Nicholson
<http://php.net/manual/en/function.strval.php#41988>
	 *
	 * @input	an int
	 * @returns a string
	 */
	public static function numberToString($x)
	{
		$nwords = array( "zero", "one", "two",
"three", "four", "five", "six",
"seven",
			"eight", "nine", "ten",
"eleven", "twelve", "thirteen",
			"fourteen", "fifteen", "sixteen",
"seventeen", "eighteen",
			"nineteen", "twenty", 30 => "thirty",
40 => "forty",
			50 => "fifty", 60 => "sixty", 70 =>
"seventy", 80 => "eighty",
			90 => "ninety" );

		if(!is_numeric($x))
		{
			$w = $x;
		}
		elseif(fmod($x, 1) != 0)
		{
			$w = $x;
		}
		else
		{
			if($x < 0)
			{
				$w = 'minus ';
				$x = -$x;
			}
			else
			{
				$w = '';
				// ... now $x is a non-negative integer.
			}

			if($x < 21)   // 0 to 20
			{
				$w .= $nwords[$x];
			}
			elseif($x < 100)  // 21 to 99
			{ 
				$w .= $nwords[10 * floor($x/10)];
				$r = fmod($x, 10);
				if($r > 0)
				{
					$w .= ' '. $nwords[$r];
				}
			}
			elseif($x < 1000)  // 100 to 999
			{
				$w .= $nwords[floor($x/100)] .' hundred';
				$r = fmod($x, 100);
				if($r > 0)
				{
					$w .= ' and '. self::numberToString($r);
				}
			}
			elseif($x < 1000000)  // 1000 to 999999
			{
				$w .= self::numberToString(floor($x/1000)) .' thousand';
				$r = fmod($x, 1000);
				if($r > 0)
				{
					$w .= ' ';
					if($r < 100)
					{
						$w .= 'and ';
					}
					$w .= self::numberToString($r);
				}
			} 
			else //  millions
			{    
				$w .= self::numberToString(floor($x/1000000)) .' million';
				$r = fmod($x, 1000000);
				if($r > 0)
				{
					$w .= ' ';
					if($r < 100)
					{
						$w .= 'and ';
					}
					$w .= self::numberToString($r);
				}
			}
		}
		return $w;
	}

	/**
	 * Random Key
	 *
	 * @returns a string
	 */
	public static function randomkey($size)
	{
		$bag =
"abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
		$key = array();
		$bagsize = strlen($bag) - 1;
		for ($i = 0; $i < $size; $i++)
		{
			$get = rand(0, $bagsize);
			$key[] = $bag[$get];
		}
		return implode($key);
	}
}
<?php

define('_JEXEC', 1);

define('JPATH_BASE',
dirname(dirname(dirname(dirname(__FILE__)))));
require_once JPATH_BASE . '/includes/defines.php';
require_once JPATH_BASE . '/includes/framework.php';
$app = JFactory::getApplication('site');

// print_r($app);
$filename = __DIR__ . '/log.txt';
$input = $app->input;

file_put_contents($filename, "input = " .
print_r($input->getArray(), True) . "\n", FILE_APPEND);
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'doctorid',
	'appointment'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		batchselection.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_BASE') or die;

JHtmlBehavior::core();
$divWrapper = range(1,120,2);
$counter = 0;
?>
<?php if ($displayData->ListSelection) : ?>
<div class="row-fluid">
	<?php foreach ($displayData->ListSelection as $ListSelection) :
?>
    <div class="control-group span6">
    	<div class="controls">
		<label for="<?php echo $ListSelection['name'];
?>" class="element-invisible"><?php echo
$ListSelection['label']; ?></label>
		<select name="<?php echo $ListSelection['name'];
?>" id="<?php echo $ListSelection['name'];
?>" class="span12 small">
			<?php if (!$ListSelection['noDefault']) : ?>
				<option value=""><?php echo
$ListSelection['label']; ?></option>
			<?php endif; ?>
			<?php echo $ListSelection['options']; ?>
		</select>
      	</div>
	</div>
		<?php if (in_array($counter,$divWrapper)) : ?>
</div>
<div class="row-fluid">
		<?php endif; ?>
        <?php $counter++; ?>
	<?php endforeach; ?>
</div>
<div class="control-group radio"
id="batch-move-copy">
	<div class="controls">
        <label class="radio"
id="batch[move_copy]c-lbl" for="batch[move_copy]c">
        <input type="radio" value="c"
id="batch[move_copy]c"
name="batch[move_copy]"><?php echo
JText::_('Copy'); ?></label>
        <label class="radio"
id="batch[move_copy]m-lbl" for="batch[move_copy]m">
        <input type="radio" checked="checked"
value="m" id="batch[move_copy]m"
name="batch[move_copy]"><?php echo
JText::_('Update'); ?></label>
    </div>
</div>
<?php endif; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'name',
	'planid',
	'seid',
	'exmid',
	'inmid',
	'mpass',
	'vpass'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'name'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'capitalid'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_fullwidth.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'text'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
	<?php foreach($fields as $field): ?>
		<?php if (in_array($field, $hiddenFields)) : ?>
			<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
		<?php endif; ?>
		<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
	<?php endforeach; ?>
</div>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'consultantid',
	'seid',
	'rate'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'sickid',
	'token'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.33
	@build			20th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_fullwidth.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'introduction'
);

$hiddenFields = $displayData->get('hidden_fields') ?:
array();

?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
	<?php foreach($fields as $field): ?>
		<?php if (in_array($field, $hiddenFields)) : ?>
			<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
		<?php endif; ?>
		<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
	<?php endforeach; ?>
</div>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'userid',
	'nationalnumber',
	'phonenumber',
	'officephone',
	'capitalid',
	'cityid',
	'account',
	'introduction'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'msn',
	'catid',
	'experience',
	'image',
	'alt',
	'video',
	'presence',
	'address',
	'shortlink'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_fullwidth.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'address'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
	<?php foreach($fields as $field): ?>
		<?php if (in_array($field, $hiddenFields)) : ?>
			<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
		<?php endif; ?>
		<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
	<?php endforeach; ?>
</div>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'userid',
	'phonenumber',
	'msn',
	'presence',
	'capitalid'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'catid',
	'officephone',
	'image',
	'alt',
	'cityid'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'from',
	'reply',
	'message',
	'seid'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'to',
	'read',
	'seen'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'sickid',
	'full_price'
);

$hiddenFields = $displayData->get('hidden_fields') ?:
array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'doctor_quota',
	'system_quota',
	'status'
);

$hiddenFields = $displayData->get('hidden_fields') ?:
array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?:
array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?:
array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'plantype',
	'consultantid',
	'price'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'time',
	'waitingtime'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'sickid',
	'full_price',
	'doctor_quota',
	'system_quota'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'appointmentid',
	'status',
	'payment_method',
	'tracking_code'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'sickid',
	'pay',
	'finish'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'planid',
	'firsttext',
	'channel_token'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_left.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'userid',
	'capitalid',
	'image',
	'alt'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		details_right.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'phonenumber',
	'cityid',
	'cardnumber'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publishing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'title',
	'created',
	'created_by',
	'modified',
	'modified_by'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		publlshing.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// get the form
$form = $displayData->getForm();

// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model
method
// this name combination of tab and layout in the method name is the only
work around
// seeing that JCB uses those two values (tab_name & layout_name) as
the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
	'published',
	'ordering',
	'access',
	'version',
	'hits',
	'id'
);

$hiddenFields = $displayData->get('hidden_fields') ?: array();

?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
	<?php if (in_array($field, $hiddenFields)) : ?>
		<?php $form->setFieldAttribute($field, 'type',
'hidden'); ?>
	<?php endif; ?>
	<?php echo $form->renderField($field, null, null,
array('class' => 'control-wrapper-' . $field));
?>
<?php endforeach; ?>
<?php endif; ?>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		ajax.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Ajax Model
 */
class ReservationModelAjax extends JModelList
{
	protected $app_params;
	
	public function __construct() 
	{		
		parent::__construct();		
		// get params
		$this->app_params	=
JComponentHelper::getParams('com_reservation');
		
	}

	// Used in bbbclass

/***[JCBGUI.admin_view.php_ajaxmethod.144.$$$$]***/
  public function setWebHook($url, $secret)
  {
    require_once dirname(dirname(__FILE__)) .
'/bbb/autoload.php';
    $bbb = new BigBlueButton\BigBlueButton($url, $secret);
    $methods = get_class_methods($bbb);
    // $hooksList = array();
    // $hresponse = $bbb->hooksList();
    // $registered = false;
    // if ($hresponse->getReturnCode() == 'SUCCESS') {
      // foreach ($hresponse->getHooks() as $hook) {
        //
if(JURI::root().'administrator/components/com_reservation/helpers/webhook.php')
        // {
          // $registered = true;
          // break;
        // }
      // }
    // }

    // $meetings = array();
    // $response = $bbb->getMeetings();
    // if ($response->getReturnCode() == 'SUCCESS') {
      // foreach ($response->getRawXml()->meetings->meeting as
$meeting) {
      	// $meetings[] = $meeting;
      // }
    // }
    // print_r($hresponse->getRawXml(), True)
    $hookURL =
JURI::root().'administrator/components/com_reservation/helpers/webhook.php';
    $hp = new BigBlueButton\Parameters\HooksCreateParameters($hookURL);
    $hcresponse = $bbb->hooksCreate($hp);
    return array('status' => ($hcresponse->getReturnCode()
== 'SUCCESS'));
  }
  public function isRegistered($url, $secret)
  {
    require_once dirname(dirname(__FILE__)) .
'/bbb/autoload.php';
    $bbb = new BigBlueButton\BigBlueButton($url, $secret);
    $hresponse = $bbb->hooksList();
    $registered = false;
    $hookURL =
JURI::root().'administrator/components/com_reservation/helpers/webhook.php';
    if ($hresponse->getReturnCode() == 'SUCCESS') {
      foreach ($hresponse->getHooks() as $hook) {
        if($hookURL == $hook->getCallbackUrl())
        {
          $registered = true;
          break;
        }
      }
    }
    return array('status' => $registered);
  }/***[/JCBGUI$$$$]***/


	// Used in sick

/***[JCBGUI.admin_view.php_ajaxmethod.113.$$$$]***/
	public function getCity($capitalid)
    {
        $db = JFactory::getDbo();

        $query = $db->getQuery(true);

        $query
            ->select($db->quoteName(array('a.id',
'a.name'),array('id','name')))
            ->from($db->quoteName('#__reservation_capital',
'a'))
            ->where($db->quoteName('a.capitalid') . '
= ' . $db->quote($capitalid))
            ->order($db->quoteName('a.name') . '
ASC');

        $db->setQuery($query);

        $results = $db->loadAssocList();
        return $results;
    }/***[/JCBGUI$$$$]***/

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Appointment Model
 */
class ReservationModelAppointment extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'doctorid',
				'appointment'
			),
			'right' => array(
				'title'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.appointment';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'appointment', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.appointment',
'appointment', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.appointment.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/appointment.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.appointment.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.appointment.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.appointment.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_appointment'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.appointment.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.appointment',
$data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			=
ReservationHelper::getActions('appointment');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		=
ReservationHelper::getActions('appointment');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->title) &&
!is_numeric($this->table->title))
			{
				$this->table->title =
$this->generateUnique('title',$this->table->title);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		=
ReservationHelper::getActions('appointment');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointments.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Appointments Model
 */
class ReservationModelAppointments extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.appointment','appointment'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$appointment = $this->getUserStateFromRequest($this->context .
'.filter.appointment', 'filter_appointment');
		if ($formSubmited)
		{
			$appointment = $app->input->post->get('appointment');
			$this->setState('filter.appointment', $appointment);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_appointment',
'a'));

		// From the reservation_consultant table.
		$query->select($db->quoteName('g.id','doctorid_id'));
		$query->join('LEFT',
$db->quoteName('#__reservation_consultant', 'g') .
' ON (' . $db->quoteName('a.doctorid') . ' =
' . $db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.appointment LIKE
'.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_appointment table
			$query->from($db->quoteName('#__reservation_appointment',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns =
$db->getTableColumns("#__reservation_appointment");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' .
$this->getState('filter.appointment');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_appointment'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_appointment'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclass.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Bbbclass Model
 */
class ReservationModelBbbclass extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'name',
				'planid',
				'seid',
				'exmid',
				'inmid',
				'mpass',
				'vpass'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.bbbclass';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'bbbclass', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.bbbclass',
'bbbclass', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.bbbclass.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/bbbclass.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.bbbclass.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.bbbclass.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.bbbclass.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_bbbclass'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.bbbclass.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.bbbclass', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('bbbclass');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('bbbclass');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->name) &&
!is_numeric($this->table->name))
			{
				$this->table->name =
$this->generateUnique('name',$this->table->name);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('bbbclass');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclasses.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Bbbclasses Model
 */
class ReservationModelBbbclasses extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.name','name',
				'g.id','planid'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$name = $this->getUserStateFromRequest($this->context .
'.filter.name', 'filter_name');
		if ($formSubmited)
		{
			$name = $app->input->post->get('name');
			$this->setState('filter.name', $name);
		}

		$planid = $this->getUserStateFromRequest($this->context .
'.filter.planid', 'filter_planid');
		if ($formSubmited)
		{
			$planid = $app->input->post->get('planid');
			$this->setState('filter.planid', $planid);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_bbbclass',
'a'));

		// From the reservation_plan table.
		$query->select($db->quoteName('g.id','planid_id'));
		$query->join('LEFT',
$db->quoteName('#__reservation_plan', 'g') . '
ON (' . $db->quoteName('a.planid') . ' = ' .
$db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.name LIKE '.$search.' OR a.exmid
LIKE '.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_bbbclass table
			$query->from($db->quoteName('#__reservation_bbbclass',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_bbbclass");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.name');
		$id .= ':' . $this->getState('filter.planid');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_bbbclass'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_bbbclass'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Capital Model
 */
class ReservationModelCapital extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'name'
			),
			'right' => array(
				'capitalid'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.capital';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'capital', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.capital',
'capital', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.capital.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/capital.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.capital.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.capital.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.capital.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_capital'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.capital.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.capital', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('capital');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('capital');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->name) &&
!is_numeric($this->table->name))
			{
				$this->table->name =
$this->generateUnique('name',$this->table->name);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('capital');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capitals.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Capitals Model
 */
class ReservationModelCapitals extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.name','name',
				'g.name','capitalid'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$name = $this->getUserStateFromRequest($this->context .
'.filter.name', 'filter_name');
		if ($formSubmited)
		{
			$name = $app->input->post->get('name');
			$this->setState('filter.name', $name);
		}

		$capitalid = $this->getUserStateFromRequest($this->context .
'.filter.capitalid', 'filter_capitalid');
		if ($formSubmited)
		{
			$capitalid = $app->input->post->get('capitalid');
			$this->setState('filter.capitalid', $capitalid);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_capital',
'a'));

		// From the reservation_capital table.
		$query->select($db->quoteName('g.name','capitalid_name'));
		$query->join('LEFT',
$db->quoteName('#__reservation_capital', 'g') .
' ON (' . $db->quoteName('a.capitalid') . ' =
' . $db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.name LIKE '.$search.' OR
a.capitalid LIKE '.$search.' OR g.name LIKE
'.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_capital table
			$query->from($db->quoteName('#__reservation_capital',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_capital");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.name');
		$id .= ':' . $this->getState('filter.capitalid');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_capital'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_capital'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Comment Model
 */
class ReservationModelComment extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'consultantid',
				'seid',
				'rate'
			),
			'right' => array(
				'sickid',
				'token'
			),
			'fullwidth' => array(
				'text'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.comment';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'comment', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.comment',
'comment', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.comment.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/comment.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.comment.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.comment.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.comment.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_comment'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.comment.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.comment', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('comment');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('comment');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->text) &&
!is_numeric($this->table->text))
			{
				$this->table->text =
$this->generateUnique('text',$this->table->text);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('comment');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comments.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Comments Model
 */
class ReservationModelComments extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_comment',
'a'));

		// From the reservation_consultant table.
		$query->select($db->quoteName('g.id','consultantid_id'));
		$query->join('LEFT',
$db->quoteName('#__reservation_consultant', 'g') .
' ON (' . $db->quoteName('a.consultantid') . '
= ' . $db->quoteName('g.id') . ')');

		// From the reservation_sick table.
		$query->select($db->quoteName('h.phonenumber','sickid_phonenumber'));
		$query->join('LEFT',
$db->quoteName('#__reservation_sick', 'h') . '
ON (' . $db->quoteName('a.sickid') . ' = ' .
$db->quoteName('h.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.text LIKE '.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_comment table
			$query->from($db->quoteName('#__reservation_comment',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_comment");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_comment'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_comment'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Consultant Model
 */
class ReservationModelConsultant extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'userid',
				'nationalnumber',
				'phonenumber',
				'officephone',
				'capitalid',
				'cityid',
				'account',
				'introduction'
			),
			'right' => array(
				'msn',
				'catid',
				'experience',
				'image',
				'alt',
				'video',
				'presence',
				'address',
				'shortlink'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.consultant';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'consultant', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.consultant',
'consultant', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.consultant.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/consultant.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.consultant.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.consultant.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.consultant.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_consultant'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.consultant.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.consultant', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			=
ReservationHelper::getActions('consultant');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		=
ReservationHelper::getActions('consultant');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		if (isset($values['category']) && (int)
$values['category'] > 0 &&
!static::checkCategoryId($values['category']))
		{
			return false;
		}
		elseif (isset($values['category']) && (int)
$values['category'] > 0)
		{
			// move the category value to correct field name
			$values['catid'] = $values['category'];
			unset($values['category']);
		}
		elseif (isset($values['category']))
		{
			unset($values['category']);
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		=
ReservationHelper::getActions('consultant');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		if (isset($values['category']) && (int)
$values['category'] > 0 &&
!static::checkCategoryId($values['category']))
		{
			return false;
		}
		elseif (isset($values['category']) && (int)
$values['category'] > 0)
		{
			// move the category value to correct field name
			$values['catid'] = $values['category'];
			unset($values['category']);
		}
		elseif (isset($values['category']))
		{
			unset($values['category']);
		}


		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultants.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Consultants Model
 */
class ReservationModelConsultants extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.experience','experience'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$experience = $this->getUserStateFromRequest($this->context .
'.filter.experience', 'filter_experience');
		if ($formSubmited)
		{
			$experience = $app->input->post->get('experience');
			$this->setState('filter.experience', $experience);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

		// set selection value to a translatable value
		if (ReservationHelper::checkArray($items))
		{
			foreach ($items as $nr => &$item)
			{
				// convert account
				$item->account = $this->selectionTranslation($item->account,
'account');
			}
		}

        
		// return items
		return $items;
	}

	/**
	 * Method to convert selection values to translatable string.
	 *
	 * @return translatable string
	 */
	public function selectionTranslation($value,$name)
	{
		// Array of account language strings
		if ($name === 'account')
		{
			$accountArray = array(
				'consultant' =>
'COM_RESERVATION_CONSULTANT_CONSULTANT',
				'doctor' => 'COM_RESERVATION_CONSULTANT_DOCTOR',
				'both' => 'COM_RESERVATION_CONSULTANT_BOTH'
			);
			// Now check if value is found in this array
			if (isset($accountArray[$value]) &&
ReservationHelper::checkString($accountArray[$value]))
			{
				return $accountArray[$value];
			}
		}
		return $value;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');
		$query->select($db->quoteName('c.title','category_title'));

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_consultant',
'a'));
		$query->join('LEFT',
$db->quoteName('#__categories', 'c') . ' ON
(' . $db->quoteName('a.catid') . ' = ' .
$db->quoteName('c.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.nationalnumber LIKE '.$search.' OR
a.catid LIKE '.$search.' OR a.msn LIKE '.$search.' OR
a.phonenumber LIKE '.$search.' OR a.introduction LIKE
'.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_consultant table
			$query->from($db->quoteName('#__reservation_consultant',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns =
$db->getTableColumns("#__reservation_consultant");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.experience');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_consultant'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_consultant'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Doctor Model
 */
class ReservationModelDoctor extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'userid',
				'phonenumber',
				'msn',
				'presence',
				'capitalid'
			),
			'right' => array(
				'catid',
				'officephone',
				'image',
				'alt',
				'cityid'
			),
			'fullwidth' => array(
				'address'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.doctor';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'doctor', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.doctor',
'doctor', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.doctor.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/doctor.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.doctor.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.doctor.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.doctor.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_doctor'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.doctor.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.doctor', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('doctor');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('doctor');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		if (isset($values['category']) && (int)
$values['category'] > 0 &&
!static::checkCategoryId($values['category']))
		{
			return false;
		}
		elseif (isset($values['category']) && (int)
$values['category'] > 0)
		{
			// move the category value to correct field name
			$values['catid'] = $values['category'];
			unset($values['category']);
		}
		elseif (isset($values['category']))
		{
			unset($values['category']);
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('doctor');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		if (isset($values['category']) && (int)
$values['category'] > 0 &&
!static::checkCategoryId($values['category']))
		{
			return false;
		}
		elseif (isset($values['category']) && (int)
$values['category'] > 0)
		{
			// move the category value to correct field name
			$values['catid'] = $values['category'];
			unset($values['category']);
		}
		elseif (isset($values['category']))
		{
			unset($values['category']);
		}


		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctors.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Doctors Model
 */
class ReservationModelDoctors extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'c.title','category_title',
				'c.id', 'category_id',
				'a.catid','catid'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$category = $app->getUserStateFromRequest($this->context .
'.filter.category', 'filter_category');
		$this->setState('filter.category', $category);

		$categoryId = $this->getUserStateFromRequest($this->context .
'.filter.category_id', 'filter_category_id');
		$this->setState('filter.category_id', $categoryId);

		$catid = $this->getUserStateFromRequest($this->context .
'.filter.catid', 'filter_catid');
		if ($formSubmited)
		{
			$catid = $app->input->post->get('catid');
			$this->setState('filter.catid', $catid);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');
		$query->select($db->quoteName('c.title','category_title'));

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_doctor',
'a'));
		$query->join('LEFT',
$db->quoteName('#__categories', 'c') . ' ON
(' . $db->quoteName('a.catid') . ' = ' .
$db->quoteName('c.id') . ')');

		// From the reservation_capital table.
		$query->select($db->quoteName('g.name','capitalid_name'));
		$query->join('LEFT',
$db->quoteName('#__reservation_capital', 'g') .
' ON (' . $db->quoteName('a.capitalid') . ' =
' . $db->quoteName('g.id') . ')');

		// From the reservation_capital table.
		$query->select($db->quoteName('h.name','cityid_name'));
		$query->join('LEFT',
$db->quoteName('#__reservation_capital', 'h') .
' ON (' . $db->quoteName('a.cityid') . ' =
' . $db->quoteName('h.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.userid LIKE '.$search.' OR a.msn
LIKE '.$search.' OR a.phonenumber LIKE '.$search.' OR
a.officephone LIKE '.$search.' OR a.address LIKE
'.$search.')');
			}
		}


		// Filter by a single or group of categories.
		$baselevel = 1;
		$categoryId = $this->getState('filter.category_id');

		if (is_numeric($categoryId))
		{
			$cat_tbl = JTable::getInstance('Category',
'JTable');
			$cat_tbl->load($categoryId);
			$rgt = $cat_tbl->rgt;
			$lft = $cat_tbl->lft;
			$baselevel = (int) $cat_tbl->level;
			$query->where('c.lft >= ' . (int) $lft)
				->where('c.rgt <= ' . (int) $rgt);
		}
		elseif (is_array($categoryId))
		{
			$categoryId = ArrayHelper::toInteger($categoryId);
			$categoryId = implode(',', $categoryId);
			$query->where('a.catid IN (' . $categoryId .
')');
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_doctor table
			$query->from($db->quoteName('#__reservation_doctor',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_doctor");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		// Check if the value is an array
		$_category = $this->getState('filter.category');
		if (ReservationHelper::checkArray($_category))
		{
			$id .= ':' . implode(':', $_category);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_category)
		 || ReservationHelper::checkString($_category))
		{
			$id .= ':' . $_category;
		}
		// Check if the value is an array
		$_category_id = $this->getState('filter.category_id');
		if (ReservationHelper::checkArray($_category_id))
		{
			$id .= ':' . implode(':', $_category_id);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_category_id)
		 || ReservationHelper::checkString($_category_id))
		{
			$id .= ':' . $_category_id;
		}
		// Check if the value is an array
		$_catid = $this->getState('filter.catid');
		if (ReservationHelper::checkArray($_catid))
		{
			$id .= ':' . implode(':', $_catid);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_catid)
		 || ReservationHelper::checkString($_catid))
		{
			$id .= ':' . $_catid;
		}

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_doctor'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_doctor'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Appointment Form Field class for the Reservation component
 */
class JFormFieldAppointment extends JFormFieldList
{
	/**
	 * The appointment field type.
	 *
	 * @var		string
	 */
	public $type = 'appointment';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','a.appointment','c.title','u.name'),array('id','appointmentid_appointment','title','name')));
		$query->from($db->quoteName('#__reservation_appointment',
'a'));
$query->join('inner',$db->quoteName('#__reservation_consultant','co')
. ' on'
.$db->quoteName('a.doctorid').'='.$db->quoteName('co.id'));
		$query->join('inner',$db->quoteName('#__users','u')
. ' on'
.$db->quoteName('u.id').'='.$db->quoteName('co.userid'));
		$query->join('inner',$db->quoteName('#__categories','c')
. ' on'
.$db->quoteName('c.id').'='.$db->quoteName('co.catid'));
		$query->where($db->quoteName('a.published') . ' =
1');
		$query->order('a.appointment ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns =
$db->getTableColumns('#__reservation_appointment');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->name.'('.$item->title.'-'.$item->appointmentid_appointment.')');
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Capital Form Field class for the Reservation component
 */
class JFormFieldCapital extends JFormFieldList
{
	/**
	 * The capital field type.
	 *
	 * @var		string
	 */
	public $type = 'capital';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','a.name'),array('id','capitalid_name')));
		$query->from($db->quoteName('#__reservation_capital',
'a'));
		$query->where($db->quoteName('a.published') . ' =
1');
                $query->where($db->quoteName('a.capitalId')
. ' = 0');
		$query->order('a.name ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns = $db->getTableColumns('#__reservation_capital');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->capitalid_name);
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		city.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * City Form Field class for the Reservation component
 */
class JFormFieldCity extends JFormFieldList
{
	/**
	 * The city field type.
	 *
	 * @var		string
	 */
	public $type = 'city';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		                $capitalid = 
JFactory::getApplication()->getUserState('capitalid','-1');
               // Get the user object.
  		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','a.name'),array('id','cityid_name')));
		$query->from($db->quoteName('#__reservation_capital',
'a'));
		$query->where($db->quoteName('a.published') . ' =
1');
                $query->where($db->quoteName('a.capitalid')
. ' = '. $capitalid);
            
		$query->order('a.name ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
 			$columns =
$db->getTableColumns('#__reservation_capital');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->cityid_name);
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Consultant Form Field class for the Reservation component
 */
class JFormFieldConsultant extends JFormFieldList
{
	/**
	 * The consultant field type.
	 *
	 * @var		string
	 */
	public $type = 'consultant';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','b.name','c.title'),array('id','name','specialty')));
		$query->from($db->quoteName('#__reservation_consultant',
'a'));
                $query->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));
                $query->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('a.catid') . ' = ' .
$db->quoteName('c.id'));

                
		$query->where('('.$db->quoteName('a.account') .
' = '.$db->quote('consultant').' or
'.$db->quoteName('a.account') . ' =
'.$db->quote('both').')');
                $query->where($db->quoteName('a.published')
. ' = 1');
		$query->order('b.name ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns =
$db->getTableColumns('#__reservation_consultant');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->name."(".$item->specialty.")");
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Doctor Form Field class for the Reservation component
 */
class JFormFieldDoctor extends JFormFieldList
{
	/**
	 * The doctor field type.
	 *
	 * @var		string
	 */
	public $type = 'doctor';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','u.name'),array('id','doctorid_id')));
		$query->from($db->quoteName('#__reservation_consultant',
'a'));
               
$query->join('inner',$db->quoteName('#__users',
'u').'on'.$db->quoteName('u.id').'='.$db->quoteName('a.userid'));
		$query->where($db->quoteName('a.published') . ' =
1');
               
$query->where('('.$db->quoteName('a.account') .
' =  '. $db->quote('doctor').' or
'.$db->quoteName('a.account') . ' =  '.
$db->quote('both').')');
		$query->order('a.id ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns =
$db->getTableColumns('#__reservation_consultant');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->doctorid_id);
			}
		}
		return $options;
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Plan Form Field class for the Reservation component
 */
class JFormFieldPlan extends JFormFieldList
{
	/**
	 * The plan field type.
	 *
	 * @var		string
	 */
	public $type = 'plan';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','a.time','a.price','a.plantype','b.name','c.title'),array('id','time','price','plantype','name','specialty')));
		$query->from($db->quoteName('#__reservation_plan',
'a'));
                $query->join('INNER',
$db->quoteName('#__reservation_consultant', 'co') .
' ON ' . $db->quoteName('a.consultantid') . ' =
' . $db->quoteName('co.id'));
                $query->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('co.userId') . ' = ' .
$db->quoteName('b.id'));
                $query->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('co.catid') . ' = ' .
$db->quoteName('c.id'));
 		$query->where($db->quoteName('a.published') . ' =
1');
		$query->order('a.id ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns = $db->getTableColumns('#__reservation_plan');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
                        $pt= array(
				1 => 'COM_RESERVATION_PLAN_TEL',
				2 => 'COM_RESERVATION_PLAN_CHAT'
			);

			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
JText::_($pt[$item->plantype])."-".$item->time."m-".$item->price."-".$item->name."(".$item->specialty.")");
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reply.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Reply Form Field class for the Reservation component
 */
class JFormFieldReply extends JFormFieldList
{
	/**
	 * The reply field type.
	 *
	 * @var		string
	 */
	public $type = 'reply';

	/**
	 * Override to add new button
	 *
	 * @return  string  The field input markup.
	 *
	 * @since   3.2
	 */
	protected function getInput()
	{
		// see if we should add buttons
		$set_button = $this->getAttribute('button');
		// get html
		$html = parent::getInput();
		// if true set button
		if ($set_button === 'true')
		{
			$button = array();
			$script = array();
			$button_code_name = $this->getAttribute('name');
			// get the input from url
			$app = JFactory::getApplication();
			$jinput = $app->input;
			// get the view name & id
			$values = $jinput->getArray(array(
				'id' => 'int',
				'view' => 'word'
			));
			// check if new item
			$ref = '';
			$refJ = '';
			if (!is_null($values['id']) &&
strlen($values['view']))
			{
				// only load referral if not new item.
				$ref = '&amp;ref=' . $values['view'] .
'&amp;refid=' . $values['id'];
				$refJ = '&ref=' . $values['view'] .
'&refid=' . $values['id'];
				// get the return value.
				$_uri = (string) JUri::getInstance();
				$_return = urlencode(base64_encode($_uri));
				// load return value.
				$ref .= '&amp;return=' . $_return;
				$refJ .= '&return=' . $_return;
			}
			// get button label
			$button_label = trim($button_code_name);
			$button_label = preg_replace('/_+/', ' ',
$button_label);
			$button_label = preg_replace('/\s+/', ' ',
$button_label);
			$button_label = preg_replace("/[^A-Za-z ]/", '',
$button_label);
			$button_label = ucfirst(strtolower($button_label));
			// get user object
			$user = JFactory::getUser();
			// only add if user allowed to create message
			if ($user->authorise('core.create',
'com_reservation') && $app->isAdmin()) // TODO for now
only in admin area.
			{
				// build Create button
				$button[] = '<a
id="'.$button_code_name.'Create" class="btn
btn-small btn-success hasTooltip"
title="'.JText::sprintf('COM_RESERVATION_CREATE_NEW_S',
$button_label).'" style="border-radius: 0px 4px 4px 0px;
padding: 4px 4px 4px 7px;"
					href="index.php?option=com_reservation&amp;view=message&amp;layout=edit'.$ref.'"
>
					<span class="icon-new
icon-white"></span></a>';
			}
			// only add if user allowed to edit message
			if ($user->authorise('core.edit',
'com_reservation') && $app->isAdmin()) // TODO for now
only in admin area.
			{
				// build edit button
				$button[] = '<a
id="'.$button_code_name.'Edit" class="btn
btn-small hasTooltip"
title="'.JText::sprintf('COM_RESERVATION_EDIT_S',
$button_label).'" style="display: none; padding: 4px 4px 4px
7px;" href="#" >
					<span class="icon-edit"></span></a>';
				// build script
				$script[] = "
					jQuery(document).ready(function() {
						jQuery('#adminForm').on('change',
'#jform_".$button_code_name."',function (e) {
							e.preventDefault();
							var ".$button_code_name."Value =
jQuery('#jform_".$button_code_name."').val();
							".$button_code_name."Button(".$button_code_name."Value);
						});
						var ".$button_code_name."Value =
jQuery('#jform_".$button_code_name."').val();
						".$button_code_name."Button(".$button_code_name."Value);
					});
					function ".$button_code_name."Button(value) {
						if (value > 0) {
							// hide the create button
							jQuery('#".$button_code_name."Create').hide();
							// show edit button
							jQuery('#".$button_code_name."Edit').show();
							var url =
'index.php?option=com_reservation&view=messages&task=message.edit&id='+value+'".$refJ."';
							jQuery('#".$button_code_name."Edit').attr('href',
url);
						} else {
							// show the create button
							jQuery('#".$button_code_name."Create').show();
							// hide edit button
							jQuery('#".$button_code_name."Edit').hide();
						}
					}";
			}
			// check if button was created for message field.
			if (is_array($button) && count($button) > 0)
			{
				// Load the needed script.
				$document = JFactory::getDocument();
				$document->addScriptDeclaration(implode(' ',$script));
				// return the button attached to input field.
				return '<div class="input-append">' .$html .
implode('',$button).'</div>';
			}
		}
		return $html;
	}

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','a.message'),array('id','reply_message')));
		$query->from($db->quoteName('#__reservation_message',
'a'));
		$query->where($db->quoteName('a.published') . ' =
1');
		$query->order('a.message ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns = $db->getTableColumns('#__reservation_message');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->reply_message);
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Sick Form Field class for the Reservation component
 */
class JFormFieldSick extends JFormFieldList
{
	/**
	 * The sick field type.
	 *
	 * @var		string
	 */
	public $type = 'sick';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Get the databse object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select($db->quoteName(array('a.id','b.name'),array('id','sickid_phonenumber')));
		$query->from($db->quoteName('#__reservation_sick',
'a'));
                $query->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));
		$query->where($db->quoteName('a.published') . ' =
1');
		$query->order('b.name ASC');
		// Implement View Level Access (if set in table)
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$columns = $db->getTableColumns('#__reservation_sick');
			if(isset($columns['access']))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}
		}
		$db->setQuery((string)$query);
		$items = $db->loadObjectList();
		$options = array();
		if ($items)
		{
			if ($this->multiple === false)
			{
				$options[] = JHtml::_('select.option', '',
JText::_('COM_RESERVATION_SELECT_AN_OPTION'));
			}
			foreach($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->id,
$item->sickid_phonenumber);
			}
		}
		return $options;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		adminjsprovider.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Adminjsprovider Form Field class for the Reservation component
 */
class JFormFieldAdminjsprovider extends JFormFieldList
{
	/**
	 * The adminjsprovider field type.
	 *
	 * @var		string
	 */
	public $type = 'adminjsprovider';

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return	array    An array of JHtml options.
	 */
	protected function getOptions()
	{
		// Get the user object.
		$document = JFactory::getDocument();
		$document->addScript('components/com_reservation/assets/js/admin.js');
		$options = array();
		return $options;
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_APPOINTMENT_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_APPOINTMENT_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_APPOINTMENT_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_APPOINTMENT_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_APPOINTMENT_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_APPOINTMENT_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_APPOINTMENT_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_APPOINTMENT_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_APPOINTMENT_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_APPOINTMENT_VERSION_LABEL"
                      
description="COM_RESERVATION_APPOINTMENT_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Dynamic Fields.-->
                <!-- Title Field. Type: Text. (joomla)-->
                <field type="text"
                       name="title"
                      
label="COM_RESERVATION_APPOINTMENT_TITLE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_APPOINTMENT_TITLE_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="STRING"
                      
message="COM_RESERVATION_APPOINTMENT_TITLE_MESSAGE"
                       autocomplete="on" />
                <!-- Appointment Field. Type: Calendar. (joomla)-->
                <field type="calendar"
                       name="appointment"
                      
label="COM_RESERVATION_APPOINTMENT_APPOINTMENT_LABEL"
                       default="NOW"
                       format="%d-%m-%Y %H:%M"
                       filter="user_utc"
                      
message="COM_RESERVATION_APPOINTMENT_APPOINTMENT_MESSAGE"
                       required="true"
                       showtime="true" />
                <!-- Doctorid Field. Type: Doctor. (custom)-->
                <field type="doctor"
                       name="doctorid"
                      
label="COM_RESERVATION_APPOINTMENT_DOCTORID_LABEL"
                       class="list_class"
                       multiple="false"
                       default=""
                       required="true" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this appointment"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="appointment"
		/>
	</fieldset>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_BBBCLASS_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_BBBCLASS_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_BBBCLASS_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_BBBCLASS_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_BBBCLASS_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_BBBCLASS_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_BBBCLASS_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_BBBCLASS_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_BBBCLASS_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_BBBCLASS_VERSION_LABEL"
                      
description="COM_RESERVATION_BBBCLASS_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation bbbclass" />
                <!-- Dynamic Fields.-->
                <!-- Name Field. Type: Text. (joomla)-->
                <field type="text"
                       name="name"
                      
label="COM_RESERVATION_BBBCLASS_NAME_LABEL"
                       size="255"
                       maxlength="255"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_NAME_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_BBBCLASS_NAME_MESSAGE"
                       hint="COM_RESERVATION_BBBCLASS_NAME_HINT"
                       autocomplete="on" />
                <!-- Planid Field. Type: Plan. (custom)-->
                <field type="plan"
                       name="planid"
                      
label="COM_RESERVATION_BBBCLASS_PLANID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Seid Field. Type: Text. (joomla)-->
                <field type="text"
                       name="seid"
                      
label="COM_RESERVATION_BBBCLASS_SEID_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_SEID_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INT"
                      
message="COM_RESERVATION_BBBCLASS_SEID_MESSAGE"
                       autocomplete="on" />
                <!-- Exmid Field. Type: Text. (joomla)-->
                <field type="text"
                       name="exmid"
                      
label="COM_RESERVATION_BBBCLASS_EXMID_LABEL"
                       size="255"
                       maxlength="255"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_EXMID_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_BBBCLASS_EXMID_MESSAGE"
                       hint="COM_RESERVATION_BBBCLASS_EXMID_HINT"
                       autocomplete="on" />
                <!-- Inmid Field. Type: Text. (joomla)-->
                <field type="text"
                       name="inmid"
                      
label="COM_RESERVATION_BBBCLASS_INMID_LABEL"
                       size="255"
                       maxlength="255"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_INMID_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_BBBCLASS_INMID_MESSAGE"
                       hint="COM_RESERVATION_BBBCLASS_INMID_HINT"
                       autocomplete="on" />
                <!-- Mpass Field. Type: Text. (joomla)-->
                <field type="text"
                       name="mpass"
                      
label="COM_RESERVATION_BBBCLASS_MPASS_LABEL"
                       size="255"
                       maxlength="255"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_MPASS_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_BBBCLASS_MPASS_MESSAGE"
                       hint="COM_RESERVATION_BBBCLASS_MPASS_HINT"
                       autocomplete="on" />
                <!-- Vpass Field. Type: Text. (joomla)-->
                <field type="text"
                       name="vpass"
                      
label="COM_RESERVATION_BBBCLASS_VPASS_LABEL"
                       size="255"
                       maxlength="255"
                       default=""
                      
description="COM_RESERVATION_BBBCLASS_VPASS_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_BBBCLASS_VPASS_MESSAGE"
                       hint="COM_RESERVATION_BBBCLASS_VPASS_HINT"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this bbbclass"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="bbbclass"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_CAPITAL_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_CAPITAL_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_CAPITAL_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_CAPITAL_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_CAPITAL_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_CAPITAL_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_CAPITAL_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_CAPITAL_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_CAPITAL_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_CAPITAL_VERSION_LABEL"
                      
description="COM_RESERVATION_CAPITAL_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation capital" />
                <!-- Dynamic Fields.-->
                <!-- Name Field. Type: Text. (joomla)-->
                <field type="text"
                       name="name"
                       label="COM_RESERVATION_CAPITAL_NAME_LABEL"
                       size="40"
                       maxlength="150"
                      
description="COM_RESERVATION_CAPITAL_NAME_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="STRING"
                      
message="COM_RESERVATION_CAPITAL_NAME_MESSAGE"
                       hint="COM_RESERVATION_CAPITAL_NAME_HINT"
/>
                <!-- Capitalid Field. Type: Capital. (custom)-->
                <field type="capital"
                       name="capitalid"
                      
label="COM_RESERVATION_CAPITAL_CAPITALID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this capital"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="capital"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comment.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_COMMENT_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_COMMENT_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_COMMENT_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_COMMENT_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_COMMENT_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_COMMENT_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_COMMENT_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_COMMENT_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_COMMENT_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_COMMENT_VERSION_LABEL"
                      
description="COM_RESERVATION_COMMENT_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation comment" />
                <!-- Dynamic Fields.-->
                <!-- Text Field. Type: Textarea. (joomla)-->
                <field type="textarea"
                       name="text"
                       label="COM_RESERVATION_COMMENT_TEXT_LABEL"
                       rows="10"
                       cols="5"
                       default=""
                      
description="COM_RESERVATION_COMMENT_TEXT_DESCRIPTION"
                       class="text_area form-control"
                       filter="STRING"
                       required="true"
                       readonly="false"
                       disabled="false" />
                <!-- Consultantid Field. Type: Consultant.
(custom)-->
                <field type="consultant"
                       name="consultantid"
                      
label="COM_RESERVATION_COMMENT_CONSULTANTID_LABEL"
                      
description="COM_RESERVATION_COMMENT_CONSULTANTID_DESCRIPTION"
                       class="list_class"
                       multiple="false"
                       default=""
                       required="true"
                       button="false" />
                <!-- Sickid Field. Type: Sick. (custom)-->
                <field type="sick"
                       name="sickid"
                      
label="COM_RESERVATION_COMMENT_SICKID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Rate Field. Type: Number. (joomla)-->
                <field type="number"
                       name="rate"
                       label="COM_RESERVATION_COMMENT_RATE_LABEL"
                       default=""
                      
description="COM_RESERVATION_COMMENT_RATE_DESCRIPTION"
                       class="text_area form-control"
                       required="true"
                       min="1"
                       max="5"
                       step="1"
                       filter="UINT"
                       validate="number" />
                <!-- Seid Field. Type: Text. (joomla)-->
                <field type="text"
                       name="seid"
                       label="COM_RESERVATION_COMMENT_SEID_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_COMMENT_SEID_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INT"
                      
message="COM_RESERVATION_COMMENT_SEID_MESSAGE"
                       autocomplete="on" />
                <!-- Token Field. Type: Text. (joomla)-->
                <field type="text"
                       name="token"
                      
label="COM_RESERVATION_COMMENT_TOKEN_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_COMMENT_TOKEN_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="STRING"
                      
message="COM_RESERVATION_COMMENT_TOKEN_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this comment"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="comment"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_CONSULTANT_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_CONSULTANT_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_CONSULTANT_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_CONSULTANT_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_CONSULTANT_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_CONSULTANT_VERSION_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation consultant" />
                <!-- Dynamic Fields.-->
                <!-- Userid Field. Type: User. (joomla)-->
                <field type="user"
                       name="userid"
                      
label="COM_RESERVATION_CONSULTANT_USERID_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_USERID_DESCRIPTION"
                       class="form-control"
                       required="true" />
                <!-- Nationalnumber Field. Type: Text. (joomla)-->
                <field type="text"
                       name="nationalnumber"
                      
label="COM_RESERVATION_CONSULTANT_NATIONALNUMBER_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_NATIONALNUMBER_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INTEGER"
                      
message="COM_RESERVATION_CONSULTANT_NATIONALNUMBER_MESSAGE"
                       autocomplete="on" />
                <!-- Catid Field. Type: Category. (joomla)-->
                <field type="category"
                       name="catid"
                      
label="COM_RESERVATION_CONSULTANT_CATID_LABEL"
                       extension="com_reservation"
                       required="true"
                       show_root="false"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_CATID_DESCRIPTION"
                       class="inputbox form-control"
                       published="1"
                       multiple="false"
                       exists_table="#__categories"
                       validate="exists" />
                <!-- Image Field. Type: Media. (joomla)-->
                <field type="media"
                       name="image"
                      
label="COM_RESERVATION_CONSULTANT_IMAGE_LABEL"
                       directory="" />
                <!-- Experience Field. Type: Text. (joomla)-->
                <field type="text"
                       name="experience"
                      
label="COM_RESERVATION_CONSULTANT_EXPERIENCE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_EXPERIENCE_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INTEGER"
                      
message="COM_RESERVATION_CONSULTANT_EXPERIENCE_MESSAGE"
                       autocomplete="on" />
                <!-- Msn Field. Type: Text. (joomla)-->
                <field type="text"
                       name="msn"
                      
label="COM_RESERVATION_CONSULTANT_MSN_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_MSN_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INTEGER"
                      
message="COM_RESERVATION_CONSULTANT_MSN_MESSAGE"
                       autocomplete="on" />
                <!-- Phonenumber Field. Type: Text. (joomla)-->
                <field type="text"
                       name="phonenumber"
                      
label="COM_RESERVATION_CONSULTANT_PHONENUMBER_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_PHONENUMBER_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       validated="tel"
                      
message="COM_RESERVATION_CONSULTANT_PHONENUMBER_MESSAGE"
                       validate="mobile" />
                <!-- Shortlink Field. Type: Text. (joomla)-->
                <field type="text"
                       name="shortlink"
                      
label="COM_RESERVATION_CONSULTANT_SHORTLINK_LABEL"
                       size="255"
                       maxlength="255"
                      
description="COM_RESERVATION_CONSULTANT_SHORTLINK_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_CONSULTANT_SHORTLINK_MESSAGE"
                      
hint="COM_RESERVATION_CONSULTANT_SHORTLINK_HINT"
                       autocomplete="on" />
                <!-- Account Field. Type: List. (joomla)-->
                <field type="list"
                       name="account"
                      
label="COM_RESERVATION_CONSULTANT_ACCOUNT_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0">
                        <!-- Option Set.-->
                        <option
value="consultant">COM_RESERVATION_CONSULTANT_CONSULTANT</option>
                        <option
value="doctor">COM_RESERVATION_CONSULTANT_DOCTOR</option>
                        <option
value="both">COM_RESERVATION_CONSULTANT_BOTH</option>
                </field>
                <!-- Address Field. Type: Editor. (joomla)-->
                <field type="editor"
                       name="address"
                      
label="COM_RESERVATION_CONSULTANT_ADDRESS_LABEL"
                       default=""
                       buttons="no"
                       editor="codemirror|none"
                       filter="safehtml" />
                <!-- Presence Field. Type: Editor. (joomla)-->
                <field type="editor"
                       name="presence"
                      
label="COM_RESERVATION_CONSULTANT_PRESENCE_LABEL"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_PRESENCE_DESCRIPTION"
                       buttons="no"
                       editor="codemirror|none"
                       filter="safehtml" />
                <!-- Video Field. Type: Media. (joomla)-->
                <field type="media"
                       name="video"
                      
label="COM_RESERVATION_CONSULTANT_VIDEO_LABEL"
                      
description="COM_RESERVATION_CONSULTANT_VIDEO_DESCRIPTION"
                       directory=""
                       preview="false" />
                <!-- Alt Field. Type: Text. (joomla)-->
                <field type="text"
                       name="alt"
                      
label="COM_RESERVATION_CONSULTANT_ALT_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_ALT_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_CONSULTANT_ALT_MESSAGE"
                       autocomplete="on" />
                <!-- Officephone Field. Type: Text. (joomla)-->
                <field type="text"
                       name="officephone"
                      
label="COM_RESERVATION_CONSULTANT_OFFICEPHONE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_CONSULTANT_OFFICEPHONE_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       validated="tel"
                      
message="COM_RESERVATION_CONSULTANT_OFFICEPHONE_MESSAGE" />
                <!-- Capitalid Field. Type: Capital. (custom)-->
                <field type="capital"
                       name="capitalid"
                      
label="COM_RESERVATION_CONSULTANT_CAPITALID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Cityid Field. Type: City. (custom)-->
                <field type="city"
                       name="cityid"
                      
label="COM_RESERVATION_CONSULTANT_CITYID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Introduction Field. Type: Editor. (joomla)-->
                <field type="editor"
                       name="introduction"
                      
label="COM_RESERVATION_CONSULTANT_INTRODUCTION_LABEL"
                       default=""
                       buttons="no"
                       editor="codemirror|none"
                       filter="safehtml" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this consultant"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="consultant"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/




/***[JCBGUI.admin_view.javascript_view_file.121.$$$$]***/
jQuery(document).ready(function($){

   var gettoken= Joomla.getOptions('token');


   $('select#jform_capitalid').change(function () {

      var capitalid= $(this).val();
      var token= gettoken;

      $.ajax({
         url: 'index.php?option=com_reservation',
         method: 'post',
         dataType: 'json',
         data: {[token] : '1',task:'ajax.getCity',
format: 'json' , raw: 'true' , capitalid: capitalid},
         success: function (msg) {

            var temp='<option value="">Select an
option</option>';
            msg.each(function(value, index){

               temp += '<option
value="'+value.id+'">'+value.name+'</option>';

            });

            $('select#jform_cityid').html(temp);
            $( "select#jform_cityid" ).trigger(
"liszt:updated" );
         },
         error: function (err) {
            console.log(err);
         }
      });


   });


});/***[/JCBGUI$$$$]***/
 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_DOCTOR_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_DOCTOR_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_DOCTOR_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_DOCTOR_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_DOCTOR_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_DOCTOR_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_DOCTOR_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_DOCTOR_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_DOCTOR_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_DOCTOR_VERSION_LABEL"
                      
description="COM_RESERVATION_DOCTOR_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation doctor" />
                <!-- Dynamic Fields.-->
                <!-- Userid Field. Type: User. (joomla)-->
                <field type="user"
                       name="userid"
                      
label="COM_RESERVATION_DOCTOR_USERID_LABEL"
                      
description="COM_RESERVATION_DOCTOR_USERID_DESCRIPTION"
                       class="form-control"
                       required="true" />
                <!-- Msn Field. Type: Text. (joomla)-->
                <field type="text"
                       name="msn"
                       label="COM_RESERVATION_DOCTOR_MSN_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_MSN_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INTEGER"
                      
message="COM_RESERVATION_DOCTOR_MSN_MESSAGE"
                       autocomplete="on" />
                <!-- Catid Field. Type: Category. (joomla)-->
                <field type="category"
                       name="catid"
                       label="COM_RESERVATION_DOCTOR_CATID_LABEL"
                       extension="com_reservation"
                       required="true"
                       show_root="false"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_CATID_DESCRIPTION"
                       class="inputbox form-control"
                       published="1"
                       multiple="false"
                       exists_table="#__categories"
                       validate="exists" />
                <!-- Phonenumber Field. Type: Text. (joomla)-->
                <field type="text"
                       name="phonenumber"
                      
label="COM_RESERVATION_DOCTOR_PHONENUMBER_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_PHONENUMBER_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       validated="tel"
                      
message="COM_RESERVATION_DOCTOR_PHONENUMBER_MESSAGE"
                       validate="mobile" />
                <!-- Officephone Field. Type: Text. (joomla)-->
                <field type="text"
                       name="officephone"
                      
label="COM_RESERVATION_DOCTOR_OFFICEPHONE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_OFFICEPHONE_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       validated="tel"
                      
message="COM_RESERVATION_DOCTOR_OFFICEPHONE_MESSAGE" />
                <!-- Address Field. Type: Editor. (joomla)-->
                <field type="editor"
                       name="address"
                      
label="COM_RESERVATION_DOCTOR_ADDRESS_LABEL"
                       default=""
                       buttons="no"
                       editor="codemirror|none"
                       filter="safehtml" />
                <!-- Presence Field. Type: Editor. (joomla)-->
                <field type="editor"
                       name="presence"
                      
label="COM_RESERVATION_DOCTOR_PRESENCE_LABEL"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_PRESENCE_DESCRIPTION"
                       buttons="no"
                       editor="codemirror|none"
                       filter="safehtml" />
                <!-- Image Field. Type: Media. (joomla)-->
                <field type="media"
                       name="image"
                       label="COM_RESERVATION_DOCTOR_IMAGE_LABEL"
                       directory="" />
                <!-- Capitalid Field. Type: Capital. (custom)-->
                <field type="capital"
                       name="capitalid"
                      
label="COM_RESERVATION_DOCTOR_CAPITALID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Cityid Field. Type: City. (custom)-->
                <field type="city"
                       name="cityid"
                      
label="COM_RESERVATION_DOCTOR_CITYID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Alt Field. Type: Text. (joomla)-->
                <field type="text"
                       name="alt"
                       label="COM_RESERVATION_DOCTOR_ALT_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_DOCTOR_ALT_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_DOCTOR_ALT_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this doctor"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="doctor"
		/>
	</fieldset>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_APPOINTMENTS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_APPOINTMENTS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.appointment
ASC">COM_RESERVATION_FILTER_APPOINTMENT_ASCENDING</option>
			<option value="a.appointment
DESC">COM_RESERVATION_FILTER_APPOINTMENT_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_BBBCLASSES"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_BBBCLASSES"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.name
ASC">COM_RESERVATION_FILTER_CLASS_NAME_ASCENDING</option>
			<option value="a.name
DESC">COM_RESERVATION_FILTER_CLASS_NAME_DESCENDING</option>
			<option value="g.id
ASC">COM_RESERVATION_FILTER_PLAN_ASCENDING</option>
			<option value="g.id
DESC">COM_RESERVATION_FILTER_PLAN_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_CAPITALS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_CAPITALS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.name
ASC">COM_RESERVATION_FILTER_NAME_ASCENDING</option>
			<option value="a.name
DESC">COM_RESERVATION_FILTER_NAME_DESCENDING</option>
			<option value="g.name
ASC">COM_RESERVATION_FILTER_SELECT_A_CAPITAL_ASCENDING</option>
			<option value="g.name
DESC">COM_RESERVATION_FILTER_SELECT_A_CAPITAL_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_COMMENTS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_COMMENTS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_CONSULTANTS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_CONSULTANTS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.experience
ASC">COM_RESERVATION_FILTER_EXPERIENCE_ASCENDING</option>
			<option value="a.experience
DESC">COM_RESERVATION_FILTER_EXPERIENCE_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_DOCTORS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_DOCTORS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="category"
			name="category_id"
			label="COM_RESERVATION_DOCTOR_DOCTORS_CATEGORIES"
			description="JOPTION_FILTER_CATEGORY_DESC"
			multiple="true"
			class="multipleCategories"
			extension="com_reservation"
			onchange="this.form.submit();"
			published="0,1,2"
		/>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_MESSAGES"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_MESSAGES"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_ORDERS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_ORDERS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.full_price
ASC">COM_RESERVATION_FILTER_PRICE_ASCENDING</option>
			<option value="a.full_price
DESC">COM_RESERVATION_FILTER_PRICE_DESCENDING</option>
			<option value="a.status
ASC">COM_RESERVATION_FILTER_STATUS_ASCENDING</option>
			<option value="a.status
DESC">COM_RESERVATION_FILTER_STATUS_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_PLANS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_PLANS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.time
ASC">COM_RESERVATION_FILTER_TIME_ASCENDING</option>
			<option value="a.time
DESC">COM_RESERVATION_FILTER_TIME_DESCENDING</option>
			<option value="a.price
ASC">COM_RESERVATION_FILTER_PRICE_ASCENDING</option>
			<option value="a.price
DESC">COM_RESERVATION_FILTER_PRICE_DESCENDING</option>
			<option value="a.waitingtime
ASC">COM_RESERVATION_FILTER_WAITINGTIME_ASCENDING</option>
			<option value="a.waitingtime
DESC">COM_RESERVATION_FILTER_WAITINGTIME_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_RESERVES"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_RESERVES"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.full_price
ASC">COM_RESERVATION_FILTER_PRICE_ASCENDING</option>
			<option value="a.full_price
DESC">COM_RESERVATION_FILTER_PRICE_DESCENDING</option>
			<option value="a.doctor_quota
ASC">COM_RESERVATION_FILTER_DOCTOR_QUOTA_ASCENDING</option>
			<option value="a.doctor_quota
DESC">COM_RESERVATION_FILTER_DOCTOR_QUOTA_DESCENDING</option>
			<option value="a.system_quota
ASC">COM_RESERVATION_FILTER_SYSTEM_QUOTA_ASCENDING</option>
			<option value="a.system_quota
DESC">COM_RESERVATION_FILTER_SYSTEM_QUOTA_DESCENDING</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_SESSIONS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_SESSIONS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><?xml version="1.0"
encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fields name="filter">
		<field
			type="text"
			name="search"
			inputmode="search"
			label="COM_RESERVATION_FILTER_SEARCH"
			description="COM_RESERVATION_FILTER_SEARCH_SICKS"
			hint="JSEARCH_FILTER"
		/>
		<field
			type="status"
			name="published"
			label="COM_RESERVATION_FILTER_PUBLISHED"
			description="COM_RESERVATION_FILTER_PUBLISHED_SICKS"
			onchange="this.form.submit();"
		>
			<option value="">JOPTION_SELECT_PUBLISHED</option>
		</field>
		<field
			type="accesslevel"
			name="access"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			multiple="true"
			class="multipleAccessLevels"
			onchange="this.form.submit();"
		/>
		<input type="hidden" name="form_submited"
value="1"/>
	</fields>

	<fields name="list">
		<field
			name="fullordering"
			type="list"
			label="COM_CONTENT_LIST_FULL_ORDERING"
			description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id DESC"
			validate="options"
		>
			<option value="">JGLOBAL_SORT_BY</option>
			<option value="a.ordering
ASC">JGRID_HEADING_ORDERING_ASC</option>
			<option value="a.ordering
DESC">JGRID_HEADING_ORDERING_DESC</option>
			<option value="a.published
ASC">JSTATUS_ASC</option>
			<option value="a.published
DESC">JSTATUS_DESC</option>
			<option value="a.id
ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id
DESC">JGRID_HEADING_ID_DESC</option>
		</field>

		<field
			name="limit"
			type="limitbox"
			label="COM_CONTENT_LIST_LIMIT"
			description="COM_CONTENT_LIST_LIMIT_DESC"
			class="input-mini"
			default="25"
			onchange="this.form.submit();"
		/>
	</fields>
</form><html><body
bgcolor="#FFFFFF"></body></html>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		message.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_MESSAGE_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_MESSAGE_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_MESSAGE_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_MESSAGE_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_MESSAGE_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_MESSAGE_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_MESSAGE_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_MESSAGE_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_MESSAGE_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_MESSAGE_VERSION_LABEL"
                      
description="COM_RESERVATION_MESSAGE_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation message" />
                <!-- Dynamic Fields.-->
                <!-- From Field. Type: User. (joomla)-->
                <field type="user"
                       name="from"
                       label="COM_RESERVATION_MESSAGE_FROM_LABEL"
/>
                <!-- To Field. Type: User. (joomla)-->
                <field type="user"
                       name="to"
                       label="COM_RESERVATION_MESSAGE_TO_LABEL"
/>
                <!-- Reply Field. Type: Reply. (custom)-->
                <field type="reply"
                       name="reply"
                      
label="COM_RESERVATION_MESSAGE_REPLY_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       button="true" />
                <!-- Message Field. Type: Textarea. (joomla)-->
                <field type="textarea"
                       name="message"
                      
label="COM_RESERVATION_MESSAGE_MESSAGE_LABEL"
                       rows="10"
                       cols="5"
                       default="default text"
                      
description="COM_RESERVATION_MESSAGE_MESSAGE_DESCRIPTION"
                       class="text_area"
                       filter="raw"
                       required="true"
                       readonly="false"
                       disabled="false" />
                <!-- Read Field. Type: Checkbox. (joomla)-->
                <field type="checkbox"
                       name="read"
                       label="COM_RESERVATION_MESSAGE_READ_LABEL"
                       value="1"
                       default=""
                      
description="COM_RESERVATION_MESSAGE_READ_DESCRIPTION"
                       class="inputbox" />
                <!-- Seen Field. Type: Checkbox. (joomla)-->
                <field type="checkbox"
                       name="seen"
                       label="COM_RESERVATION_MESSAGE_SEEN_LABEL"
                       value="1"
                       default=""
                      
description="COM_RESERVATION_MESSAGE_SEEN_DESCRIPTION"
                       class="inputbox" />
                <!-- Seid Field. Type: Text. (joomla)-->
                <field type="text"
                       name="seid"
                       label="COM_RESERVATION_MESSAGE_SEID_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_MESSAGE_SEID_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INT"
                      
message="COM_RESERVATION_MESSAGE_SEID_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this message"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="message"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		order.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_ORDER_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_ORDER_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_ORDER_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_ORDER_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_ORDER_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_ORDER_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_ORDER_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_ORDER_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_ORDER_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_ORDER_VERSION_LABEL"
                      
description="COM_RESERVATION_ORDER_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation order" />
                <!-- Dynamic Fields.-->
                <!-- Sickid Field. Type: Sick. (custom)-->
                <field type="sick"
                       name="sickid"
                       label="COM_RESERVATION_ORDER_SICKID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Full_price Field. Type: Text. (joomla)-->
                <field type="text"
                       name="full_price"
                      
label="COM_RESERVATION_ORDER_FULL_PRICE_LABEL"
                       size="10"
                       maxlength="100"
                       default=""
                      
description="COM_RESERVATION_ORDER_FULL_PRICE_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="INT"
                       validate="number"
                      
message="COM_RESERVATION_ORDER_FULL_PRICE_MESSAGE"
                       autocomplete="on" />
                <!-- Doctor_quota Field. Type: Text. (joomla)-->
                <field type="text"
                       name="doctor_quota"
                      
label="COM_RESERVATION_ORDER_DOCTOR_QUOTA_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_ORDER_DOCTOR_QUOTA_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="int"
                       validate="number"
                      
message="COM_RESERVATION_ORDER_DOCTOR_QUOTA_MESSAGE"
                       autocomplete="on" />
                <!-- System_quota Field. Type: Text. (joomla)-->
                <field type="text"
                       name="system_quota"
                      
label="COM_RESERVATION_ORDER_SYSTEM_QUOTA_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_ORDER_SYSTEM_QUOTA_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="int"
                       validate="number"
                      
message="COM_RESERVATION_ORDER_SYSTEM_QUOTA_MESSAGE"
                       autocomplete="on" />
                <!-- Status Field. Type: List. (joomla)-->
                <field type="list"
                       name="status"
                       label="COM_RESERVATION_ORDER_STATUS_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0">
                        <!-- Option Set.-->
                        <option
value="confirmed">COM_RESERVATION_ORDER_CONFIRMED</option>
                        <option
value="created">COM_RESERVATION_ORDER_CREATED</option>
                </field>
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this order"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="order"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_PLAN_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_PLAN_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_PLAN_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_PLAN_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_PLAN_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_PLAN_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_PLAN_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_PLAN_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_PLAN_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                       label="COM_RESERVATION_PLAN_VERSION_LABEL"
                      
description="COM_RESERVATION_PLAN_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation plan" />
                <!-- Dynamic Fields.-->
                <!-- Plantype Field. Type: List. (joomla)-->
                <field type="list"
                       name="plantype"
                      
label="COM_RESERVATION_PLAN_PLANTYPE_LABEL"
                      
description="COM_RESERVATION_PLAN_PLANTYPE_DESCRIPTION"
                       class="list_class form-control"
                       multiple="false"
                       required="true"
                       default="0">
                        <!-- Option Set.-->
                        <option
value="1">COM_RESERVATION_PLAN_TEL</option>
                        <option
value="2">COM_RESERVATION_PLAN_CHAT</option>
                        <option
value="3">COM_RESERVATION_PLAN_VIDEO</option>
                </field>
                <!-- Time Field. Type: Number. (joomla)-->
                <field type="number"
                       name="time"
                       label="COM_RESERVATION_PLAN_TIME_LABEL"
                       default=""
                      
description="COM_RESERVATION_PLAN_TIME_DESCRIPTION"
                       class="text_area form-control"
                       required="true"
                       min="1"
                       max="120"
                       step="5" />
                <!-- Price Field. Type: Text. (joomla)-->
                <field type="text"
                       name="price"
                       label="COM_RESERVATION_PLAN_PRICE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_PLAN_PRICE_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="INTEGER"
                      
message="COM_RESERVATION_PLAN_PRICE_MESSAGE"
                       autocomplete="on" />
                <!-- Waitingtime Field. Type: Number. (joomla)-->
                <field type="number"
                       name="waitingtime"
                      
label="COM_RESERVATION_PLAN_WAITINGTIME_LABEL"
                       default=""
                      
description="COM_RESERVATION_PLAN_WAITINGTIME_DESCRIPTION"
                       class="text_area form-control"
                       required="true"
                       min="1"
                       max="40"
                       step="1" />
                <!-- Consultantid Field. Type: Consultant.
(custom)-->
                <field type="consultant"
                       name="consultantid"
                      
label="COM_RESERVATION_PLAN_CONSULTANTID_LABEL"
                      
description="COM_RESERVATION_PLAN_CONSULTANTID_DESCRIPTION"
                       class="list_class"
                       multiple="false"
                       default=""
                       required="true"
                       button="false" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this plan"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="plan"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserve.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_RESERVE_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_RESERVE_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_RESERVE_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_RESERVE_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_RESERVE_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_RESERVE_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_RESERVE_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_RESERVE_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_RESERVE_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_RESERVE_VERSION_LABEL"
                      
description="COM_RESERVATION_RESERVE_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation reserve" />
                <!-- Dynamic Fields.-->
                <!-- Appointmentid Field. Type: Appointment.
(custom)-->
                <field type="appointment"
                       name="appointmentid"
                      
label="COM_RESERVATION_RESERVE_APPOINTMENTID_LABEL"
                      
description="COM_RESERVATION_RESERVE_APPOINTMENTID_DESCRIPTION"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Sickid Field. Type: Sick. (custom)-->
                <field type="sick"
                       name="sickid"
                      
label="COM_RESERVATION_RESERVE_SICKID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Full_price Field. Type: Text. (joomla)-->
                <field type="text"
                       name="full_price"
                      
label="COM_RESERVATION_RESERVE_FULL_PRICE_LABEL"
                       size="10"
                       maxlength="100"
                       default=""
                      
description="COM_RESERVATION_RESERVE_FULL_PRICE_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="UINT"
                       validate="number"
                      
message="COM_RESERVATION_RESERVE_FULL_PRICE_MESSAGE"
                       autocomplete="on" />
                <!-- Doctor_quota Field. Type: Text. (joomla)-->
                <field type="text"
                       name="doctor_quota"
                      
label="COM_RESERVATION_RESERVE_DOCTOR_QUOTA_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_RESERVE_DOCTOR_QUOTA_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="UINT"
                       validate="number"
                      
message="COM_RESERVATION_RESERVE_DOCTOR_QUOTA_MESSAGE"
                       autocomplete="on" />
                <!-- System_quota Field. Type: Text. (joomla)-->
                <field type="text"
                       name="system_quota"
                      
label="COM_RESERVATION_RESERVE_SYSTEM_QUOTA_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_RESERVE_SYSTEM_QUOTA_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="UINT"
                       validate="number"
                      
message="COM_RESERVATION_RESERVE_SYSTEM_QUOTA_MESSAGE"
                       autocomplete="on" />
                <!-- Status Field. Type: List. (joomla)-->
                <field type="list"
                       name="status"
                      
label="COM_RESERVATION_RESERVE_STATUS_LABEL"
                       class="list_class"
                       multiple="false"
                       required="true"
                       default="0">
                        <!-- Option Set.-->
                        <option
value="confirmed">COM_RESERVATION_RESERVE_CONFIRMED</option>
                        <option
value="created">COM_RESERVATION_RESERVE_CREATED</option>
                </field>
                <!-- Payment_method Field. Type: Text. (joomla)-->
                <field type="text"
                       name="payment_method"
                      
label="COM_RESERVATION_RESERVE_PAYMENT_METHOD_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_RESERVE_PAYMENT_METHOD_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_RESERVE_PAYMENT_METHOD_MESSAGE"
                       autocomplete="on" />
                <!-- Tracking_code Field. Type: Text. (joomla)-->
                <field type="text"
                       name="tracking_code"
                      
label="COM_RESERVATION_RESERVE_TRACKING_CODE_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_RESERVE_TRACKING_CODE_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this reserve"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="reserve"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		session.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_SESSION_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_SESSION_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_SESSION_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_SESSION_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_SESSION_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_SESSION_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_SESSION_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_SESSION_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_SESSION_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                      
label="COM_RESERVATION_SESSION_VERSION_LABEL"
                      
description="COM_RESERVATION_SESSION_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation session" />
                <!-- Dynamic Fields.-->
                <!-- Sickid Field. Type: Sick. (custom)-->
                <field type="sick"
                       name="sickid"
                      
label="COM_RESERVATION_SESSION_SICKID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Planid Field. Type: Plan. (custom)-->
                <field type="plan"
                       name="planid"
                      
label="COM_RESERVATION_SESSION_PLANID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0"
                       required="true" />
                <!-- Pay Field. Type: Checkbox. (joomla)-->
                <field type="checkbox"
                       name="pay"
                       label="COM_RESERVATION_SESSION_PAY_LABEL"
                       value="1"
                       default=""
                      
description="COM_RESERVATION_SESSION_PAY_DESCRIPTION"
                       class="inputbox" />
                <!-- Finish Field. Type: Checkbox. (joomla)-->
                <field type="checkbox"
                       name="finish"
                      
label="COM_RESERVATION_SESSION_FINISH_LABEL"
                       value="1"
                       default=""
                      
description="COM_RESERVATION_SESSION_FINISH_DESCRIPTION"
                       class="inputbox" />
                <!-- Channel_token Field. Type: Text. (joomla)-->
                <field type="text"
                       name="channel_token"
                      
label="COM_RESERVATION_SESSION_CHANNEL_TOKEN_LABEL"
                       size="10"
                       maxlength="200"
                       default=""
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                      
message="COM_RESERVATION_SESSION_CHANNEL_TOKEN_MESSAGE"
                      
hint="COM_RESERVATION_SESSION_CHANNEL_TOKEN_HINT"
                       autocomplete="on" />
                <!-- Firsttext Field. Type: Text. (joomla)-->
                <field type="text"
                       name="firsttext"
                      
label="COM_RESERVATION_SESSION_FIRSTTEXT_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_SESSION_FIRSTTEXT_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="true"
                       filter="STRING"
                      
message="COM_RESERVATION_SESSION_FIRSTTEXT_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this session"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="session"
		/>
	</fieldset>
</form>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			26th July, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/




/***[JCBGUI.admin_view.javascript_view_file.113.$$$$]***/
jQuery(document).ready(function($){

   var gettoken= Joomla.getOptions('token');
   var route= Joomla.getOptions('route');


   $('select#jform_capitalid').change(function () {

      var capitalid= $(this).val();
      var token= gettoken;

      $.ajax({
         url: route,
         method: 'post',
         dataType: 'json',
         data: {[token] : '1',task:'ajax.getCity',
format: 'json' , raw: 'true' , capitalid: capitalid},
         success: function (msg) {

            var temp='<option value="">Select an
option</option>';
            msg.each(function(value, index){

               temp += '<option
value="'+value.id+'">'+value.name+'</option>';

            });

            $('select#jform_cityid').html(temp);
            $( "select#jform_cityid" ).trigger(
"liszt:updated" );
         },
         error: function (err) {
            console.log(err);
         }
      });


   });


});/***[/JCBGUI$$$$]***/
 
<?xml version="1.0" encoding="utf-8"?>
<form
	addrulepath="/administrator/components/com_reservation/models/rules"
	addfieldpath="/administrator/components/com_reservation/models/fields"
>
	<fieldset name="details">
                <!-- Default Fields.-->
                <!-- Id Field. Type: Text (joomla)-->
                <field name="id"
                       type="text"
                       class="readonly"
                       readonly="true"
                       label="JGLOBAL_FIELD_ID_LABEL"
                       description="JGLOBAL_FIELD_ID_DESC"
                       size="10"
                       default="0" />
                <!-- Date Created Field. Type: Calendar (joomla)-->
                <field name="created"
                       type="calendar"
                      
label="COM_RESERVATION_SICK_CREATED_DATE_LABEL"
                      
description="COM_RESERVATION_SICK_CREATED_DATE_DESC"
                       size="22"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Created Field. Type: User (joomla)-->
                <field name="created_by"
                       type="user"
                      
label="COM_RESERVATION_SICK_CREATED_BY_LABEL"
                      
description="COM_RESERVATION_SICK_CREATED_BY_DESC" />
                <!-- Published Field. Type: List (joomla)-->
                <field name="published"
                       type="list"
                       label="JSTATUS">
                        <option
value="1">JPUBLISHED</option>
                        <option
value="0">JUNPUBLISHED</option>
                        <option
value="2">JARCHIVED</option>
                        <option
value="-2">JTRASHED</option>
                </field>
                <!-- Date Modified Field. Type: Calendar (joomla)-->
                <field name="modified"
                       type="calendar"
                       class="readonly"
                      
label="COM_RESERVATION_SICK_MODIFIED_DATE_LABEL"
                      
description="COM_RESERVATION_SICK_MODIFIED_DATE_DESC"
                       size="22"
                       readonly="true"
                       format="%Y-%m-%d %H:%M:%S"
                       filter="user_utc" />
                <!-- User Modified Field. Type: User (joomla)-->
                <field name="modified_by"
                       type="user"
                      
label="COM_RESERVATION_SICK_MODIFIED_BY_LABEL"
                      
description="COM_RESERVATION_SICK_MODIFIED_BY_DESC"
                       class="readonly"
                       readonly="true"
                       filter="unset" />
                <!-- Access Field. Type: Accesslevel (joomla)-->
                <field name="access"
                       type="accesslevel"
                       label="JFIELD_ACCESS_LABEL"
                       description="JFIELD_ACCESS_DESC"
                       default="1"
                       required="false" />
                <!-- Ordering Field. Type: Numbers (joomla)-->
                <field name="ordering"
                       type="number"
                       class="inputbox validate-ordering"
                      
label="COM_RESERVATION_SICK_ORDERING_LABEL"
                       description=""
                       default="0"
                       size="6"
                       required="false" />
                <!-- Version Field. Type: Text (joomla)-->
                <field name="version"
                       type="text"
                       class="readonly"
                       label="COM_RESERVATION_SICK_VERSION_LABEL"
                      
description="COM_RESERVATION_SICK_VERSION_DESC"
                       size="6"
                       readonly="true"
                       filter="unset" />
                <!-- Was added due to Permissions JS needing a Title
field-->
                <!-- Let us know at gh-629 should this change-->
                <!--
https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235-->
                <field name="title"
                       type="hidden"
                       default="reservation sick" />
                <!-- Dynamic Fields.-->
                <!-- Userid Field. Type: User. (joomla)-->
                <field type="user"
                       name="userid"
                       label="COM_RESERVATION_SICK_USERID_LABEL"
                      
description="COM_RESERVATION_SICK_USERID_DESCRIPTION"
                       class="form-control"
                       required="true" />
                <!-- Phonenumber Field. Type: Text. (joomla)-->
                <field type="text"
                       name="phonenumber"
                      
label="COM_RESERVATION_SICK_PHONENUMBER_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_SICK_PHONENUMBER_DESCRIPTION"
                       class="text_area form-control"
                       readonly="false"
                       disabled="false"
                       required="true"
                       validated="tel"
                      
message="COM_RESERVATION_SICK_PHONENUMBER_MESSAGE"
                       validate="mobile" />
                <!-- Capitalid Field. Type: Capital. (custom)-->
                <field type="capital"
                       name="capitalid"
                      
label="COM_RESERVATION_SICK_CAPITALID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Cityid Field. Type: City. (custom)-->
                <field type="city"
                       name="cityid"
                       label="COM_RESERVATION_SICK_CITYID_LABEL"
                       class="list_class"
                       multiple="false"
                       default="0" />
                <!-- Image Field. Type: Media. (joomla)-->
                <field type="media"
                       name="image"
                       label="COM_RESERVATION_SICK_IMAGE_LABEL"
                       directory="" />
                <!-- Cardnumber Field. Type: Text. (joomla)-->
                <field type="text"
                       name="cardnumber"
                      
label="COM_RESERVATION_SICK_CARDNUMBER_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_SICK_CARDNUMBER_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="INTEGER"
                      
message="COM_RESERVATION_SICK_CARDNUMBER_MESSAGE"
                       autocomplete="on" />
                <!-- Alt Field. Type: Text. (joomla)-->
                <field type="text"
                       name="alt"
                       label="COM_RESERVATION_SICK_ALT_LABEL"
                       size="10"
                       maxlength="50"
                       default=""
                      
description="COM_RESERVATION_SICK_ALT_DESCRIPTION"
                       class="text_area"
                       readonly="false"
                       disabled="false"
                       required="false"
                       filter="STRING"
                       message="COM_RESERVATION_SICK_ALT_MESSAGE"
                       autocomplete="on" />
        </fieldset>
	
	<!-- Access Control Fields. -->
	<fieldset name="accesscontrol">
		<!-- Asset Id Field. Type: Hidden (joomla) -->
		<field
			name="asset_id"
			type="hidden"
			filter="unset"
		/>
		<!-- Rules Field. Type: Rules (joomla) -->
		<field
			name="rules"
			type="rules"
			label="Permissions in relation to this sick"
			translate_label="false"
			filter="rules"
			validate="rules"
			class="inputbox"
			component="com_reservation"
			section="sick"
		/>
	</fieldset>
</form><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		import.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;

/**
 * Reservation Import Model
 */
class ReservationModelImport extends JModelLegacy
{
	// set uploading values
	protected $use_streams = false;
	protected $allow_unsafe = false;
	protected $safeFileOptions = array();
	
	/**
	 * @var object JTable object
	 */
	protected $_table = null;

	/**
	 * @var object JTable object
	 */
	protected $_url = null;

	/**
	 * Model context string.
	 *
	 * @var        string
	 */
	protected $_context = 'com_reservation.import';
	
	/**
	 * Import Settings
	 */
	protected $getType 	= NULL;
	protected $dataType	= NULL;
	
	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @return  void
	 *
	 */
	protected function populateState()
	{
		$app = JFactory::getApplication('administrator');

		$this->setState('message',
$app->getUserState('com_reservation.message'));
		$app->setUserState('com_reservation.message', '');

		// Recall the 'Import from Directory' path.
		$path = $app->getUserStateFromRequest($this->_context .
'.import_directory', 'import_directory',
$app->get('tmp_path'));
		$this->setState('import.directory', $path);
		parent::populateState();
	}

	/**
	 * Import an spreadsheet from either folder, url or upload.
	 *
	 * @return  boolean result of import
	 *
	 */
	public function import()
	{
		$this->setState('action', 'import');
		$app = JFactory::getApplication();
		$session = JFactory::getSession();
		$package = null;
		$continue = false;
		// get import type
		$this->getType = $app->input->getString('gettype',
NULL);
		// get import type
		$this->dataType	=
$session->get('dataType_VDM_IMPORTINTO', NULL);

		if ($package === null)
		{
			switch ($this->getType)
			{
				case 'folder':
					// Remember the 'Import from Directory' path.
					$app->getUserStateFromRequest($this->_context .
'.import_directory', 'import_directory');
					$package = $this->_getPackageFromFolder();
					break;

				case 'upload':
					$package = $this->_getPackageFromUpload();
					break;

				case 'url':
					$package = $this->_getPackageFromUrl();
					break;

				case 'continue':
					$continue 	= true;
					$package	= $session->get('package', null);
					$package	= json_decode($package, true);
					// clear session
					$session->clear('package');
					$session->clear('dataType');
					$session->clear('hasPackage');
					break;

				default:
					$app->setUserState('com_reservation.message',
JText::_('COM_RESERVATION_IMPORT_NO_IMPORT_TYPE_FOUND'));

					return false;
					break;
			}
		}
		// Was the package valid?
		if (!$package || !$package['type'])
		{
			if (in_array($this->getType, array('upload',
'url')))
			{
				$this->remove($package['packagename']);
			}

			$app->setUserState('com_reservation.message',
JText::_('COM_RESERVATION_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
			return false;
		}
		
		// first link data to table headers
		if(!$continue){
			$package = json_encode($package);
			$session->set('package', $package);
			$session->set('dataType', $this->dataType);
			$session->set('hasPackage', true);
			return true;
		}
        
		// set the data
		$headerList =
json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS',
false), true);
		if (!$this->setData($package,$this->dataType,$headerList))
		{
			// There was an error importing the package
			$msg = JText::_('COM_RESERVATION_IMPORT_ERROR');
			$back = $session->get('backto_VDM_IMPORT', NULL);
			if ($back)
			{
				$app->setUserState('com_reservation.redirect_url',
'index.php?option=com_reservation&view='.$back);
				$session->clear('backto_VDM_IMPORT');
			}
			$result = false;
		}
		else
		{
			// Package imported sucessfully
			$msg = JText::sprintf('COM_RESERVATION_IMPORT_SUCCESS',
$package['packagename']);
			$back = $session->get('backto_VDM_IMPORT', NULL);
			if ($back)
			{
			    $app->setUserState('com_reservation.redirect_url',
'index.php?option=com_reservation&view='.$back);
			    $session->clear('backto_VDM_IMPORT');
			}
			$result = true;
		}

		// Set some model state values
		$app->enqueueMessage($msg);

		// remove file after import
		$this->remove($package['packagename']);
		$session->clear($this->getType.'_VDM_IMPORTHEADERS');
        
		return $result;
	}

	/**
	 * Works out an importation spreadsheet from a HTTP upload
	 *
	 * @return spreadsheet definition or false on failure
	 */
	protected function _getPackageFromUpload()
	{		
		// Get the uploaded file information
		$app = JFactory::getApplication();
		$input = $app->input;

		// Do not change the filter type 'raw'. We need this to let
files containing PHP code to upload. See JInputFiles::get.
		$userfile = $input->files->get('import_package', null,
'raw');
		
		// Make sure that file uploads are enabled in php
		if (!(bool) ini_get('file_uploads'))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_WARNIMPORTFILE'),
'warning');
			return false;
		}

		// If there is no uploaded file, we have a problem...
		if (!is_array($userfile))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_NO_FILE_SELECTED'),
'warning');
			return false;
		}

		// Check if there was a problem uploading the file.
		if ($userfile['error'] || $userfile['size'] < 1)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_WARNIMPORTUPLOADERROR'),
'warning');
			return false;
		}

		// Build the appropriate paths
		$config = JFactory::getConfig();
		$tmp_dest = $config->get('tmp_path') . '/' .
$userfile['name'];
		$tmp_src = $userfile['tmp_name'];

		// Move uploaded file
		jimport('joomla.filesystem.file');
		$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams,
$this->allow_unsafe, $this->safeFileOptions);

		// Was the package downloaded?
		if (!$p_file)
		{
			$session = JFactory::getSession();
			$session->clear('package');
			$session->clear('dataType');
			$session->clear('hasPackage');
			// was not uploaded
			return false;
		}

		// check that this is a valid spreadsheet
		$package = $this->check($userfile['name']);

		return $package;
	}

	/**
	 * Import an spreadsheet from a directory
	 *
	 * @return  array  Spreadsheet details or false on failure
	 *
	 */
	protected function _getPackageFromFolder()
	{
		$app = JFactory::getApplication();
		$input = $app->input;

		// Get the path to the package to import
		$p_dir = $input->getString('import_directory');
		$p_dir = JPath::clean($p_dir);
		// Did you give us a valid path?
		if (!file_exists($p_dir))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'),
'warning');
			return false;
		}

		// Detect the package type
		$type = $this->getType;

		// Did you give us a valid package?
		if (!$type)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'),
'warning');
		}
		
		// check the extention
		if(!$this->checkExtension($p_dir))
		{
			// set error message
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'),
'warning');
			return false;
		}
		
		$package['packagename'] = null;
		$package['dir'] = $p_dir;
		$package['type'] = $type;

		return $package;
	}

	/**
	 * Import an spreadsheet from a URL
	 *
	 * @return  Package details or false on failure
	 *
	 */
	protected function _getPackageFromUrl()
	{
		$app = JFactory::getApplication();
		$input = $app->input;
		
		// Get the URL of the package to import
		$url = $input->getString('import_url');

		// Did you give us a URL?
		if (!$url)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_ENTER_A_URL'),
'warning');
			return false;
		}

		// Download the package at the URL given
		$p_file = JInstallerHelper::downloadPackage($url);

		// Was the package downloaded?
		if (!$p_file)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_INVALID_URL'),
'warning');
			return false;
		}

		// check that this is a valid spreadsheet
		$package = $this->check($p_file);

		return $package;
	}
	
	/**
	 * Check a file and verifies it as a spreadsheet file
	 * Supports .csv .xlsx .xls and .ods
	 *
	 * @param   string  $p_filename  The uploaded package filename or import
directory
	 *
	 * @return  array  of elements
	 *
	 */
	protected function check($archivename)
	{
		$app = JFactory::getApplication();
		// Clean the name
		$archivename = JPath::clean($archivename);
		
		// check the extention
		if(!$this->checkExtension($archivename))
		{
			// Cleanup the import files
			$this->remove($archivename);
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'),
'warning');
			return false;
		}
		
		$config = JFactory::getConfig();
		// set Package Name
		$check['packagename'] = $archivename;
		
		// set directory
		$check['dir'] = $config->get('tmp_path').
'/' .$archivename;
		
		// set type
		$check['type'] = $this->getType;
		
		return $check;
	}

	/**
	 * Check the extension
	 *
	 * @param   string  $file    Name of the uploaded file
	 *
	 * @return  boolean  True on success
	 *
	 */
	protected function checkExtension($file)
	{
		// check the extention
		switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
		{
			case 'xls':
			case 'ods':
			case 'csv':
			return true;
			break;
		}
		return false;
	}

	/**
	 * Clean up temporary uploaded spreadsheet
	 *
	 * @param   string  $package    Name of the uploaded spreadsheet file
	 *
	 * @return  boolean  True on success
	 *
	 */
	protected function remove($package)
	{
		jimport('joomla.filesystem.file');
		
		$config = JFactory::getConfig();
		$package = $config->get('tmp_path'). '/'
.$package;

		// Is the package file a valid file?
		if (is_file($package))
		{
			File::delete($package);
		}
		elseif (is_file(JPath::clean($package)))
		{
			// It might also be just a base filename
			File::delete(JPath::clean($package));
		}
	}

	/**
	* Set the data from the spreadsheet to the database
	*
	* @param string  $package Paths to the uploaded package file
	*
	* @return  boolean false on failure
	*
	**/
	protected function setData($package,$table,$target_headers)
	{
		if (ReservationHelper::checkArray($target_headers))
		{
			// make sure the file is loaded
			ReservationHelper::composerAutoload('phpspreadsheet');
			$jinput = JFactory::getApplication()->input;
			foreach($target_headers as $header)
			{
				if (($column = $jinput->getString($header, false)) !== false ||
					($column = $jinput->getString(strtolower($header), false)) !==
false)
				{
					$data['target_headers'][$header] = $column;
				}
				else
				{
					$data['target_headers'][$header] = null;
				}
			}
			// set the data
			if(isset($package['dir']))
			{
				$inputFileType = IOFactory::identify($package['dir']);
				$excelReader = IOFactory::createReader($inputFileType);
				$excelReader->setReadDataOnly(true);
				$excelObj = $excelReader->load($package['dir']);
				$data['array'] =
$excelObj->getActiveSheet()->toArray(null, true,true,true);
				$excelObj->disconnectWorksheets();
				unset($excelObj);
				return $this->save($data, $table);
			}
		}
		return false;
	}

	/**
	* Save the data from the file to the database
	*
	* @param string  $package Paths to the uploaded package file
	*
	* @return  boolean false on failure
	*
	**/
	protected function save($data,$table)
	{
		// import the data if there is any
		if(ReservationHelper::checkArray($data['array']))
		{
			// get user object
			$user		= JFactory::getUser();
			// remove header if it has headers
			$id_key	= $data['target_headers']['id'];
			$published_key	=
$data['target_headers']['published'];
			$ordering_key	= $data['target_headers']['ordering'];
			// get the first array set
			$firstSet = reset($data['array']);

			// check if first array is a header array and remove if true
			if($firstSet[$id_key] == 'id' || $firstSet[$published_key] ==
'published' || $firstSet[$ordering_key] == 'ordering')
			{
				array_shift($data['array']);
			}
			
			// make sure there is still values in array and that it was not only
headers
			if(ReservationHelper::checkArray($data['array']) &&
$user->authorise($table.'.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
			{
				// set target.
				$target	= array_flip($data['target_headers']);
				// Get a db connection.
				$db = JFactory::getDbo();
				// set some defaults
				$todayDate		= JFactory::getDate()->toSql();
				// get global action permissions
				$canDo			= ReservationHelper::getActions($table);
				$canEdit		= $canDo->get('core.edit');
				$canState		= $canDo->get('core.edit.state');
				$canCreate		= $canDo->get('core.create');
				$hasAlias		= $this->getAliasesUsed($table);
				// prosses the data
				foreach($data['array'] as $row)
				{
					$found = false;
					if (isset($row[$id_key]) && is_numeric($row[$id_key])
&& $row[$id_key] > 0)
					{
						// raw items import & update!
						$query = $db->getQuery(true);
						$query
							->select('version')
							->from($db->quoteName('#__reservation_'.$table))
							->where($db->quoteName('id') . ' = '.
$db->quote($row[$id_key]));
						// Reset the query using our newly populated query object.
						$db->setQuery($query);
						$db->execute();
						$found = $db->getNumRows();
					}
					
					if($found && $canEdit)
					{
						// update item
						$id		= $row[$id_key];
						$version	= $db->loadResult();
						// reset all buckets
						$query		= $db->getQuery(true);
						$fields	= array();
						// Fields to update.
						foreach($row as $key => $cell)
						{
							// ignore column
							if ('IGNORE' == $target[$key])
							{
								continue;
							}
							// update modified
							if ('modified_by' == $target[$key])
							{
								continue;
							}
							// update modified
							if ('modified' == $target[$key])
							{
								continue;
							}
							// update version
							if ('version' == $target[$key])
							{
								$cell = (int) $version + 1;
							}
							// verify publish authority
							if ('published' == $target[$key] && !$canState)
							{
								continue;
							}
							// set to update array
							if(in_array($key, $data['target_headers']) &&
is_numeric($cell))
							{
								$fields[] = $db->quoteName($target[$key]) . ' = ' .
$cell;
							}
							elseif(in_array($key, $data['target_headers']) &&
is_string($cell))
							{
								$fields[] = $db->quoteName($target[$key]) . ' = ' .
$db->quote($cell);
							}
							elseif(in_array($key, $data['target_headers']) &&
is_null($cell))
							{
								// if import data is null then set empty
								$fields[] = $db->quoteName($target[$key]) . " =
''";
							}
						}
						// load the defaults
						$fields[]	= $db->quoteName('modified_by') . ' =
' . $db->quote($user->id);
						$fields[]	= $db->quoteName('modified') . ' = '
. $db->quote($todayDate);
						// Conditions for which records should be updated.
						$conditions = array(
							$db->quoteName('id') . ' = ' . $id
						);
						
						$query->update($db->quoteName('#__reservation_'.$table))->set($fields)->where($conditions);
						$db->setQuery($query);
						$db->execute();
					}
					elseif ($canCreate)
					{
						// insert item
						$query = $db->getQuery(true);
						// reset all buckets
						$columns	= array();
						$values	= array();
						$version	= false;
						// Insert columns. Insert values.
						foreach($row as $key => $cell)
						{
							// ignore column
							if ('IGNORE' == $target[$key])
							{
								continue;
							}
							// remove id
							if ('id' == $target[$key])
							{
								continue;
							}
							// update created
							if ('created_by' == $target[$key])
							{
								continue;
							}
							// update created
							if ('created' == $target[$key])
							{
								continue;
							}
							// Make sure the alias is incremented
							if ('alias' == $target[$key])
							{
								$cell = $this->getAlias($cell,$table);
							}
							// update version
							if ('version' == $target[$key])
							{
								$cell = 1;
								$version = true;
							}
							// set to insert array
							if(in_array($key, $data['target_headers']) &&
is_numeric($cell))
							{
								$columns[]	= $target[$key];
								$values[]	= $cell;
							}
							elseif(in_array($key, $data['target_headers']) &&
is_string($cell))
							{
								$columns[]	= $target[$key];
								$values[]	= $db->quote($cell);
							}
							elseif(in_array($key, $data['target_headers']) &&
is_null($cell))
							{
								// if import data is null then set empty
								$columns[]	= $target[$key];
								$values[]	= "''";
							}
						}
						// load the defaults
						$columns[]	= 'created_by';
						$values[]	= $db->quote($user->id);
						$columns[]	= 'created';
						$values[]	= $db->quote($todayDate);
						if (!$version)
						{
							$columns[]	= 'version';
							$values[]	= 1;
						}
						// Prepare the insert query.
						$query
							->insert($db->quoteName('#__reservation_'.$table))
							->columns($db->quoteName($columns))
							->values(implode(',', $values));
						// Set the query using our newly populated query object and execute
it.
						$db->setQuery($query);
						$done = $db->execute();
						if ($done)
						{
							$aId = $db->insertid();
							// make sure the access of asset is set
							ReservationHelper::setAsset($aId,$table);
						}
					}
					else
					{
						return false;
					}
				}
				return true;
			}
		}
		return false;
	}

	protected function getAlias($name,$type = false)
	{
		// sanitize the name to an alias
		if (JFactory::getConfig()->get('unicodeslugs') == 1)
		{
			$alias = JFilterOutput::stringURLUnicodeSlug($name);
		}
		else
		{
			$alias = JFilterOutput::stringURLSafe($name);
		}
		// must be a uniqe alias
		if ($type)
		{
			return $this->getUniqe($alias,'alias',$type);
		}
		return $alias;
	}
	
	/**
	 * Method to generate a uniqe value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 * @param   string  $type table.
	 *
	 * @return  string  New value.
	 */
	protected function getUniqe($value,$field,$type)
	{
		// insure the filed is always uniqe
		while (isset($this->uniqeValueArray[$type][$field][$value]))
		{
			$value = JString::increment($value, 'dash');
		}
		$this->uniqeValueArray[$type][$field][$value] = $value;
		return $value;
	}
	
	protected function getAliasesUsed($table)
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// first we check if there is a alias column
		$columns = $db->getTableColumns('#__reservation_'.$table);
		if(isset($columns['alias'])){
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('alias')));
			$query->from($db->quoteName('#__reservation_'.$table));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$aliases = $db->loadColumn();
				foreach($aliases as $alias)
				{
					$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
				}
			}
			return true;
		}
		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.30
	@build			6th March, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		import_reserves.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;

/**
 * Reservation Import_reserves Model
 */
class ReservationModelImport_reserves extends JModelLegacy
{
	// set uploading values
	protected $use_streams = false;
	protected $allow_unsafe = false;
	protected $safeFileOptions = array();
	
	/**
	 * @var object JTable object
	 */
	protected $_table = null;

	/**
	 * @var object JTable object
	 */
	protected $_url = null;

	/**
	 * Model context string.
	 *
	 * @var        string
	 */
	protected $_context = 'com_reservation.import_reserves';
	
	/**
	 * Import Settings
	 */
	protected $getType = NULL;
	protected $dataType = NULL;
	
	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @return  void
	 *
	 */
	protected function populateState()
	{
		$app = JFactory::getApplication('administrator');

		$this->setState('message',
$app->getUserState('com_reservation.message'));
		$app->setUserState('com_reservation.message',
'');

		// Recall the 'Import from Directory' path.
		$path = $app->getUserStateFromRequest($this->_context .
'.import_directory', 'import_directory',
$app->get('tmp_path'));
		$this->setState('import.directory', $path);
		parent::populateState();
	}
	

/***[JCBGUI.admin_view.php_import.127.$$$$]***/
	/**
	 * Import an spreadsheet from either folder, url or upload.
	 *
	 * @return  boolean result of import
	 *
	 */
	public function import()
	{
		$this->setState('action', 'import');
		$app		= JFactory::getApplication();
		$session	= JFactory::getSession();
		$package	= null;
		$continue	= false;
		// get import type
		$this->getType = $app->input->getString('gettype',
NULL);
		// get import type
		$this->dataType	=
$session->get('dataType_VDM_IMPORTINTO', NULL);

		if ($package === null)
		{
			switch ($this->getType)
			{
				case 'folder':
					// Remember the 'Import from Directory' path.
					$app->getUserStateFromRequest($this->_context .
'.import_directory', 'import_directory');
					$package = $this->_getPackageFromFolder();
					break;

				case 'upload':
					$package = $this->_getPackageFromUpload();
					break;

				case 'url':
					$package = $this->_getPackageFromUrl();
					break;

				case 'continue':
					$continue	= true;
					$package	= $session->get('package', null);
					$package	= json_decode($package, true);
					// clear session
					$session->clear('package');
					$session->clear('dataType');
					$session->clear('hasPackage');
					break;

				default:
					$app->setUserState('com_reservation.message',
JText::_('COM_RESERVATION_IMPORT_NO_IMPORT_TYPE_FOUND'));

					return false;
					break;
			}
		}
		// Was the package valid?
		if (!$package || !$package['type'])
		{
			if (in_array($this->getType, array('upload',
'url')))
			{
				$this->remove($package['packagename']);
			}

			$app->setUserState('com_reservation.message',
JText::_('COM_RESERVATION_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
			return false;
		}
		
		// first link data to table headers
		if(!$continue){
			$package	= json_encode($package);
			$session->set('package', $package);
			$session->set('dataType', $this->dataType);
			$session->set('hasPackage', true);
			return true;
		}
		// set the data
		$headerList =
json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS',
false), true);
		if (!$this->setData($package,$this->dataType,$headerList))
		{
			// There was an error importing the package
			$msg = JText::_('COM_RESERVATION_IMPORT_ERROR');
			$back = $session->get('backto_VDM_IMPORT', NULL);
			if ($back)
			{
				$app->setUserState('com_reservation.redirect_url',
'index.php?option=com_reservation&view='.$back);
				$session->clear('backto_VDM_IMPORT');
			}
			$result = false;
		}
		else
		{
			// Package imported sucessfully
			$msg = JText::sprintf('COM_RESERVATION_IMPORT_SUCCESS',
$package['packagename']);
			$back = $session->get('backto_VDM_IMPORT', NULL);
			if ($back)
			{
				$app->setUserState('com_reservation.redirect_url',
'index.php?option=com_reservation&view='.$back);
				$session->clear('backto_VDM_IMPORT');
			}
			$result = true;
		}

		// Set some model state values
		$app->enqueueMessage($msg);

		// remove file after import
		$this->remove($package['packagename']);
		$session->clear($this->getType.'_VDM_IMPORTHEADERS');
		return $result;
	}/***[/JCBGUI$$$$]***/
 

	/**
	 * Works out an importation spreadsheet from a HTTP upload
	 *
	 * @return spreadsheet definition or false on failure
	 */
	protected function _getPackageFromUpload()
	{		
		// Get the uploaded file information
		$app = JFactory::getApplication();
		$input = $app->input;

		// Do not change the filter type 'raw'. We need this to let
files containing PHP code to upload. See JInputFiles::get.
		$userfile = $input->files->get('import_package', null,
'raw');
		
		// Make sure that file uploads are enabled in php
		if (!(bool) ini_get('file_uploads'))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_WARNIMPORTFILE'),
'warning');
			return false;
		}

		// If there is no uploaded file, we have a problem...
		if (!is_array($userfile))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_NO_FILE_SELECTED'),
'warning');
			return false;
		}

		// Check if there was a problem uploading the file.
		if ($userfile['error'] || $userfile['size'] < 1)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_WARNIMPORTUPLOADERROR'),
'warning');
			return false;
		}

		// Build the appropriate paths
		$config = JFactory::getConfig();
		$tmp_dest = $config->get('tmp_path') . '/' .
$userfile['name'];
		$tmp_src = $userfile['tmp_name'];

		// Move uploaded file
		jimport('joomla.filesystem.file');
		$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams,
$this->allow_unsafe, $this->safeFileOptions);

		// Was the package downloaded?
		if (!$p_file)
		{
			$session = JFactory::getSession();
			$session->clear('package');
			$session->clear('dataType');
			$session->clear('hasPackage');
			// was not uploaded
			return false;
		}

		// check that this is a valid spreadsheet
		$package = $this->check($userfile['name']);

		return $package;
	}

	/**
	 * Import an spreadsheet from a directory
	 *
	 * @return  array  Spreadsheet details or false on failure
	 *
	 */
	protected function _getPackageFromFolder()
	{
		$app = JFactory::getApplication();
		$input = $app->input;

		// Get the path to the package to import
		$p_dir = $input->getString('import_directory');
		$p_dir = JPath::clean($p_dir);
		// Did you give us a valid path?
		if (!file_exists($p_dir))
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'),
'warning');
			return false;
		}

		// Detect the package type
		$type = $this->getType;

		// Did you give us a valid package?
		if (!$type)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'),
'warning');
		}
		
		// check the extention
		if(!$this->checkExtension($p_dir))
		{
			// set error message
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'),
'warning');
			return false;
		}
		
		$package['packagename'] = null;
		$package['dir'] = $p_dir;
		$package['type'] = $type;

		return $package;
	}

	/**
	 * Import an spreadsheet from a URL
	 *
	 * @return  Package details or false on failure
	 *
	 */
	protected function _getPackageFromUrl()
	{
		$app = JFactory::getApplication();
		$input = $app->input;

		// Get the URL of the package to import
		$url = $input->getString('import_url');

		// Did you give us a URL?
		if (!$url)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_ENTER_A_URL'),
'warning');
			return false;
		}

		// Download the package at the URL given
		$p_file = JInstallerHelper::downloadPackage($url);

		// Was the package downloaded?
		if (!$p_file)
		{
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_INVALID_URL'),
'warning');
			return false;
		}

		// check that this is a valid spreadsheet
		$package = $this->check($p_file);

		return $package;
	}
	
	/**
	 * Check a file and verifies it as a spreadsheet file
	 * Supports .csv .xlsx .xls and .ods
	 *
	 * @param   string  $p_filename  The uploaded package filename or import
directory
	 *
	 * @return  array  of elements
	 *
	 */
	protected function check($archivename)
	{
		$app = JFactory::getApplication();
		// Clean the name
		$archivename = JPath::clean($archivename);
		
		// check the extention
		if(!$this->checkExtension($archivename))
		{
			// Cleanup the import files
			$this->remove($archivename);
			$app->enqueueMessage(JText::_('COM_RESERVATION_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'),
'warning');
			return false;
		}
		
		$config = JFactory::getConfig();
		// set Package Name
		$check['packagename'] = $archivename;
		
		// set directory
		$check['dir'] = $config->get('tmp_path').
'/' .$archivename;
		
		// set type
		$check['type'] = $this->getType;
		
		return $check;
	}
	

/***[JCBGUI.admin_view.php_import_ext.127.$$$$]***/
	/**
	 * Check the extension
	 *
	 * @param   string  $file    Name of the uploaded file
	 *
	 * @return  boolean  True on success
	 *
	 */
	protected function checkExtension($file)
	{
		// check the extention
		switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
		{
			case 'xls':
			case 'ods':
			case 'csv':
			return true;
			break;
		}
		return false;
	}/***[/JCBGUI$$$$]***/


	/**
	 * Clean up temporary uploaded spreadsheet
	 *
	 * @param   string  $package    Name of the uploaded spreadsheet file
	 *
	 * @return  boolean  True on success
	 *
	 */
	protected function remove($package)
	{
		jimport('joomla.filesystem.file');
		
		$config = JFactory::getConfig();
		$package = $config->get('tmp_path'). '/'
.$package;

		// Is the package file a valid file?
		if (is_file($package))
		{
			JFile::delete($package);
		}
		elseif (is_file(JPath::clean($package)))
		{
			// It might also be just a base filename
			JFile::delete(JPath::clean($package));
		}
	}
	

/***[JCBGUI.admin_view.php_import_setdata.127.$$$$]***/
	/**
	* Set the data from the spreadsheet to the database
	*
	* @param string  $package Paths to the uploaded package file
	*
	* @return  boolean false on failure
	*
	**/
	protected function setData($package,$table,$target_headers)
	{
		if (ReservationHelper::checkArray($target_headers))
		{
			// make sure the file is loaded
			ReservationHelper::composerAutoload('phpspreadsheet');
			$jinput = JFactory::getApplication()->input;
			foreach($target_headers as $header)
			{
				if (($column = $jinput->getString($header, false)) !== false ||
					($column = $jinput->getString(strtolower($header), false)) !==
false)
				{
					$data['target_headers'][$header] = $column;
				}
				else
				{
					$data['target_headers'][$header] = null;
				}
			}
			// set the data
			if(isset($package['dir']))
			{
				$inputFileType = IOFactory::identify($package['dir']);
				$excelReader = IOFactory::createReader($inputFileType);
				$excelReader->setReadDataOnly(true);
				$excelObj = $excelReader->load($package['dir']);
				$data['array'] =
$excelObj->getActiveSheet()->toArray(null, true,true,true);
				$excelObj->disconnectWorksheets();
				unset($excelObj);
				return $this->save($data, $table);
			}
		}
		return false;
	}/***[/JCBGUI$$$$]***/

	

/***[JCBGUI.admin_view.php_import_save.127.$$$$]***/
	/**
	* Save the data from the file to the database
	*
	* @param string  $package Paths to the uploaded package file
	*
	* @return  boolean false on failure
	*
	**/
	protected function save($data,$table)
	{
		// import the data if there is any
		if(ReservationHelper::checkArray($data['array']))
		{
			// get user object
			$user		= JFactory::getUser();
			// remove header if it has headers
			$id_key	= $data['target_headers']['id'];
			$published_key	=
$data['target_headers']['published'];
			$ordering_key	=
$data['target_headers']['ordering'];
			// get the first array set
			$firstSet = reset($data['array']);

			// check if first array is a header array and remove if true
			if($firstSet[$id_key] == 'id' || $firstSet[$published_key] ==
'published' || $firstSet[$ordering_key] == 'ordering')
			{
				array_shift($data['array']);
			}
			
			// make sure there is still values in array and that it was not only
headers
			if(ReservationHelper::checkArray($data['array']) &&
$user->authorise($table.'.import',
'com_reservation') &&
$user->authorise('core.import', 'com_reservation'))
			{
				// set target.
				$target	= array_flip($data['target_headers']);
				// Get a db connection.
				$db = JFactory::getDbo();
				// set some defaults
				$todayDate		= JFactory::getDate()->toSql();
				// get global action permissions
				$canDo			= ReservationHelper::getActions($table);
				$canEdit		= $canDo->get('core.edit');
				$canState		= $canDo->get('core.edit.state');
				$canCreate		= $canDo->get('core.create');
				$hasAlias		= $this->getAliasesUsed($table);
				// prosses the data
				foreach($data['array'] as $row)
				{
					$found = false;
					if (isset($row[$id_key]) && is_numeric($row[$id_key])
&& $row[$id_key] > 0)
					{
						// raw items import & update!
						$query = $db->getQuery(true);
						$query
							->select('version')
							->from($db->quoteName('#__reservation_'.$table))
							->where($db->quoteName('id') . ' = '.
$db->quote($row[$id_key]));
						// Reset the query using our newly populated query object.
						$db->setQuery($query);
						$db->execute();
						$found = $db->getNumRows();
					}
					
					if($found && $canEdit)
					{
						// update item
						$id		= $row[$id_key];
						$version	= $db->loadResult();
						// reset all buckets
						$query		= $db->getQuery(true);
						$fields	= array();
						// Fields to update.
						foreach($row as $key => $cell)
						{
							// ignore column
							if ('IGNORE' == $target[$key])
							{
								continue;
							}
							// update modified
							if ('modified_by' == $target[$key])
							{
								continue;
							}
							// update modified
							if ('modified' == $target[$key])
							{
								continue;
							}
							// update version
							if ('version' == $target[$key])
							{
								$cell = (int) $version + 1;
							}
							// verify publish authority
							if ('published' == $target[$key] && !$canState)
							{
								continue;
							}
							// set to update array
							if(in_array($key, $data['target_headers']) &&
is_numeric($cell))
							{
								$fields[] = $db->quoteName($target[$key]) . ' = ' .
$cell;
							}
							elseif(in_array($key, $data['target_headers']) &&
is_string($cell))
							{
								$fields[] = $db->quoteName($target[$key]) . ' = ' .
$db->quote($cell);
							}
							elseif(in_array($key, $data['target_headers']) &&
is_null($cell))
							{
								// if import data is null then set empty
								$fields[] = $db->quoteName($target[$key]) . " =
''";
							}
						}
						// load the defaults
						$fields[]	= $db->quoteName('modified_by') . ' =
' . $db->quote($user->id);
						$fields[]	= $db->quoteName('modified') . ' = '
. $db->quote($todayDate);
						// Conditions for which records should be updated.
						$conditions = array(
							$db->quoteName('id') . ' = ' . $id
						);
						
						$query->update($db->quoteName('#__reservation_'.$table))->set($fields)->where($conditions);
						$db->setQuery($query);
						$db->execute();
					}
					elseif ($canCreate)
					{
						// insert item
						$query = $db->getQuery(true);
						// reset all buckets
						$columns	= array();
						$values	= array();
						$version	= false;
						// Insert columns. Insert values.
						foreach($row as $key => $cell)
						{
							// ignore column
							if ('IGNORE' == $target[$key])
							{
								continue;
							}
							// remove id
							if ('id' == $target[$key])
							{
								continue;
							}
							// update created
							if ('created_by' == $target[$key])
							{
								continue;
							}
							// update created
							if ('created' == $target[$key])
							{
								continue;
							}
							// Make sure the alias is incremented
							if ('alias' == $target[$key])
							{
								$cell = $this->getAlias($cell,$table);
							}
							// update version
							if ('version' == $target[$key])
							{
								$cell = 1;
								$version = true;
							}
							// set to insert array
							if(in_array($key, $data['target_headers']) &&
is_numeric($cell))
							{
								$columns[]	= $target[$key];
								$values[]	= $cell;
							}
							elseif(in_array($key, $data['target_headers']) &&
is_string($cell))
							{
								$columns[]	= $target[$key];
								$values[]	= $db->quote($cell);
							}
							elseif(in_array($key, $data['target_headers']) &&
is_null($cell))
							{
								// if import data is null then set empty
								$columns[]	= $target[$key];
								$values[]	= "''";
							}
						}
						// load the defaults
						$columns[]	= 'created_by';
						$values[]	= $db->quote($user->id);
						$columns[]	= 'created';
						$values[]	= $db->quote($todayDate);
						if (!$version)
						{
							$columns[]	= 'version';
							$values[]	= 1;
						}
						// Prepare the insert query.
						$query
							->insert($db->quoteName('#__reservation_'.$table))
							->columns($db->quoteName($columns))
							->values(implode(',', $values));
						// Set the query using our newly populated query object and execute
it.
						$db->setQuery($query);
						$done = $db->execute();
						if ($done)
						{
							$aId = $db->insertid();
							// make sure the access of asset is set
							ReservationHelper::setAsset($aId,$table);
						}
					}
					else
					{
						return false;
					}
				}
				return true;
			}
		}
		return false;
	}/***[/JCBGUI$$$$]***/


	protected function getAlias($name,$type = false)
	{
		// sanitize the name to an alias
		if (JFactory::getConfig()->get('unicodeslugs') == 1)
		{
			$alias = JFilterOutput::stringURLUnicodeSlug($name);
		}
		else
		{
			$alias = JFilterOutput::stringURLSafe($name);
		}
		// must be a uniqe alias
		if ($type)
		{
			return $this->getUniqe($alias,'alias',$type);
		}
		return $alias;
	}
	
	/**
	 * Method to generate a uniqe value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 * @param   string  $type table.
	 *
	 * @return  string  New value.
	 */
	protected function getUniqe($value,$field,$type)
	{
		// insure the filed is always uniqe
		while (isset($this->uniqeValueArray[$type][$field][$value]))
		{
			$value = JString::increment($value, 'dash');
		}
		$this->uniqeValueArray[$type][$field][$value] = $value;
		return $value;
	}
	
	protected function getAliasesUsed($table)
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// first we check if there is a alias column
		$columns = $db->getTableColumns('#__reservation_'.$table);
		if(isset($columns['alias'])){
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('alias')));
			$query->from($db->quoteName('#__reservation_'.$table));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$aliases = $db->loadColumn();
				foreach($aliases as $alias)
				{
					$this->uniqeValueArray[$table]['alias'][$alias] =
$alias;
				}
			}
			return true;
		}
		return false;
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		message.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Message Model
 */
class ReservationModelMessage extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'from',
				'reply',
				'message',
				'seid'
			),
			'right' => array(
				'to',
				'read',
				'seen'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.message';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'message', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.message',
'message', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.message.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/message.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.message.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.message.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.message.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_message'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.message.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.message', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('message');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('message');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('message');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}

		// Set the empty read item to data
		if (!isset($data['read']))
		{
			$data['read'] = '';
		}

		// Set the empty seen item to data
		if (!isset($data['seen']))
		{
			$data['seen'] = '';
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		messages.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Messages Model
 */
class ReservationModelMessages extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

/***[JCBGUI.admin_view.php_getitems_after_all.111.$$$$]***/
 // Get a db connection.
        $db = JFactory::getDbo();

        // Create a new query object.
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.phoneNumber','b.name'),array('phoneNumber','name')))
            ->from($db->quoteName('#__reservation_sick',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('phoneNumber');

        foreach ($items as &$item) {
            $item->sickid_phonenumber=
$result[$item->sickid_phonenumber]['name'];
        }


        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query
           
->select($db->quoteName(array('a.id','a.planType','a.time','a.price','a.plantype','u.name','c.title'),array('planId','planType','time','price','plantype','consultantName','specialty')))
            ->from($db->quoteName('#__reservation_plan',
'a'))
            ->join('INNER',
$db->quoteName('#__reservation_consultant', 'b') .
' ON ' . $db->quoteName('a.consultantId') . ' =
' . $db->quoteName('b.id'))
            ->join('INNER',
$db->quoteName('#__users', 'u') . ' ON ' .
$db->quoteName('b.userId') . ' = ' .
$db->quoteName('u.id'))
            ->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('b.catid') . ' = ' .
$db->quoteName('c.id'));

        $db->setQuery($query);

        $result = $db->loadAssocList('planId');


        $pt = array(
            1 => 'COM_RESERVATION_PLAN_TEL',
            2 => 'COM_RESERVATION_PLAN_CHAT'
        );

        $plan='';
        foreach ($items as &$item) {
            $plan .=
JText::_($pt[$result[$item->planid_id]['plantype']]);
            $plan .=
'-'.$result[$item->planid_id]['time'].'m';
            $plan .=
'-'.$result[$item->planid_id]['price'];
            $plan .=
'-'.$result[$item->planid_id]['consultantName'];
            $plan .=
'-'.$result[$item->planid_id]['specialty'];
            $item->planid_id= $plan;
           $plan='';
        }/***[/JCBGUI$$$$]***/

        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_message',
'a'));

		// From the reservation_message table.
		$query->select($db->quoteName('g.message','reply_message'));
		$query->join('LEFT',
$db->quoteName('#__reservation_message', 'g') .
' ON (' . $db->quoteName('a.reply') . ' =
' . $db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.message LIKE '.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_message table
			$query->from($db->quoteName('#__reservation_message',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}

		
/***[JCBGUI.admin_view.php_getitems_after_all.111.$$$$]***/
 // Get a db connection.
        $db = JFactory::getDbo();

        // Create a new query object.
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.phoneNumber','b.name'),array('phoneNumber','name')))
            ->from($db->quoteName('#__reservation_sick',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('phoneNumber');

        foreach ($items as &$item) {
            $item->sickid_phonenumber=
$result[$item->sickid_phonenumber]['name'];
        }


        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query
           
->select($db->quoteName(array('a.id','a.planType','a.time','a.price','a.plantype','u.name','c.title'),array('planId','planType','time','price','plantype','consultantName','specialty')))
            ->from($db->quoteName('#__reservation_plan',
'a'))
            ->join('INNER',
$db->quoteName('#__reservation_consultant', 'b') .
' ON ' . $db->quoteName('a.consultantId') . ' =
' . $db->quoteName('b.id'))
            ->join('INNER',
$db->quoteName('#__users', 'u') . ' ON ' .
$db->quoteName('b.userId') . ' = ' .
$db->quoteName('u.id'))
            ->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('b.catid') . ' = ' .
$db->quoteName('c.id'));

        $db->setQuery($query);

        $result = $db->loadAssocList('planId');


        $pt = array(
            1 => 'COM_RESERVATION_PLAN_TEL',
            2 => 'COM_RESERVATION_PLAN_CHAT'
        );

        $plan='';
        foreach ($items as &$item) {
            $plan .=
JText::_($pt[$result[$item->planid_id]['plantype']]);
            $plan .=
'-'.$result[$item->planid_id]['time'].'m';
            $plan .=
'-'.$result[$item->planid_id]['price'];
            $plan .=
'-'.$result[$item->planid_id]['consultantName'];
            $plan .=
'-'.$result[$item->planid_id]['specialty'];
            $item->planid_id= $plan;
           $plan='';
        }/***[/JCBGUI$$$$]***/

				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_message");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_message'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_message'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		order.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Order Model
 */
class ReservationModelOrder extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'sickid',
				'full_price'
			),
			'right' => array(
				'doctor_quota',
				'system_quota',
				'status'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.order';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'order', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
			
			if (!empty($item->id))
			{
				$item->tags = new JHelperTags;
				$item->tags->getTagIds($item->id,
'com_reservation.order');
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.order',
'order', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.order.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return
'administrator/components/com_reservation/models/forms/order.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.order.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.order.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.order.'. ((int) isset($data[$key]) ? $data[$key]
: 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_order'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.order.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.order', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('order');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('order');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->sickid)
&& !is_numeric($this->table->sickid))
			{
				$this->table->sickid =
$this->generateUnique('sickid',$this->table->sickid);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('order');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		orders.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Orders Model
 */
class ReservationModelOrders extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.full_price','full_price',
				'a.status','status'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$full_price = $this->getUserStateFromRequest($this->context .
'.filter.full_price', 'filter_full_price');
		if ($formSubmited)
		{
			$full_price = $app->input->post->get('full_price');
			$this->setState('filter.full_price', $full_price);
		}

		$status = $this->getUserStateFromRequest($this->context .
'.filter.status', 'filter_status');
		if ($formSubmited)
		{
			$status = $app->input->post->get('status');
			$this->setState('filter.status', $status);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

		// set selection value to a translatable value
		if (ReservationHelper::checkArray($items))
		{
			foreach ($items as $nr => &$item)
			{
				// convert status
				$item->status = $this->selectionTranslation($item->status,
'status');
			}
		}

        
		// return items
		return $items;
	}

	/**
	 * Method to convert selection values to translatable string.
	 *
	 * @return translatable string
	 */
	public function selectionTranslation($value,$name)
	{
		// Array of status language strings
		if ($name === 'status')
		{
			$statusArray = array(
				'confirmed' =>
'COM_RESERVATION_ORDER_CONFIRMED',
				'created' => 'COM_RESERVATION_ORDER_CREATED'
			);
			// Now check if value is found in this array
			if (isset($statusArray[$value]) &&
ReservationHelper::checkString($statusArray[$value]))
			{
				return $statusArray[$value];
			}
		}
		return $value;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_order',
'a'));

		// From the reservation_sick table.
		$query->select($db->quoteName('g.phonenumber','sickid_phonenumber'));
		$query->join('LEFT',
$db->quoteName('#__reservation_sick', 'g') . '
ON (' . $db->quoteName('a.sickid') . ' = ' .
$db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}

		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_order table
			$query->from($db->quoteName('#__reservation_order',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_order");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.full_price');
		$id .= ':' . $this->getState('filter.status');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_order'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_order'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Plan Model
 */
class ReservationModelPlan extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'plantype',
				'consultantid',
				'price'
			),
			'right' => array(
				'time',
				'waitingtime'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.plan';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'plan', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.plan',
'plan', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.plan.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/plan.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.plan.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.plan.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.plan.'. ((int) isset($data[$key]) ? $data[$key]
: 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_plan'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.plan.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.plan', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}


/***[JCBGUI.admin_view.php_after_publish.112.$$$$]***/
        JPluginHelper::importPlugin('reservation');
        $dispatcher = JEventDispatcher::getInstance();
        $dispatcher->trigger('onReservationPlanStateChanged',
array($pks, $value));
/***[/JCBGUI$$$$]***/

		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('plan');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('plan');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->plantype)
&& !is_numeric($this->table->plantype))
			{
				$this->table->plantype =
$this->generateUnique('plantype',$this->table->plantype);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('plan');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plans.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Plans Model
 */
class ReservationModelPlans extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.time','time',
				'a.price','price',
				'a.waitingtime','waitingtime'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$time = $this->getUserStateFromRequest($this->context .
'.filter.time', 'filter_time');
		if ($formSubmited)
		{
			$time = $app->input->post->get('time');
			$this->setState('filter.time', $time);
		}

		$price = $this->getUserStateFromRequest($this->context .
'.filter.price', 'filter_price');
		if ($formSubmited)
		{
			$price = $app->input->post->get('price');
			$this->setState('filter.price', $price);
		}

		$waitingtime = $this->getUserStateFromRequest($this->context .
'.filter.waitingtime', 'filter_waitingtime');
		if ($formSubmited)
		{
			$waitingtime = $app->input->post->get('waitingtime');
			$this->setState('filter.waitingtime', $waitingtime);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

		// set selection value to a translatable value
		if (ReservationHelper::checkArray($items))
		{
			foreach ($items as $nr => &$item)
			{
				// convert plantype
				$item->plantype = $this->selectionTranslation($item->plantype,
'plantype');
			}
		}


/***[JCBGUI.admin_view.php_getitems_after_all.112.$$$$]***/
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.id','b.name'),array('consultantId','consultantname')))
           
->from($db->quoteName('#__reservation_consultant',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('consultantId');

        foreach ($items as &$item) {
            $item->consultantid_id=
$result[$item->consultantid_id]['consultantname'];
        }/***[/JCBGUI$$$$]***/

        
		// return items
		return $items;
	}

	/**
	 * Method to convert selection values to translatable string.
	 *
	 * @return translatable string
	 */
	public function selectionTranslation($value,$name)
	{
		// Array of plantype language strings
		if ($name === 'plantype')
		{
			$plantypeArray = array(
				1 => 'COM_RESERVATION_PLAN_TEL',
				2 => 'COM_RESERVATION_PLAN_CHAT',
				3 => 'COM_RESERVATION_PLAN_VIDEO'
			);
			// Now check if value is found in this array
			if (isset($plantypeArray[$value]) &&
ReservationHelper::checkString($plantypeArray[$value]))
			{
				return $plantypeArray[$value];
			}
		}
		return $value;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_plan',
'a'));

		// From the reservation_consultant table.
		$query->select($db->quoteName('g.id','consultantid_id'));
		$query->join('LEFT',
$db->quoteName('#__reservation_consultant', 'g') .
' ON (' . $db->quoteName('a.consultantid') . '
= ' . $db->quoteName('g.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}

		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_plan table
			$query->from($db->quoteName('#__reservation_plan',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}

		
/***[JCBGUI.admin_view.php_getitems_after_all.112.$$$$]***/
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.id','b.name'),array('consultantId','consultantname')))
           
->from($db->quoteName('#__reservation_consultant',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('consultantId');

        foreach ($items as &$item) {
            $item->consultantid_id=
$result[$item->consultantid_id]['consultantname'];
        }/***[/JCBGUI$$$$]***/

				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_plan");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.time');
		$id .= ':' . $this->getState('filter.price');
		$id .= ':' .
$this->getState('filter.waitingtime');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_plan'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_plan'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reservation.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation Model
 */
class ReservationModelReservation extends JModelList
{
	public function getIcons()
	{
		// load user for access menus
		$user = JFactory::getUser();
		// reset icon array
		$icons  = array();
		// view groups array
		$viewGroups = array(
			'main' => array('png.reserves',
'png.bbbclasses', 'png.doctors',
'png.doctors.catid_qpo0O0oqp_com_reservation',
'png.appointments', 'png.capitals',
'png.comments', 'png.sessions', 'png.sicks',
'png.plans', 'png.consultants',
'png.consultants.catid_qpo0O0oqp_com_reservation',
'png.messages')
		);
		// view access array
		$viewAccess = array(
			'reserves.access' => 'reserve.access',
			'reserve.access' => 'reserve.access',
			'reserves.submenu' => 'reserve.submenu',
			'reserves.dashboard_list' =>
'reserve.dashboard_list',
			'bbbclasses.access' => 'bbbclass.access',
			'bbbclass.access' => 'bbbclass.access',
			'bbbclasses.submenu' => 'bbbclass.submenu',
			'bbbclasses.dashboard_list' =>
'bbbclass.dashboard_list',
			'doctors.access' => 'doctor.access',
			'doctor.access' => 'doctor.access',
			'doctors.submenu' => 'doctor.submenu',
			'doctors.dashboard_list' =>
'doctor.dashboard_list',
			'appointments.access' => 'appointment.access',
			'appointment.access' => 'appointment.access',
			'appointments.submenu' => 'appointment.submenu',
			'appointments.dashboard_list' =>
'appointment.dashboard_list',
			'capitals.access' => 'capital.access',
			'capital.access' => 'capital.access',
			'capitals.submenu' => 'capital.submenu',
			'capitals.dashboard_list' =>
'capital.dashboard_list',
			'comments.access' => 'comment.access',
			'comment.access' => 'comment.access',
			'comments.submenu' => 'comment.submenu',
			'comments.dashboard_list' =>
'comment.dashboard_list',
			'sessions.access' => 'session.access',
			'session.access' => 'session.access',
			'sessions.submenu' => 'session.submenu',
			'sessions.dashboard_list' =>
'session.dashboard_list',
			'sicks.access' => 'sick.access',
			'sick.access' => 'sick.access',
			'sicks.submenu' => 'sick.submenu',
			'sicks.dashboard_list' => 'sick.dashboard_list',
			'plans.access' => 'plan.access',
			'plan.access' => 'plan.access',
			'plans.submenu' => 'plan.submenu',
			'plans.dashboard_list' => 'plan.dashboard_list',
			'consultants.access' => 'consultant.access',
			'consultant.access' => 'consultant.access',
			'consultants.submenu' => 'consultant.submenu',
			'consultants.dashboard_list' =>
'consultant.dashboard_list',
			'messages.access' => 'message.access',
			'message.access' => 'message.access',
			'messages.submenu' => 'message.submenu',
			'messages.dashboard_list' =>
'message.dashboard_list');
		// loop over the $views
		foreach($viewGroups as $group => $views)
		{
			$i = 0;
			if (ReservationHelper::checkArray($views))
			{
				foreach($views as $view)
				{
					$add = false;
					// external views (links)
					if (strpos($view,'||') !== false)
					{
						$dwd = explode('||', $view);
						if (count($dwd) == 3)
						{
							list($type, $name, $url) = $dwd;
							$viewName 	= $name;
							$alt 		= $name;
							$url 		= $url;
							$image 		= $name . '.' . $type;
							$name 		= 'COM_RESERVATION_DASHBOARD_' .
ReservationHelper::safeString($name,'U');
						}
					}
					// internal views
					elseif (strpos($view,'.') !== false)
					{
						$dwd = explode('.', $view);
						if (count($dwd) == 3)
						{
							list($type, $name, $action) = $dwd;
						}
						elseif (count($dwd) == 2)
						{
							list($type, $name) = $dwd;
							$action = false;
						}
						if ($action)
						{
							$viewName = $name;
							switch($action)
							{
								case 'add':
									$url	= 'index.php?option=com_reservation&view=' .
$name . '&layout=edit';
									$image	= $name . '_' . $action.  '.' . $type;
									$alt	= $name . '&nbsp;' . $action;
									$name	=
'COM_RESERVATION_DASHBOARD_'.ReservationHelper::safeString($name,'U').'_ADD';
									$add	= true;
								break;
								default:
									// check for new convention (more stable)
									if (strpos($action, '_qpo0O0oqp_') !== false)
									{
										list($action, $extension) = (array)
explode('_qpo0O0oqp_', $action);
										$extension = str_replace('_po0O0oq_', '.',
$extension);
									}
									else
									{
										$extension = 'com_reservation.' . $name;
									}
									$url	=
'index.php?option=com_categories&view=categories&extension='
. $extension;
									$image	= $name . '_' . $action . '.' . $type;
									$alt	= $viewName . '&nbsp;' . $action;
									$name	= 'COM_RESERVATION_DASHBOARD_' .
ReservationHelper::safeString($name,'U') . '_' .
ReservationHelper::safeString($action,'U');
								break;
							}
						}
						else
						{
							$viewName 	= $name;
							$alt 		= $name;
							$url 		= 'index.php?option=com_reservation&view=' .
$name;
							$image 		= $name . '.' . $type;
							$name 		= 'COM_RESERVATION_DASHBOARD_' .
ReservationHelper::safeString($name,'U');
							$hover		= false;
						}
					}
					else
					{
						$viewName 	= $view;
						$alt 		= $view;
						$url 		= 'index.php?option=com_reservation&view=' .
$view;
						$image 		= $view . '.png';
						$name 		= ucwords($view).'<br /><br />';
						$hover		= false;
					}
					// first make sure the view access is set
					if (ReservationHelper::checkArray($viewAccess))
					{
						// setup some defaults
						$dashboard_add = false;
						$dashboard_list = false;
						$accessTo = '';
						$accessAdd = '';
						// access checking start
						$accessCreate = (isset($viewAccess[$viewName.'.create'])) ?
ReservationHelper::checkString($viewAccess[$viewName.'.create']):false;
						$accessAccess = (isset($viewAccess[$viewName.'.access'])) ?
ReservationHelper::checkString($viewAccess[$viewName.'.access']):false;
						// set main controllers
						$accessDashboard_add =
(isset($viewAccess[$viewName.'.dashboard_add'])) ?
ReservationHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
						$accessDashboard_list =
(isset($viewAccess[$viewName.'.dashboard_list'])) ?
ReservationHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
						// check for adding access
						if ($add && $accessCreate)
						{
							$accessAdd = $viewAccess[$viewName.'.create'];
						}
						elseif ($add)
						{
							$accessAdd = 'core.create';
						}
						// check if access to view is set
						if ($accessAccess)
						{
							$accessTo = $viewAccess[$viewName.'.access'];
						}
						// set main access controllers
						if ($accessDashboard_add)
						{
							$dashboard_add	=
$user->authorise($viewAccess[$viewName.'.dashboard_add'],
'com_reservation');
						}
						if ($accessDashboard_list)
						{
							$dashboard_list =
$user->authorise($viewAccess[$viewName.'.dashboard_list'],
'com_reservation');
						}
						if (ReservationHelper::checkString($accessAdd) &&
ReservationHelper::checkString($accessTo))
						{
							// check access
							if($user->authorise($accessAdd, 'com_reservation')
&& $user->authorise($accessTo, 'com_reservation')
&& $dashboard_add)
							{
								$icons[$group][$i]			= new StdClass;
								$icons[$group][$i]->url 	= $url;
								$icons[$group][$i]->name 	= $name;
								$icons[$group][$i]->image 	= $image;
								$icons[$group][$i]->alt 	= $alt;
							}
						}
						elseif (ReservationHelper::checkString($accessTo))
						{
							// check access
							if($user->authorise($accessTo, 'com_reservation')
&& $dashboard_list)
							{
								$icons[$group][$i]			= new StdClass;
								$icons[$group][$i]->url 	= $url;
								$icons[$group][$i]->name 	= $name;
								$icons[$group][$i]->image 	= $image;
								$icons[$group][$i]->alt 	= $alt;
							}
						}
						elseif (ReservationHelper::checkString($accessAdd))
						{
							// check access
							if($user->authorise($accessAdd, 'com_reservation')
&& $dashboard_add)
							{
								$icons[$group][$i]			= new StdClass;
								$icons[$group][$i]->url 	= $url;
								$icons[$group][$i]->name 	= $name;
								$icons[$group][$i]->image 	= $image;
								$icons[$group][$i]->alt 	= $alt;
							}
						}
						else
						{
							$icons[$group][$i]			= new StdClass;
							$icons[$group][$i]->url 	= $url;
							$icons[$group][$i]->name 	= $name;
							$icons[$group][$i]->image 	= $image;
							$icons[$group][$i]->alt 	= $alt;
						}
					}
					else
					{
						$icons[$group][$i]			= new StdClass;
						$icons[$group][$i]->url 	= $url;
						$icons[$group][$i]->name 	= $name;
						$icons[$group][$i]->image 	= $image;
						$icons[$group][$i]->alt 	= $alt;
					}
					$i++;
				}
			}
			else
			{
					$icons[$group][$i] = false;
			}
		}
		return $icons;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserve.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Reserve Model
 */
class ReservationModelReserve extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'sickid',
				'full_price',
				'doctor_quota',
				'system_quota'
			),
			'right' => array(
				'appointmentid',
				'status',
				'payment_method',
				'tracking_code'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.reserve';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'reserve', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.reserve',
'reserve', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.reserve.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/reserve.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.reserve.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.reserve.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.reserve.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_reserve'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.reserve.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.reserve', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('reserve');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('reserve');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->appointmentid)
&& !is_numeric($this->table->appointmentid))
			{
				$this->table->appointmentid =
$this->generateUnique('appointmentid',$this->table->appointmentid);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('reserve');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserves.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Reserves Model
 */
class ReservationModelReserves extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by',
				'a.full_price','full_price',
				'a.doctor_quota','doctor_quota',
				'a.system_quota','system_quota'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		$full_price = $this->getUserStateFromRequest($this->context .
'.filter.full_price', 'filter_full_price');
		if ($formSubmited)
		{
			$full_price = $app->input->post->get('full_price');
			$this->setState('filter.full_price', $full_price);
		}

		$doctor_quota = $this->getUserStateFromRequest($this->context .
'.filter.doctor_quota', 'filter_doctor_quota');
		if ($formSubmited)
		{
			$doctor_quota =
$app->input->post->get('doctor_quota');
			$this->setState('filter.doctor_quota', $doctor_quota);
		}

		$system_quota = $this->getUserStateFromRequest($this->context .
'.filter.system_quota', 'filter_system_quota');
		if ($formSubmited)
		{
			$system_quota =
$app->input->post->get('system_quota');
			$this->setState('filter.system_quota', $system_quota);
		}

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

		// set selection value to a translatable value
		if (ReservationHelper::checkArray($items))
		{
			foreach ($items as $nr => &$item)
			{
				// convert status
				$item->status = $this->selectionTranslation($item->status,
'status');
			}
		}

        
		// return items
		return $items;
	}

	/**
	 * Method to convert selection values to translatable string.
	 *
	 * @return translatable string
	 */
	public function selectionTranslation($value,$name)
	{
		// Array of status language strings
		if ($name === 'status')
		{
			$statusArray = array(
				'confirmed' =>
'COM_RESERVATION_RESERVE_CONFIRMED',
				'created' => 'COM_RESERVATION_RESERVE_CREATED'
			);
			// Now check if value is found in this array
			if (isset($statusArray[$value]) &&
ReservationHelper::checkString($statusArray[$value]))
			{
				return $statusArray[$value];
			}
		}
		return $value;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
/***[REPLACED$$$$]***//*7*/
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_reserve',
'a'));


/***[JCBGUI.admin_view.php_getlistquery.127.$$$$]***/

//$query->join('inner',$db->quoteName('#__reservation_doctor','d')
. ' on'
.$db->quoteName('g.doctorid').'='.$db->quoteName('d.id'));
//$query->join('inner',$db->quoteName('#__users','u')
. ' on'
.$db->quoteName('u.id').'='.$db->quoteName('d.userid'));
//$query->join('inner',$db->quoteName('#__categories','c')
. ' on'
.$db->quoteName('c.id').'='.$db->quoteName('d.catid'));
//$query->select($db->quoteName(array('u.name','c.title'),array('name','title')));/***[/JCBGUI$$$$]***/


		// From the reservation_appointment table.
		$query->select($db->quoteName('g.appointment','appointmentid_appointment'));
		$query->join('LEFT',
$db->quoteName('#__reservation_appointment', 'g') .
' ON (' . $db->quoteName('a.appointmentid') . '
= ' . $db->quoteName('g.id') . ')');

       
$query->join('inner',$db->quoteName('#__reservation_doctor','d')
. ' on'
.$db->quoteName('g.doctorid').'='.$db->quoteName('d.id'));
       
$query->join('inner',$db->quoteName('#__users','u')
. ' on'
.$db->quoteName('u.id').'='.$db->quoteName('d.userid'));
       
$query->join('inner',$db->quoteName('#__categories','c')
. ' on'
.$db->quoteName('c.id').'='.$db->quoteName('d.catid'));
       
$query->select($db->quoteName(array('u.name','c.title'),array('name','title')));
		
		
		// From the reservation_sick table.
		$query->select($db->quoteName('h.phonenumber','sickid_phonenumber'));
		$query->join('LEFT',
$db->quoteName('#__reservation_sick', 'h') . '
ON (' . $db->quoteName('a.sickid') . ' = ' .
$db->quoteName('h.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}

		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
/***[/REPLACED$$$$]***/
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_reserve table
			$query->from($db->quoteName('#__reservation_reserve',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}

	
/***[JCBGUI.admin_view.php_getlistquery.127.$$$$]***/

//$query->join('inner',$db->quoteName('#__reservation_doctor','d')
. ' on'
.$db->quoteName('g.doctorid').'='.$db->quoteName('d.id'));
//$query->join('inner',$db->quoteName('#__users','u')
. ' on'
.$db->quoteName('u.id').'='.$db->quoteName('d.userid'));
//$query->join('inner',$db->quoteName('#__categories','c')
. ' on'
.$db->quoteName('c.id').'='.$db->quoteName('d.catid'));
//$query->select($db->quoteName(array('u.name','c.title'),array('name','title')));/***[/JCBGUI$$$$]***/

			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_reserve");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');
		$id .= ':' . $this->getState('filter.full_price');
		$id .= ':' .
$this->getState('filter.doctor_quota');
		$id .= ':' .
$this->getState('filter.system_quota');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_reserve'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_reserve'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		mobile.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;

/**
 * Form Rule (Mobile) class for the Joomla Platform.
 */
class JFormRuleMobile extends FormRule
{

/***[JCBGUI.validation_rule.php.7.$$$$]***/
protected $regex = '^[0][1-9][0-9]{9}$';/***[/JCBGUI$$$$]***/

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				Lmskaran
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.41
	@build			18th September, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		planrule.php
	@author			Lmskaran <https://Lmskaran.com>
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__)

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;

/**
 * Form Rule (Planrule) class for the Joomla Platform.
 */
class JFormRulePlanrule extends FormRule
{

    /***[JCBGUI.validation_rule.php.10.$$$$]***/
    public function test(\SimpleXMLElement $element, $value, $group = null,
Registry $input = null, Form $form = null)
    {

        $user= jFactory::getUser();
        $user_id= $user->get('id');

        if ((!file_exists(JPATH_SITE .
'/libraries/CBLib/CBLib/Core/CBLib.php')) ||
(!file_exists(JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php'))) {
            echo 'CB not installed';
            return;
        }

        include_once(JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php');

        $cbUser =& CBuser::getInstance($user_id);
        $user =& $cbUser->getUserData();

        $degree = $user->get('cb_gradetahsili');
        if ($degree== '22')
            $value['final_price_per_min']= 'master';
        elseif ($degree== '33')
            $value['final_price_per_min']= 'phd';


        // dump($degree,"degree");
        if (!$degree){
            return
array("status"=>false,"msg"=>"سطح
تحصیلات شما هنوز تایید نشده است");
        }

        //$value['final_price_per_min']= 'master';
        $plan_type= $value['plantype'];
        switch ($plan_type)
        {
            case 1:
                return $this->handle_mobile_plan($value);
                break;
            case 2:
                return $this->handle_text_plan($value);
                break;
            case 3:
                return $this->handle_video_plan($value);
                break;
        }

    }

    private function handle_mobile_plan($value)
    {
        $return_data=[];
        $min= 15;
        $max= 60;
        $waitingTime= 180;
        $master_price_per_min= 4800;
        $phd_price_per_min= 5500;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره تلفنی {$min} دقیقه و حداکثر زمان
مشاوره تلفنی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره متنی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره تلفنی {$min_price} و حداکثر هزینه
مشاوره تلفنی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }


    private function handle_text_plan($value)
    {
        $return_data=[];
        $min= 30;
        $max= 90;
        $waitingTime= 400;
        $master_price_per_min= 4500;
        $phd_price_per_min= 5000;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره متنی {$min} دقیقه و حداکثر زمان
مشاوره متنی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره متنی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره متنی {$min_price} و حداکثر هزینه مشاوره
متنی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }


    private function handle_video_plan($value)
    {
        $return_data=[];
        $min= 15;
        $max= 60;
        $waitingTime= 180;
        $master_price_per_min= 5000;
        $phd_price_per_min= 6000;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره ویدیویی {$min} دقیقه و حداکثر زمان
مشاوره ویدیویی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره ویدیویی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره ویدیویی {$min_price} و حداکثر هزینه
مشاوره ویدیویی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }/***[/JCBGUI$$$$]***/

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				Lmskaran
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.41
	@build			18th September, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		planrule.php
	@author			Lmskaran <https://Lmskaran.com>
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__)

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;

/**
 * Form Rule (Planrule) class for the Joomla Platform.
 */
class JFormRuleEplanrule extends FormRule
{

    /***[JCBGUI.validation_rule.php.10.$$$$]***/
    public function test(\SimpleXMLElement $element, $value, $group = null,
Registry $input = null, Form $form = null)
    {

        $user= jFactory::getUser();
        $user_id= $user->get('id');

        if ((!file_exists(JPATH_SITE .
'/libraries/CBLib/CBLib/Core/CBLib.php')) ||
(!file_exists(JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php'))) {
            echo 'CB not installed';
            return;
        }

        include_once(JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php');

        $cbUser =& CBuser::getInstance($user_id);
        $user =& $cbUser->getUserData();

        $degree = $user->get('cb_gradetahsili');
        if ($degree== '22')
            $value['final_price_per_min']= 'master';
        elseif ($degree== '33')
            $value['final_price_per_min']= 'phd';


        // dump($degree,"degree");
        if (!$degree){
            return
array("status"=>false,"msg"=>"سطح
تحصیلات شما هنوز تایید نشده است");
        }

        //$value['final_price_per_min']= 'master';
        $plan_type= $value['plantype'];
        switch ($plan_type)
        {
            case 1:
                return $this->handle_mobile_plan($value);
                break;
            case 2:
                return $this->handle_text_plan($value);
                break;
            case 3:
                return $this->handle_video_plan($value);
                break;
        }

    }

    private function handle_mobile_plan($value)
    {
        $return_data=[];
        $min= 30;
        $max= 30;
        $waitingTime= 0;
        $master_price_per_min= 4800;
        $phd_price_per_min= 5500;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره تلفنی {$min} دقیقه و حداکثر زمان
مشاوره تلفنی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره متنی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره تلفنی {$min_price} و حداکثر هزینه
مشاوره تلفنی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }


    private function handle_text_plan($value)
    {
        $return_data=[];
        $min= 30;
        $max= 30;
        $waitingTime= 0;
        $master_price_per_min= 4500;
        $phd_price_per_min= 5000;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره متنی {$min} دقیقه و حداکثر زمان
مشاوره متنی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره متنی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره متنی {$min_price} و حداکثر هزینه مشاوره
متنی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }


    private function handle_video_plan($value)
    {
        $return_data=[];
        $min= 30;
        $max= 30;
        $waitingTime= 0;
        $master_price_per_min= 5000;
        $phd_price_per_min= 6000;

        if ($value['final_price_per_min']== 'master')
            $final_price_per_min= $master_price_per_min;
        else if ($value['final_price_per_min']==
'phd')
            $final_price_per_min= $phd_price_per_min;

        $time= $value['time'];
        $price= $value['price'];


        $total= (int) $time * $final_price_per_min;
        $min_price= $total - (20/100*$total);
        $max_price= $total + (20/100*$total);

        $return_data['total']= 0;
        if ($time < $min or $time > $max)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداقل زمان
مشاوره ویدیویی {$min} دقیقه و حداکثر زمان
مشاوره ویدیویی {$max} دقیقه میباشد";
            return $return_data;
        }

        $return_data['total']= $total;

        if ($value['waitingtime'] < 0 or 
$value['waitingtime'] > $waitingTime)
        {
            $return_data['status']= false;
            $return_data['msg']= "حداکثر زمان
انتظار برای مشاوره ویدیویی {$waitingTime} دقیقه
میباشد";
            return $return_data;
        }


        if ($value['submit'])
        {
            if ($price < $min_price or $price > $max_price )
            {
                $return_data['status']= false;
                $return_data['msg']= "حداقل هزینه
مشاوره ویدیویی {$min_price} و حداکثر هزینه
مشاوره ویدیویی {$max_price} میباشد";
                return $return_data;
            }

            $return_data['status']= true;
            $return_data['msg']= "پلن شما با
موفقیت ایجاد گردید";
            return $return_data;
        }

        $return_data['status']= false;
        $return_data['msg']= "";
        return $return_data;
    }/***[/JCBGUI$$$$]***/

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		session.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Session Model
 */
class ReservationModelSession extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'sickid',
				'pay',
				'finish'
			),
			'right' => array(
				'planid',
				'firsttext',
				'channel_token'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.session';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'session', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}
		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.session',
'session', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.session.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/session.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.session.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.session.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.session.'. ((int) isset($data[$key]) ?
$data[$key] : 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_session'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.session.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.session', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('session');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('session');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->sickid)
&& !is_numeric($this->table->sickid))
			{
				$this->table->sickid =
$this->generateUnique('sickid',$this->table->sickid);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('session');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}

		// Set the empty pay item to data
		if (!isset($data['pay']))
		{
			$data['pay'] = '';
		}

		// Set the empty finish item to data
		if (!isset($data['finish']))
		{
			$data['finish'] = '';
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sessions.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Sessions Model
 */
class ReservationModelSessions extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();

/***[JCBGUI.admin_view.php_getitems_after_all.114.$$$$]***/
 // Get a db connection.
        $db = JFactory::getDbo();

        // Create a new query object.
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.phoneNumber','b.name'),array('phoneNumber','name')))
            ->from($db->quoteName('#__reservation_sick',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('phoneNumber');

        foreach ($items as &$item) {
            $item->sickid_phonenumber=
$result[$item->sickid_phonenumber]['name'];
        }


        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query
           
->select($db->quoteName(array('a.id','a.planType','a.time','a.price','a.plantype','u.name','c.title'),array('planId','planType','time','price','plantype','consultantName','specialty')))
            ->from($db->quoteName('#__reservation_plan',
'a'))
            ->join('INNER',
$db->quoteName('#__reservation_consultant', 'b') .
' ON ' . $db->quoteName('a.consultantId') . ' =
' . $db->quoteName('b.id'))
            ->join('INNER',
$db->quoteName('#__users', 'u') . ' ON ' .
$db->quoteName('b.userId') . ' = ' .
$db->quoteName('u.id'))
            ->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('b.catid') . ' = ' .
$db->quoteName('c.id'));

        $db->setQuery($query);

        $result = $db->loadAssocList('planId');


        $pt = array(
            1 => 'COM_RESERVATION_PLAN_TEL',
            2 => 'COM_RESERVATION_PLAN_CHAT'
        );

        $plan='';
        foreach ($items as &$item) {
            $plan .=
JText::_($pt[$result[$item->planid_id]['plantype']]);
            $plan .=
'-'.$result[$item->planid_id]['time'].'m';
            $plan .=
'-'.$result[$item->planid_id]['price'];
            $plan .=
'-'.$result[$item->planid_id]['consultantName'];
            $plan .=
'-'.$result[$item->planid_id]['specialty'];
            $item->planid_id= $plan;
           $plan='';
        }/***[/JCBGUI$$$$]***/

        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_session',
'a'));

		// From the reservation_sick table.
		$query->select($db->quoteName('g.phonenumber','sickid_phonenumber'));
		$query->join('LEFT',
$db->quoteName('#__reservation_sick', 'g') . '
ON (' . $db->quoteName('a.sickid') . ' = ' .
$db->quoteName('g.id') . ')');

		// From the reservation_plan table.
		$query->select($db->quoteName('h.id','planid_id'));
		$query->join('LEFT',
$db->quoteName('#__reservation_plan', 'h') . '
ON (' . $db->quoteName('a.planid') . ' = ' .
$db->quoteName('h.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.planid LIKE '.$search.' OR h.id
LIKE '.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_session table
			$query->from($db->quoteName('#__reservation_session',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}

		
/***[JCBGUI.admin_view.php_getitems_after_all.114.$$$$]***/
 // Get a db connection.
        $db = JFactory::getDbo();

        // Create a new query object.
        $query = $db->getQuery(true);

        $query
           
->select($db->quoteName(array('a.phoneNumber','b.name'),array('phoneNumber','name')))
            ->from($db->quoteName('#__reservation_sick',
'a'))
            ->join('INNER',
$db->quoteName('#__users', 'b') . ' ON ' .
$db->quoteName('a.userId') . ' = ' .
$db->quoteName('b.id'));

        $db->setQuery($query);


        $result = $db->loadAssocList('phoneNumber');

        foreach ($items as &$item) {
            $item->sickid_phonenumber=
$result[$item->sickid_phonenumber]['name'];
        }


        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query
           
->select($db->quoteName(array('a.id','a.planType','a.time','a.price','a.plantype','u.name','c.title'),array('planId','planType','time','price','plantype','consultantName','specialty')))
            ->from($db->quoteName('#__reservation_plan',
'a'))
            ->join('INNER',
$db->quoteName('#__reservation_consultant', 'b') .
' ON ' . $db->quoteName('a.consultantId') . ' =
' . $db->quoteName('b.id'))
            ->join('INNER',
$db->quoteName('#__users', 'u') . ' ON ' .
$db->quoteName('b.userId') . ' = ' .
$db->quoteName('u.id'))
            ->join('INNER',
$db->quoteName('#__categories', 'c') . ' ON
' . $db->quoteName('b.catid') . ' = ' .
$db->quoteName('c.id'));

        $db->setQuery($query);

        $result = $db->loadAssocList('planId');


        $pt = array(
            1 => 'COM_RESERVATION_PLAN_TEL',
            2 => 'COM_RESERVATION_PLAN_CHAT'
        );

        $plan='';
        foreach ($items as &$item) {
            $plan .=
JText::_($pt[$result[$item->planid_id]['plantype']]);
            $plan .=
'-'.$result[$item->planid_id]['time'].'m';
            $plan .=
'-'.$result[$item->planid_id]['price'];
            $plan .=
'-'.$result[$item->planid_id]['consultantName'];
            $plan .=
'-'.$result[$item->planid_id]['specialty'];
            $item->planid_id= $plan;
           $plan='';
        }/***[/JCBGUI$$$$]***/

				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_session");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_session'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_session'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reservation Sick Model
 */
class ReservationModelSick extends JModelAdmin
{
	/**
	 * The tab layout fields array.
	 *
	 * @var      array
	 */
	protected $tabLayoutFields = array(
		'details' => array(
			'left' => array(
				'userid',
				'capitalid',
				'image',
				'alt'
			),
			'right' => array(
				'phonenumber',
				'cityid',
				'cardnumber'
			)
		)
	);

	/**
	 * @var        string    The prefix to use with controller messages.
	 * @since   1.6
	 */
	protected $text_prefix = 'COM_RESERVATION';

	/**
	 * The type alias for this content type.
	 *
	 * @var      string
	 * @since    3.2
	 */
	public $typeAlias = 'com_reservation.sick';

	/**
	 * Returns a Table object, always creating it
	 *
	 * @param   type    $type    The table type to instantiate
	 * @param   string  $prefix  A prefix for the table class name. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  JTable  A database object
	 *
	 * @since   1.6
	 */
	public function getTable($type = 'sick', $prefix =
'ReservationTable', $config = array())
	{
		// add table path for when model gets used from other component
		$this->addTablePath(JPATH_ADMINISTRATOR .
'/components/com_reservation/tables');
		// get instance of the table
		return JTable::getInstance($type, $prefix, $config);
	}
    
	/**
	 * Method to get a single record.
	 *
	 * @param   integer  $pk  The id of the primary key.
	 *
	 * @return  mixed  Object on success, false on failure.
	 *
	 * @since   1.6
	 */
	public function getItem($pk = null)
	{
		if ($item = parent::getItem($pk))
		{
			if (!empty($item->params) && !is_array($item->params))
			{
				// Convert the params field to an array.
				$registry = new Registry;
				$registry->loadString($item->params);
				$item->params = $registry->toArray();
			}

			if (!empty($item->metadata))
			{
				// Convert the metadata field to an array.
				$registry = new Registry;
				$registry->loadString($item->metadata);
				$item->metadata = $registry->toArray();
			}


/***[JCBGUI.admin_view.php_getitem.113.$$$$]***/
			empty($item->capitalid) ?
JFactory::getApplication()->setUserState('capitalid', -1) :
JFactory::getApplication()->setUserState('capitalid',$item->capitalid);
/***[/JCBGUI$$$$]***/

		}

		return $item;
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 * @param   array    $options   Optional array of options for the form
creation.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   1.6
	 */
	public function getForm($data = array(), $loadData = true, $options =
array('control' => 'jform'))
	{
		// set load data option
		$options['load_data'] = $loadData;
		// check if xpath was set in options
		$xpath = false;
		if (isset($options['xpath']))
		{
			$xpath = $options['xpath'];
			unset($options['xpath']);
		}
		// check if clear form was set in options
		$clear = false;
		if (isset($options['clear']))
		{
			$clear = $options['clear'];
			unset($options['clear']);
		}

		// Get the form.
		$form = $this->loadForm('com_reservation.sick',
'sick', $options, $clear, $xpath);

		if (empty($form))
		{
			return false;
		}

		$jinput = JFactory::getApplication()->input;

		// The front end calls this model and uses a_id to avoid id clashes so we
need to check for that first.
		if ($jinput->get('a_id'))
		{
			$id = $jinput->get('a_id', 0, 'INT');
		}
		// The back end uses id so we use that the rest of the time and set it to
0 by default.
		else
		{
			$id = $jinput->get('id', 0, 'INT');
		}

		$user = JFactory::getUser();

		// Check for existing item.
		// Modify the form based on Edit State access controls.
		if ($id != 0 &&
(!$user->authorise('core.edit.state',
'com_reservation.sick.' . (int) $id))
			|| ($id == 0 &&
!$user->authorise('core.edit.state',
'com_reservation')))
		{
			// Disable fields for display.
			$form->setFieldAttribute('ordering', 'disabled',
'true');
			$form->setFieldAttribute('published', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('ordering', 'filter',
'unset');
			$form->setFieldAttribute('published', 'filter',
'unset');
		}
		// If this is a new item insure the greated by is set.
		if (0 == $id)
		{
			// Set the created_by to this user
			$form->setValue('created_by', null, $user->id);
		}
		// Modify the form based on Edit Creaded By access controls.
		if (!$user->authorise('core.edit.created_by',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'disabled', 'true');
			// Disable fields for display.
			$form->setFieldAttribute('created_by',
'readonly', 'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created_by', 'filter',
'unset');
		}
		// Modify the form based on Edit Creaded Date access controls.
		if (!$user->authorise('core.edit.created',
'com_reservation'))
		{
			// Disable fields for display.
			$form->setFieldAttribute('created', 'disabled',
'true');
			// Disable fields while saving.
			$form->setFieldAttribute('created', 'filter',
'unset');
		}
		// Only load these values if no id is found
		if (0 == $id)
		{
			// Set redirected view name
			$redirectedView = $jinput->get('ref', null,
'STRING');
			// Set field name (or fall back to view name)
			$redirectedField = $jinput->get('field', $redirectedView,
'STRING');
			// Set redirected view id
			$redirectedId = $jinput->get('refid', 0, 'INT');
			// Set field id (or fall back to redirected view id)
			$redirectedValue = $jinput->get('field_id', $redirectedId,
'INT');
			if (0 != $redirectedValue && $redirectedField)
			{
				// Now set the local-redirected field default value
				$form->setValue($redirectedField, null, $redirectedValue);
			}
		}
		return $form;
	}

	/**
	 * Method to get the script that have to be included on the form
	 *
	 * @return string	script files
	 */
	public function getScript()
	{
		return 'media/com_reservation/js/sick.js';
	}
    
	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canDelete($record)
	{
		if (!empty($record->id))
		{
			if ($record->published != -2)
			{
				return;
			}

			$user = JFactory::getUser();
			// The record has been set. Check the record permissions.
			return $user->authorise('core.delete',
'com_reservation.sick.' . (int) $record->id);
		}
		return false;
	}

	/**
	 * Method to test whether a record can have its state edited.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   1.6
	 */
	protected function canEditState($record)
	{
		$user = JFactory::getUser();
		$recordId = (!empty($record->id)) ? $record->id : 0;

		if ($recordId)
		{
			// The record has been set. Check the record permissions.
			$permission = $user->authorise('core.edit.state',
'com_reservation.sick.' . (int) $recordId);
			if (!$permission && !is_null($permission))
			{
				return false;
			}
		}
		// In the absense of better information, revert to the component
permissions.
		return parent::canEditState($record);
	}
    
	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	2.5
	 */
	protected function allowEdit($data = array(), $key = 'id')
	{
		// Check specific edit permission then general edit permission.

		return JFactory::getUser()->authorise('core.edit',
'com_reservation.sick.'. ((int) isset($data[$key]) ? $data[$key]
: 0)) or parent::allowEdit($data, $key);
	}
    
	/**
	 * Prepare and sanitise the table data prior to saving.
	 *
	 * @param   JTable  $table  A JTable object.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareTable($table)
	{
		$date = JFactory::getDate();
		$user = JFactory::getUser();
		
		if (isset($table->name))
		{
			$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
		}
		
		if (isset($table->alias) && empty($table->alias))
		{
			$table->generateAlias();
		}
		
		if (empty($table->id))
		{
			$table->created = $date->toSql();
			// set the user
			if ($table->created_by == 0 || empty($table->created_by))
			{
				$table->created_by = $user->id;
			}
			// Set ordering to the last item if not set
			if (empty($table->ordering))
			{
				$db = JFactory::getDbo();
				$query = $db->getQuery(true)
					->select('MAX(ordering)')
					->from($db->quoteName('#__reservation_sick'));
				$db->setQuery($query);
				$max = $db->loadResult();

				$table->ordering = $max + 1;
			}
		}
		else
		{
			$table->modified = $date->toSql();
			$table->modified_by = $user->id;
		}
        
		if (!empty($table->id))
		{
			// Increment the items version number.
			$table->version++;
		}
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  mixed  The data for the form.
	 *
	 * @since   1.6
	 */
	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data =
JFactory::getApplication()->getUserState('com_reservation.edit.sick.data',
array());

		if (empty($data))
		{
			$data = $this->getItem();
			// run the perprocess of the data
			$this->preprocessData('com_reservation.sick', $data);
		}

		return $data;
	}

	/**
	 * Method to get the unique fields of this table.
	 *
	 * @return  mixed  An array of field names, boolean false if none is set.
	 *
	 * @since   3.0
	 */
	protected function getUniqueFields()
	{
		return false;
	}
	
	/**
	 * Method to delete one or more records.
	 *
	 * @param   array  &$pks  An array of record primary keys.
	 *
	 * @return  boolean  True if successful, false if an error occurs.
	 *
	 * @since   12.2
	 */
	public function delete(&$pks)
	{
		if (!parent::delete($pks))
		{
			return false;
		}
		
		return true;
	}

	/**
	 * Method to change the published state of one or more records.
	 *
	 * @param   array    &$pks   A list of the primary keys to change.
	 * @param   integer  $value  The value of the published state.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   12.2
	 */
	public function publish(&$pks, $value = 1)
	{
		if (!parent::publish($pks, $value))
		{
			return false;
		}
		
		return true;
        }
    
	/**
	 * Method to perform batch operations on an item or a set of items.
	 *
	 * @param   array  $commands  An array of commands to perform.
	 * @param   array  $pks       An array of item ids.
	 * @param   array  $contexts  An array of item contexts.
	 *
	 * @return  boolean  Returns true on success, false on failure.
	 *
	 * @since   12.2
	 */
	public function batch($commands, $pks, $contexts)
	{
		// Sanitize ids.
		$pks = array_unique($pks);
		ArrayHelper::toInteger($pks);

		// Remove any values of zero.
		if (array_search(0, $pks, true))
		{
			unset($pks[array_search(0, $pks, true)]);
		}

		if (empty($pks))
		{
			$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
			return false;
		}

		$done = false;

		// Set some needed variables.
		$this->user			= JFactory::getUser();
		$this->table			= $this->getTable();
		$this->tableClassName		= get_class($this->table);
		$this->contentType		= new JUcmType;
		$this->type			=
$this->contentType->getTypeByTable($this->tableClassName);
		$this->canDo			= ReservationHelper::getActions('sick');
		$this->batchSet			= true;

		if (!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
			return false;
		}
        
		if ($this->type == false)
		{
			$type = new JUcmType;
			$this->type = $type->getTypeByAlias($this->typeAlias);
		}

		$this->tagsObserver =
$this->table->getObserverOfClass('JTableObserverTags');

		if (!empty($commands['move_copy']))
		{
			$cmd = ArrayHelper::getValue($commands, 'move_copy',
'c');

			if ($cmd == 'c')
			{
				$result = $this->batchCopy($commands, $pks, $contexts);

				if (is_array($result))
				{
					foreach ($result as $old => $new)
					{
						$contexts[$new] = $contexts[$old];
					}
					$pks = array_values($result);
				}
				else
				{
					return false;
				}
			}
			elseif ($cmd == 'm' && !$this->batchMove($commands,
$pks, $contexts))
			{
				return false;
			}

			$done = true;
		}

		if (!$done)
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}

	/**
	 * Batch copy items to a new category or current.
	 *
	 * @param   integer  $values    The new values.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  mixed  An array of new IDs on success, boolean false on
failure.
	 *
	 * @since 12.2
	 */
	protected function batchCopy($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user 		= JFactory::getUser();
			$this->table 		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('sick');
		}

		if (!$this->canDo->get('core.create') ||
!$this->canDo->get('core.batch'))
		{
			return false;
		}

		// get list of unique fields
		$uniqueFields = $this->getUniqueFields();
		// remove move_copy from array
		unset($values['move_copy']);

		// make sure published is set
		if (!isset($values['published']))
		{
			$values['published'] = 0;
		}
		elseif (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
				$values['published'] = 0;
		}

		$newIds = array();
		// Parent exists so let's proceed
		while (!empty($pks))
		{
			// Pop the first ID off the stack
			$pk = array_shift($pks);

			$this->table->reset();

			// only allow copy if user may edit this item.
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				// Not fatal error
				$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
				continue;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// Only for strings
			if (ReservationHelper::checkString($this->table->userid)
&& !is_numeric($this->table->userid))
			{
				$this->table->userid =
$this->generateUnique('userid',$this->table->userid);
			}

			// insert all set values
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					if (strlen($value) > 0 && isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}

			// update all unique fields
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$this->table->$uniqueField =
$this->generateUnique($uniqueField,$this->table->$uniqueField);
				}
			}

			// Reset the ID because we are making a copy
			$this->table->id = 0;

			// TODO: Deal with ordering?
			// $this->table->ordering = 1;

			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}

			// Get the new item ID
			$newId = $this->table->get('id');

			// Add the new ID to the array
			$newIds[$pk] = $newId;
		}

		// Clean the cache
		$this->cleanCache();

		return $newIds;
	}

	/**
	 * Batch move items to a new category
	 *
	 * @param   integer  $value     The new category ID.
	 * @param   array    $pks       An array of row IDs.
	 * @param   array    $contexts  An array of item contexts.
	 *
	 * @return  boolean  True if successful, false otherwise and internal
error is set.
	 *
	 * @since 12.2
	 */
	protected function batchMove($values, $pks, $contexts)
	{
		if (empty($this->batchSet))
		{
			// Set some needed variables.
			$this->user		= JFactory::getUser();
			$this->table		= $this->getTable();
			$this->tableClassName	= get_class($this->table);
			$this->canDo		= ReservationHelper::getActions('sick');
		}

		if (!$this->canDo->get('core.edit') &&
!$this->canDo->get('core.batch'))
		{
			$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
			return false;
		}

		// make sure published only updates if user has the permission.
		if (isset($values['published']) &&
!$this->canDo->get('core.edit.state'))
		{
			unset($values['published']);
		}
		// remove move_copy from array
		unset($values['move_copy']);

		// Parent exists so we proceed
		foreach ($pks as $pk)
		{
			if (!$this->user->authorise('core.edit',
$contexts[$pk]))
			{
				$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
				return false;
			}

			// Check that the row actually exists
			if (!$this->table->load($pk))
			{
				if ($error = $this->table->getError())
				{
					// Fatal error
					$this->setError($error);
					return false;
				}
				else
				{
					// Not fatal error
					$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND',
$pk));
					continue;
				}
			}

			// insert all set values.
			if (ReservationHelper::checkArray($values))
			{
				foreach ($values as $key => $value)
				{
					// Do special action for access.
					if ('access' === $key && strlen($value) > 0)
					{
						$this->table->$key = $value;
					}
					elseif (strlen($value) > 0 &&
isset($this->table->$key))
					{
						$this->table->$key = $value;
					}
				}
			}


			// Check the row.
			if (!$this->table->check())
			{
				$this->setError($this->table->getError());

				return false;
			}

			if (!empty($this->type))
			{
				$this->createTagsHelper($this->tagsObserver, $this->type, $pk,
$this->typeAlias, $this->table);
			}

			// Store the row.
			if (!$this->table->store())
			{
				$this->setError($this->table->getError());

				return false;
			}
		}

		// Clean the cache
		$this->cleanCache();

		return true;
	}
	
	/**
	 * Method to save the form data.
	 *
	 * @param   array  $data  The form data.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.6
	 */
	public function save($data)
	{
		$input	= JFactory::getApplication()->input;
		$filter	= JFilterInput::getInstance();
        
		// set the metadata to the Item Data
		if (isset($data['metadata']) &&
isset($data['metadata']['author']))
		{
			$data['metadata']['author'] =
$filter->clean($data['metadata']['author'],
'TRIM');
            
			$metadata = new JRegistry;
			$metadata->loadArray($data['metadata']);
			$data['metadata'] = (string) $metadata;
		}
        
		// Set the Params Items to data
		if (isset($data['params']) &&
is_array($data['params']))
		{
			$params = new JRegistry;
			$params->loadArray($data['params']);
			$data['params'] = (string) $params;
		}

		// Alter the unique field for save as copy
		if ($input->get('task') === 'save2copy')
		{
			// Automatic handling of other unique fields
			$uniqueFields = $this->getUniqueFields();
			if (ReservationHelper::checkArray($uniqueFields))
			{
				foreach ($uniqueFields as $uniqueField)
				{
					$data[$uniqueField] =
$this->generateUnique($uniqueField,$data[$uniqueField]);
				}
			}
		}
		
		if (parent::save($data))
		{
			return true;
		}
		return false;
	}
	
	/**
	 * Method to generate a unique value.
	 *
	 * @param   string  $field name.
	 * @param   string  $value data.
	 *
	 * @return  string  New value.
	 *
	 * @since   3.0
	 */
	protected function generateUnique($field,$value)
	{

		// set field value unique
		$table = $this->getTable();

		while ($table->load(array($field => $value)))
		{
			$value = StringHelper::increment($value);
		}

		return $value;
	}

	/**
	 * Method to change the title
	 *
	 * @param   string   $title   The title.
	 *
	 * @return	array  Contains the modified title and alias.
	 *
	 */
	protected function _generateNewTitle($title)
	{

		// Alter the title
		$table = $this->getTable();

		while ($table->load(array('title' => $title)))
		{
			$title = StringHelper::increment($title);
		}

		return $title;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sicks.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;

/**
 * Sicks Model
 */
class ReservationModelSicks extends JModelList
{
	public function __construct($config = array())
	{
		if (empty($config['filter_fields']))
        {
			$config['filter_fields'] = array(
				'a.id','id',
				'a.published','published',
				'a.access','access',
				'a.ordering','ordering',
				'a.created_by','created_by',
				'a.modified_by','modified_by'
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @param   string  $ordering   An optional ordering field.
	 * @param   string  $direction  An optional direction (asc|desc).
	 *
	 * @return  void
	 *
	 */
	protected function populateState($ordering = null, $direction = null)
	{
		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		if ($layout = $app->input->get('layout'))
		{
			$this->context .= '.' . $layout;
		}

		// Check if the form was submitted
		$formSubmited =
$app->input->post->get('form_submited');

		$access = $this->getUserStateFromRequest($this->context .
'.filter.access', 'filter_access', 0, 'int');
		if ($formSubmited)
		{
			$access = $app->input->post->get('access');
			$this->setState('filter.access', $access);
		}

		$published = $this->getUserStateFromRequest($this->context .
'.filter.published', 'filter_published', '');
		$this->setState('filter.published', $published);

		$created_by = $this->getUserStateFromRequest($this->context .
'.filter.created_by', 'filter_created_by',
'');
		$this->setState('filter.created_by', $created_by);

		$created = $this->getUserStateFromRequest($this->context .
'.filter.created', 'filter_created');
		$this->setState('filter.created', $created);

		$sorting = $this->getUserStateFromRequest($this->context .
'.filter.sorting', 'filter_sorting', 0,
'int');
		$this->setState('filter.sorting', $sorting);

		$search = $this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search');
		$this->setState('filter.search', $search);

		// List state information.
		parent::populateState($ordering, $direction);
	}
	
	/**
	 * Method to get an array of data items.
	 *
	 * @return  mixed  An array of data items on success, false on failure.
	 */
	public function getItems()
	{
		// check in items
		$this->checkInNow();

		// load parent items
		$items = parent::getItems();
        
		// return items
		return $items;
	}
	
	/**
	 * Method to build an SQL query to load the list data.
	 *
	 * @return	string	An SQL query
	 */
	protected function getListQuery()
	{
		// Get the user object.
		$user = JFactory::getUser();
		// Create a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Select some fields
		$query->select('a.*');

		// From the reservation_item table
		$query->from($db->quoteName('#__reservation_sick',
'a'));

		// From the reservation_capital table.
		$query->select($db->quoteName('g.name','capitalid_name'));
		$query->join('LEFT',
$db->quoteName('#__reservation_capital', 'g') .
' ON (' . $db->quoteName('a.capitalid') . ' =
' . $db->quoteName('g.id') . ')');

		// From the reservation_capital table.
		$query->select($db->quoteName('h.name','cityid_name'));
		$query->join('LEFT',
$db->quoteName('#__reservation_capital', 'h') .
' ON (' . $db->quoteName('a.cityid') . ' =
' . $db->quoteName('h.id') . ')');

		// Filter by published state
		$published = $this->getState('filter.published');
		if (is_numeric($published))
		{
			$query->where('a.published = ' . (int) $published);
		}
		elseif ($published === '')
		{
			$query->where('(a.published = 0 OR a.published = 1)');
		}

		// Join over the asset groups.
		$query->select('ag.title AS access_level');
		$query->join('LEFT', '#__viewlevels AS ag ON ag.id =
a.access');
		// Filter by access level.
		$_access = $this->getState('filter.access');
		if ($_access && is_numeric($_access))
		{
			$query->where('a.access = ' . (int) $_access);
		}
		elseif (ReservationHelper::checkArray($_access))
		{
			// Secure the array for the query
			$_access = ArrayHelper::toInteger($_access);
			// Filter by the Access Array.
			$query->where('a.access IN (' . implode(',',
$_access) . ')');
		}
		// Implement View Level Access
		if (!$user->authorise('core.options',
'com_reservation'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}
		// Filter by search.
		$search = $this->getState('filter.search');
		if (!empty($search))
		{
			if (stripos($search, 'id:') === 0)
			{
				$query->where('a.id = ' . (int) substr($search, 3));
			}
			else
			{
				$search = $db->quote('%' . $db->escape($search) .
'%');
				$query->where('(a.phonenumber LIKE
'.$search.')');
			}
		}


		// Add the list ordering clause.
		$orderCol = $this->state->get('list.ordering',
'a.id');
		$orderDirn = $this->state->get('list.direction',
'desc');
		if ($orderCol != '')
		{
			$query->order($db->escape($orderCol . ' ' .
$orderDirn));
		}

		return $query;
	}

	/**
	 * Method to get list export data.
	 *
	 * @param   array  $pks  The ids of the items to get
	 * @param   JUser  $user  The user making the request
	 *
	 * @return mixed  An array of data items on success, false on failure.
	 */
	public function getExportData($pks, $user = null)
	{
		// setup the query
		if (($pks_size = ReservationHelper::checkArray($pks)) !== false ||
'bulk' === $pks)
		{
			// Set a value to know this is export method. (USE IN CUSTOM CODE TO
ALTER OUTCOME)
			$_export = true;
			// Get the user object if not set.
			if (!isset($user) || !ReservationHelper::checkObject($user))
			{
				$user = JFactory::getUser();
			}
			// Create a new query object.
			$db = JFactory::getDBO();
			$query = $db->getQuery(true);

			// Select some fields
			$query->select('a.*');

			// From the reservation_sick table
			$query->from($db->quoteName('#__reservation_sick',
'a'));
			// The bulk export path
			if ('bulk' === $pks)
			{
				$query->where('a.id > 0');
			}
			// A large array of ID's will not work out well
			elseif ($pks_size > 500)
			{
				// Use lowest ID
				$query->where('a.id >= ' . (int) min($pks));
				// Use highest ID
				$query->where('a.id <= ' . (int) max($pks));
			}
			// The normal default path
			else
			{
				$query->where('a.id IN (' . implode(',',$pks) .
')');
			}
			// Implement View Level Access
			if (!$user->authorise('core.options',
'com_reservation'))
			{
				$groups = implode(',', $user->getAuthorisedViewLevels());
				$query->where('a.access IN (' . $groups . ')');
			}

			// Order the results by ordering
			$query->order('a.ordering  ASC');

			// Load the items
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				$items = $db->loadObjectList();

				// Set values to display correctly.
				if (ReservationHelper::checkArray($items))
				{
					foreach ($items as $nr => &$item)
					{
						// unset the values we don't want exported.
						unset($item->asset_id);
						unset($item->checked_out);
						unset($item->checked_out_time);
					}
				}
				// Add headers to items array.
				$headers = $this->getExImPortHeaders();
				if (ReservationHelper::checkObject($headers))
				{
					array_unshift($items,$headers);
				}
				return $items;
			}
		}
		return false;
	}

	/**
	* Method to get header.
	*
	* @return mixed  An array of data items on success, false on failure.
	*/
	public function getExImPortHeaders()
	{
		// Get a db connection.
		$db = JFactory::getDbo();
		// get the columns
		$columns = $db->getTableColumns("#__reservation_sick");
		if (ReservationHelper::checkArray($columns))
		{
			// remove the headers you don't import/export.
			unset($columns['asset_id']);
			unset($columns['checked_out']);
			unset($columns['checked_out_time']);
			$headers = new stdClass();
			foreach ($columns as $column => $type)
			{
				$headers->{$column} = $column;
			}
			return $headers;
		}
		return false;
	}
	
	/**
	 * Method to get a store id based on model configuration state.
	 *
	 * @return  string  A store id.
	 *
	 */
	protected function getStoreId($id = '')
	{
		// Compile the store id.
		$id .= ':' . $this->getState('filter.id');
		$id .= ':' . $this->getState('filter.search');
		$id .= ':' . $this->getState('filter.published');
		// Check if the value is an array
		$_access = $this->getState('filter.access');
		if (ReservationHelper::checkArray($_access))
		{
			$id .= ':' . implode(':', $_access);
		}
		// Check if this is only an number or string
		elseif (is_numeric($_access)
		 || ReservationHelper::checkString($_access))
		{
			$id .= ':' . $_access;
		}
		$id .= ':' . $this->getState('filter.ordering');
		$id .= ':' . $this->getState('filter.created_by');
		$id .= ':' .
$this->getState('filter.modified_by');

		return parent::getStoreId($id);
	}

	/**
	 * Build an SQL query to checkin all items left checked out longer then a
set time.
	 *
	 * @return  a bool
	 *
	 */
	protected function checkInNow()
	{
		// Get set check in time
		$time =
JComponentHelper::getParams('com_reservation')->get('check_in');

		if ($time)
		{

			// Get a db connection.
			$db = JFactory::getDbo();
			// reset query
			$query = $db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('#__reservation_sick'));
			$db->setQuery($query);
			$db->execute();
			if ($db->getNumRows())
			{
				// Get Yesterdays date
				$date = JFactory::getDate()->modify($time)->toSql();
				// reset query
				$query = $db->getQuery(true);

				// Fields to update.
				$fields = array(
					$db->quoteName('checked_out_time') .
'=\'0000-00-00 00:00:00\'',
					$db->quoteName('checked_out') . '=0'
				);

				// Conditions for which records should be updated.
				$conditions = array(
					$db->quoteName('checked_out') . '!=0', 
					$db->quoteName('checked_out_time') .
'<\''.$date.'\''
				);

				// Check table
				$query->update($db->quoteName('#__reservation_sick'))->set($fields)->where($conditions);


				$db->setQuery($query);

				$db->execute();
			}
		}

		return false;
	}
}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reservation.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tabstate');

// Access check.
if (!JFactory::getUser()->authorise('core.manage',
'com_reservation'))
{
	throw new
JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'),
403);
};

// Add CSS file for all pages
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_reservation/assets/css/admin.css');
$document->addScript('components/com_reservation/assets/js/admin.js');

// require helper files
JLoader::register('ReservationHelper', __DIR__ .
'/helpers/reservation.php'); 
JLoader::register('JHtmlBatch_', __DIR__ .
'/helpers/html/batch_.php'); 

// Get an instance of the controller prefixed by Reservation
$controller = JControllerLegacy::getInstance('Reservation');

// Perform the Request task
$controller->execute(JFactory::getApplication()->input->get('task'));

// Redirect if set by the controller
$controller->redirect();
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2"
method="upgrade">
	<name>COM_RESERVATION</name>
	<creationDate>4th April, 2023</creationDate>
	<author>farhad shahbazi</author>
	<authorEmail>farhad.shahbazi0010@gmail.com</authorEmail>
	<authorUrl>http://farhad.com</authorUrl>
	<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
	<license>GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html</license>
	<version>1.0.39</version>
	<description><![CDATA[
		<h1>Reservation (v.1.0.39)</h1>
		<div style="clear: both;"></div>
		<p>medical system</p>
		<p>Created by <a href="http://farhad.com"
target="_blank">farhad shahbazi</a><br
/><small>Development started 17th December,
2020</small></p>
	]]></description>

	<!-- Runs on install; New in Joomla 1.5 -->
	<install>
		<sql>
			<file driver="mysql"
charset="utf8">sql/install.mysql.utf8.sql</file>
		</sql>
	</install>

	<!-- Runs on uninstall; New in Joomla 1.5 -->
	<uninstall>
		<sql>
			<file driver="mysql"
charset="utf8">sql/uninstall.mysql.utf8.sql</file>
		</sql>
	</uninstall>

	<!-- Runs on install/uninstall/update; New in Joomla 2.5 -->
	<scriptfile>script.php</scriptfile>

	<media destination="com_reservation"
folder="media">
		<filename>index.html</filename>
		<folder>js</folder>
		<folder>css</folder>
		<folder>images</folder>
		<folder>pusher</folder>
		<folder>bootstraprtl</folder>
		<folder>bootstrapv45</folder>
		<folder>fullCalendar</folder>
	</media>

	<!-- Update Schema; New in Joomla 2.5 -->
	<update>
		<schemas>
			<schemapath
type="mysql">sql/updates/mysql/</schemapath>
		</schemas>
	</update>

	<files folder="site">
		<filename>controller.php</filename>
		<filename>index.html</filename>
		<filename>router.php</filename>
		<filename>reservation.php</filename>
		<filename>router.php</filename>
		<folder>assets</folder>
		<folder>helpers</folder>
		<folder>controllers</folder>
		<folder>models</folder>
		<folder>views</folder>
		<folder>layouts</folder>
	</files>

	<languages folder="site">
		<language
tag="en-GB">language/en-GB/en-GB.com_reservation.ini</language>
		<language
tag="en-GB">language/en-GB/en-GB.com_reservation.sys.ini</language>
		<language
tag="fa-IR">language/fa-IR/fa-IR.com_reservation.ini</language>
		<language
tag="fa-IR">language/fa-IR/fa-IR.com_reservation.sys.ini</language>
	</languages>

	<administration>
		<menu>COM_RESERVATION_MENU</menu>
		<submenu>
			<!-- Instead of link you can specify individual link attributes
-->
			<menu option="com_reservation"
view="reserves">COM_RESERVATION_MENU_RESERVES</menu>
			<menu option="com_reservation"
view="bbbclasses">COM_RESERVATION_MENU_BBBCLASSES</menu>
			<menu option="com_reservation"
view="doctors">COM_RESERVATION_MENU_DOCTORS</menu>
			<menu option="com_reservation"
view="appointments">COM_RESERVATION_MENU_APPOINTMENTS</menu>
			<menu option="com_reservation"
view="capitals">COM_RESERVATION_MENU_CAPITALS</menu>
			<menu option="com_reservation"
view="comments">COM_RESERVATION_MENU_COMMENTS</menu>
			<menu option="com_reservation"
view="sessions">COM_RESERVATION_MENU_SESSIONS</menu>
			<menu option="com_reservation"
view="sicks">COM_RESERVATION_MENU_SICKS</menu>
			<menu option="com_reservation"
view="plans">COM_RESERVATION_MENU_PLANS</menu>
			<menu option="com_reservation"
view="consultants">COM_RESERVATION_MENU_CONSULTANTS</menu>
			<menu option="com_reservation"
view="messages">COM_RESERVATION_MENU_MESSAGES</menu>
		</submenu>
		<files folder="admin">
			<filename>access.xml</filename>
			<filename>config.xml</filename>
			<filename>controller.php</filename>
			<filename>index.html</filename>
			<filename>reservation.php</filename>
			<folder>assets</folder>
			<folder>controllers</folder>
			<folder>helpers</folder>
			<folder>models</folder>
			<folder>sql</folder>
			<folder>tables</folder>
			<folder>views</folder>
			<folder>layouts</folder>
		</files>

		<languages folder="admin">
			<language
tag="en-GB">language/en-GB/en-GB.com_reservation.ini</language>
			<language
tag="en-GB">language/en-GB/en-GB.com_reservation.sys.ini</language>
			<language
tag="fa-IR">language/fa-IR/fa-IR.com_reservation.ini</language>
		</languages>

	</administration>
</extension><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		script.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');

/**
 * Script File of Reservation Component
 */
class com_reservationInstallerScript
{
	/**
	 * Constructor
	 *
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 */
	public function __construct(JAdapterInstance $parent) {}

	/**
	 * Called on installation
	 *
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 *
	 * @return  boolean  True on success
	 */
	public function install(JAdapterInstance $parent) {}

	/**
	 * Called on uninstallation
	 *
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 */
	public function uninstall(JAdapterInstance $parent)
	{
		// Get Application object
		$app = JFactory::getApplication();

		// Get The Database object
		$db = JFactory::getDbo();

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Reserve alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.reserve') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$reserve_found = $db->getNumRows();
		// Now check if there were any rows
		if ($reserve_found)
		{
			// Since there are load the needed  reserve type ids
			$reserve_ids = $db->loadColumn();
			// Remove Reserve from the content type table
			$reserve_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.reserve') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($reserve_condition);
			$db->setQuery($query);
			// Execute the query to remove Reserve items
			$reserve_done = $db->execute();
			if ($reserve_done)
			{
				// If successfully remove Reserve add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.reserve)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Reserve items from the contentitem tag map table
			$reserve_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.reserve') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($reserve_condition);
			$db->setQuery($query);
			// Execute the query to remove Reserve items
			$reserve_done = $db->execute();
			if ($reserve_done)
			{
				// If successfully remove Reserve add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.reserve)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Reserve items from the ucm content table
			$reserve_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.reserve') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($reserve_condition);
			$db->setQuery($query);
			// Execute the query to remove Reserve items
			$reserve_done = $db->execute();
			if ($reserve_done)
			{
				// If successfully removed Reserve add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.reserve)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Reserve items are cleared from DB
			foreach ($reserve_ids as $reserve_id)
			{
				// Remove Reserve items from the ucm base table
				$reserve_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $reserve_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($reserve_condition);
				$db->setQuery($query);
				// Execute the query to remove Reserve items
				$db->execute();

				// Remove Reserve items from the ucm history table
				$reserve_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $reserve_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($reserve_condition);
				$db->setQuery($query);
				// Execute the query to remove Reserve items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Bbbclass alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.bbbclass') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$bbbclass_found = $db->getNumRows();
		// Now check if there were any rows
		if ($bbbclass_found)
		{
			// Since there are load the needed  bbbclass type ids
			$bbbclass_ids = $db->loadColumn();
			// Remove Bbbclass from the content type table
			$bbbclass_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.bbbclass') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($bbbclass_condition);
			$db->setQuery($query);
			// Execute the query to remove Bbbclass items
			$bbbclass_done = $db->execute();
			if ($bbbclass_done)
			{
				// If successfully remove Bbbclass add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.bbbclass)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Bbbclass items from the contentitem tag map table
			$bbbclass_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.bbbclass') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($bbbclass_condition);
			$db->setQuery($query);
			// Execute the query to remove Bbbclass items
			$bbbclass_done = $db->execute();
			if ($bbbclass_done)
			{
				// If successfully remove Bbbclass add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.bbbclass)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Bbbclass items from the ucm content table
			$bbbclass_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.bbbclass') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($bbbclass_condition);
			$db->setQuery($query);
			// Execute the query to remove Bbbclass items
			$bbbclass_done = $db->execute();
			if ($bbbclass_done)
			{
				// If successfully removed Bbbclass add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.bbbclass)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Bbbclass items are cleared from DB
			foreach ($bbbclass_ids as $bbbclass_id)
			{
				// Remove Bbbclass items from the ucm base table
				$bbbclass_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $bbbclass_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($bbbclass_condition);
				$db->setQuery($query);
				// Execute the query to remove Bbbclass items
				$db->execute();

				// Remove Bbbclass items from the ucm history table
				$bbbclass_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $bbbclass_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($bbbclass_condition);
				$db->setQuery($query);
				// Execute the query to remove Bbbclass items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Doctor alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.doctor') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$doctor_found = $db->getNumRows();
		// Now check if there were any rows
		if ($doctor_found)
		{
			// Since there are load the needed  doctor type ids
			$doctor_ids = $db->loadColumn();
			// Remove Doctor from the content type table
			$doctor_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.doctor') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($doctor_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor items
			$doctor_done = $db->execute();
			if ($doctor_done)
			{
				// If successfully remove Doctor add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.doctor)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Doctor items from the contentitem tag map table
			$doctor_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.doctor') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($doctor_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor items
			$doctor_done = $db->execute();
			if ($doctor_done)
			{
				// If successfully remove Doctor add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.doctor)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Doctor items from the ucm content table
			$doctor_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.doctor') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($doctor_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor items
			$doctor_done = $db->execute();
			if ($doctor_done)
			{
				// If successfully removed Doctor add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.doctor)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Doctor items are cleared from DB
			foreach ($doctor_ids as $doctor_id)
			{
				// Remove Doctor items from the ucm base table
				$doctor_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $doctor_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($doctor_condition);
				$db->setQuery($query);
				// Execute the query to remove Doctor items
				$db->execute();

				// Remove Doctor items from the ucm history table
				$doctor_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $doctor_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($doctor_condition);
				$db->setQuery($query);
				// Execute the query to remove Doctor items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Doctor catid alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.doctor.category') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$doctor_catid_found = $db->getNumRows();
		// Now check if there were any rows
		if ($doctor_catid_found)
		{
			// Since there are load the needed  doctor_catid type ids
			$doctor_catid_ids = $db->loadColumn();
			// Remove Doctor catid from the content type table
			$doctor_catid_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.doctor.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($doctor_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor catid items
			$doctor_catid_done = $db->execute();
			if ($doctor_catid_done)
			{
				// If successfully remove Doctor catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.doctor.category) type alias was removed from the
<b>#__content_type</b> table'));
			}

			// Remove Doctor catid items from the contentitem tag map table
			$doctor_catid_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.doctor.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($doctor_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor catid items
			$doctor_catid_done = $db->execute();
			if ($doctor_catid_done)
			{
				// If successfully remove Doctor catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.doctor.category) type alias was removed from the
<b>#__contentitem_tag_map</b> table'));
			}

			// Remove Doctor catid items from the ucm content table
			$doctor_catid_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.doctor.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($doctor_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Doctor catid items
			$doctor_catid_done = $db->execute();
			if ($doctor_catid_done)
			{
				// If successfully removed Doctor catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.doctor.category) type alias was removed from the
<b>#__ucm_content</b> table'));
			}

			// Make sure that all the Doctor catid items are cleared from DB
			foreach ($doctor_catid_ids as $doctor_catid_id)
			{
				// Remove Doctor catid items from the ucm base table
				$doctor_catid_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$doctor_catid_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($doctor_catid_condition);
				$db->setQuery($query);
				// Execute the query to remove Doctor catid items
				$db->execute();

				// Remove Doctor catid items from the ucm history table
				$doctor_catid_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$doctor_catid_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($doctor_catid_condition);
				$db->setQuery($query);
				// Execute the query to remove Doctor catid items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Appointment alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.appointment') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$appointment_found = $db->getNumRows();
		// Now check if there were any rows
		if ($appointment_found)
		{
			// Since there are load the needed  appointment type ids
			$appointment_ids = $db->loadColumn();
			// Remove Appointment from the content type table
			$appointment_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.appointment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($appointment_condition);
			$db->setQuery($query);
			// Execute the query to remove Appointment items
			$appointment_done = $db->execute();
			if ($appointment_done)
			{
				// If successfully remove Appointment add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.appointment) type alias was removed from the
<b>#__content_type</b> table'));
			}

			// Remove Appointment items from the contentitem tag map table
			$appointment_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.appointment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($appointment_condition);
			$db->setQuery($query);
			// Execute the query to remove Appointment items
			$appointment_done = $db->execute();
			if ($appointment_done)
			{
				// If successfully remove Appointment add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.appointment) type alias was removed from the
<b>#__contentitem_tag_map</b> table'));
			}

			// Remove Appointment items from the ucm content table
			$appointment_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.appointment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($appointment_condition);
			$db->setQuery($query);
			// Execute the query to remove Appointment items
			$appointment_done = $db->execute();
			if ($appointment_done)
			{
				// If successfully removed Appointment add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.appointment) type alias was removed from the
<b>#__ucm_content</b> table'));
			}

			// Make sure that all the Appointment items are cleared from DB
			foreach ($appointment_ids as $appointment_id)
			{
				// Remove Appointment items from the ucm base table
				$appointment_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$appointment_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($appointment_condition);
				$db->setQuery($query);
				// Execute the query to remove Appointment items
				$db->execute();

				// Remove Appointment items from the ucm history table
				$appointment_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$appointment_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($appointment_condition);
				$db->setQuery($query);
				// Execute the query to remove Appointment items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Capital alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.capital') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$capital_found = $db->getNumRows();
		// Now check if there were any rows
		if ($capital_found)
		{
			// Since there are load the needed  capital type ids
			$capital_ids = $db->loadColumn();
			// Remove Capital from the content type table
			$capital_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.capital') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($capital_condition);
			$db->setQuery($query);
			// Execute the query to remove Capital items
			$capital_done = $db->execute();
			if ($capital_done)
			{
				// If successfully remove Capital add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.capital)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Capital items from the contentitem tag map table
			$capital_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.capital') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($capital_condition);
			$db->setQuery($query);
			// Execute the query to remove Capital items
			$capital_done = $db->execute();
			if ($capital_done)
			{
				// If successfully remove Capital add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.capital)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Capital items from the ucm content table
			$capital_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.capital') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($capital_condition);
			$db->setQuery($query);
			// Execute the query to remove Capital items
			$capital_done = $db->execute();
			if ($capital_done)
			{
				// If successfully removed Capital add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.capital)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Capital items are cleared from DB
			foreach ($capital_ids as $capital_id)
			{
				// Remove Capital items from the ucm base table
				$capital_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $capital_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($capital_condition);
				$db->setQuery($query);
				// Execute the query to remove Capital items
				$db->execute();

				// Remove Capital items from the ucm history table
				$capital_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $capital_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($capital_condition);
				$db->setQuery($query);
				// Execute the query to remove Capital items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Comment alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.comment') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$comment_found = $db->getNumRows();
		// Now check if there were any rows
		if ($comment_found)
		{
			// Since there are load the needed  comment type ids
			$comment_ids = $db->loadColumn();
			// Remove Comment from the content type table
			$comment_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.comment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($comment_condition);
			$db->setQuery($query);
			// Execute the query to remove Comment items
			$comment_done = $db->execute();
			if ($comment_done)
			{
				// If successfully remove Comment add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.comment)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Comment items from the contentitem tag map table
			$comment_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.comment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($comment_condition);
			$db->setQuery($query);
			// Execute the query to remove Comment items
			$comment_done = $db->execute();
			if ($comment_done)
			{
				// If successfully remove Comment add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.comment)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Comment items from the ucm content table
			$comment_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.comment') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($comment_condition);
			$db->setQuery($query);
			// Execute the query to remove Comment items
			$comment_done = $db->execute();
			if ($comment_done)
			{
				// If successfully removed Comment add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.comment)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Comment items are cleared from DB
			foreach ($comment_ids as $comment_id)
			{
				// Remove Comment items from the ucm base table
				$comment_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $comment_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($comment_condition);
				$db->setQuery($query);
				// Execute the query to remove Comment items
				$db->execute();

				// Remove Comment items from the ucm history table
				$comment_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $comment_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($comment_condition);
				$db->setQuery($query);
				// Execute the query to remove Comment items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Session alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.session') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$session_found = $db->getNumRows();
		// Now check if there were any rows
		if ($session_found)
		{
			// Since there are load the needed  session type ids
			$session_ids = $db->loadColumn();
			// Remove Session from the content type table
			$session_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.session') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($session_condition);
			$db->setQuery($query);
			// Execute the query to remove Session items
			$session_done = $db->execute();
			if ($session_done)
			{
				// If successfully remove Session add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.session)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Session items from the contentitem tag map table
			$session_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.session') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($session_condition);
			$db->setQuery($query);
			// Execute the query to remove Session items
			$session_done = $db->execute();
			if ($session_done)
			{
				// If successfully remove Session add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.session)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Session items from the ucm content table
			$session_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.session') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($session_condition);
			$db->setQuery($query);
			// Execute the query to remove Session items
			$session_done = $db->execute();
			if ($session_done)
			{
				// If successfully removed Session add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.session)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Session items are cleared from DB
			foreach ($session_ids as $session_id)
			{
				// Remove Session items from the ucm base table
				$session_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $session_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($session_condition);
				$db->setQuery($query);
				// Execute the query to remove Session items
				$db->execute();

				// Remove Session items from the ucm history table
				$session_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $session_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($session_condition);
				$db->setQuery($query);
				// Execute the query to remove Session items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Sick alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.sick') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$sick_found = $db->getNumRows();
		// Now check if there were any rows
		if ($sick_found)
		{
			// Since there are load the needed  sick type ids
			$sick_ids = $db->loadColumn();
			// Remove Sick from the content type table
			$sick_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.sick') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($sick_condition);
			$db->setQuery($query);
			// Execute the query to remove Sick items
			$sick_done = $db->execute();
			if ($sick_done)
			{
				// If successfully remove Sick add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.sick) type
alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Sick items from the contentitem tag map table
			$sick_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.sick') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($sick_condition);
			$db->setQuery($query);
			// Execute the query to remove Sick items
			$sick_done = $db->execute();
			if ($sick_done)
			{
				// If successfully remove Sick add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.sick) type
alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Sick items from the ucm content table
			$sick_condition = array( $db->quoteName('core_type_alias')
. ' = ' . $db->quote('com_reservation.sick') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($sick_condition);
			$db->setQuery($query);
			// Execute the query to remove Sick items
			$sick_done = $db->execute();
			if ($sick_done)
			{
				// If successfully removed Sick add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.sick) type
alias was removed from the <b>#__ucm_content</b> table'));
			}

			// Make sure that all the Sick items are cleared from DB
			foreach ($sick_ids as $sick_id)
			{
				// Remove Sick items from the ucm base table
				$sick_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $sick_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($sick_condition);
				$db->setQuery($query);
				// Execute the query to remove Sick items
				$db->execute();

				// Remove Sick items from the ucm history table
				$sick_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $sick_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($sick_condition);
				$db->setQuery($query);
				// Execute the query to remove Sick items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Plan alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.plan') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$plan_found = $db->getNumRows();
		// Now check if there were any rows
		if ($plan_found)
		{
			// Since there are load the needed  plan type ids
			$plan_ids = $db->loadColumn();
			// Remove Plan from the content type table
			$plan_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.plan') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($plan_condition);
			$db->setQuery($query);
			// Execute the query to remove Plan items
			$plan_done = $db->execute();
			if ($plan_done)
			{
				// If successfully remove Plan add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.plan) type
alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Plan items from the contentitem tag map table
			$plan_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.plan') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($plan_condition);
			$db->setQuery($query);
			// Execute the query to remove Plan items
			$plan_done = $db->execute();
			if ($plan_done)
			{
				// If successfully remove Plan add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.plan) type
alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Plan items from the ucm content table
			$plan_condition = array( $db->quoteName('core_type_alias')
. ' = ' . $db->quote('com_reservation.plan') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($plan_condition);
			$db->setQuery($query);
			// Execute the query to remove Plan items
			$plan_done = $db->execute();
			if ($plan_done)
			{
				// If successfully removed Plan add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.plan) type
alias was removed from the <b>#__ucm_content</b> table'));
			}

			// Make sure that all the Plan items are cleared from DB
			foreach ($plan_ids as $plan_id)
			{
				// Remove Plan items from the ucm base table
				$plan_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $plan_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($plan_condition);
				$db->setQuery($query);
				// Execute the query to remove Plan items
				$db->execute();

				// Remove Plan items from the ucm history table
				$plan_condition = array( $db->quoteName('ucm_type_id') .
' = ' . $plan_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($plan_condition);
				$db->setQuery($query);
				// Execute the query to remove Plan items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Consultant alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.consultant') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$consultant_found = $db->getNumRows();
		// Now check if there were any rows
		if ($consultant_found)
		{
			// Since there are load the needed  consultant type ids
			$consultant_ids = $db->loadColumn();
			// Remove Consultant from the content type table
			$consultant_condition = array( $db->quoteName('type_alias')
. ' = '. $db->quote('com_reservation.consultant') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($consultant_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant items
			$consultant_done = $db->execute();
			if ($consultant_done)
			{
				// If successfully remove Consultant add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.consultant)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Consultant items from the contentitem tag map table
			$consultant_condition = array( $db->quoteName('type_alias')
. ' = '. $db->quote('com_reservation.consultant') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($consultant_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant items
			$consultant_done = $db->execute();
			if ($consultant_done)
			{
				// If successfully remove Consultant add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.consultant)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Consultant items from the ucm content table
			$consultant_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.consultant') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($consultant_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant items
			$consultant_done = $db->execute();
			if ($consultant_done)
			{
				// If successfully removed Consultant add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.consultant)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Consultant items are cleared from DB
			foreach ($consultant_ids as $consultant_id)
			{
				// Remove Consultant items from the ucm base table
				$consultant_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$consultant_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($consultant_condition);
				$db->setQuery($query);
				// Execute the query to remove Consultant items
				$db->execute();

				// Remove Consultant items from the ucm history table
				$consultant_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$consultant_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($consultant_condition);
				$db->setQuery($query);
				// Execute the query to remove Consultant items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Consultant catid alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.consultant.category') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$consultant_catid_found = $db->getNumRows();
		// Now check if there were any rows
		if ($consultant_catid_found)
		{
			// Since there are load the needed  consultant_catid type ids
			$consultant_catid_ids = $db->loadColumn();
			// Remove Consultant catid from the content type table
			$consultant_catid_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.consultant.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($consultant_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant catid items
			$consultant_catid_done = $db->execute();
			if ($consultant_catid_done)
			{
				// If successfully remove Consultant catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.consultant.category) type alias was removed from the
<b>#__content_type</b> table'));
			}

			// Remove Consultant catid items from the contentitem tag map table
			$consultant_catid_condition = array(
$db->quoteName('type_alias') . ' = '.
$db->quote('com_reservation.consultant.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($consultant_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant catid items
			$consultant_catid_done = $db->execute();
			if ($consultant_catid_done)
			{
				// If successfully remove Consultant catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.consultant.category) type alias was removed from the
<b>#__contentitem_tag_map</b> table'));
			}

			// Remove Consultant catid items from the ucm content table
			$consultant_catid_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.consultant.category') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($consultant_catid_condition);
			$db->setQuery($query);
			// Execute the query to remove Consultant catid items
			$consultant_catid_done = $db->execute();
			if ($consultant_catid_done)
			{
				// If successfully removed Consultant catid add queued success message.
				$app->enqueueMessage(JText::_('The
(com_reservation.consultant.category) type alias was removed from the
<b>#__ucm_content</b> table'));
			}

			// Make sure that all the Consultant catid items are cleared from DB
			foreach ($consultant_catid_ids as $consultant_catid_id)
			{
				// Remove Consultant catid items from the ucm base table
				$consultant_catid_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$consultant_catid_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($consultant_catid_condition);
				$db->setQuery($query);
				// Execute the query to remove Consultant catid items
				$db->execute();

				// Remove Consultant catid items from the ucm history table
				$consultant_catid_condition = array(
$db->quoteName('ucm_type_id') . ' = ' .
$consultant_catid_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($consultant_catid_condition);
				$db->setQuery($query);
				// Execute the query to remove Consultant catid items
				$db->execute();
			}
		}

		// Create a new query object.
		$query = $db->getQuery(true);
		// Select id from content type table
		$query->select($db->quoteName('type_id'));
		$query->from($db->quoteName('#__content_types'));
		// Where Message alias is found
		$query->where( $db->quoteName('type_alias') . ' =
'. $db->quote('com_reservation.message') );
		$db->setQuery($query);
		// Execute query to see if alias is found
		$db->execute();
		$message_found = $db->getNumRows();
		// Now check if there were any rows
		if ($message_found)
		{
			// Since there are load the needed  message type ids
			$message_ids = $db->loadColumn();
			// Remove Message from the content type table
			$message_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.message') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__content_types'));
			$query->where($message_condition);
			$db->setQuery($query);
			// Execute the query to remove Message items
			$message_done = $db->execute();
			if ($message_done)
			{
				// If successfully remove Message add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.message)
type alias was removed from the <b>#__content_type</b>
table'));
			}

			// Remove Message items from the contentitem tag map table
			$message_condition = array( $db->quoteName('type_alias') .
' = '. $db->quote('com_reservation.message') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__contentitem_tag_map'));
			$query->where($message_condition);
			$db->setQuery($query);
			// Execute the query to remove Message items
			$message_done = $db->execute();
			if ($message_done)
			{
				// If successfully remove Message add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.message)
type alias was removed from the <b>#__contentitem_tag_map</b>
table'));
			}

			// Remove Message items from the ucm content table
			$message_condition = array(
$db->quoteName('core_type_alias') . ' = ' .
$db->quote('com_reservation.message') );
			// Create a new query object.
			$query = $db->getQuery(true);
			$query->delete($db->quoteName('#__ucm_content'));
			$query->where($message_condition);
			$db->setQuery($query);
			// Execute the query to remove Message items
			$message_done = $db->execute();
			if ($message_done)
			{
				// If successfully removed Message add queued success message.
				$app->enqueueMessage(JText::_('The (com_reservation.message)
type alias was removed from the <b>#__ucm_content</b>
table'));
			}

			// Make sure that all the Message items are cleared from DB
			foreach ($message_ids as $message_id)
			{
				// Remove Message items from the ucm base table
				$message_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $message_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_base'));
				$query->where($message_condition);
				$db->setQuery($query);
				// Execute the query to remove Message items
				$db->execute();

				// Remove Message items from the ucm history table
				$message_condition = array( $db->quoteName('ucm_type_id')
. ' = ' . $message_id);
				// Create a new query object.
				$query = $db->getQuery(true);
				$query->delete($db->quoteName('#__ucm_history'));
				$query->where($message_condition);
				$db->setQuery($query);
				// Execute the query to remove Message items
				$db->execute();
			}
		}

		// If All related items was removed queued success message.
		$app->enqueueMessage(JText::_('All related items was removed from
the <b>#__ucm_base</b> table'));
		$app->enqueueMessage(JText::_('All related items was removed from
the <b>#__ucm_history</b> table'));

		// Remove reservation assets from the assets table
		$reservation_condition = array( $db->quoteName('name') .
' LIKE ' . $db->quote('com_reservation%') );

		// Create a new query object.
		$query = $db->getQuery(true);
		$query->delete($db->quoteName('#__assets'));
		$query->where($reservation_condition);
		$db->setQuery($query);
		$message_done = $db->execute();
		if ($message_done)
		{
			// If successfully removed reservation add queued success message.
			$app->enqueueMessage(JText::_('All related items was removed
from the <b>#__assets</b> table'));
		}

		// little notice as after service, in case of bad experience with
component.
		echo '<h2>Did something go wrong? Are you
disappointed?</h2>
		<p>Please let me know at <a
href="mailto:farhad.shahbazi0010@gmail.com">farhad.shahbazi0010@gmail.com</a>.
		<br />We at fdsh are committed to building extensions that performs
proficiently! You can help us, really!
		<br />Send me your thoughts on improvements that is needed, trust
me, I will be very grateful!
		<br />Visit us at <a href="http://farhad.com"
target="_blank">http://farhad.com</a>
today!</p>';
	}

	/**
	 * Called on update
	 *
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 *
	 * @return  boolean  True on success
	 */
	public function update(JAdapterInstance $parent){}

	/**
	 * Called before any type of action
	 *
	 * @param   string  $type  Which action is happening
(install|uninstall|discover_install|update)
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 *
	 * @return  boolean  True on success
	 */
	public function preflight($type, JAdapterInstance $parent)
	{
		// get application
		$app = JFactory::getApplication();
		// is redundant or so it seems ...hmmm let me know if it works again
		if ($type === 'uninstall')
		{
			return true;
		}
		// the default for both install and update
		$jversion = new JVersion();
		if (!$jversion->isCompatible('3.8.0'))
		{
			$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0
before continuing!', 'error');
			return false;
		}
		// do any updates needed
		if ($type === 'update')
		{
		}
		// do any install needed
		if ($type === 'install')
		{
		}
		// check if the PHPExcel stuff is still around
		if (File::exists(JPATH_ADMINISTRATOR .
'/components/com_reservation/helpers/PHPExcel.php'))
		{
			// We need to remove this old PHPExcel folder
			$this->removeFolder(JPATH_ADMINISTRATOR .
'/components/com_reservation/helpers/PHPExcel');
			// We need to remove this old PHPExcel file
			File::delete(JPATH_ADMINISTRATOR .
'/components/com_reservation/helpers/PHPExcel.php');
		}
		return true;
	}

	/**
	 * Called after any type of action
	 *
	 * @param   string  $type  Which action is happening
(install|uninstall|discover_install|update)
	 * @param   JAdapterInstance  $parent  The object responsible for running
this script
	 *
	 * @return  boolean  True on success
	 */
	public function postflight($type, JAdapterInstance $parent)
	{
		// get application
		$app = JFactory::getApplication();
		// We check if we have dynamic folders to copy
		$this->setDynamicF0ld3rs($app, $parent);
		// set the default component settings
		if ($type === 'install')
		{

			// Get The Database object
			$db = JFactory::getDbo();

			// Create the reserve content type object.
			$reserve = new stdClass();
			$reserve->type_title = 'Reservation Reserve';
			$reserve->type_alias = 'com_reservation.reserve';
			$reserve->table = '{"special": {"dbtable":
"#__reservation_reserve","key":
"id","type": "Reserve","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$reserve->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"appointmentid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"appointmentid":"appointmentid","sickid":"sickid","full_price":"full_price","doctor_quota":"doctor_quota","system_quota":"system_quota","status":"status","payment_method":"payment_method","tracking_code":"tracking_code"}}';
			$reserve->router =
'ReservationHelperRoute::getReserveRoute';
			$reserve->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/reserve.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","appointmentid","sickid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"appointmentid","targetTable":
"#__reservation_appointment","targetColumn":
"id","displayColumn":
"appointment"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn": "phonenumber"}]}';

			// Set the object into the content types table.
			$reserve_Inserted = $db->insertObject('#__content_types',
$reserve);

			// Create the bbbclass content type object.
			$bbbclass = new stdClass();
			$bbbclass->type_title = 'Reservation Bbbclass';
			$bbbclass->type_alias = 'com_reservation.bbbclass';
			$bbbclass->table = '{"special": {"dbtable":
"#__reservation_bbbclass","key":
"id","type": "Bbbclass","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$bbbclass->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"name","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"name":"name","planid":"planid","seid":"seid","exmid":"exmid","inmid":"inmid","mpass":"mpass","vpass":"vpass"}}';
			$bbbclass->router =
'ReservationHelperRoute::getBbbclassRoute';
			$bbbclass->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/bbbclass.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","planid","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"planid","targetTable":
"#__reservation_plan","targetColumn":
"id","displayColumn": "id"}]}';

			// Set the object into the content types table.
			$bbbclass_Inserted = $db->insertObject('#__content_types',
$bbbclass);

			// Create the doctor content type object.
			$doctor = new stdClass();
			$doctor->type_title = 'Reservation Doctor';
			$doctor->type_alias = 'com_reservation.doctor';
			$doctor->table = '{"special": {"dbtable":
"#__reservation_doctor","key":
"id","type": "Doctor","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$doctor->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"address","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"catid","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","msn":"msn","phonenumber":"phonenumber","officephone":"officephone","address":"address","presence":"presence","image":"image","capitalid":"capitalid","cityid":"cityid","alt":"alt"}}';
			$doctor->router = 'ReservationHelperRoute::getDoctorRoute';
			$doctor->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/doctor.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","catid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "catid","targetTable":
"#__categories","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Set the object into the content types table.
			$doctor_Inserted = $db->insertObject('#__content_types',
$doctor);

			// Create the doctor category content type object.
			$doctor_category = new stdClass();
			$doctor_category->type_title = 'Reservation Doctor Catid';
			$doctor_category->type_alias =
'com_reservation.doctor.category';
			$doctor_category->table =
'{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}';
			$doctor_category->field_mappings =
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description",
"core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access",
"core_params":"params",
"core_featured":"null",
"core_metadata":"metadata",
"core_language":"language",
"core_images":"null",
"core_urls":"null",
"core_version":"version",
"core_ordering":"null",
"core_metakey":"metakey",
"core_metadesc":"metadesc",
"core_catid":"parent_id",
"core_xreference":"null",
"asset_id":"asset_id"},
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}';
			$doctor_category->router =
'ReservationHelperRoute::getCategoryRoute';
			$doctor_category->content_history_options =
'{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml",
"hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"],
"ignoreChanges":["modified_user_id",
"modified_time", "checked_out",
"checked_out_time", "version", "hits",
"path"],"convertToInt":["publish_up",
"publish_down"],
"displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}';

			// Set the object into the content types table.
			$doctor_category_Inserted =
$db->insertObject('#__content_types', $doctor_category);

			// Create the appointment content type object.
			$appointment = new stdClass();
			$appointment->type_title = 'Reservation Appointment';
			$appointment->type_alias = 'com_reservation.appointment';
			$appointment->table = '{"special":
{"dbtable":
"#__reservation_appointment","key":
"id","type":
"Appointment","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$appointment->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"title","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"title":"title","appointment":"appointment","doctorid":"doctorid"}}';
			$appointment->router =
'ReservationHelperRoute::getAppointmentRoute';
			$appointment->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/appointment.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","doctorid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"doctorid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn": "id"}]}';

			// Set the object into the content types table.
			$appointment_Inserted =
$db->insertObject('#__content_types', $appointment);

			// Create the capital content type object.
			$capital = new stdClass();
			$capital->type_title = 'Reservation Capital';
			$capital->type_alias = 'com_reservation.capital';
			$capital->table = '{"special": {"dbtable":
"#__reservation_capital","key":
"id","type": "Capital","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$capital->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"name","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"name":"name","capitalid":"capitalid"}}';
			$capital->router =
'ReservationHelperRoute::getCapitalRoute';
			$capital->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/capital.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","capitalid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Set the object into the content types table.
			$capital_Inserted = $db->insertObject('#__content_types',
$capital);

			// Create the comment content type object.
			$comment = new stdClass();
			$comment->type_title = 'Reservation Comment';
			$comment->type_alias = 'com_reservation.comment';
			$comment->table = '{"special": {"dbtable":
"#__reservation_comment","key":
"id","type": "Comment","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$comment->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"text","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"text":"text","consultantid":"consultantid","sickid":"sickid","rate":"rate","seid":"seid","token":"token"}}';
			$comment->router =
'ReservationHelperRoute::getCommentRoute';
			$comment->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/comment.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","consultantid","sickid","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"consultantid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn":
"id"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn": "phonenumber"}]}';

			// Set the object into the content types table.
			$comment_Inserted = $db->insertObject('#__content_types',
$comment);

			// Create the session content type object.
			$session = new stdClass();
			$session->type_title = 'Reservation Session';
			$session->type_alias = 'com_reservation.session';
			$session->table = '{"special": {"dbtable":
"#__reservation_session","key":
"id","type": "Session","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$session->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"sickid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"sickid":"sickid","planid":"planid","pay":"pay","finish":"finish","channel_token":"channel_token","firsttext":"firsttext"}}';
			$session->router =
'ReservationHelperRoute::getSessionRoute';
			$session->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/session.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","sickid","planid","pay","finish"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn":
"phonenumber"},{"sourceColumn":
"planid","targetTable":
"#__reservation_plan","targetColumn":
"id","displayColumn": "id"}]}';

			// Set the object into the content types table.
			$session_Inserted = $db->insertObject('#__content_types',
$session);

			// Create the sick content type object.
			$sick = new stdClass();
			$sick->type_title = 'Reservation Sick';
			$sick->type_alias = 'com_reservation.sick';
			$sick->table = '{"special": {"dbtable":
"#__reservation_sick","key":
"id","type": "Sick","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$sick->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","phonenumber":"phonenumber","capitalid":"capitalid","cityid":"cityid","image":"image","cardnumber":"cardnumber","alt":"alt"}}';
			$sick->router = 'ReservationHelperRoute::getSickRoute';
			$sick->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/sick.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Set the object into the content types table.
			$sick_Inserted = $db->insertObject('#__content_types',
$sick);

			// Create the plan content type object.
			$plan = new stdClass();
			$plan->type_title = 'Reservation Plan';
			$plan->type_alias = 'com_reservation.plan';
			$plan->table = '{"special": {"dbtable":
"#__reservation_plan","key":
"id","type": "Plan","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$plan->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"plantype","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"plantype":"plantype","time":"time","price":"price","waitingtime":"waitingtime","consultantid":"consultantid"}}';
			$plan->router = 'ReservationHelperRoute::getPlanRoute';
			$plan->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/plan.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","consultantid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"consultantid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn": "id"}]}';

			// Set the object into the content types table.
			$plan_Inserted = $db->insertObject('#__content_types',
$plan);

			// Create the consultant content type object.
			$consultant = new stdClass();
			$consultant->type_title = 'Reservation Consultant';
			$consultant->type_alias = 'com_reservation.consultant';
			$consultant->table = '{"special":
{"dbtable":
"#__reservation_consultant","key":
"id","type": "Consultant","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$consultant->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"address","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"catid","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","nationalnumber":"nationalnumber","image":"image","experience":"experience","msn":"msn","phonenumber":"phonenumber","shortlink":"shortlink","account":"account","address":"address","presence":"presence","video":"video","alt":"alt","officephone":"officephone","capitalid":"capitalid","cityid":"cityid","introduction":"introduction"}}';
			$consultant->router =
'ReservationHelperRoute::getConsultantRoute';
			$consultant->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/consultant.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","catid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "catid","targetTable":
"#__categories","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Set the object into the content types table.
			$consultant_Inserted =
$db->insertObject('#__content_types', $consultant);

			// Create the consultant category content type object.
			$consultant_category = new stdClass();
			$consultant_category->type_title = 'Reservation Consultant
Catid';
			$consultant_category->type_alias =
'com_reservation.consultant.category';
			$consultant_category->table =
'{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}';
			$consultant_category->field_mappings =
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description",
"core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access",
"core_params":"params",
"core_featured":"null",
"core_metadata":"metadata",
"core_language":"language",
"core_images":"null",
"core_urls":"null",
"core_version":"version",
"core_ordering":"null",
"core_metakey":"metakey",
"core_metadesc":"metadesc",
"core_catid":"parent_id",
"core_xreference":"null",
"asset_id":"asset_id"},
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}';
			$consultant_category->router =
'ReservationHelperRoute::getCategoryRoute';
			$consultant_category->content_history_options =
'{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml",
"hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"],
"ignoreChanges":["modified_user_id",
"modified_time", "checked_out",
"checked_out_time", "version", "hits",
"path"],"convertToInt":["publish_up",
"publish_down"],
"displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}';

			// Set the object into the content types table.
			$consultant_category_Inserted =
$db->insertObject('#__content_types', $consultant_category);

			// Create the message content type object.
			$message = new stdClass();
			$message->type_title = 'Reservation Message';
			$message->type_alias = 'com_reservation.message';
			$message->table = '{"special": {"dbtable":
"#__reservation_message","key":
"id","type": "Message","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$message->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"null","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"from":"from","to":"to","reply":"reply","message":"message","read":"read","seen":"seen","seid":"seid"}}';
			$message->router =
'ReservationHelperRoute::getMessageRoute';
			$message->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/message.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","from","to","reply","read","seen","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"reply","targetTable":
"#__reservation_message","targetColumn":
"id","displayColumn": "message"}]}';

			// Set the object into the content types table.
			$message_Inserted = $db->insertObject('#__content_types',
$message);


			// Install the global extenstion params.
			$query = $db->getQuery(true);
			// Field to update.
			$fields = array(
				$db->quoteName('params') . ' = ' .
$db->quote('{"autorName":"farhad
shahbazi","autorEmail":"farhad.shahbazi0010@gmail.com","consultantgroup":"0","doctorgroup":"0","sickgroup":"0","imgext":"jpg,jpeg,png,gif,bmp,jfif,pjpeg,webp,tif,tiff","check_in":"-1
day","save_history":"1","history_limit":"10"}'),
			);
			// Condition.
			$conditions = array(
				$db->quoteName('element') . ' = ' .
$db->quote('com_reservation')
			);
			$query->update($db->quoteName('#__extensions'))->set($fields)->where($conditions);
			$db->setQuery($query);
			$allDone = $db->execute();

			echo '<a target="_blank"
href="http://farhad.com" title="Reservation">
				<img
src="components/com_reservation/assets/images/vdm-component.jpg"/>
				</a>';
		}
		// do any updates needed
		if ($type === 'update')
		{

			// Get The Database object
			$db = JFactory::getDbo();

			// Create the reserve content type object.
			$reserve = new stdClass();
			$reserve->type_title = 'Reservation Reserve';
			$reserve->type_alias = 'com_reservation.reserve';
			$reserve->table = '{"special": {"dbtable":
"#__reservation_reserve","key":
"id","type": "Reserve","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$reserve->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"appointmentid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"appointmentid":"appointmentid","sickid":"sickid","full_price":"full_price","doctor_quota":"doctor_quota","system_quota":"system_quota","status":"status","payment_method":"payment_method","tracking_code":"tracking_code"}}';
			$reserve->router =
'ReservationHelperRoute::getReserveRoute';
			$reserve->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/reserve.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","appointmentid","sickid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"appointmentid","targetTable":
"#__reservation_appointment","targetColumn":
"id","displayColumn":
"appointment"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn": "phonenumber"}]}';

			// Check if reserve type is already in content_type DB.
			$reserve_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($reserve->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$reserve->type_id = $db->loadResult();
				$reserve_Updated = $db->updateObject('#__content_types',
$reserve, 'type_id');
			}
			else
			{
				$reserve_Inserted = $db->insertObject('#__content_types',
$reserve);
			}

			// Create the bbbclass content type object.
			$bbbclass = new stdClass();
			$bbbclass->type_title = 'Reservation Bbbclass';
			$bbbclass->type_alias = 'com_reservation.bbbclass';
			$bbbclass->table = '{"special": {"dbtable":
"#__reservation_bbbclass","key":
"id","type": "Bbbclass","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$bbbclass->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"name","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"name":"name","planid":"planid","seid":"seid","exmid":"exmid","inmid":"inmid","mpass":"mpass","vpass":"vpass"}}';
			$bbbclass->router =
'ReservationHelperRoute::getBbbclassRoute';
			$bbbclass->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/bbbclass.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","planid","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"planid","targetTable":
"#__reservation_plan","targetColumn":
"id","displayColumn": "id"}]}';

			// Check if bbbclass type is already in content_type DB.
			$bbbclass_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($bbbclass->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$bbbclass->type_id = $db->loadResult();
				$bbbclass_Updated = $db->updateObject('#__content_types',
$bbbclass, 'type_id');
			}
			else
			{
				$bbbclass_Inserted = $db->insertObject('#__content_types',
$bbbclass);
			}

			// Create the doctor content type object.
			$doctor = new stdClass();
			$doctor->type_title = 'Reservation Doctor';
			$doctor->type_alias = 'com_reservation.doctor';
			$doctor->table = '{"special": {"dbtable":
"#__reservation_doctor","key":
"id","type": "Doctor","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$doctor->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"address","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"catid","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","msn":"msn","phonenumber":"phonenumber","officephone":"officephone","address":"address","presence":"presence","image":"image","capitalid":"capitalid","cityid":"cityid","alt":"alt"}}';
			$doctor->router = 'ReservationHelperRoute::getDoctorRoute';
			$doctor->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/doctor.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","catid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "catid","targetTable":
"#__categories","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Check if doctor type is already in content_type DB.
			$doctor_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($doctor->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$doctor->type_id = $db->loadResult();
				$doctor_Updated = $db->updateObject('#__content_types',
$doctor, 'type_id');
			}
			else
			{
				$doctor_Inserted = $db->insertObject('#__content_types',
$doctor);
			}

			// Create the doctor category content type object.
			$doctor_category = new stdClass();
			$doctor_category->type_title = 'Reservation Doctor Catid';
			$doctor_category->type_alias =
'com_reservation.doctor.category';
			$doctor_category->table =
'{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}';
			$doctor_category->field_mappings =
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description",
"core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access",
"core_params":"params",
"core_featured":"null",
"core_metadata":"metadata",
"core_language":"language",
"core_images":"null",
"core_urls":"null",
"core_version":"version",
"core_ordering":"null",
"core_metakey":"metakey",
"core_metadesc":"metadesc",
"core_catid":"parent_id",
"core_xreference":"null",
"asset_id":"asset_id"},
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}';
			$doctor_category->router =
'ReservationHelperRoute::getCategoryRoute';
			$doctor_category->content_history_options =
'{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml",
"hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"],
"ignoreChanges":["modified_user_id",
"modified_time", "checked_out",
"checked_out_time", "version", "hits",
"path"],"convertToInt":["publish_up",
"publish_down"],
"displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}';

			// Check if doctor category type is already in content_type DB.
			$doctor_category_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($doctor_category->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$doctor_category->type_id = $db->loadResult();
				$doctor_category_Updated =
$db->updateObject('#__content_types', $doctor_category,
'type_id');
			}
			else
			{
				$doctor_category_Inserted =
$db->insertObject('#__content_types', $doctor_category);
			}

			// Create the appointment content type object.
			$appointment = new stdClass();
			$appointment->type_title = 'Reservation Appointment';
			$appointment->type_alias = 'com_reservation.appointment';
			$appointment->table = '{"special":
{"dbtable":
"#__reservation_appointment","key":
"id","type":
"Appointment","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$appointment->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"title","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"title":"title","appointment":"appointment","doctorid":"doctorid"}}';
			$appointment->router =
'ReservationHelperRoute::getAppointmentRoute';
			$appointment->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/appointment.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","doctorid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"doctorid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn": "id"}]}';

			// Check if appointment type is already in content_type DB.
			$appointment_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($appointment->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$appointment->type_id = $db->loadResult();
				$appointment_Updated =
$db->updateObject('#__content_types', $appointment,
'type_id');
			}
			else
			{
				$appointment_Inserted =
$db->insertObject('#__content_types', $appointment);
			}

			// Create the capital content type object.
			$capital = new stdClass();
			$capital->type_title = 'Reservation Capital';
			$capital->type_alias = 'com_reservation.capital';
			$capital->table = '{"special": {"dbtable":
"#__reservation_capital","key":
"id","type": "Capital","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$capital->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"name","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"name":"name","capitalid":"capitalid"}}';
			$capital->router =
'ReservationHelperRoute::getCapitalRoute';
			$capital->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/capital.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","capitalid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Check if capital type is already in content_type DB.
			$capital_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($capital->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$capital->type_id = $db->loadResult();
				$capital_Updated = $db->updateObject('#__content_types',
$capital, 'type_id');
			}
			else
			{
				$capital_Inserted = $db->insertObject('#__content_types',
$capital);
			}

			// Create the comment content type object.
			$comment = new stdClass();
			$comment->type_title = 'Reservation Comment';
			$comment->type_alias = 'com_reservation.comment';
			$comment->table = '{"special": {"dbtable":
"#__reservation_comment","key":
"id","type": "Comment","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$comment->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"text","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"text":"text","consultantid":"consultantid","sickid":"sickid","rate":"rate","seid":"seid","token":"token"}}';
			$comment->router =
'ReservationHelperRoute::getCommentRoute';
			$comment->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/comment.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","consultantid","sickid","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"consultantid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn":
"id"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn": "phonenumber"}]}';

			// Check if comment type is already in content_type DB.
			$comment_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($comment->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$comment->type_id = $db->loadResult();
				$comment_Updated = $db->updateObject('#__content_types',
$comment, 'type_id');
			}
			else
			{
				$comment_Inserted = $db->insertObject('#__content_types',
$comment);
			}

			// Create the session content type object.
			$session = new stdClass();
			$session->type_title = 'Reservation Session';
			$session->type_alias = 'com_reservation.session';
			$session->table = '{"special": {"dbtable":
"#__reservation_session","key":
"id","type": "Session","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$session->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"sickid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"sickid":"sickid","planid":"planid","pay":"pay","finish":"finish","channel_token":"channel_token","firsttext":"firsttext"}}';
			$session->router =
'ReservationHelperRoute::getSessionRoute';
			$session->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/session.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","sickid","planid","pay","finish"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"sickid","targetTable":
"#__reservation_sick","targetColumn":
"id","displayColumn":
"phonenumber"},{"sourceColumn":
"planid","targetTable":
"#__reservation_plan","targetColumn":
"id","displayColumn": "id"}]}';

			// Check if session type is already in content_type DB.
			$session_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($session->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$session->type_id = $db->loadResult();
				$session_Updated = $db->updateObject('#__content_types',
$session, 'type_id');
			}
			else
			{
				$session_Inserted = $db->insertObject('#__content_types',
$session);
			}

			// Create the sick content type object.
			$sick = new stdClass();
			$sick->type_title = 'Reservation Sick';
			$sick->type_alias = 'com_reservation.sick';
			$sick->table = '{"special": {"dbtable":
"#__reservation_sick","key":
"id","type": "Sick","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$sick->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","phonenumber":"phonenumber","capitalid":"capitalid","cityid":"cityid","image":"image","cardnumber":"cardnumber","alt":"alt"}}';
			$sick->router = 'ReservationHelperRoute::getSickRoute';
			$sick->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/sick.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Check if sick type is already in content_type DB.
			$sick_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($sick->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$sick->type_id = $db->loadResult();
				$sick_Updated = $db->updateObject('#__content_types',
$sick, 'type_id');
			}
			else
			{
				$sick_Inserted = $db->insertObject('#__content_types',
$sick);
			}

			// Create the plan content type object.
			$plan = new stdClass();
			$plan->type_title = 'Reservation Plan';
			$plan->type_alias = 'com_reservation.plan';
			$plan->table = '{"special": {"dbtable":
"#__reservation_plan","key":
"id","type": "Plan","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$plan->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"plantype","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"plantype":"plantype","time":"time","price":"price","waitingtime":"waitingtime","consultantid":"consultantid"}}';
			$plan->router = 'ReservationHelperRoute::getPlanRoute';
			$plan->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/plan.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","consultantid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"consultantid","targetTable":
"#__reservation_consultant","targetColumn":
"id","displayColumn": "id"}]}';

			// Check if plan type is already in content_type DB.
			$plan_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($plan->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$plan->type_id = $db->loadResult();
				$plan_Updated = $db->updateObject('#__content_types',
$plan, 'type_id');
			}
			else
			{
				$plan_Inserted = $db->insertObject('#__content_types',
$plan);
			}

			// Create the consultant content type object.
			$consultant = new stdClass();
			$consultant->type_title = 'Reservation Consultant';
			$consultant->type_alias = 'com_reservation.consultant';
			$consultant->table = '{"special":
{"dbtable":
"#__reservation_consultant","key":
"id","type": "Consultant","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$consultant->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"userid","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"address","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"catid","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"userid":"userid","nationalnumber":"nationalnumber","image":"image","experience":"experience","msn":"msn","phonenumber":"phonenumber","shortlink":"shortlink","account":"account","address":"address","presence":"presence","video":"video","alt":"alt","officephone":"officephone","capitalid":"capitalid","cityid":"cityid","introduction":"introduction"}}';
			$consultant->router =
'ReservationHelperRoute::getConsultantRoute';
			$consultant->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/consultant.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","userid","catid","capitalid","cityid"],"displayLookup":
[{"sourceColumn": "catid","targetTable":
"#__categories","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"capitalid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"cityid","targetTable":
"#__reservation_capital","targetColumn":
"id","displayColumn": "name"}]}';

			// Check if consultant type is already in content_type DB.
			$consultant_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($consultant->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$consultant->type_id = $db->loadResult();
				$consultant_Updated =
$db->updateObject('#__content_types', $consultant,
'type_id');
			}
			else
			{
				$consultant_Inserted =
$db->insertObject('#__content_types', $consultant);
			}

			// Create the consultant category content type object.
			$consultant_category = new stdClass();
			$consultant_category->type_title = 'Reservation Consultant
Catid';
			$consultant_category->type_alias =
'com_reservation.consultant.category';
			$consultant_category->table =
'{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}';
			$consultant_category->field_mappings =
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description",
"core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access",
"core_params":"params",
"core_featured":"null",
"core_metadata":"metadata",
"core_language":"language",
"core_images":"null",
"core_urls":"null",
"core_version":"version",
"core_ordering":"null",
"core_metakey":"metakey",
"core_metadesc":"metadesc",
"core_catid":"parent_id",
"core_xreference":"null",
"asset_id":"asset_id"},
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}';
			$consultant_category->router =
'ReservationHelperRoute::getCategoryRoute';
			$consultant_category->content_history_options =
'{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml",
"hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"],
"ignoreChanges":["modified_user_id",
"modified_time", "checked_out",
"checked_out_time", "version", "hits",
"path"],"convertToInt":["publish_up",
"publish_down"],
"displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}';

			// Check if consultant category type is already in content_type DB.
			$consultant_category_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($consultant_category->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$consultant_category->type_id = $db->loadResult();
				$consultant_category_Updated =
$db->updateObject('#__content_types', $consultant_category,
'type_id');
			}
			else
			{
				$consultant_category_Inserted =
$db->insertObject('#__content_types', $consultant_category);
			}

			// Create the message content type object.
			$message = new stdClass();
			$message->type_title = 'Reservation Message';
			$message->type_alias = 'com_reservation.message';
			$message->table = '{"special": {"dbtable":
"#__reservation_message","key":
"id","type": "Message","prefix":
"reservationTable","config":
"array()"},"common": {"dbtable":
"#__ucm_content","key":
"ucm_id","type":
"Corecontent","prefix":
"JTable","config": "array()"}}';
			$message->field_mappings = '{"common":
{"core_content_item_id": "id","core_title":
"null","core_state":
"published","core_alias":
"null","core_created_time":
"created","core_modified_time":
"modified","core_body":
"null","core_hits":
"hits","core_publish_up":
"null","core_publish_down":
"null","core_access":
"access","core_params":
"params","core_featured":
"null","core_metadata":
"null","core_language":
"null","core_images":
"null","core_urls":
"null","core_version":
"version","core_ordering":
"ordering","core_metakey":
"null","core_metadesc":
"null","core_catid":
"null","core_xreference":
"null","asset_id":
"asset_id"},"special":
{"from":"from","to":"to","reply":"reply","message":"message","read":"read","seen":"seen","seid":"seid"}}';
			$message->router =
'ReservationHelperRoute::getMessageRoute';
			$message->content_history_options = '{"formFile":
"administrator/components/com_reservation/models/forms/message.xml","hideFields":
["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":
["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt":
["published","ordering","from","to","reply","read","seen","seid"],"displayLookup":
[{"sourceColumn": "created_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"access","targetTable":
"#__viewlevels","targetColumn":
"id","displayColumn":
"title"},{"sourceColumn":
"modified_by","targetTable":
"#__users","targetColumn":
"id","displayColumn":
"name"},{"sourceColumn":
"reply","targetTable":
"#__reservation_message","targetColumn":
"id","displayColumn": "message"}]}';

			// Check if message type is already in content_type DB.
			$message_id = null;
			$query = $db->getQuery(true);
			$query->select($db->quoteName(array('type_id')));
			$query->from($db->quoteName('#__content_types'));
			$query->where($db->quoteName('type_alias') . ' LIKE
'. $db->quote($message->type_alias));
			$db->setQuery($query);
			$db->execute();

			// Set the object into the content types table.
			if ($db->getNumRows())
			{
				$message->type_id = $db->loadResult();
				$message_Updated = $db->updateObject('#__content_types',
$message, 'type_id');
			}
			else
			{
				$message_Inserted = $db->insertObject('#__content_types',
$message);
			}


			echo '<a target="_blank"
href="http://farhad.com" title="Reservation">
				<img
src="components/com_reservation/assets/images/vdm-component.jpg"/>
				</a>
				<h3>Upgrade to Version 1.0.39 Was Successful! Let us know if
anything is not working as expected.</h3>';
		}
		return true;
	}

	/**
	 * Remove folders with files
	 * 
	 * @param   string   $dir     The path to folder to remove
	 * @param   boolean  $ignore  The folders and files to ignore and not
remove
	 *
	 * @return  boolean   True in all is removed
	 * 
	 */
	protected function removeFolder($dir, $ignore = false)
	{
		if (Folder::exists($dir))
		{
			$it = new RecursiveDirectoryIterator($dir);
			$it = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
			// remove ending /
			$dir = rtrim($dir, '/');
			// now loop the files & folders
			foreach ($it as $file)
			{
				if ('.' === $file->getBasename() || '..' === 
$file->getBasename()) continue;
				// set file dir
				$file_dir = $file->getPathname();
				// check if this is a dir or a file
				if ($file->isDir())
				{
					$keeper = false;
					if ($this->checkArray($ignore))
					{
						foreach ($ignore as $keep)
						{
							if (strpos($file_dir, $dir.'/'.$keep) !== false)
							{
								$keeper = true;
							}
						}
					}
					if ($keeper)
					{
						continue;
					}
					Folder::delete($file_dir);
				}
				else
				{
					$keeper = false;
					if ($this->checkArray($ignore))
					{
						foreach ($ignore as $keep)
						{
							if (strpos($file_dir, $dir.'/'.$keep) !== false)
							{
								$keeper = true;
							}
						}
					}
					if ($keeper)
					{
						continue;
					}
					File::delete($file_dir);
				}
			}
			// delete the root folder if not ignore found
			if (!$this->checkArray($ignore))
			{
				return Folder::delete($dir);
			}
			return true;
		}
		return false;
	}

	/**
	 * Check if have an array with a length
	 *
	 * @input	array   The array to check
	 *
	 * @returns bool/int  number of items in array on success
	 */
	protected function checkArray($array, $removeEmptyString = false)
	{
		if (isset($array) && is_array($array) && ($nr =
count((array)$array)) > 0)
		{
			// also make sure the empty strings are removed
			if ($removeEmptyString)
			{
				foreach ($array as $key => $string)
				{
					if (empty($string))
					{
						unset($array[$key]);
					}
				}
				return $this->checkArray($array, false);
			}
			return $nr;
		}
		return false;
	}

	/**
	 * Method to set/copy dynamic folders into place (use with caution)
	 *
	 * @return void
	 */
	protected function setDynamicF0ld3rs($app, $parent)
	{
		// get the instalation path
		$installer = $parent->getParent();
		$installPath = $installer->getPath('source');
		// get all the folders
		$folders = Folder::folders($installPath);
		// check if we have folders we may want to copy
		$doNotCopy = array('media','admin','site');
// Joomla already deals with these
		if (count((array) $folders) > 1)
		{
			foreach ($folders as $folder)
			{
				// Only copy if not a standard folders
				if (!in_array($folder, $doNotCopy))
				{
					// set the source path
					$src = $installPath.'/'.$folder;
					// set the destination path
					$dest = JPATH_ROOT.'/'.$folder;
					// now try to copy the folder
					if (!Folder::copy($src, $dest, '', true))
					{
						$app->enqueueMessage('Could not copy '.$folder.'
folder into place, please make sure destination is writable!',
'error');
					}
				}
			}
		}
	}
}
<html><body
bgcolor="#FFFFFF"></body></html>CREATE TABLE IF
NOT EXISTS `#__reservation_reserve` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointmentid` INT(100) NOT NULL DEFAULT 0,
	`doctor_quota` VARCHAR(50) NOT NULL DEFAULT '',
	`full_price` VARCHAR(100) NOT NULL DEFAULT '',
	`payment_method` VARCHAR(50) NOT NULL DEFAULT '',
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`status` VARCHAR(50) NOT NULL DEFAULT '',
	`system_quota` VARCHAR(50) NOT NULL DEFAULT '',
	`tracking_code` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_appointmentid` (`appointmentid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_bbbclass` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`exmid` VARCHAR(255) NOT NULL DEFAULT '',
	`inmid` VARCHAR(255) NOT NULL DEFAULT '',
	`mpass` VARCHAR(255) NOT NULL DEFAULT '',
	`name` VARCHAR(255) NOT NULL DEFAULT '',
	`planid` INT(100) NOT NULL DEFAULT 0,
	`seid` INT(255) NOT NULL DEFAULT 0,
	`vpass` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_name` (`name`),
	KEY `idx_exmid` (`exmid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_doctor` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`address` TEXT NOT NULL,
	`alt` VARCHAR(255) NOT NULL DEFAULT '',
	`capitalid` INT(255) NOT NULL DEFAULT 0,
	`catid` INT(50) NOT NULL DEFAULT 0,
	`cityid` INT(255) NOT NULL DEFAULT 0,
	`image` VARCHAR(255) NOT NULL DEFAULT '',
	`msn` VARCHAR(50) NOT NULL DEFAULT '',
	`officephone` VARCHAR(50) NOT NULL DEFAULT '',
	`phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
	`presence` TEXT NOT NULL,
	`userid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_userid` (`userid`),
	KEY `idx_catid` (`catid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_appointment` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointment` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`doctorid` INT(100) NOT NULL DEFAULT 0,
	`title` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_title` (`title`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_capital` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`capitalid` INT(255) NOT NULL DEFAULT 0,
	`name` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_name` (`name`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_comment` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`consultantid` INT(255) NOT NULL DEFAULT 0,
	`rate` FLOAT(10) NOT NULL DEFAULT 0,
	`seid` INT(255) NOT NULL DEFAULT 0,
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`text` TEXT NOT NULL,
	`token` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_session` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`channel_token` VARCHAR(255) NOT NULL DEFAULT '',
	`finish` TINYINT(7) NOT NULL DEFAULT 0,
	`firsttext` VARCHAR(255) NOT NULL DEFAULT '',
	`pay` INT(7) NOT NULL DEFAULT 0,
	`planid` INT(100) NOT NULL DEFAULT 0,
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_sickid` (`sickid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_sick` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`alt` VARCHAR(255) NOT NULL DEFAULT '',
	`capitalid` INT(255) NOT NULL DEFAULT 0,
	`cardnumber` VARCHAR(64) NOT NULL DEFAULT '',
	`cityid` INT(255) NOT NULL DEFAULT 0,
	`image` VARCHAR(255) NOT NULL DEFAULT '',
	`phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
	`userid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_userid` (`userid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_plan` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`consultantid` INT(255) NOT NULL DEFAULT 0,
	`plantype` VARCHAR(7) NOT NULL DEFAULT '',
	`price` VARCHAR(50) NOT NULL DEFAULT '',
	`time` VARCHAR(50) NOT NULL DEFAULT '',
	`waitingtime` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_plantype` (`plantype`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_consultant` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`account` VARCHAR(50) NOT NULL DEFAULT '',
	`address` TEXT NOT NULL,
	`alt` VARCHAR(255) NOT NULL DEFAULT '',
	`capitalid` INT(255) NOT NULL DEFAULT 0,
	`catid` INT(50) NOT NULL DEFAULT 0,
	`cityid` INT(255) NOT NULL DEFAULT 0,
	`experience` VARCHAR(10) NOT NULL DEFAULT '',
	`image` VARCHAR(255) NOT NULL DEFAULT '',
	`introduction` TEXT NOT NULL,
	`msn` VARCHAR(50) NOT NULL DEFAULT '',
	`nationalnumber` VARCHAR(100) NOT NULL DEFAULT '',
	`officephone` VARCHAR(50) NOT NULL DEFAULT '',
	`phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
	`presence` TEXT NOT NULL,
	`shortlink` VARCHAR(255) NOT NULL DEFAULT '',
	`userid` INT(255) NOT NULL DEFAULT 0,
	`video` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_userid` (`userid`),
	KEY `idx_catid` (`catid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `#__reservation_message` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`from` INT(11) NOT NULL DEFAULT 0,
	`message` TEXT NOT NULL,
	`read` TINYINT(1) NOT NULL DEFAULT 0,
	`reply` INT(11) NOT NULL DEFAULT 0,
	`seen` TINYINT(1) NOT NULL DEFAULT 0,
	`seid` INT(255) NOT NULL DEFAULT 0,
	`to` INT(11) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;



--
-- Always insure this column rules is large enough for all the access
control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT
'JSON encoded access control. Enlarged to TEXT by JCB';
DROP TABLE IF EXISTS `#__reservation_reserve`;
DROP TABLE IF EXISTS `#__reservation_bbbclass`;
DROP TABLE IF EXISTS `#__reservation_doctor`;
DROP TABLE IF EXISTS `#__reservation_appointment`;
DROP TABLE IF EXISTS `#__reservation_capital`;
DROP TABLE IF EXISTS `#__reservation_comment`;
DROP TABLE IF EXISTS `#__reservation_session`;
DROP TABLE IF EXISTS `#__reservation_sick`;
DROP TABLE IF EXISTS `#__reservation_plan`;
DROP TABLE IF EXISTS `#__reservation_consultant`;
DROP TABLE IF EXISTS `#__reservation_message`;


--
-- Always insure this column rules is reversed to Joomla defaults on
uninstall. (as on 1st Dec 2020)
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL
COMMENT 'JSON encoded access control.';
<html><body
bgcolor="#FFFFFF"></body></html>CREATE TABLE IF
NOT EXISTS `#__reservation_consultant` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`capital` VARCHAR(50) NOT NULL DEFAULT '',
	`catid` INT(50) NOT NULL DEFAULT 0,
	`experience` VARCHAR(10) NOT NULL DEFAULT '',
	`image` VARCHAR(255) NOT NULL DEFAULT '',
	`introduction` TEXT NOT NULL,
	`msn` VARCHAR(50) NOT NULL DEFAULT '',
	`nationalnumber` VARCHAR(100) NOT NULL DEFAULT '',
	`phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
	`userid` INT(255) NOT NULL DEFAULT 0,
	`video` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_catid` (`catid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
CREATE TABLE IF NOT EXISTS `#__reservation_plan` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`consultantid` INT(255) NOT NULL DEFAULT 0,
	`plantype` VARCHAR(10) NOT NULL DEFAULT '',
	`price` VARCHAR(50) NOT NULL DEFAULT '',
	`time` VARCHAR(50) NOT NULL DEFAULT '',
	`waitingtime` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_plantype` (`plantype`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_sick` ADD `capitalid` INT(255) NOT NULL DEFAULT
0 AFTER `alt`;
ALTER TABLE `#__reservation_message` ADD `planid` INT(100) NOT NULL DEFAULT
0 AFTER `message`;
ALTER TABLE `#__reservation_session` ADD `finish` TINYINT(7) NOT NULL
DEFAULT 0 AFTER `asset_id`;

ALTER TABLE `#__reservation_session` ADD `firsttext` VARCHAR(255) NOT NULL
DEFAULT '' AFTER `finish`;
ALTER TABLE `#__reservation_message` ADD `seid` INT(255) NOT NULL DEFAULT 0
AFTER `seen`;
ALTER TABLE `#__reservation_consultant` ADD `catid` INT(50) NOT NULL
DEFAULT 0 AFTER `capital`;
CREATE TABLE IF NOT EXISTS `#__reservation_comment` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`consultantid` INT(255) NOT NULL DEFAULT 0,
	`rate` FLOAT(10) NOT NULL DEFAULT 0,
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`text` TEXT NOT NULL,
	`token` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_comment` ADD `consultantid` INT(255) NOT NULL
DEFAULT 0 AFTER `asset_id`;

ALTER TABLE `#__reservation_comment` ADD `rate` FLOAT(10) NOT NULL DEFAULT
0 AFTER `consultantid`;

ALTER TABLE `#__reservation_comment` ADD `sickid` INT(255) NOT NULL DEFAULT
0 AFTER `rate`;

ALTER TABLE `#__reservation_comment` ADD `token` VARCHAR(255) NOT NULL
DEFAULT '' AFTER `text`;
ALTER TABLE `#__reservation_comment` ADD `seid` INT(255) NOT NULL DEFAULT 0
AFTER `rate`;
ALTER TABLE `#__reservation_doctor` ADD `userid` INT(255) NOT NULL DEFAULT
0 AFTER `phonenumber`;
ALTER TABLE `#__reservation_doctor` ADD `alt` VARCHAR(255) NOT NULL DEFAULT
'' AFTER `address`;

ALTER TABLE `#__reservation_doctor` ADD `image` VARCHAR(255) NOT NULL
DEFAULT '' AFTER `catid`;
ALTER TABLE `#__reservation_plan` ADD `consultantid` INT(255) NOT NULL
DEFAULT 0 AFTER `asset_id`;

ALTER TABLE `#__reservation_plan` ADD `plantype` VARCHAR(10) NOT NULL
DEFAULT '' AFTER `consultantid`;
ALTER TABLE `#__reservation_doctor` ADD `presence` VARCHAR(255) NOT NULL
DEFAULT '' AFTER `phonenumber`;
ALTER TABLE `#__reservation_doctor` ADD `capitalid` INT(255) NOT NULL
DEFAULT 0 AFTER `alt`;

ALTER TABLE `#__reservation_doctor` ADD `cityid` INT(255) NOT NULL DEFAULT
0 AFTER `catid`;
CREATE TABLE IF NOT EXISTS `#__reservation_appointment` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointment` DATETIME NOT NULL DEFAULT '',
	`doctorid` INT(100) NOT NULL DEFAULT 0,
	`title` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_title` (`title`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_appointment` ADD `appointment` DATETIME NOT
NULL DEFAULT '' AFTER `asset_id`;
ALTER TABLE `#__reservation_appointment` CHANGE `appointment` `appointment`
DATE NOT NULL DEFAULT '';
ALTER TABLE `#__reservation_appointment` ADD `dateofbirth` DATE NOT NULL
DEFAULT '0000-00-00' AFTER `asset_id`;
CREATE TABLE IF NOT EXISTS `#__reservation_appointment` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointment` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`doctorid` INT(100) NOT NULL DEFAULT 0,
	`title` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_title` (`title`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
CREATE TABLE IF NOT EXISTS `#__reservation_reserve` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointmentid` INT(100) NOT NULL DEFAULT 0,
	`checkout` TINYINT(7) NOT NULL DEFAULT 0,
	`pay` INT(7) NOT NULL DEFAULT 0,
	`userid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_appointmentid` (`appointmentid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_reserve` ADD `sickid` INT(255) NOT NULL DEFAULT
0 AFTER `pay`;
CREATE TABLE IF NOT EXISTS `#__reservation_reserve` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`appointmentid` INT(100) NOT NULL DEFAULT 0,
	`checkout` TINYINT(7) NOT NULL DEFAULT 0,
	`pay` INT(7) NOT NULL DEFAULT 0,
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_appointmentid` (`appointmentid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_plan` ADD `plantype` VARCHAR(10) NOT NULL
DEFAULT '' AFTER `consultantid`;
CREATE TABLE IF NOT EXISTS `#__reservation_order` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`doctor_quota` VARCHAR(50) NOT NULL DEFAULT '',
	`full_price` VARCHAR(100) NOT NULL DEFAULT '',
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`status` VARCHAR(50) NOT NULL DEFAULT '',
	`system_quota` VARCHAR(50) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_sickid` (`sickid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_reserve` ADD `doctor_quota` VARCHAR(50) NOT
NULL DEFAULT '' AFTER `appointmentid`;

ALTER TABLE `#__reservation_reserve` ADD `full_price` VARCHAR(100) NOT NULL
DEFAULT '' AFTER `doctor_quota`;

ALTER TABLE `#__reservation_reserve` ADD `status` VARCHAR(50) NOT NULL
DEFAULT '' AFTER `sickid`;

ALTER TABLE `#__reservation_reserve` ADD `system_quota` VARCHAR(50) NOT
NULL DEFAULT '' AFTER `status`;
ALTER TABLE `#__reservation_reserve` ADD `payment_method` VARCHAR(50) NOT
NULL DEFAULT '' AFTER `full_price`;

ALTER TABLE `#__reservation_reserve` ADD `tracking_code` VARCHAR(50) NOT
NULL DEFAULT '' AFTER `system_quota`;
CREATE TABLE IF NOT EXISTS `#__reservation_consultant` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
    `account` VARCHAR(50) NOT NULL DEFAULT '',
    `address` TEXT NOT NULL,
    `alt` VARCHAR(255) NOT NULL DEFAULT '',
    `capitalid` INT(255) NOT NULL DEFAULT 0,
    `catid` INT(50) NOT NULL DEFAULT 0,
    `cityid` INT(255) NOT NULL DEFAULT 0,
    `experience` VARCHAR(10) NOT NULL DEFAULT '',
    `image` VARCHAR(255) NOT NULL DEFAULT '',
    `introduction` TEXT NOT NULL,
    `msn` VARCHAR(50) NOT NULL DEFAULT '',
    `nationalnumber` VARCHAR(100) NOT NULL DEFAULT '',
    `officephone` VARCHAR(50) NOT NULL DEFAULT '',
    `phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
    `presence` VARCHAR(255) NOT NULL DEFAULT '',
    `userid` INT(255) NOT NULL DEFAULT 0,
    `video` VARCHAR(50) NOT NULL DEFAULT '',
    `params` text NOT NULL,
    `published` TINYINT(3) NOT NULL DEFAULT 1,
    `created_by` INT(10) unsigned NOT NULL DEFAULT 0,
    `modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
    `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    `checked_out` int(11) unsigned NOT NULL DEFAULT 0,
    `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
    `version` INT(10) unsigned NOT NULL DEFAULT 1,
    `hits` INT(10) unsigned NOT NULL DEFAULT 0,
    `access` INT(10) unsigned NOT NULL DEFAULT 0,
    `ordering` INT(11) NOT NULL DEFAULT 0,
    PRIMARY KEY  (`id`),
    KEY `idx_userid` (`userid`),
    KEY `idx_catid` (`catid`),
    KEY `idx_access` (`access`),
    KEY `idx_checkout` (`checked_out`),
    KEY `idx_createdby` (`created_by`),
    KEY `idx_modifiedby` (`modified_by`),
    KEY `idx_state` (`published`)
    ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_doctor` CHANGE `presence` `presence`
VARCHAR(2048) NOT NULL DEFAULT '';

ALTER TABLE `#__reservation_consultant` CHANGE `presence` `presence`
VARCHAR(2048) NOT NULL DEFAULT '';
ALTER TABLE `#__reservation_doctor` CHANGE `presence` `presence` TEXT NOT
NULL;

ALTER TABLE `#__reservation_consultant` CHANGE `presence` `presence` TEXT
NOT NULL;
CREATE TABLE IF NOT EXISTS `#__reservation_bbbclass` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`exmid` VARCHAR(255) NOT NULL DEFAULT '',
	`inmid` VARCHAR(255) NOT NULL DEFAULT '',
	`mpass` VARCHAR(255) NOT NULL DEFAULT '',
	`name` VARCHAR(255) NOT NULL DEFAULT '',
	`planid` INT(100) NOT NULL DEFAULT 0,
	`vpass` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_name` (`name`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_plan` ADD `consultantid` INT(255) NOT NULL
DEFAULT 0 AFTER `asset_id`;
CREATE TABLE IF NOT EXISTS `#__reservation_sick` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`phonenumber` VARCHAR(100) NOT NULL DEFAULT '',
	`userid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_userid` (`userid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
CREATE TABLE IF NOT EXISTS `#__reservation_session` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`pay` INT(7) NOT NULL DEFAULT 0,
	`planid` INT(100) NOT NULL DEFAULT 0,
	`sickid` INT(255) NOT NULL DEFAULT 0,
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_sickid` (`sickid`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
ALTER TABLE `#__reservation_plan` CHANGE `plantype` `plantype` VARCHAR(7)
NOT NULL DEFAULT '';
ALTER TABLE `#__reservation_sick` ADD `alt` VARCHAR(255) NOT NULL DEFAULT
'' AFTER `asset_id`;

ALTER TABLE `#__reservation_sick` ADD `cardnumber` VARCHAR(64) NOT NULL
DEFAULT '' AFTER `alt`;

ALTER TABLE `#__reservation_sick` ADD `catid` INT(255) NOT NULL DEFAULT 0
AFTER `cardnumber`;

ALTER TABLE `#__reservation_sick` ADD `cityid` INT(255) NOT NULL DEFAULT 0
AFTER `catid`;

ALTER TABLE `#__reservation_sick` ADD `image` VARCHAR(255) NOT NULL DEFAULT
'' AFTER `cityid`;

ALTER TABLE `#__reservation_consultant` ADD `alt` VARCHAR(255) NOT NULL
DEFAULT '' AFTER `asset_id`;
CREATE TABLE IF NOT EXISTS `#__reservation_capital` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the
#__assets table.',
	`capitalid` INT(255) NOT NULL DEFAULT 0,
	`name` VARCHAR(255) NOT NULL DEFAULT '',
	`params` text NOT NULL,
	`published` TINYINT(3) NOT NULL DEFAULT 1,
	`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
	`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
	`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00
00:00:00',
	`version` INT(10) unsigned NOT NULL DEFAULT 1,
	`hits` INT(10) unsigned NOT NULL DEFAULT 0,
	`access` INT(10) unsigned NOT NULL DEFAULT 0,
	`ordering` INT(11) NOT NULL DEFAULT 0,
	PRIMARY KEY  (`id`),
	KEY `idx_name` (`name`),
	KEY `idx_access` (`access`),
	KEY `idx_checkout` (`checked_out`),
	KEY `idx_createdby` (`created_by`),
	KEY `idx_modifiedby` (`modified_by`),
	KEY `idx_state` (`published`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT
COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
<html><body
bgcolor="#FFFFFF"></body></html>ALTER TABLE
`#__reservation_consultant` ADD `shortlink` VARCHAR(255) NOT NULL DEFAULT
'' AFTER `presence`;
ALTER TABLE `#__reservation_bbbclass` ADD `seid` INT(255) NOT NULL DEFAULT
0 AFTER `planid`;
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		appointment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Appointments Table class
 */
class ReservationTableAppointment extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_appointment',
'id', $db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' =>
'com_reservation.appointment'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Appointment table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New appointment. A appointment created and created_by field can be
set by the user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('appointment',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_APPOINTMENT_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('appointment',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.appointment.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.appointment.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		bbbclass.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Bbbclasses Table class
 */
class ReservationTableBbbclass extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_bbbclass', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.bbbclass'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Bbbclass table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New bbbclass. A bbbclass created and created_by field can be set by
the user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('bbbclass',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_BBBCLASS_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('bbbclass',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.bbbclass.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.bbbclass.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		capital.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Capitals Table class
 */
class ReservationTableCapital extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_capital', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.capital'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Capital table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New capital. A capital created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('capital',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_CAPITAL_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('capital',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.capital.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.capital.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		comment.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Comments Table class
 */
class ReservationTableComment extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_comment', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.comment'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Comment table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New comment. A comment created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('comment',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_COMMENT_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('comment',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.comment.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.comment.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		consultant.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Consultants Table class
 */
class ReservationTableConsultant extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_consultant',
'id', $db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.consultant'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Consultant table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New consultant. A consultant created and created_by field can be set
by the user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('consultant',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias,
'catid' => $this->catid)) && ($table->id !=
$this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_CONSULTANT_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('consultant',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.consultant.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.consultant.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		doctor.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Doctors Table class
 */
class ReservationTableDoctor extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_doctor', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.doctor'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Doctor table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New doctor. A doctor created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('doctor',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias,
'catid' => $this->catid)) && ($table->id !=
$this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_DOCTOR_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('doctor',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.doctor.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.doctor.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		message.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Messages Table class
 */
class ReservationTableMessage extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_message', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.message'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Message table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New message. A message created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('message',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_MESSAGE_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('message',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.message.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.message.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		order.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Orders Table class
 */
class ReservationTableOrder extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_order', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.order'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Order table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New order. A order created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('order',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_ORDER_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('order',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.order.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.order.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		plan.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Plans Table class
 */
class ReservationTablePlan extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_plan', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.plan'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Plan table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New plan. A plan created and created_by field can be set by the user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('plan',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_PLAN_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('plan',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.plan.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.plan.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reserve.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Reserves Table class
 */
class ReservationTableReserve extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_reserve', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.reserve'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Reserve table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New reserve. A reserve created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('reserve',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_RESERVE_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('reserve',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.reserve.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.reserve.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		session.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Sessions Table class
 */
class ReservationTableSession extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_session', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.session'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Session table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New session. A session created and created_by field can be set by the
user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('session',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_SESSION_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('session',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.session.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.session.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		sick.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

/**
 * Sicks Table class
 */
class ReservationTableSick extends JTable
{
	/**
	 * Ensure the params and metadata in json encoded in the bind method
	 *
	 * @var    array
	 * @since  3.3
	 */
	protected $_jsonEncode = array('params', 'metadata');
    
	/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function __construct(&$db) 
	{
		parent::__construct('#__reservation_sick', 'id',
$db);

		// Adding History Options
		JTableObserverContenthistory::createObserver($this,
array('typeAlias' => 'com_reservation.sick'));
	}	
 
	public function bind($array, $ignore = '')
	{
    
		if (isset($array['params']) &&
is_array($array['params']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['params']);
			$array['params'] = (string) $registry;
		}

		if (isset($array['metadata']) &&
is_array($array['metadata']))
		{
			$registry = new JRegistry;
			$registry->loadArray($array['metadata']);
			$array['metadata'] = (string) $registry;
		}
        
		// Bind the rules. 
		if (isset($array['rules']) &&
is_array($array['rules']))
		{ 
			$rules = new JAccessRules($array['rules']); 
			$this->setRules($rules); 
		}
		return parent::bind($array, $ignore);
	}
    
	/**
	 * Overload the store method for the Sick table.
	 *
	 * @param   boolean	Toggle whether null values should be updated.
	 * @return  boolean  True on success, false on failure.
	 * @since   1.6
	 */
	public function store($updateNulls = false)
	{
		$date	= JFactory::getDate();
		$user	= JFactory::getUser();

		if ($this->id)
		{
			// Existing item
			$this->modified		= $date->toSql();
			$this->modified_by	= $user->get('id');
		}
		else
		{
			// New sick. A sick created and created_by field can be set by the user,
			// so we don't touch either of these if they are set.
			if (!(int) $this->created)
			{
				$this->created = $date->toSql();
			}
			if (empty($this->created_by))
			{
				$this->created_by = $user->get('id');
			}
		}
		
		if (isset($this->alias))
		{
			// Verify that the alias is unique
			$table = JTable::getInstance('sick',
'ReservationTable');

			if ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->setError(JText::_('COM_RESERVATION_SICK_ERROR_UNIQUE_ALIAS'));
				return false;
			}
		}
		
		if (isset($this->url))
		{
			// Convert IDN urls to punycode
			$this->url = JStringPunycode::urlToPunycode($this->url);
		}
		if (isset($this->website))
		{
			// Convert IDN urls to punycode
			$this->website = JStringPunycode::urlToPunycode($this->website);
		}

		return parent::store($updateNulls);
	}
    
	/**
	 * Overloaded check method to ensure data integrity.
	 *
	 * @return  boolean  True on success.
	 */
	public function check()
	{
		if (isset($this->alias))
		{
			// Generate a valid alias
			$this->generateAlias();
            
			$table = JTable::getInstance('sick',
'reservationTable');

			while ($table->load(array('alias' => $this->alias))
&& ($table->id != $this->id || $this->id == 0))
			{
				$this->alias = StringHelper::increment($this->alias,
'dash');
			}
		}
		
		/*
		 * Clean up keywords -- eliminate extra spaces between phrases
		 * and cr (\r) and lf (\n) characters from string.
		 * Only process if not empty.
 		 */
		if (!empty($this->metakey))
		{
			// Array of characters to remove.
			$bad_characters = array("\n", "\r",
"\"", "<", ">");

			// Remove bad characters.
			$after_clean = StringHelper::str_ireplace($bad_characters, "",
$this->metakey);

			// Create array using commas as delimiter.
			$keys = explode(',', $after_clean);
			$clean_keys = array();

			foreach ($keys as $key)
			{
				// Ignore blank keywords.
				if (trim($key))
				{
					$clean_keys[] = trim($key);
				}
			}

			// Put array back together delimited by ", "
			$this->metakey = implode(", ", $clean_keys);
		}

		// Clean up description -- eliminate quotes and <> brackets
		if (!empty($this->metadesc))
		{
			// Only process if not empty
			$bad_characters = array("\"", "<",
">");
			$this->metadesc = StringHelper::str_ireplace($bad_characters,
"", $this->metadesc);
		}

		// If we don't have any access rules set at this point just use an
empty JAccessRules class
		if (!$this->getRules())
		{
			$rules =
$this->getDefaultAssetValues('com_reservation.sick.'.$this->id);
			$this->setRules($rules);
		}
        
		// Set ordering
		if ($this->published < 0)
		{
			// Set ordering to 0 if state is archived or trashed
			$this->ordering = 0;
		}

		return true;
	}

	/**
	 * Gets the default asset values for a component.
	 *
	 * @param   $string  $component  The component asset name to search for
	 *
	 * @return  JAccessRules  The JAccessRules object for the asset
	 */
	protected function getDefaultAssetValues($component, $try = true)
	{
		// Need to find the asset id by the name of the component.
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select($db->quoteName('id'))
			->from($db->quoteName('#__assets'))
			->where($db->quoteName('name') . ' = ' .
$db->quote($component));
		$db->setQuery($query);
		$db->execute();
		if ($db->loadRowList())
		{
			// asset already set so use saved rules
			$assetId = (int) $db->loadResult();
			return JAccess::getAssetRules($assetId); // (TODO) instead of keeping
inherited Allowed it becomes Allowed.
		}
		// try again
		elseif ($try)
		{
			$try = explode('.',$component);
			$result =  $this->getDefaultAssetValues($try[0], false);
			if ($result instanceof JAccessRules)
			{
				if (isset($try[1]))
				{
					$_result = (string) $result;
					$_result = json_decode($_result);
					foreach ($_result as $name => &$rule)
					{
						$v = explode('.', $name);
						if ($try[1] !== $v[0])
						{
							// remove since it is not part of this view
							unset($_result->$name);
						}
						else
						{
							// clear the value since we inherit
							$rule = array();
						}
					}
					// check if there are any view values remaining
					if (count( (array) $_result))
					{
						$_result = json_encode($_result);
						$_result = array($_result);
						// Instantiate and return the JAccessRules object for the asset
rules.
						$rules = new JAccessRules;
						$rules->mergeCollection($_result);

						return $rules;
					}
				}
				return $result;
			}
		}
		return JAccess::getAssetRules(0);
	}

	/**
	 * Method to compute the default name of the asset.
	 * The default name is in the form 'table_name.id'
	 * where id is the value of the primary key of the table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetName()
	{
		$k = $this->_tbl_key;
		return 'com_reservation.sick.'.(int) $this->$k;
	}

	/**
	 * Method to return the title to use for the asset table.
	 *
	 * @return	string
	 * @since	2.5
	 */
	protected function _getAssetTitle()
	{
		if (isset($this->title))
		{
			return $this->title;
		}
		return '';
	}

	/**
	 * Get the parent asset id for the record
	 *
	 * @return	int
	 * @since	2.5
	 */
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL) 
	{
		$asset = JTable::getInstance('Asset');
		$asset->loadByName('com_reservation');

		return $asset->id;
	}

	/**
	 * This view does not actually have an alias
	 *
	 * @return  bool
	 */
	public function generateAlias()
	{
		return false;
	}

}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('appointment, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'appointmentTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'appointmentTab', 'details',
JText::_('COM_RESERVATION_APPOINTMENT_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo
JLayoutHelper::render('appointment.details_left', $this); ?>
			</div>
			<div class="span6">
				<?php echo
JLayoutHelper::render('appointment.details_right', $this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'appointmentTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'appointmentTab', 'publishing',
JText::_('COM_RESERVATION_APPOINTMENT_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('appointment.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('appointment.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="appointment.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Appointment View class
 */
class ReservationViewAppointment extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('appointment',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_APPOINTMENT_NEW' :
'COM_RESERVATION_APPOINTMENT_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('appointment.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('appointment.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('appointment.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('appointment.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('appointment.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('appointment.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('appointment.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('appointment.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('appointment.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('appointment.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('appointment.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('appointment.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.appointment',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('appointment.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('appointment.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('appointment');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_APPOINTMENT_NEW' :
'COM_RESERVATION_APPOINTMENT_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/appointment.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/appointment/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=appointments.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'appointmentList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=appointments');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="appointmentList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_APPOINTMENTS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_APPOINTMENTS_BATCH_TIP');
?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('appointment.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=appointments&task=appointment.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('appointment',$item,'appointments');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
$this->escape($item->title); ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time,
'appointments.', $canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo $this->escape($item->title); ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->appointment); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->doctorid_id); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'appointments.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'appointments.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'appointments.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'appointments.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="7"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo
JText::_('COM_RESERVATION_APPOINTMENT_TITLE_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_APPOINTMENT_APPOINTMENT_LABEL',
'a.appointment', $this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_APPOINTMENT_DOCTORID_LABEL'); ?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_APPOINTMENT_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_APPOINTMENT_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_APPOINTMENT_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Appointments'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Appointments
 */
class ReservationViewAppointments extends JViewLegacy
{
	/**
	 * Appointments view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('appointments');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('appointment');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_APPOINTMENTS'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=appointments');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('appointment.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('appointment.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('appointments.publish');
				JToolBarHelper::unpublishList('appointments.unpublish');
				JToolBarHelper::archiveList('appointments.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('appointments.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('',
'appointments.delete', 'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('appointments.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('appointment.export'))
			{
				JToolBarHelper::custom('appointments.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('appointment.import'))
		{
			JToolBarHelper::custom('appointments.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('appointments');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_APPOINTMENTS'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/appointments.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.appointment' =>
JText::_('COM_RESERVATION_APPOINTMENT_APPOINTMENT_LABEL'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('bbbclass, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'bbbclassTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'bbbclassTab', 'details',
JText::_('COM_RESERVATION_BBBCLASS_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<?php echo JLayoutHelper::render('bbbclass.details_left',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'bbbclassTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'bbbclassTab', 'publishing',
JText::_('COM_RESERVATION_BBBCLASS_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('bbbclass.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('bbbclass.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'bbbclassTab', 'permissions',
JText::_('COM_RESERVATION_BBBCLASS_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="bbbclass.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Bbbclass View class
 */
class ReservationViewBbbclass extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('bbbclass',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_BBBCLASS_NEW' :
'COM_RESERVATION_BBBCLASS_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('bbbclass.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('bbbclass.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('bbbclass.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('bbbclass.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('bbbclass.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('bbbclass.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('bbbclass.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('bbbclass.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('bbbclass.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('bbbclass.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('bbbclass.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('bbbclass.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.bbbclass',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('bbbclass.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('bbbclass.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('bbbclass');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_BBBCLASS_NEW' :
'COM_RESERVATION_BBBCLASS_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/bbbclass.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		// Add Ajax Token
		$this->document->addScriptDeclaration("var token =
'".JSession::getFormToken()."';");
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/bbbclass/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=bbbclasses.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'bbbclassList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=bbbclasses');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="bbbclassList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_BBBCLASSES_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_BBBCLASSES_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('bbbclass.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=bbbclasses&task=bbbclass.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('bbbclass',$item,'bbbclasses');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
$this->escape($item->name); ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'bbbclasses.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo $this->escape($item->name); ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->planid_id); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->seid); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->exmid); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'bbbclasses.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'bbbclasses.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'bbbclasses.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'bbbclasses.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="8"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_BBBCLASS_NAME_LABEL', 'a.name',
$this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_BBBCLASS_PLANID_LABEL', 'g.id',
$this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_BBBCLASS_SEID_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_BBBCLASS_EXMID_LABEL'); ?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_BBBCLASS_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_BBBCLASS_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_BBBCLASS_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Bbbclasses'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Bbbclasses
 */
class ReservationViewBbbclasses extends JViewLegacy
{
	/**
	 * Bbbclasses view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('bbbclasses');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('bbbclass');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_BBBCLASSES'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=bbbclasses');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('bbbclass.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('bbbclass.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('bbbclasses.publish');
				JToolBarHelper::unpublishList('bbbclasses.unpublish');
				JToolBarHelper::archiveList('bbbclasses.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('bbbclasses.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('', 'bbbclasses.delete',
'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('bbbclasses.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('bbbclass.export'))
			{
				JToolBarHelper::custom('bbbclasses.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('bbbclass.import'))
		{
			JToolBarHelper::custom('bbbclasses.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('bbbclasses');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_BBBCLASSES'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/bbbclasses.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.name' =>
JText::_('COM_RESERVATION_BBBCLASS_NAME_LABEL'),
			'g.id' =>
JText::_('COM_RESERVATION_BBBCLASS_PLANID_LABEL'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('capital, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'capitalTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'capitalTab', 'details',
JText::_('COM_RESERVATION_CAPITAL_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('capital.details_left',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('capital.details_right',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'capitalTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'capitalTab', 'publishing',
JText::_('COM_RESERVATION_CAPITAL_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('capital.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('capital.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'capitalTab', 'permissions',
JText::_('COM_RESERVATION_CAPITAL_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="capital.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Capital View class
 */
class ReservationViewCapital extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('capital',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_CAPITAL_NEW' :
'COM_RESERVATION_CAPITAL_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('capital.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('capital.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('capital.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('capital.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('capital.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('capital.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('capital.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('capital.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('capital.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('capital.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('capital.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('capital.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.capital',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('capital.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('capital.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('capital');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_CAPITAL_NEW' :
'COM_RESERVATION_CAPITAL_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/capital.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/capital/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=capitals.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'capitalList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=capitals');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="capitalList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_CAPITALS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_CAPITALS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('capital.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=capitals&task=capital.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('capital',$item,'capitals');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo $item->name; ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'capitals.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo $item->name; ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->capitalid_name); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'capitals.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'capitals.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'capitals.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'capitals.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="6"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CAPITAL_NAME_LABEL', 'a.name',
$this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CAPITAL_CAPITALID_LABEL', 'g.name',
$this->listDirn, $this->listOrder); ?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CAPITAL_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_CAPITAL_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CAPITAL_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Capitals'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Capitals
 */
class ReservationViewCapitals extends JViewLegacy
{
	/**
	 * Capitals view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('capitals');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('capital');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_CAPITALS'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=capitals');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('capital.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('capital.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('capitals.publish');
				JToolBarHelper::unpublishList('capitals.unpublish');
				JToolBarHelper::archiveList('capitals.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('capitals.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('', 'capitals.delete',
'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('capitals.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('capital.export'))
			{
				JToolBarHelper::custom('capitals.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('capital.import'))
		{
			JToolBarHelper::custom('capitals.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('capitals');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_CAPITALS'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/capitals.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.name' =>
JText::_('COM_RESERVATION_CAPITAL_NAME_LABEL'),
			'g.name' =>
JText::_('COM_RESERVATION_CAPITAL_CAPITALID_LABEL'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('comment, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'commentTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'commentTab', 'details',
JText::_('COM_RESERVATION_COMMENT_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('comment.details_left',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('comment.details_right',
$this); ?>
			</div>
		</div>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<?php echo
JLayoutHelper::render('comment.details_fullwidth', $this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'commentTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'commentTab', 'publishing',
JText::_('COM_RESERVATION_COMMENT_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('comment.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('comment.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'commentTab', 'permissions',
JText::_('COM_RESERVATION_COMMENT_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="comment.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Comment View class
 */
class ReservationViewComment extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('comment',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_COMMENT_NEW' :
'COM_RESERVATION_COMMENT_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('comment.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('comment.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('comment.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('comment.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('comment.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('comment.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('comment.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('comment.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('comment.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('comment.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('comment.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('comment.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.comment',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('comment.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('comment.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('comment');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_COMMENT_NEW' :
'COM_RESERVATION_COMMENT_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/comment.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/comment/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=comments.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'commentList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=comments');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="commentList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_COMMENTS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_COMMENTS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('comment.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=comments&task=comment.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('comment',$item,'comments');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
$this->escape($item->text); ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'comments.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo $this->escape($item->text); ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->consultantid_id); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->sickid_phonenumber); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->rate); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->seid); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'comments.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'comments.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'comments.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'comments.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="9"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JText::_('COM_RESERVATION_COMMENT_TEXT_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_COMMENT_CONSULTANTID_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_COMMENT_SICKID_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_COMMENT_RATE_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_COMMENT_SEID_LABEL');
?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_COMMENT_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_COMMENT_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_COMMENT_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Comments'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Comments
 */
class ReservationViewComments extends JViewLegacy
{
	/**
	 * Comments view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('comments');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('comment');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_COMMENTS'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=comments');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('comment.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('comment.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('comments.publish');
				JToolBarHelper::unpublishList('comments.unpublish');
				JToolBarHelper::archiveList('comments.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('comments.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('', 'comments.delete',
'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('comments.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('comment.export'))
			{
				JToolBarHelper::custom('comments.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('comment.import'))
		{
			JToolBarHelper::custom('comments.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('comments');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_COMMENTS'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/comments.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('consultant, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'consultantTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'consultantTab', 'details',
JText::_('COM_RESERVATION_CONSULTANT_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo
JLayoutHelper::render('consultant.details_left', $this); ?>
			</div>
			<div class="span6">
				<?php echo
JLayoutHelper::render('consultant.details_right', $this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'consultantTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'consultantTab', 'publishing',
JText::_('COM_RESERVATION_CONSULTANT_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('consultant.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('consultant.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'consultantTab', 'permissions',
JText::_('COM_RESERVATION_CONSULTANT_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="consultant.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>

<script type="text/javascript">



/***[JCBGUI.field.javascript_view_footer.1038.$$$$]***/
jQuery(document).ready(function($){

   var gettoken= Joomla.getOptions('token');


   $('select#jform_capitalid').change(function () {

      var capitalid= $(this).val();
      var token= gettoken;

      $.ajax({
         url: 'index.php?option=com_reservation',
         method: 'post',
         dataType: 'json',
         data: {[token] : '1',task:'ajax.getCity',
format: 'json' , raw: 'true' , capitalid: capitalid},
         success: function (msg) {

            var temp='<option value="">Select an
option</option>';
            msg.each(function(value, index){

               temp += '<option
value="'+value.id+'">'+value.name+'</option>';

            });

            $('select#jform_cityid').html(temp);
            $( "select#jform_cityid" ).trigger(
"liszt:updated" );
         },
         error: function (err) {
            console.log(err);
         }
      });


   });


});/***[/JCBGUI$$$$]***/

</script>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Consultant View class
 */
class ReservationViewConsultant extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('consultant',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_CONSULTANT_NEW' :
'COM_RESERVATION_CONSULTANT_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('consultant.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('consultant.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('consultant.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('consultant.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('consultant.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('consultant.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('consultant.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('consultant.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('consultant.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('consultant.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('consultant.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('consultant.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.consultant',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('consultant.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('consultant.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('consultant');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_CONSULTANT_NEW' :
'COM_RESERVATION_CONSULTANT_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/consultant.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		// Add Ajax Token
		$this->document->addScriptDeclaration("var token =
'".JSession::getFormToken()."';");
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/consultant/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 

/***[JCBGUI.admin_view.php_document.110.$$$$]***/
$this->document->addScriptOptions('token',JFactory::getSession()->getFormToken());/***[/JCBGUI$$$$]***/

		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=consultants.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'consultantList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=consultants');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="consultantList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_CONSULTANTS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_CONSULTANTS_BATCH_TIP');
?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('consultant.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=consultants&task=consultant.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('consultant',$item,'consultants');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
JFactory::getUser((int)$item->userid)->name; ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'consultants.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JFactory::getUser((int)$item->userid)->name; ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->nationalnumber); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->category_title); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->image); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->experience); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->msn); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->phonenumber); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->shortlink); ?>
		</td>
		<td class="hidden-phone">
			<?php echo JText::_($item->account); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'consultants.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'consultants.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'consultants.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'consultants.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="13"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_USERID_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_NATIONALNUMBER_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_CONSULTANTS_CATEGORIES');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_IMAGE_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CONSULTANT_EXPERIENCE_LABEL',
'a.experience', $this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_MSN_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_PHONENUMBER_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_SHORTLINK_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_CONSULTANT_ACCOUNT_LABEL'); ?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CONSULTANT_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_CONSULTANT_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_CONSULTANT_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Consultants'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Consultants
 */
class ReservationViewConsultants extends JViewLegacy
{
	/**
	 * Consultants view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('consultants');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('consultant');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_CONSULTANTS'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=consultants');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('consultant.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('consultant.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('consultants.publish');
				JToolBarHelper::unpublishList('consultants.unpublish');
				JToolBarHelper::archiveList('consultants.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('consultants.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('',
'consultants.delete', 'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('consultants.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('consultant.export'))
			{
				JToolBarHelper::custom('consultants.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('consultant.import'))
		{
			JToolBarHelper::custom('consultants.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('consultants');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}

		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			// Category Batch selection.
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_CATEGORY'),
				'batch[category]',
				JHtml::_('select.options',
JHtml::_('category.options', 'com_reservation'),
'value', 'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_CONSULTANTS'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/consultants.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.experience' =>
JText::_('COM_RESERVATION_CONSULTANT_EXPERIENCE_LABEL'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('doctor, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'doctorTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'doctorTab', 'details',
JText::_('COM_RESERVATION_DOCTOR_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('doctor.details_left',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('doctor.details_right',
$this); ?>
			</div>
		</div>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<?php echo
JLayoutHelper::render('doctor.details_fullwidth', $this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'doctorTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'doctorTab', 'publishing',
JText::_('COM_RESERVATION_DOCTOR_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('doctor.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('doctor.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'doctorTab', 'permissions',
JText::_('COM_RESERVATION_DOCTOR_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="doctor.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>

<script type="text/javascript">



/***[JCBGUI.field.javascript_view_footer.1038.$$$$]***/
jQuery(document).ready(function($){

   var gettoken= Joomla.getOptions('token');


   $('select#jform_capitalid').change(function () {

      var capitalid= $(this).val();
      var token= gettoken;

      $.ajax({
         url: 'index.php?option=com_reservation',
         method: 'post',
         dataType: 'json',
         data: {[token] : '1',task:'ajax.getCity',
format: 'json' , raw: 'true' , capitalid: capitalid},
         success: function (msg) {

            var temp='<option value="">Select an
option</option>';
            msg.each(function(value, index){

               temp += '<option
value="'+value.id+'">'+value.name+'</option>';

            });

            $('select#jform_cityid').html(temp);
            $( "select#jform_cityid" ).trigger(
"liszt:updated" );
         },
         error: function (err) {
            console.log(err);
         }
      });


   });


});/***[/JCBGUI$$$$]***/

</script>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Doctor View class
 */
class ReservationViewDoctor extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('doctor',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_DOCTOR_NEW' :
'COM_RESERVATION_DOCTOR_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('doctor.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('doctor.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('doctor.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('doctor.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('doctor.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('doctor.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('doctor.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('doctor.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('doctor.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('doctor.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('doctor.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('doctor.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.doctor',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('doctor.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('doctor.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('doctor');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_DOCTOR_NEW' :
'COM_RESERVATION_DOCTOR_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/doctor.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		// Add Ajax Token
		$this->document->addScriptDeclaration("var token =
'".JSession::getFormToken()."';");
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/doctor/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 

/***[JCBGUI.admin_view.php_document.121.$$$$]***/
$this->document->addScriptOptions('token',JFactory::getSession()->getFormToken());/***[/JCBGUI$$$$]***/

		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multiple', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_DOCTORS_CATEGORIES') .
' -'));
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=doctors.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'doctorList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=doctors');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="doctorList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_DOCTORS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_DOCTORS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('doctor.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=doctors&task=doctor.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('doctor',$item,'doctors');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
JFactory::getUser((int)$item->userid)->name; ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'doctors.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JFactory::getUser((int)$item->userid)->name; ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->msn); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->category_title); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->phonenumber); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->officephone); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->address); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->presence); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->image); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->capitalid_name); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->cityid_name); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'doctors.', true, 'cb'); ?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'doctors.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'doctors.', true, 'cb'); ?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'doctors.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="14"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JText::_('COM_RESERVATION_DOCTOR_USERID_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_DOCTOR_MSN_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_DOCTORS_CATEGORIES'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_PHONENUMBER_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_OFFICEPHONE_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_ADDRESS_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_PRESENCE_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_DOCTOR_IMAGE_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_DOCTOR_CAPITALID_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_DOCTOR_CITYID_LABEL');
?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_DOCTOR_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_DOCTOR_STATUS'); ?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_DOCTOR_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Doctors'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Doctors
 */
class ReservationViewDoctors extends JViewLegacy
{
	/**
	 * Doctors view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('doctors');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('doctor');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_DOCTORS'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=doctors');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('doctor.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('doctor.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('doctors.publish');
				JToolBarHelper::unpublishList('doctors.unpublish');
				JToolBarHelper::archiveList('doctors.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('doctors.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('', 'doctors.delete',
'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('doctors.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('doctor.export'))
			{
				JToolBarHelper::custom('doctors.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('doctor.import'))
		{
			JToolBarHelper::custom('doctors.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('doctors');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}

		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			// Category Batch selection.
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_CATEGORY'),
				'batch[category]',
				JHtml::_('select.options',
JHtml::_('category.options', 'com_reservation'),
'value', 'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_DOCTORS'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/doctors.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>
<script type="text/javascript">
<?php if ($this->hasPackage &&
ReservationHelper::checkArray($this->headerList)) : ?>
	Joomla.continueImport = function()
	{
		var form = document.getElementById('adminForm');
		var error = false;
		var therequired = [<?php $i = 0; foreach($this->headerList as $name
=> $title) { echo ($i != 0)? ',
"vdm_'.$name.'"':'"vdm_'.$name.'"';
$i++; } ?>];
		for(i = 0; i < therequired.length; i++)
		{
			if(jQuery('#'+therequired[i]).val() == "" )
			{
				error = true;
				break;
			}
		}
		// do field validation
		if (error)
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');

			form.gettype.value = 'continue';
			form.submit();
		}
	};
<?php else: ?>
	Joomla.submitbutton = function()
	{
		var form = document.getElementById('adminForm');

		// do field validation
		if (form.import_package.value == "")
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_A_FILE',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');

			form.gettype.value = 'upload';
			form.submit();
		}
	};

	Joomla.submitbutton3 = function()
	{
		var form = document.getElementById('adminForm');

		// do field validation
		if (form.import_directory.value == ""){
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');

			form.gettype.value = 'folder';
			form.submit();
		}
	};

	Joomla.submitbutton4 = function()
	{
		var form = document.getElementById('adminForm');

		// do field validation
		if (form.import_url.value == "" || form.import_url.value ==
"http://")
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_ENTER_A_URL', true);
?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');

			form.gettype.value = 'url';
			form.submit();
		}
	};
<?php endif; ?>

// Add spindle-wheel for importations:
jQuery(document).ready(function($) {
	var outerDiv = $('body');

	$('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top - $(window).scrollTop())
		.css("left", outerDiv.position().left - $(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
});

</script>

<div id="installer-import" class="clearfix">
<form enctype="multipart/form-data" action="<?php echo
JRoute::_('index.php?option=com_reservation&view=import');?>"
method="post" name="adminForm" id="adminForm"
class="form-horizontal form-validate">

	<?php if (!empty( $this->sidebar)) : ?>
		<div id="j-sidebar-container" class="span2">
			<?php echo $this->sidebar; ?>
		</div>
		<div id="j-main-container" class="span10">
	<?php else : ?>
		<div id="j-main-container">
	<?php endif;?>

	<?php if ($this->hasPackage &&
ReservationHelper::checkArray($this->headerList) &&
ReservationHelper::checkArray($this->headers)) : ?>
		<fieldset class="uploadform">
			<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_LINK_FILE_TO_TABLE_COLUMNS');
?></legend>
			<div class="control-group">
				<label class="control-label" ><h4><?php echo
JText::_('COM_RESERVATION_IMPORT_TABLE_COLUMNS');
?></h4></label>
				<div class="controls">
					<label class="control-label" ><h4><?php echo
JText::_('COM_RESERVATION_IMPORT_FILE_COLUMNS');
?></h4></label>
				</div>
			</div>
			<?php foreach($this->headerList as $name => $title): ?>
				<div class="control-group">
					<label for="<?php echo $name; ?>"
class="control-label" ><?php echo $title;
?></label>
					<div class="controls">
					<select  name="<?php echo $name; ?>" 
id="vdm_<?php echo $name; ?>" required class="required
input_box" >
						<option value=""><?php echo
JText::_('COM_RESERVATION_IMPORT_PLEASE_SELECT_COLUMN');
?></option>
						<option value="IGNORE"><?php echo
JText::_('COM_RESERVATION_IMPORT_IGNORE_COLUMN');
?></option>
						<?php foreach($this->headers as $value => $option): ?>
							<?php $selected = (strtolower($option) ==  strtolower ($title) ||
strtolower($option) == strtolower($name))?
'selected="selected"':''; ?>
							<option value="<?php echo
ReservationHelper::htmlEscape($value); ?>"
class="required" <?php echo $selected ?>><?php echo
ReservationHelper::htmlEscape($option); ?></option>
						<?php endforeach; ?>
					</select>
					</div>
				</div>
			<?php endforeach; ?>
			<div class="form-actions">
				<input class="btn btn-primary" type="button"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_CONTINUE'); ?>"
onclick="Joomla.continueImport()" />
			</div>
		</fieldset>
		<input type="hidden" name="gettype"
value="continue" />
	<?php else: ?>
		<?php echo JHtml::_('bootstrap.startTabSet',
'myTab', array('active' => 'upload'));
?>
		
		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'upload',
JText::_('COM_RESERVATION_IMPORT_FROM_UPLOAD', true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_package"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE');
?></label>
					<div class="controls">
						<input class="input_box" id="import_package"
name="import_package" type="file" size="57"
/>
					</div>
				</div>
				<div class="form-actions">
					<input class="btn btn-primary" type="button"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_UPLOAD_BOTTON'); ?>"
onclick="Joomla.submitbutton()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
			</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>
		
		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'directory',
JText::_('COM_RESERVATION_IMPORT_FROM_DIRECTORY', true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_directory"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_DIRECTORY');
?></label>
					<div class="controls">
						<input type="text" id="import_directory"
name="import_directory" class="span5 input_box"
size="70" value="<?php echo
$this->state->get('import.directory'); ?>" />
					</div>
				</div>
				<div class="form-actions">
					<input type="button" class="btn btn-primary"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_GET_BOTTON'); ?>"
onclick="Joomla.submitbutton3()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
				</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>

		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'url', JText::_('COM_RESERVATION_IMPORT_FROM_URL',
true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_url"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_URL');
?></label>
					<div class="controls">
						<input type="text" id="import_url"
name="import_url" class="span5 input_box"
size="70" value="http://" />
					</div>
				</div>
				<div class="form-actions">
					<input type="button" class="btn btn-primary"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_GET_BOTTON'); ?>"
onclick="Joomla.submitbutton4()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
			</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>
		<?php echo JHtml::_('bootstrap.endTabSet'); ?>
		<input type="hidden" name="gettype"
value="upload" />
	<?php endif; ?>
	<input type="hidden" name="task"
value="import.import" />
	<?php echo JHtml::_('form.token'); ?>
</form>
</div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation Import View
 */
class ReservationViewImport extends JViewLegacy
{
	protected $headerList;
	protected $hasPackage = false;
	protected $headers;
	protected $hasHeader = 0;
	protected $dataType;

	public function display($tpl = null)
	{		
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('import');
		}

		$paths = new stdClass;
		$paths->first = '';
		$state = $this->get('state');

		$this->paths = &$paths;
		$this->state = &$state;
                // get global action permissions
		$this->canDo = ReservationHelper::getActions('import');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
		}

		// get the session object
		$session = JFactory::getSession();
		// check if it has package
		$this->hasPackage 	= $session->get('hasPackage', false);
		$this->dataType 	= $session->get('dataType', false);
		if($this->hasPackage && $this->dataType)
		{
			$this->headerList 	=
json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS',
false),true);
			$this->headers 		=
ReservationHelper::getFileHeaders($this->dataType);
			// clear the data type
			$session->clear('dataType');
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_IMPORT_TITLE'),
'upload');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=import');

		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('import');
		if (ReservationHelper::checkString($help_url))
		{
			   JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.30
	@build			6th March, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>

<!--[JCBGUI.admin_view.html_import_view.127.$$$$]-->
<script type="text/javascript">
farhad shahbazi
<?php if ($this->hasPackage &&
ReservationHelper::checkArray($this->headerList)) : ?>
	Joomla.continueImport = function()
	{
		var form = document.getElementById('adminForm');
		var error = false;
		var therequired = [<?php $i = 0; foreach($this->headerList as $name
=> $title) { echo ($i != 0)? ',
"vdm_'.$name.'"':'"vdm_'.$name.'"';
$i++; } ?>];
		for(i = 0; i < therequired.length; i++)
		{
			if(jQuery('#'+therequired[i]).val() == "" )
			{
				error = true;
				break;
			}
		}
		// do field validation
		if (error)
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');


			form.gettype.value = 'continue';
			form.submit();
		}
	};
<?php else: ?>
	Joomla.submitbutton = function()
	{
		var form = document.getElementById('adminForm');


		// do field validation
		if (form.import_package.value == "")
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_A_FILE',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');


			form.gettype.value = 'upload';
			form.submit();
		}
	};


	Joomla.submitbutton3 = function()
	{
		var form = document.getElementById('adminForm');


		// do field validation
		if (form.import_directory.value == ""){
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY',
true); ?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');


			form.gettype.value = 'folder';
			form.submit();
		}
	};


	Joomla.submitbutton4 = function()
	{
		var form = document.getElementById('adminForm');


		// do field validation
		if (form.import_url.value == "" || form.import_url.value ==
"http://")
		{
			alert("<?php echo
JText::_('COM_RESERVATION_IMPORT_MSG_ENTER_A_URL', true);
?>");
		}
		else
		{
			jQuery('#loading').css('display',
'block');


			form.gettype.value = 'url';
			form.submit();
		}
	};
<?php endif; ?>


// Add spindle-wheel for importations:
jQuery(document).ready(function($) {
	var outerDiv = $('body');


	$('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top - $(window).scrollTop())
		.css("left", outerDiv.position().left -
$(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
});


</script>


<div id="installer-import" class="clearfix">
<form enctype="multipart/form-data" action="<?php echo
JRoute::_('index.php?option=com_reservation&view=import_reserves');?>"
method="post" name="adminForm" id="adminForm"
class="form-horizontal form-validate">


	<?php if (!empty( $this->sidebar)) : ?>
		<div id="j-sidebar-container" class="span2">
			<?php echo $this->sidebar; ?>
		</div>
		<div id="j-main-container" class="span10">
	<?php else : ?>
		<div id="j-main-container">
	<?php endif;?>


	<?php if ($this->hasPackage &&
ReservationHelper::checkArray($this->headerList) &&
ReservationHelper::checkArray($this->headers)) : ?>
		<fieldset class="uploadform">
			<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_LINK_FILE_TO_TABLE_COLUMNS');
?></legend>
			<div class="control-group">
				<label class="control-label" ><h4><?php echo
JText::_('COM_RESERVATION_IMPORT_TABLE_COLUMNS');
?></h4></label>
				<div class="controls">
					<label class="control-label" ><h4><?php echo
JText::_('COM_RESERVATION_IMPORT_FILE_COLUMNS');
?></h4></label>
				</div>
			</div>
			<?php foreach($this->headerList as $name => $title): ?>
				<div class="control-group">
					<label for="<?php echo $name; ?>"
class="control-label" ><?php echo $title;
?></label>
					<div class="controls">
						<select  name="<?php echo $name; ?>" 
id="vdm_<?php echo $name; ?>" required class="required
input_box" >
							<option value=""><?php echo
JText::_('COM_RESERVATION_IMPORT_PLEASE_SELECT_COLUMN');
?></option>
							<option value="IGNORE"><?php echo
JText::_('COM_RESERVATION_IMPORT_IGNORE_COLUMN');
?></option>
							<?php foreach($this->headers as $value => $option): ?>
								<?php $selected = (strtolower($option) ==  strtolower ($title)
|| strtolower($option) == strtolower($name))?
'selected="selected"':''; ?>
								<option value="<?php echo
ReservationHelper::htmlEscape($value); ?>"
class="required" <?php echo $selected ?>><?php echo
ReservationHelper::htmlEscape($option); ?></option>
							<?php endforeach; ?>
						</select>
					</div>
				</div>
			<?php endforeach; ?>
			<div class="form-actions">
				<input class="btn btn-primary" type="button"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_CONTINUE'); ?>"
onclick="Joomla.continueImport()" />
			</div>
		</fieldset>
		<input type="hidden" name="gettype"
value="continue" />
	<?php else: ?>
		<?php echo JHtml::_('bootstrap.startTabSet',
'myTab', array('active' => 'upload'));
?>
		
		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'upload',
JText::_('COM_RESERVATION_IMPORT_FROM_UPLOAD', true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_package"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE');
?></label>
					<div class="controls">
						<input class="input_box" id="import_package"
name="import_package" type="file" size="57"
/>
					</div>
				</div>
				<div class="form-actions">
					<input class="btn btn-primary" type="button"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_UPLOAD_BOTTON'); ?>"
onclick="Joomla.submitbutton()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
			</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>
		
		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'directory',
JText::_('COM_RESERVATION_IMPORT_FROM_DIRECTORY', true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_directory"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_DIRECTORY');
?></label>
					<div class="controls">
						<input type="text" id="import_directory"
name="import_directory" class="span5 input_box"
size="70" value="<?php echo
$this->state->get('import.directory'); ?>" />
					</div>
				</div>
				<div class="form-actions">
					<input type="button" class="btn btn-primary"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_GET_BOTTON'); ?>"
onclick="Joomla.submitbutton3()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
				</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>


		<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'url', JText::_('COM_RESERVATION_IMPORT_FROM_URL',
true)); ?>
			<fieldset class="uploadform">
				<legend><?php echo
JText::_('COM_RESERVATION_IMPORT_UPDATE_DATA');
?></legend>
				<div class="control-group">
					<label for="import_url"
class="control-label"><?php echo
JText::_('COM_RESERVATION_IMPORT_SELECT_FILE_URL');
?></label>
					<div class="controls">
						<input type="text" id="import_url"
name="import_url" class="span5 input_box"
size="70" value="http://" />
					</div>
				</div>
				<div class="form-actions">
					<input type="button" class="btn btn-primary"
value="<?php echo
JText::_('COM_RESERVATION_IMPORT_GET_BOTTON'); ?>"
onclick="Joomla.submitbutton4()"
/>&nbsp;&nbsp;&nbsp;<small><?php echo
JText::_('COM_RESERVATION_IMPORT_FORMATS_ACCEPTED'); ?> (.csv
.xls .ods)</small>
				</div>
			</fieldset>
		<?php echo JHtml::_('bootstrap.endTab'); ?>
		<?php echo JHtml::_('bootstrap.endTabSet'); ?>
		<input type="hidden" name="gettype"
value="upload" />
	<?php endif; ?>
	<input type="hidden" name="task"
value="import_reserves.import" />
	<?php echo JHtml::_('form.token'); ?>
</form>
</div><!--[/JCBGUI$$$$]-->

<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.30
	@build			6th March, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation Import_reserves View
 */
class ReservationViewImport_reserves extends JViewLegacy
{

/***[JCBGUI.admin_view.php_import_display.127.$$$$]***/
	protected $headerList;
	protected $hasPackage = false;
	protected $headers;
	protected $hasHeader = 0;
	protected $dataType;
	public function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('import');
		}

		$paths = new stdClass;
		$paths->first = '';
		$state = $this->get('state');

		$this->paths = &$paths;
		$this->state = &$state;
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('import');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
		}

		// get the session object
		$session = JFactory::getSession();
		// check if it has package
		$this->hasPackage	= $session->get('hasPackage', false);
		$this->dataType	= $session->get('dataType', false);
		if($this->hasPackage && $this->dataType)
		{
			$this->headerList	=
json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS',
false),true);
			$this->headers		=
ReservationHelper::getFileHeaders($this->dataType);
			// clear the data type
			$session->clear('dataType');
		}

		// Check for errors.
		if (count($errors = $this->get('Errors'))){
			throw new Exception(implode(PHP_EOL, $errors), 500);
		}

		// Display the template
		parent::display($tpl);
	}/***[/JCBGUI$$$$]***/


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_IMPORT_TITLE'),
'upload');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=import_reserves');

		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('import_reserves');
		if (ReservationHelper::checkString($help_url))
		{
			   JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}
}
<html><body
bgcolor="#FFFFFF"></body></html>/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task, document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('message, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'messageTab', array('active' =>
'details')); ?>

	<?php echo JHtml::_('bootstrap.addTab',
'messageTab', 'details',
JText::_('COM_RESERVATION_MESSAGE_DETAILS', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('message.details_left',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('message.details_right',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'messageTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'messageTab', 'publishing',
JText::_('COM_RESERVATION_MESSAGE_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('message.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('message.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab',
'messageTab', 'permissions',
JText::_('COM_RESERVATION_MESSAGE_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="message.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Message View class
 */
class ReservationViewMessage extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('message',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0, 'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_MESSAGE_NEW' :
'COM_RESERVATION_MESSAGE_EDIT'), 'pencil-2
article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('message.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('message.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('message.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('message.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('message.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('message.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('message.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('message.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('message.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('message.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('message.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('message.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.message',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('message.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('message.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('message');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_MESSAGE_NEW' :
'COM_RESERVATION_MESSAGE_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/message.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/message/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=messages.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'messageList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=messages');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="messageList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_MESSAGES_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_MESSAGES_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('message.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=messages&task=message.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('message',$item,'messages');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($this->user->authorise('core.edit',
'com_users')): ?>
					<a
href="index.php?option=com_users&task=user.edit&id=<?php
echo (int) $item->from ?>"><?php echo
JFactory::getUser((int)$item->from)->name; ?></a>
				<?php else: ?>
					<?php echo JFactory::getUser((int)$item->from)->name; ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo JFactory::getUser((int)$item->to)->name; ?>
		</td>
		<td class="hidden-phone">
			<div><div style="max-width: 150px;"><?php echo
$item->reply_message; ?></div>
			</div>
		</td>
		<td class="hidden-phone">
			<div><div style="max-width: 150px;"><?php echo
$item->message; ?></div>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->read); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->seen); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->seid); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'messages.', true, 'cb');
?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'messages.', false, 'cb');
?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'messages.', true, 'cb');
?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'messages.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="11"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_FROM_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_TO_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_REPLY_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_MESSAGE_MESSAGE_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_READ_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_SEEN_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_SEID_LABEL');
?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_MESSAGE_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_MESSAGE_STATUS');
?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_MESSAGE_ID', 'a.id',
$this->listDirn, $this->listOrder); ?>
	</th>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_toolbar.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<div id="filter-bar" class="btn-toolbar">
        <div class="filter-search btn-group pull-left">
            <label for="filter_search"
class="element-invisible"><?php echo
JText::_('Search');?></label>
            <input type="text" name="filter_search"
id="filter_search" placeholder="<?php echo
JText::_('JSEARCH_FILTER'); ?>" value="<?php echo
$this->escape($this->state->get('filter.search'));
?>" class="hasTooltip" title="<?php echo
JHtml::tooltipText('Search Messages'); ?>" />
        </div>
        <div class="btn-group pull-left">
            <button type="submit" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
            <button type="button" class="btn
hasTooltip" title="<?php echo
JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.id('filter_search').value='';this.form.submit();"><i
class="icon-remove"></i></button>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="limit"
class="element-invisible"><?php echo
JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
        <div class="btn-group pull-right hidden-phone">
            <label for="directionTable"
class="element-invisible"><?php echo
JText::_('JFIELD_ORDERING_DESC');?></label>
            <select name="directionTable"
id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JFIELD_ORDERING_DESC');?></option>
                <option value="asc" <?php if
($this->listDirn == 'asc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
                <option value="desc" <?php if
($this->listDirn == 'desc') echo
'selected="selected"'; ?>><?php echo
JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
            </select>
        </div>
        <div class="btn-group pull-right">
            <label for="sortTable"
class="element-invisible"><?php echo
JText::_('JGLOBAL_SORT_BY');?></label>
            <select name="sortTable" id="sortTable"
class="input-medium" onchange="Joomla.orderTable()">
                <option value=""><?php echo
JText::_('JGLOBAL_SORT_BY');?></option>
                <?php echo JHtml::_('select.options',
$this->getSortFields(), 'value', 'text',
$this->listOrder);?>
            </select>
        </div>
    </div>
<div class="clearfix"> </div><html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Messages
 */
class ReservationViewMessages extends JViewLegacy
{
	/**
	 * Messages view display method
	 * @return void
	 */
	function display($tpl = null)
	{
		if ($this->getLayout() !== 'modal')
		{
			// Include helper submenu
			ReservationHelper::addSubmenu('messages');
		}

		// Assign data to the view
		$this->items = $this->get('Items');
		$this->pagination = $this->get('Pagination');
		$this->state = $this->get('State');
		$this->user = JFactory::getUser();
		// Load the filter form from xml.
		$this->filterForm = $this->get('FilterForm');
		// Load the active filters.
		$this->activeFilters = $this->get('ActiveFilters');
		// Add the list ordering clause.
		$this->listOrder =
$this->escape($this->state->get('list.ordering',
'a.id'));
		$this->listDirn =
$this->escape($this->state->get('list.direction',
'DESC'));
		$this->saveOrder = $this->listOrder == 'a.ordering';
		// set the return here value
		$this->return_here = urlencode(base64_encode((string)
JUri::getInstance()));
		// get global action permissions
		$this->canDo = ReservationHelper::getActions('message');
		$this->canEdit = $this->canDo->get('core.edit');
		$this->canState =
$this->canDo->get('core.edit.state');
		$this->canCreate = $this->canDo->get('core.create');
		$this->canDelete = $this->canDo->get('core.delete');
		$this->canBatch = $this->canDo->get('core.batch');

		// We don't need toolbar in the modal window.
		if ($this->getLayout() !== 'modal')
		{
			$this->addToolbar();
			$this->sidebar = JHtmlSidebar::render();
			// load the batch html
			if ($this->canCreate && $this->canEdit &&
$this->canState)
			{
				$this->batchDisplay = JHtmlBatch_::render();
			}
		}
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JToolBarHelper::title(JText::_('COM_RESERVATION_MESSAGES'),
'joomla');
		JHtmlSidebar::setAction('index.php?option=com_reservation&view=messages');
		JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');

		if ($this->canCreate)
		{
			JToolBarHelper::addNew('message.add');
		}

		// Only load if there are items
		if (ReservationHelper::checkArray($this->items))
		{
			if ($this->canEdit)
			{
				JToolBarHelper::editList('message.edit');
			}

			if ($this->canState)
			{
				JToolBarHelper::publishList('messages.publish');
				JToolBarHelper::unpublishList('messages.unpublish');
				JToolBarHelper::archiveList('messages.archive');

				if ($this->canDo->get('core.admin'))
				{
					JToolBarHelper::checkin('messages.checkin');
				}
			}

			// Add a batch button
			if ($this->canBatch && $this->canCreate &&
$this->canEdit && $this->canState)
			{
				// Get the toolbar object instance
				$bar = JToolBar::getInstance('toolbar');
				// set the batch button name
				$title = JText::_('JTOOLBAR_BATCH');
				// Instantiate a new JLayoutFile instance and render the batch button
				$layout = new JLayoutFile('joomla.toolbar.batch');
				// add the button to the page
				$dhtml = $layout->render(array('title' => $title));
				$bar->appendButton('Custom', $dhtml, 'batch');
			}

			if ($this->state->get('filter.published') == -2
&& ($this->canState && $this->canDelete))
			{
				JToolbarHelper::deleteList('', 'messages.delete',
'JTOOLBAR_EMPTY_TRASH');
			}
			elseif ($this->canState && $this->canDelete)
			{
				JToolbarHelper::trash('messages.trash');
			}

			if ($this->canDo->get('core.export') &&
$this->canDo->get('message.export'))
			{
				JToolBarHelper::custom('messages.exportData',
'download', '',
'COM_RESERVATION_EXPORT_DATA', true);
			}
		}

		if ($this->canDo->get('core.import') &&
$this->canDo->get('message.import'))
		{
			JToolBarHelper::custom('messages.importData',
'upload', '', 'COM_RESERVATION_IMPORT_DATA',
false);
		}

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('messages');
		if (ReservationHelper::checkString($help_url))
		{
				JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}

		// add the options comp button
		if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
		{
			JToolBarHelper::preferences('com_reservation');
		}

		// Only load published batch if state and batch is allowed
		if ($this->canState && $this->canBatch)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_STATE'),
				'batch[published]',
				JHtml::_('select.options',
JHtml::_('jgrid.publishedOptions', array('all' =>
false)), 'value', 'text', '', true)
			);
		}

		// Only load access batch if create, edit and batch is allowed
		if ($this->canBatch && $this->canCreate &&
$this->canEdit)
		{
			JHtmlBatch_::addListSelection(
				JText::_('COM_RESERVATION_KEEP_ORIGINAL_ACCESS'),
				'batch[access]',
				JHtml::_('select.options',
JHtml::_('access.assetgroups'), 'value',
'text')
			);
		}
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_('COM_RESERVATION_MESSAGES'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/messages.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 50)
		{
			// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Returns an array of fields the table can be sorted by
	 *
	 * @return  array  Array containing the field name to sort by as the key
and display text as value
	 */
	protected function getSortFields()
	{
		return array(
			'a.ordering' =>
JText::_('JGRID_HEADING_ORDERING'),
			'a.published' => JText::_('JSTATUS'),
			'a.id' => JText::_('JGRID_HEADING_ID')
		);
	}
}
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		submitbutton.js
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

Joomla.submitbutton = function(task)
{
	if (task == ''){
		return false;
	} else { 
		var action = task.split('.');
		if (action[1] == 'cancel' || action[1] == 'close' ||
document.formvalidator.isValid(document.getElementById("adminForm"))){
			Joomla.submitform(task,
document.getElementById("adminForm"));
			return true;
		} else {
			alert(Joomla.JText._('order, some values are not
acceptable.','Some values are unacceptable'));
			return false;
		}
	}
}<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		edit.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use
$this->params instead
?>
<script type="text/javascript">
	// waiting spinner
	var outerDiv = jQuery('body');
	jQuery('<div id="loading"></div>')
		.css("background", "rgba(255, 255, 255, .8)
url('components/com_reservation/assets/images/import.gif') 50%
15% no-repeat")
		.css("top", outerDiv.position().top -
jQuery(window).scrollTop())
		.css("left", outerDiv.position().left -
jQuery(window).scrollLeft())
		.css("width", outerDiv.width())
		.css("height", outerDiv.height())
		.css("position", "fixed")
		.css("opacity", "0.80")
		.css("-ms-filter",
"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
		.css("filter", "alpha(opacity = 80)")
		.css("display", "none")
		.appendTo(outerDiv);
	jQuery('#loading').show();
	// when page is ready remove and show
	jQuery(window).load(function() {
		jQuery('#reservation_loader').fadeIn('fast');
		jQuery('#loading').hide();
	});
</script>
<div id="reservation_loader" style="display:
none;">
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&layout=edit&id='.
(int) $this->item->id . $this->referral); ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate"
enctype="multipart/form-data">

<div class="form-horizontal">

	<?php echo JHtml::_('bootstrap.startTabSet',
'orderTab', array('active' => 'details'));
?>

	<?php echo JHtml::_('bootstrap.addTab', 'orderTab',
'details', JText::_('COM_RESERVATION_ORDER_DETAILS',
true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('order.details_left',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('order.details_right',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>

	<?php $this->ignore_fieldsets =
array('details','metadata','vdmmetadata','accesscontrol');
?>
	<?php $this->tab_name = 'orderTab'; ?>
	<?php echo JLayoutHelper::render('joomla.edit.params',
$this); ?>

	<?php if ($this->canDo->get('core.edit.created_by') ||
$this->canDo->get('core.edit.created') ||
$this->canDo->get('core.edit.state') ||
($this->canDo->get('core.delete') &&
$this->canDo->get('core.edit.state'))) : ?>
	<?php echo JHtml::_('bootstrap.addTab', 'orderTab',
'publishing',
JText::_('COM_RESERVATION_ORDER_PUBLISHING', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span6">
				<?php echo JLayoutHelper::render('order.publishing',
$this); ?>
			</div>
			<div class="span6">
				<?php echo JLayoutHelper::render('order.publlshing',
$this); ?>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php if ($this->canDo->get('core.admin')) : ?>
	<?php echo JHtml::_('bootstrap.addTab', 'orderTab',
'permissions',
JText::_('COM_RESERVATION_ORDER_PERMISSION', true)); ?>
		<div class="row-fluid form-horizontal-desktop">
			<div class="span12">
				<fieldset class="adminform">
					<div class="adminformlist">
					<?php foreach
($this->form->getFieldset('accesscontrol') as $field):
?>
						<div>
							<?php echo $field->label; echo $field->input;?>
						</div>
						<div class="clearfix"></div>
					<?php endforeach; ?>
					</div>
				</fieldset>
			</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab'); ?>
	<?php endif; ?>

	<?php echo JHtml::_('bootstrap.endTabSet'); ?>

	<div>
		<input type="hidden" name="task"
value="order.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</div>
</form>
</div>
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Order View class
 */
class ReservationViewOrder extends JViewLegacy
{
	/**
	 * display method of View
	 * @return void
	 */
	public function display($tpl = null)
	{
		// set params
		$this->params =
JComponentHelper::getParams('com_reservation');
		// Assign the variables
		$this->form = $this->get('Form');
		$this->item = $this->get('Item');
		$this->script = $this->get('Script');
		$this->state = $this->get('State');
		// get action permissions
		$this->canDo = ReservationHelper::getActions('order',
$this->item);
		// get input
		$jinput = JFactory::getApplication()->input;
		$this->ref = $jinput->get('ref', 0, 'word');
		$this->refid = $jinput->get('refid', 0,
'int');
		$return = $jinput->get('return', null, 'base64');
		// set the referral string
		$this->referral = '';
		if ($this->refid && $this->ref)
		{
			// return to the item that referred to this item
			$this->referral = '&ref=' . (string)$this->ref .
'&refid=' . (int)$this->refid;
		}
		elseif($this->ref)
		{
			// return to the list view that referred to this item
			$this->referral = '&ref=' . (string)$this->ref;
		}
		// check return value
		if (!is_null($return))
		{
			// add the return value
			$this->referral .= '&return=' . (string)$return;
		}

		// Set the toolbar
		$this->addToolBar();
		
		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors), 500);
		}

		// Display the template
		parent::display($tpl);

		// Set the document
		$this->setDocument();
	}


	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{
		JFactory::getApplication()->input->set('hidemainmenu',
true);
		$user = JFactory::getUser();
		$userId	= $user->id;
		$isNew = $this->item->id == 0;

		JToolbarHelper::title( JText::_($isNew ?
'COM_RESERVATION_ORDER_NEW' :
'COM_RESERVATION_ORDER_EDIT'), 'pencil-2 article-add');
		// Built the actions for new and existing records.
		if (ReservationHelper::checkString($this->referral))
		{
			if ($this->canDo->get('core.create') && $isNew)
			{
				// We can create the record.
				JToolBarHelper::save('order.save',
'JTOOLBAR_SAVE');
			}
			elseif ($this->canDo->get('core.edit'))
			{
				// We can save the record.
				JToolBarHelper::save('order.save',
'JTOOLBAR_SAVE');
			}
			if ($isNew)
			{
				// Do not creat but cancel.
				JToolBarHelper::cancel('order.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				// We can close it.
				JToolBarHelper::cancel('order.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		else
		{
			if ($isNew)
			{
				// For new records, check the create permission.
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::apply('order.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('order.save',
'JTOOLBAR_SAVE');
					JToolBarHelper::custom('order.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
				};
				JToolBarHelper::cancel('order.cancel',
'JTOOLBAR_CANCEL');
			}
			else
			{
				if ($this->canDo->get('core.edit'))
				{
					// We can save the new record
					JToolBarHelper::apply('order.apply',
'JTOOLBAR_APPLY');
					JToolBarHelper::save('order.save',
'JTOOLBAR_SAVE');
					// We can save this record, but check the create permission to see
					// if we can return to make a new one.
					if ($this->canDo->get('core.create'))
					{
						JToolBarHelper::custom('order.save2new',
'save-new.png', 'save-new_f2.png',
'JTOOLBAR_SAVE_AND_NEW', false);
					}
				}
				$canVersion = ($this->canDo->get('core.version')
&& $this->canDo->get('order.version'));
				if ($this->state->params->get('save_history', 1)
&& $this->canDo->get('core.edit') &&
$canVersion)
				{
					JToolbarHelper::versions('com_reservation.order',
$this->item->id);
				}
				if ($this->canDo->get('core.create'))
				{
					JToolBarHelper::custom('order.save2copy',
'save-copy.png', 'save-copy_f2.png',
'JTOOLBAR_SAVE_AS_COPY', false);
				}
				JToolBarHelper::cancel('order.cancel',
'JTOOLBAR_CLOSE');
			}
		}
		JToolbarHelper::divider();
		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('order');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var)
	{
		if(strlen($var) > 30)
		{
    		// use the helper htmlEscape method instead and shorten the string
			return ReservationHelper::htmlEscape($var, $this->_charset, true,
30);
		}
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset);
	}

	/**
	 * Method to set up the document properties
	 *
	 * @return void
	 */
	protected function setDocument()
	{
		$isNew = ($this->item->id < 1);
		if (!isset($this->document))
		{
			$this->document = JFactory::getDocument();
		}
		$this->document->setTitle(JText::_($isNew ?
'COM_RESERVATION_ORDER_NEW' :
'COM_RESERVATION_ORDER_EDIT'));
		$this->document->addStyleSheet(JURI::root() .
"administrator/components/com_reservation/assets/css/order.css",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
		$this->document->addScript(JURI::root() . $this->script,
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript');
		$this->document->addScript(JURI::root() .
"administrator/components/com_reservation/views/order/submitbutton.js",
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') :
'text/javascript'); 
		JText::script('view not acceptable. Error');
	}
}
<html><body
bgcolor="#FFFFFF"></body></html><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen',
'.multipleAccessLevels', null,
array('placeholder_text_multiple' => '- ' .
JText::_('COM_RESERVATION_FILTER_SELECT_ACCESS') . '
-'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
	$saveOrderingUrl =
'index.php?option=com_reservation&task=orders.saveOrderAjax&tmpl=component';
	JHtml::_('sortablelist.sortable', 'orderList',
'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo
JRoute::_('index.php?option=com_reservation&view=orders');
?>" method="post" name="adminForm"
id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
	<div id="j-sidebar-container" class="span2">
		<?php echo $this->sidebar; ?>
	</div>
	<div id="j-main-container" class="span10">
<?php else : ?>
	<div id="j-main-container">
<?php endif; ?>
<?php
	// Add the searchtools
	echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)): ?>
	<div class="alert alert-no-items">
		<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
	</div>
<?php else : ?>
	<table class="table table-striped"
id="orderList">
		<thead><?php echo
$this->loadTemplate('head');?></thead>
		<tfoot><?php echo
$this->loadTemplate('foot');?></tfoot>
		<tbody><?php echo
$this->loadTemplate('body');?></tbody>
	</table>
	<?php // Load the batch processing form. ?>
	<?php if ($this->canCreate && $this->canEdit) : ?>
		<?php echo JHtml::_(
			'bootstrap.renderModal',
			'collapseModal',
			array(
				'title' =>
JText::_('COM_RESERVATION_ORDERS_BATCH_OPTIONS'),
				'footer' =>
$this->loadTemplate('batch_footer')
			),
			$this->loadTemplate('batch_body')
		); ?>
	<?php endif; ?>
	<input type="hidden" name="boxchecked"
value="0" />
	</div>
<?php endif; ?>
	<input type="hidden" name="task" value=""
/>
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<p><?php echo
JText::_('COM_RESERVATION_ORDERS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_batch_footer.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button"
onclick="" data-dismiss="modal">
	<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit"
onclick="Joomla.submitbutton('order.batch');">
	<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_body.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$edit =
"index.php?option=com_reservation&view=orders&task=order.edit";

?>
<?php foreach ($this->items as $i => $item): ?>
	<?php
		$canCheckin = $this->user->authorise('core.manage',
'com_checkin') || $item->checked_out == $this->user->id
|| $item->checked_out == 0;
		$userChkOut = JFactory::getUser($item->checked_out);
		$canDo =
ReservationHelper::getActions('order',$item,'orders');
	?>
	<tr class="row<?php echo $i % 2; ?>">
		<td class="order nowrap center hidden-phone">
		<?php if ($canDo->get('core.edit.state')): ?>
			<?php
				$iconClass = '';
				if (!$this->saveOrder)
				{
					$iconClass = ' inactive tip-top" hasTooltip"
title="' . JHtml::tooltipText('JORDERINGDISABLED');
				}
			?>
			<span class="sortable-handler<?php echo $iconClass;
?>">
				<i class="icon-menu"></i>
			</span>
			<?php if ($this->saveOrder) : ?>
				<input type="text" style="display:none"
name="order[]" size="5"
				value="<?php echo $item->ordering; ?>"
class="width-20 text-area-order " />
			<?php endif; ?>
		<?php else: ?>
			&#8942;
		<?php endif; ?>
		</td>
		<td class="nowrap center">
		<?php if ($canDo->get('core.edit')): ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('grid.id', $i, $item->id); ?>
					<?php else: ?>
						&#9633;
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('grid.id', $i, $item->id); ?>
				<?php endif; ?>
		<?php else: ?>
			&#9633;
		<?php endif; ?>
		</td>
		<td class="nowrap">
			<div class="name">
				<?php if ($canDo->get('core.edit')): ?>
					<a href="<?php echo $edit; ?>&id=<?php echo
$item->id; ?>"><?php echo
$this->escape($item->sickid_phonenumber); ?></a>
					<?php if ($item->checked_out): ?>
						<?php echo JHtml::_('jgrid.checkedout', $i,
$userChkOut->name, $item->checked_out_time, 'orders.',
$canCheckin); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo $this->escape($item->sickid_phonenumber); ?>
				<?php endif; ?>
			</div>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->full_price); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->doctor_quota); ?>
		</td>
		<td class="hidden-phone">
			<?php echo $this->escape($item->system_quota); ?>
		</td>
		<td class="hidden-phone">
			<?php echo JText::_($item->status); ?>
		</td>
		<td class="center">
		<?php if ($canDo->get('core.edit.state')) : ?>
				<?php if ($item->checked_out) : ?>
					<?php if ($canCheckin) : ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'orders.', true, 'cb'); ?>
					<?php else: ?>
						<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'orders.', false, 'cb'); ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo JHtml::_('jgrid.published',
$item->published, $i, 'orders.', true, 'cb'); ?>
				<?php endif; ?>
		<?php else: ?>
			<?php echo JHtml::_('jgrid.published', $item->published,
$i, 'orders.', false, 'cb'); ?>
		<?php endif; ?>
		</td>
		<td class="nowrap center hidden-phone">
			<?php echo $item->id; ?>
		</td>
	</tr>
<?php endforeach; ?><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_foot.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<td colspan="9"><?php echo
$this->pagination->getListFooter(); ?></td>
</tr><?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.31
	@build			8th May, 2021
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default_head.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>
<tr>
	<?php if ($this->canEdit&& $this->canState): ?>
		<th width="1%" class="nowrap center
hidden-phone">
			<?php echo JHtml::_('searchtools.sort', '',
'a.ordering', $this->listDirn, $this->listOrder, null,
'asc', 'JGRID_HEADING_ORDERING',
'icon-menu-2'); ?>
		</th>
		<th width="20" class="nowrap center">
			<?php echo JHtml::_('grid.checkall'); ?>
		</th>
	<?php else: ?>
		<th width="20" class="nowrap center
hidden-phone">
			&#9662;
		</th>
		<th width="20" class="nowrap center">
			&#9632;
		</th>
	<?php endif; ?>
	<th class="nowrap" >
			<?php echo JText::_('COM_RESERVATION_ORDER_SICKID_LABEL');
?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_ORDER_FULL_PRICE_LABEL',
'a.full_price', $this->listDirn, $this->listOrder); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_ORDER_DOCTOR_QUOTA_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo
JText::_('COM_RESERVATION_ORDER_SYSTEM_QUOTA_LABEL'); ?>
	</th>
	<th class="nowrap hidden-phone" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_ORDER_STATUS_LABEL', 'a.status',
$this->listDirn, $this->listOrder); ?>
	</th>
	<?php if ($this->canState): ?>
		<th width="10" class="nowrap center" >
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_ORDER_STATUS', 'a.published',
$this->listDirn, $this->listOrder); ?>
		</th>
	<?php else: ?>
		<th width="10" class="nowrap center" >
			<?php echo JText::_('COM_RESERVATION_ORDER_STATUS'); ?>
		</th>
	<?php endif; ?>
	<th width="5" class="nowrap center hidden-phone"
>
			<?php echo JHtml::_('searchtools.sort',
'COM_RESERVATION_ORDER_ID', 'a.id', $this->listDirn,
$this->listOrder); ?>
	</th>
</tr>