From: <txm...@us...> - 2013-03-10 23:52:01
|
Revision: 11193 http://sourceforge.net/p/xoops/svn/11193 Author: txmodxoops Date: 2013-03-10 23:51:55 +0000 (Sun, 10 Mar 2013) Log Message: ----------- New module xhotel beta 1 for management hotels Added Paths: ----------- XoopsModules/xhotel/ XoopsModules/xhotel/releases/1.0/ XoopsModules/xhotel/releases/1.0/xhotel/ XoopsModules/xhotel/releases/1.0/xhotel/admin/ XoopsModules/xhotel/releases/1.0/xhotel/admin/about.php XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_footer.php XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_header.php XoopsModules/xhotel/releases/1.0/xhotel/admin/clients.php XoopsModules/xhotel/releases/1.0/xhotel/admin/index.html XoopsModules/xhotel/releases/1.0/xhotel/admin/index.php XoopsModules/xhotel/releases/1.0/xhotel/admin/menu.php XoopsModules/xhotel/releases/1.0/xhotel/admin/prices.php XoopsModules/xhotel/releases/1.0/xhotel/admin/reservations.php XoopsModules/xhotel/releases/1.0/xhotel/admin/rooms.php XoopsModules/xhotel/releases/1.0/xhotel/admin/supplements.php XoopsModules/xhotel/releases/1.0/xhotel/admin/supplements_reserved.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/ XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_clients.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_prices.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_reservations.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_rooms.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_supplements.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/blocks_supplements_reserved.php XoopsModules/xhotel/releases/1.0/xhotel/blocks/index.html XoopsModules/xhotel/releases/1.0/xhotel/class/ XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_clients.php XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_prices.php XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_reservations.php XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_rooms.php XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_supplements.php XoopsModules/xhotel/releases/1.0/xhotel/class/hotel_supplements_reserved.php XoopsModules/xhotel/releases/1.0/xhotel/class/index.html XoopsModules/xhotel/releases/1.0/xhotel/comment_delete.php XoopsModules/xhotel/releases/1.0/xhotel/comment_edit.php XoopsModules/xhotel/releases/1.0/xhotel/comment_new.php XoopsModules/xhotel/releases/1.0/xhotel/comment_post.php XoopsModules/xhotel/releases/1.0/xhotel/comment_reply.php XoopsModules/xhotel/releases/1.0/xhotel/css/ XoopsModules/xhotel/releases/1.0/xhotel/css/index.html XoopsModules/xhotel/releases/1.0/xhotel/docs/ XoopsModules/xhotel/releases/1.0/xhotel/docs/changelog.txt XoopsModules/xhotel/releases/1.0/xhotel/docs/credits.txt XoopsModules/xhotel/releases/1.0/xhotel/docs/index.html XoopsModules/xhotel/releases/1.0/xhotel/docs/install.txt XoopsModules/xhotel/releases/1.0/xhotel/docs/lang_diff.txt XoopsModules/xhotel/releases/1.0/xhotel/docs/license.txt XoopsModules/xhotel/releases/1.0/xhotel/docs/readme.txt XoopsModules/xhotel/releases/1.0/xhotel/header.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_clients.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_prices.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_reservations.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_rooms.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_supplements.php XoopsModules/xhotel/releases/1.0/xhotel/hotel_supplements_reserved.php XoopsModules/xhotel/releases/1.0/xhotel/images/ XoopsModules/xhotel/releases/1.0/xhotel/images/32/ XoopsModules/xhotel/releases/1.0/xhotel/images/32/clients.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/dollars.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/index.html XoopsModules/xhotel/releases/1.0/xhotel/images/32/money.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/permissions.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/reservations.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/reserved.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/rooms.png XoopsModules/xhotel/releases/1.0/xhotel/images/32/supplements.png XoopsModules/xhotel/releases/1.0/xhotel/images/Hotel_logo.png XoopsModules/xhotel/releases/1.0/xhotel/images/icons/ XoopsModules/xhotel/releases/1.0/xhotel/images/icons/arrow.gif XoopsModules/xhotel/releases/1.0/xhotel/images/icons/index.html XoopsModules/xhotel/releases/1.0/xhotel/images/icons/off.png XoopsModules/xhotel/releases/1.0/xhotel/images/icons/on.png XoopsModules/xhotel/releases/1.0/xhotel/images/index.html XoopsModules/xhotel/releases/1.0/xhotel/images/menu/ XoopsModules/xhotel/releases/1.0/xhotel/images/menu/bg.png XoopsModules/xhotel/releases/1.0/xhotel/images/menu/index.html XoopsModules/xhotel/releases/1.0/xhotel/images/menu/left_both.png XoopsModules/xhotel/releases/1.0/xhotel/images/menu/right_both.png XoopsModules/xhotel/releases/1.0/xhotel/include/ XoopsModules/xhotel/releases/1.0/xhotel/include/common.php XoopsModules/xhotel/releases/1.0/xhotel/include/functions.php XoopsModules/xhotel/releases/1.0/xhotel/include/index.html XoopsModules/xhotel/releases/1.0/xhotel/include/install.php XoopsModules/xhotel/releases/1.0/xhotel/include/waiting.plugin.php XoopsModules/xhotel/releases/1.0/xhotel/index.php XoopsModules/xhotel/releases/1.0/xhotel/language/ XoopsModules/xhotel/releases/1.0/xhotel/language/english/ XoopsModules/xhotel/releases/1.0/xhotel/language/english/admin.php XoopsModules/xhotel/releases/1.0/xhotel/language/english/blocks.php XoopsModules/xhotel/releases/1.0/xhotel/language/english/help/ XoopsModules/xhotel/releases/1.0/xhotel/language/english/help/help.html XoopsModules/xhotel/releases/1.0/xhotel/language/english/help/index.html XoopsModules/xhotel/releases/1.0/xhotel/language/english/index.html XoopsModules/xhotel/releases/1.0/xhotel/language/english/main.php XoopsModules/xhotel/releases/1.0/xhotel/language/english/modinfo.php XoopsModules/xhotel/releases/1.0/xhotel/language/index.html XoopsModules/xhotel/releases/1.0/xhotel/sql/ XoopsModules/xhotel/releases/1.0/xhotel/sql/index.html XoopsModules/xhotel/releases/1.0/xhotel/sql/mysql.sql XoopsModules/xhotel/releases/1.0/xhotel/templates/ XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_clients.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_footer.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_header.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_index.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_prices.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_reservations.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_rooms.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_supplements.html XoopsModules/xhotel/releases/1.0/xhotel/templates/Hotel_supplements_reserved.html XoopsModules/xhotel/releases/1.0/xhotel/templates/admin/ XoopsModules/xhotel/releases/1.0/xhotel/templates/admin/Hotel_admin_about.html XoopsModules/xhotel/releases/1.0/xhotel/templates/admin/Hotel_admin_help.html XoopsModules/xhotel/releases/1.0/xhotel/templates/admin/index.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/ XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_clients_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_clients_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_clients_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_prices_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_prices_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_prices_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_reservations_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_reservations_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_reservations_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_rooms_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_rooms_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_rooms_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_reserved_block_day.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_reserved_block_random.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/hotel_supplements_reserved_block_recent.html XoopsModules/xhotel/releases/1.0/xhotel/templates/blocks/index.html XoopsModules/xhotel/releases/1.0/xhotel/templates/index.html XoopsModules/xhotel/releases/1.0/xhotel/xoops_version.php Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/about.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/about.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/about.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,26 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: about.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include "admin_header.php"; +echo $adminMenu->addNavigation("about.php"); +echo $adminMenu->renderabout('YDRUY5QZQHAHS', false); +include "admin_footer.php"; \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_footer.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_footer.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_footer.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,28 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: admin_footer.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +echo "<div align='center'><a href='http://www.xoops.org' target='_blank'> + <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>"; +echo "<div class='center smallsmall italic pad5'> + <strong>" . $xoopsModule->getVar('name') . "</strong> "._AM_HOTEL_MAINTAINEDBY." + <a href='http://www.txmodxoops.org/modules/newbb' title='Visit TXMod Xoops Community' class='tooltip' rel='external'>TXMod Xoops Community</a></div>"; +xoops_cp_footer(); Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_header.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_header.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/admin_header.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,58 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: admin_header.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ +require_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php'; +include_once '../include/common.php'; +include_once '../include/functions.php'; + +$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); + +$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); +$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); +//load handlers +$clientsHandler =& xoops_getModuleHandler('hotel_clients', $thisDirname); +$roomsHandler =& xoops_getModuleHandler('hotel_rooms', $thisDirname); +$pricesHandler =& xoops_getModuleHandler('hotel_prices', $thisDirname); +$supplementsHandler =& xoops_getModuleHandler('hotel_supplements', $thisDirname); +$reservationsHandler =& xoops_getModuleHandler('hotel_reservations', $thisDirname); +$supplements_reservedHandler =& xoops_getModuleHandler('hotel_supplements_reserved', $thisDirname); + +$myts =& MyTextSanitizer::getInstance(); +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} + +$xoopsTpl->assign('pathIcon16', $pathIcon16); +$xoopsTpl->assign('pathIcon32', $pathIcon32); +//Load languages +xoops_loadLanguage('admin', $thisDirname); +xoops_loadLanguage('modinfo', $thisDirname); +xoops_loadLanguage('main', $thisDirname); +// Locad admin menu class +if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); +}else{ + redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); +} +xoops_cp_header(); +$adminMenu = new ModuleAdmin(); \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/clients.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/clients.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/clients.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,172 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: clients.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; +//It recovered the value of argument op in URL$ +$op = hotel_CleanVars($_REQUEST, 'op', 'list', 'string'); +switch ($op) +{ + case "list": + default: + echo $adminMenu->addNavigation('clients.php'); + $adminMenu->addItemButton(_AM_HOTEL_NEWCLIENTS, 'clients.php?op=new_clients', 'add'); + echo $adminMenu->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("client_id"); + $criteria->setOrder("ASC"); + $numrows = $clientsHandler->getCount(); + $clients_arr = $clientsHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_CLIENT_NAME."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_ADDRESS."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_PHONE."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_ONLINE."</th> + + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($clients_arr) as $i) + { + if ( $clients_arr[$i]->getVar("clients_pid") == 0) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".$clients_arr[$i]->getVar("client_name")."</td>"; + echo "<td align=\"center\">".$clients_arr[$i]->getVar("client_address")."</td>"; + echo "<td align=\"center\">".$clients_arr[$i]->getVar("client_phone")."</td>"; + + $verif_clients_status = ( $clients_arr[$i]->getVar("clients_status") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_clients_status."</td>"; + + $verif_clients_waiting = ( $clients_arr[$i]->getVar("clients_waiting") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_clients_waiting."</td>"; + + $verif_clients_online = ( $clients_arr[$i]->getVar("clients_online") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_clients_online."</td>"; + + echo "<td align='center' width='10%'> + <a href='clients.php?op=edit_clients&client_id=".$clients_arr[$i]->getVar("client_id")."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='clients.php?op=delete_clients&client_id=".$clients_arr[$i]->getVar("client_id")."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br /><br />"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_CLIENT_NAME."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_ADDRESS."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_PHONE."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_CLIENT_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='7'>There are no clients</td></tr>"; + echo "</table><br /><br />"; + } + + break; + + case "new_clients": + echo $adminMenu->addNavigation("clients.php"); + $adminMenu->addItemButton(_AM_HOTEL_CLIENTSLIST, 'clients.php?op=list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $clientsHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_clients": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("clients.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["client_id"])) { + $obj =& $clientsHandler->get($_REQUEST["client_id"]); + } else { + $obj =& $clientsHandler->create(); + } + + //Form client_name + $obj->setVar("client_name", $_REQUEST["client_name"]); + //Form client_address + $obj->setVar("client_address", $_REQUEST["client_address"]); + //Form client_phone + $obj->setVar("client_phone", $_REQUEST["client_phone"]); + //Form clients_status + $verif_clients_status = ($_REQUEST["clients_status"] == 1) ? "1" : "0"; + $obj->setVar("clients_status", $verif_clients_status); + //Form clients_waiting + $verif_clients_waiting = ($_REQUEST["clients_waiting"] == 1) ? "1" : "0"; + $obj->setVar("clients_waiting", $verif_clients_waiting); + //Form clients_online + $verif_clients_online = ($_REQUEST["clients_online"] == 1) ? "1" : "0"; + $obj->setVar("clients_online", $verif_clients_online); + + + if ($clientsHandler->insert($obj)) { + redirect_header("clients.php?op=list", 2, _AM_HOTEL_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_clients": + echo $adminMenu->addNavigation("clients.php"); + $adminMenu->addItemButton(_AM_HOTEL_NEWCLIENTS, 'clients.php?op=new_clients', 'add'); + $adminMenu->addItemButton(_AM_HOTEL_CLIENTSLIST, 'clients.php?op=list', 'list'); + echo $adminMenu->renderButton(); + $obj = $clientsHandler->get($_REQUEST["client_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_clients": + $obj =& $clientsHandler->get($_REQUEST["client_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("clients.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($clientsHandler->delete($obj)) { + redirect_header("clients.php", 3, _AM_HOTEL_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "client_id" => $_REQUEST["client_id"], "op" => "delete_clients"), $_SERVER["REQUEST_URI"], sprintf(_AM_HOTEL_FORMSUREDEL, $obj->getVar("clients"))); + } + break; +} +include_once "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/index.html =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/index.html (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/index.html 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/index.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/index.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/index.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,54 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: index.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; + //count "total clients" + $count_clients = $clientsHandler->getCount(); + //count "total rooms" + $count_rooms = $roomsHandler->getCount(); + //count "total prices" + $count_prices = $pricesHandler->getCount(); + //count "total supplements" + $count_supplements = $supplementsHandler->getCount(); + //count "total reservations" + $count_reservations = $reservationsHandler->getCount(); + //count "total supplements_reserved" + $count_supplements_reserved = $supplements_reservedHandler->getCount(); + // InfoBox + $adminMenu->addInfoBox(_AM_HOTEL_STATISTICS); + // InfoBox clients + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_CLIENTS, $count_clients); + // InfoBox rooms + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_ROOMS, $count_rooms); + // InfoBox prices + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_PRICES, $count_prices); + // InfoBox supplements + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_SUPPLEMENTS, $count_supplements); + // InfoBox reservations + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_RESERVATIONS, $count_reservations); + // InfoBox supplements_reserved + $adminMenu->addInfoBoxLine(_AM_HOTEL_STATISTICS,_AM_HOTEL_THEREARE_SUPPLEMENTS_RESERVED, $count_supplements_reserved); + // Render Index + echo $adminMenu->addNavigation("index.php"); + echo $adminMenu->renderIndex(); +include_once "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/menu.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/menu.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/menu.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,62 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: menu.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +$dirname = basename( dirname( dirname( __FILE__ ) ) ) ; +$module_handler =& xoops_gethandler("module"); +$xoopsModule =& XoopsModule::getByDirname($dirname); +$moduleInfo =& $module_handler->get($xoopsModule->getVar("mid")); +$pathIcon32 = $moduleInfo->getInfo("icons32"); +$adminmenu = array(); +$i = 1; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU1; +$adminmenu[$i]["link"] = "admin/index.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/home.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU2; +$adminmenu[$i]["link"] = "admin/clients.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/user-icon.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU3; +$adminmenu[$i]["link"] = "admin/rooms.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/view_detailed.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU4; +$adminmenu[$i]["link"] = "admin/prices.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/cash_stack.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU5; +$adminmenu[$i]["link"] = "admin/supplements.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/attach.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU6; +$adminmenu[$i]["link"] = "admin/reservations.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/access.list.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU7; +$adminmenu[$i]["link"] = "admin/supplements_reserved.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/extention.png"; +$i++; +$adminmenu[$i]["title"] = _MI_HOTEL_ADMENU8; +$adminmenu[$i]["link"] = "admin/about.php"; +$adminmenu[$i]["icon"] = $pathIcon32."/about.png"; +unset( $i ); +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/prices.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/prices.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/prices.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,173 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: prices.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; +//It recovered the value of argument op in URL$ +$op = hotel_CleanVars($_REQUEST, 'op', 'list', 'string'); +switch ($op) +{ + case "list": + default: + echo $adminMenu->addNavigation('prices.php'); + $adminMenu->addItemButton(_AM_HOTEL_NEWPRICES, 'prices.php?op=new_prices', 'add'); + echo $adminMenu->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("prices_id"); + $criteria->setOrder("ASC"); + $numrows = $pricesHandler->getCount(); + $prices_arr = $pricesHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_PRICE_FROMPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_TOPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_TYPE_ROOM."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_MATCH."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($prices_arr) as $i) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".formatTimeStamp($prices_arr[$i]->getVar("prices_fromperiod"),"S")."</td>"; + echo "<td align=\"center\">".formatTimeStamp($prices_arr[$i]->getVar("prices_toperiod"),"S")."</td>"; + echo "<td align=\"center\">".$prices_arr[$i]->getVar("prices_type_room")."</td>"; + echo "<td align=\"center\">".$prices_arr[$i]->getVar("prices_match")."</td>"; + + $verif_prices_status = ( $prices_arr[$i]->getVar("prices_status") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_prices_status."</td>"; + + $verif_prices_waiting = ( $prices_arr[$i]->getVar("prices_waiting") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_prices_waiting."</td>"; + + $verif_prices_online = ( $prices_arr[$i]->getVar("prices_online") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_prices_online."</td>"; + + echo "<td align='center' width='10%'> + <a href='prices.php?op=edit_prices&prices_id=".$prices_arr[$i]->getVar("prices_id")."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='prices.php?op=delete_prices&prices_id=".$prices_arr[$i]->getVar("prices_id")."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + echo "</table><br /><br />"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_PRICE_FROMPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_TOPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_TYPE_ROOM."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_MATCH."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_PRICE_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='8'>There are no rooms</td></tr>"; + echo "</table><br /><br />"; + } + + break; + + case "new_prices": + echo $adminMenu->addNavigation("prices.php"); + $adminMenu->addItemButton(_AM_HOTEL_PRICESLIST, 'prices.php?op=list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $pricesHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_prices": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("prices.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["prices_id"])) { + $obj =& $pricesHandler->get($_REQUEST["prices_id"]); + } else { + $obj =& $pricesHandler->create(); + } + + //Form prices_fromperiod + $obj->setVar("prices_fromperiod", strtotime($_REQUEST["prices_fromperiod"])); + //Form prices_toperiod + $obj->setVar("prices_toperiod", strtotime($_REQUEST["prices_toperiod"])); + //Form prices_type_room + $obj->setVar("prices_type_room", $_REQUEST["prices_type_room"]); + //Form prices_match + $obj->setVar("prices_match", $_REQUEST["prices_match"]); + //Form prices_status + $verif_prices_status = ($_REQUEST["prices_status"] == 1) ? "1" : "0"; + $obj->setVar("prices_status", $verif_prices_status); + //Form prices_waiting + $verif_prices_waiting = ($_REQUEST["prices_waiting"] == 1) ? "1" : "0"; + $obj->setVar("prices_waiting", $verif_prices_waiting); + //Form prices_online + $verif_prices_online = ($_REQUEST["prices_online"] == 1) ? "1" : "0"; + $obj->setVar("prices_online", $verif_prices_online); + + + if ($pricesHandler->insert($obj)) { + redirect_header("prices.php?op=list", 2, _AM_HOTEL_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_prices": + echo $adminMenu->addNavigation("prices.php"); + $adminMenu->addItemButton(_AM_HOTEL_NEWPRICES, 'prices.php?op=new_prices', 'add'); + $adminMenu->addItemButton(_AM_HOTEL_PRICESLIST, 'prices.php?op=list', 'list'); + echo $adminMenu->renderButton(); + $obj = $pricesHandler->get($_REQUEST["prices_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_prices": + $obj =& $pricesHandler->get($_REQUEST["prices_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("prices.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($pricesHandler->delete($obj)) { + redirect_header("prices.php", 3, _AM_HOTEL_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "prices_id" => $_REQUEST["prices_id"], "op" => "delete_prices"), $_SERVER["REQUEST_URI"], sprintf(_AM_HOTEL_FORMSUREDEL, $obj->getVar("prices"))); + } + break; +} +include_once "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/reservations.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/reservations.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/reservations.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,185 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: reservations.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; +//It recovered the value of argument op in URL$ +$op = hotel_CleanVars($_REQUEST, 'op', 'list', 'string'); +switch ($op) +{ + case "list": + default: + echo $adminMenu->addNavigation('reservations.php'); + $adminMenu->addItemButton(_AM_HOTEL_NEWRESERVATIONS, 'reservations.php?op=new_reservations', 'add'); + echo $adminMenu->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("reservation_id"); + $criteria->setOrder("ASC"); + $numrows = $reservationsHandler->getCount(); + $reservations_arr = $reservationsHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_RESERVATION_FROMPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_TOPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_ROOM."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_CLIENTID."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_TOTALPRICE."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_ONLINE."</th> + + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($reservations_arr) as $i) + { + if ( $reservations_arr[$i]->getVar("reservations_pid") == 0) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".formatTimeStamp($reservations_arr[$i]->getVar("reservation_fromperiod"),"S")."</td>"; + echo "<td align=\"center\">".formatTimeStamp($reservations_arr[$i]->getVar("reservation_toperiod"),"S")."</td>"; + echo "<td align=\"center\">".$reservations_arr[$i]->getVar("reservation_room")."</td>"; + + $clients =& $clientsHandler->get($reservations_arr[$i]->getVar("reservation_clientid")); + $title_clients = $clients->getVar("client_name"); + echo "<td align=\"center\">".$title_clients."</td>"; + echo "<td align=\"center\">".$reservations_arr[$i]->getVar("reservation_totalprice")."</td>"; + + $verif_reservations_status = ( $reservations_arr[$i]->getVar("reservations_status") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_reservations_status."</td>"; + + $verif_reservations_waiting = ( $reservations_arr[$i]->getVar("reservations_waiting") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_reservations_waiting."</td>"; + + $verif_reservations_online = ( $reservations_arr[$i]->getVar("reservations_online") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_reservations_online."</td>"; + + echo "<td align='center' width='10%'> + <a href='reservations.php?op=edit_reservations&reservation_id=".$reservations_arr[$i]->getVar("reservation_id")."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='reservations.php?op=delete_reservations&reservation_id=".$reservations_arr[$i]->getVar("reservation_id")."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br /><br />"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_RESERVATION_FROMPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_TOPERIOD."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_ROOM."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_CLIENTID."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_TOTALPRICE."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_RESERVATION_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='9'>There are no reservations</td></tr>"; + echo "</table><br /><br />"; + } + + break; + + case "new_reservations": + echo $adminMenu->addNavigation("reservations.php"); + $adminMenu->addItemButton(_AM_HOTEL_RESERVATIONSLIST, 'reservations.php?op=list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $reservationsHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_reservations": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("reservations.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["reservation_id"])) { + $obj =& $reservationsHandler->get($_REQUEST["reservation_id"]); + } else { + $obj =& $reservationsHandler->create(); + } + + //Form reservation_fromperiod + $obj->setVar("reservation_fromperiod", strtotime($_REQUEST["reservation_fromperiod"])); + //Form reservation_toperiod + $obj->setVar("reservation_toperiod", strtotime($_REQUEST["reservation_toperiod"])); + //Form reservation_room + $obj->setVar("reservation_room", $_REQUEST["reservation_room"]); + //Form reservation_clientid + $obj->setVar("reservation_clientid", $_REQUEST["reservation_clientid"]); + //Form reservation_totalprice + $obj->setVar("reservation_totalprice", $_REQUEST["reservation_totalprice"]); + //Form reservations_status + $verif_reservations_status = ($_REQUEST["reservations_status"] == 1) ? "1" : "0"; + $obj->setVar("reservations_status", $verif_reservations_status); + //Form reservations_waiting + $verif_reservations_waiting = ($_REQUEST["reservations_waiting"] == 1) ? "1" : "0"; + $obj->setVar("reservations_waiting", $verif_reservations_waiting); + //Form reservations_online + $verif_reservations_online = ($_REQUEST["reservations_online"] == 1) ? "1" : "0"; + $obj->setVar("reservations_online", $verif_reservations_online); + + + if ($reservationsHandler->insert($obj)) { + redirect_header("reservations.php?op=list", 2, _AM_HOTEL_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_reservations": + echo $adminMenu->addNavigation("reservations.php"); + $adminMenu->addItemButton(_AM_HOTEL_NEWRESERVATIONS, 'reservations.php?op=new_reservations', 'add'); + $adminMenu->addItemButton(_AM_HOTEL_RESERVATIONSLIST, 'reservations.php?op=list', 'list'); + echo $adminMenu->renderButton(); + $obj = $reservationsHandler->get($_REQUEST["reservation_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_reservations": + $obj =& $reservationsHandler->get($_REQUEST["reservation_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("reservations.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($reservationsHandler->delete($obj)) { + redirect_header("reservations.php", 3, _AM_HOTEL_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "reservation_id" => $_REQUEST["reservation_id"], "op" => "delete_reservations"), $_SERVER["REQUEST_URI"], sprintf(_AM_HOTEL_FORMSUREDEL, $obj->getVar("reservations"))); + } + break; +} +include_once "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/rooms.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/rooms.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/rooms.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,182 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: rooms.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; +//It recovered the value of argument op in URL$ +$op = hotel_CleanVars($_REQUEST, 'op', 'list', 'string'); +switch ($op) +{ + case "list": + default: + echo $adminMenu->addNavigation('rooms.php'); + $adminMenu->addItemButton(_AM_HOTEL_NEWROOMS, 'rooms.php?op=new_rooms', 'add'); + echo $adminMenu->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("room_id"); + $criteria->setOrder("ASC"); + $numrows = $roomsHandler->getCount(); + $rooms_arr = $roomsHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_ROOM_NUMBER."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_FLOOR."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_TYPE."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_ADDED_BEDS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_OPTIONALS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_ONLINE."</th> + + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($rooms_arr) as $i) + { + if ( $rooms_arr[$i]->getVar("rooms_pid") == 0) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".$rooms_arr[$i]->getVar("room_number")."</td>"; + echo "<td align=\"center\">".$rooms_arr[$i]->getVar("room_floor")."</td>"; + echo "<td align=\"center\">".$rooms_arr[$i]->getVar("room_type")."</td>"; + echo "<td align=\"center\">".$rooms_arr[$i]->getVar("room_added_beds")."</td>"; + echo "<td align=\"center\">".$rooms_arr[$i]->getVar("room_optionals")."</td>"; + + $verif_rooms_status = ( $rooms_arr[$i]->getVar("rooms_status") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_rooms_status."</td>"; + + $verif_rooms_waiting = ( $rooms_arr[$i]->getVar("rooms_waiting") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_rooms_waiting."</td>"; + + $verif_rooms_online = ( $rooms_arr[$i]->getVar("rooms_online") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_rooms_online."</td>"; + + echo "<td align='center' width='10%'> + <a href='rooms.php?op=edit_rooms&room_id=".$rooms_arr[$i]->getVar("room_id")."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='rooms.php?op=delete_rooms&room_id=".$rooms_arr[$i]->getVar("room_id")."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br /><br />"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_ROOM_NUMBER."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_FLOOR."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_TYPE."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_ADDED_BEDS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_OPTIONALS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_ROOM_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='9'>There are no rooms</td></tr>"; + echo "</table><br /><br />"; + } + + break; + + case "new_rooms": + echo $adminMenu->addNavigation("rooms.php"); + $adminMenu->addItemButton(_AM_HOTEL_ROOMSLIST, 'rooms.php?op=list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $roomsHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_rooms": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("rooms.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["room_id"])) { + $obj =& $roomsHandler->get($_REQUEST["room_id"]); + } else { + $obj =& $roomsHandler->create(); + } + + //Form room_number + $obj->setVar("room_number", $_REQUEST["room_number"]); + //Form room_floor + $obj->setVar("room_floor", $_REQUEST["room_floor"]); + //Form room_type + $obj->setVar("room_type", $_REQUEST["room_type"]); + //Form room_added_beds + $obj->setVar("room_added_beds", $_REQUEST["room_added_beds"]); + //Form room_optionals + $obj->setVar("room_optionals", $_REQUEST["room_optionals"]); + //Form rooms_status + $verif_rooms_status = ($_REQUEST["rooms_status"] == 1) ? "1" : "0"; + $obj->setVar("rooms_status", $verif_rooms_status); + //Form rooms_waiting + $verif_rooms_waiting = ($_REQUEST["rooms_waiting"] == 1) ? "1" : "0"; + $obj->setVar("rooms_waiting", $verif_rooms_waiting); + //Form rooms_online + $verif_rooms_online = ($_REQUEST["rooms_online"] == 1) ? "1" : "0"; + $obj->setVar("rooms_online", $verif_rooms_online); + + + if ($roomsHandler->insert($obj)) { + redirect_header("rooms.php?op=list", 2, _AM_HOTEL_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_rooms": + echo $adminMenu->addNavigation("rooms.php"); + $adminMenu->addItemButton(_AM_HOTEL_NEWROOMS, 'rooms.php?op=new_rooms', 'add'); + $adminMenu->addItemButton(_AM_HOTEL_ROOMSLIST, 'rooms.php?op=list', 'list'); + echo $adminMenu->renderButton(); + $obj = $roomsHandler->get($_REQUEST["room_id"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_rooms": + $obj =& $roomsHandler->get($_REQUEST["room_id"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("rooms.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($roomsHandler->delete($obj)) { + redirect_header("rooms.php", 3, _AM_HOTEL_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "room_id" => $_REQUEST["room_id"], "op" => "delete_rooms"), $_SERVER["REQUEST_URI"], sprintf(_AM_HOTEL_FORMSUREDEL, $obj->getVar("rooms"))); + } + break; +} +include_once "admin_footer.php"; +?> \ No newline at end of file Added: XoopsModules/xhotel/releases/1.0/xhotel/admin/supplements.php =================================================================== --- XoopsModules/xhotel/releases/1.0/xhotel/admin/supplements.php (rev 0) +++ XoopsModules/xhotel/releases/1.0/xhotel/admin/supplements.php 2013-03-10 23:51:55 UTC (rev 11193) @@ -0,0 +1,167 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * hotel module for xoops + * + * @copyright The TXMod XOOPS Project http://sourceforge.net/projects/thmod/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GPL 2.0 or later + * @package hotel + * @since 2.5.x + * @author TXMod Xoops (Timgno) ( su...@tx... ) - ( http://www.txmodxoops.org ) + * @version $Id: supplements.php 11095 2012-07-13 10:41:41Z txmodxoops $ + */ + +include_once "admin_header.php"; +//It recovered the value of argument op in URL$ +$op = hotel_CleanVars($_REQUEST, 'op', 'list', 'string'); +switch ($op) +{ + case "list": + default: + echo $adminMenu->addNavigation('supplements.php'); + $adminMenu->addItemButton(_AM_HOTEL_NEWSUPPLEMENTS, 'supplements.php?op=new_supplements', 'add'); + echo $adminMenu->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("supplements_code"); + $criteria->setOrder("ASC"); + $numrows = $supplementsHandler->getCount(); + $supplements_arr = $supplementsHandler->getall($criteria); + + //Affichage du tableau + if ($numrows>0) + { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_ITEM."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_PRICE."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_ONLINE."</th> + + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr>"; + + $class = "odd"; + + foreach (array_keys($supplements_arr) as $i) + { + if ( $supplements_arr[$i]->getVar("supplements_pid") == 0) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td align=\"center\">".$supplements_arr[$i]->getVar("supplements_item")."</td>"; + echo "<td align=\"center\">".$supplements_arr[$i]->getVar("supplements_price")."</td>"; + + $verif_supplements_status = ( $supplements_arr[$i]->getVar("supplements_status") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_supplements_status."</td>"; + + $verif_supplements_waiting = ( $supplements_arr[$i]->getVar("supplements_waiting") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_supplements_waiting."</td>"; + + $verif_supplements_online = ( $supplements_arr[$i]->getVar("supplements_online") == 1 ) ? _YES : _NO; + echo "<td align=\"center\">".$verif_supplements_online."</td>"; + + echo "<td align='center' width='10%'> + <a href='supplements.php?op=edit_supplements&supplements_code=".$supplements_arr[$i]->getVar("supplements_code")."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a> + <a href='supplements.php?op=delete_supplements&supplements_code=".$supplements_arr[$i]->getVar("supplements_code")."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + } + echo "</table><br /><br />"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_ITEM."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_PRICE."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_STATUS."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_WAITING."</th> + <th align=\"center\">"._AM_HOTEL_SUPPLEMENT_ONLINE."</th> + <th align='center' width='10%'>"._AM_HOTEL_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='6'>There are no rooms</td></tr>"; + echo "</table><br /><br />"; + } + + break; + + case "new_supplements": + echo $adminMenu->addNavigation("supplements.php"); + $adminMenu->addItemButton(_AM_HOTEL_SUPPLEMENTSLIST, 'supplements.php?op=list', 'list'); + echo $adminMenu->renderButton(); + + $obj =& $supplementsHandler->create(); + $form = $obj->getForm(); + $form->display(); + break; + + case "save_supplements": + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("supplements.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if (isset($_REQUEST["supplements_code"])) { + $obj =& $supplementsHandler->get($_REQUEST["supplements_code"]); + } else { + $obj =& $supplementsHandler->create(); + } + + //Form supplements_item + $obj->setVar("supplements_item", $_REQUEST["supplements_item"]); + //Form supplements_price + $obj->setVar("supplements_price", $_REQUEST["supplements_price"]); + //Form supplements_status + $verif_supplements_status = ($_REQUEST["supplements_status"] == 1) ? "1" : "0"; + $obj->setVar("supplements_status", $verif_supplements_status); + //Form supplements_waiting + $verif_supplements_waiting = ($_REQUEST["supplements_waiting"] == 1) ? "1" : "0"; + $obj->setVar("supplements_waiting", $verif_supplements_waiting); + //Form supplements_online + $verif_supplements_online = ($_REQUEST["supplements_online"] == 1) ? "1" : "0"; + $obj->setVar("supplements_online", $verif_supplements_online); + + + if ($supplementsHandler->insert($obj)) { + redirect_header("supplements.php?op=list", 2, _AM_HOTEL_FORMOK); + } + + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + + case "edit_supplements": + echo $adminMenu->addNavigation("supplements.php"); + $adminMenu->addItemButton(_AM_HOTEL_NEWSUPPLEMENTS, 'supplements.php?op=new_supplements', 'add'); + $adminMenu->addItemButton(_AM_HOTEL_SUPPLEMENTSLIST, 'supplements.php?op=list', 'list'); + echo $adminMenu->renderButton(); + $obj = $supplementsHandler->get($_REQUEST["supplements_code"]); + $form = $obj->getForm(); + $form->display(); + break; + + case "delete_supplements": + $obj =& $supplementsHandler->get($_REQUEST["supplements_code"]); + if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { + if ( !$GLOBALS["xoopsSecurity"]->check() ) { + redirect_header("supplements.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + } + if ($supplementsHandler->delete($obj)) { + redirect_header("supplements.php", 3, _AM_HOTEL_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array("ok" => 1, "supplements_code" => $_REQUEST["suppl... [truncated message content] |