public function getStats() { DB::transaction(function () { $guestlist_date = date('Y-m-d', strtotime(date('Y-m-d') . "-1 days")); $hotels = Guestlist::select('hotel_id')->where('guestlist_date', $guestlist_date)->distinct()->get(); foreach ($hotels as $row) { $total_check_in = Guestlist::select(DB::raw('count(*) as total_check_in'))->where('guestlist_date', $guestlist_date)->where('hotel_id', $row->hotel_id)->pluck('total_check_in'); $total_check_out = Guestlist::select(DB::raw('count(*) as total_check_out'))->where('checkout_date', 'like', $guestlist_date . '%')->where('hotel_id', $row->hotel_id)->pluck('total_check_out'); $foreign_guest = Guestlist::select(DB::raw('count(*) as foreign_guest'))->where('checkin_date', 'like', $guestlist_date . '%')->where('hotel_id', $row->hotel_id)->whereNotIn('nationality', array('IND', 'INDIA', 'INDIAN'))->pluck('foreign_guest'); //dd(DB::getQueryLog($total_check_out)); $data = array(); $data['hotel_id'] = $row->hotel_id; $data['guestlist_date'] = $guestlist_date; $data['total_check_in'] = $total_check_in; $data['total_check_out'] = $total_check_out; $data['foreign_guest'] = $foreign_guest; $data['id'] = DB::table('hotel_records')->insertGetId($data); } }); }
$fill = true; foreach ($data as $row) { $this->Cell($w[0], 6, $row[0], 'LR', 0, 'C', $fill); $this->Cell($w[1], 6, iconv('UTF-8', 'ISO-8859-1', $row[1]), 'LR', 0, 'C', $fill); $this->Cell($w[2], 6, iconv('UTF-8', 'ISO-8859-1', $row[2]), 'LR', 0, 'C', $fill); $this->Cell($w[3], 6, $row[3], 'LR', 0, 'C', $fill); $this->Cell($w[4], 6, iconv('UTF-8', 'ISO-8859-1', $row[4]), 'LR', 0, 'C', $fill); $this->Ln(); $fill = !$fill; } //Closure line $this->Cell(array_sum($w), 0, '', 'T'); } } $header = array('id', 'Nome', 'Email', 'Contacto', iconv('UTF-8', 'ISO-8859-1', 'Comentário')); $gl = new Guestlist(); $guests = $gl->ListGuests(' 1 ORDER BY NAME ASC'); $data = array(); $i = 0; foreach ($guests as $guest) { $data[$i][0] = $guest['id']; $data[$i][1] = $guest['name']; $data[$i][2] = $guest['email']; $data[$i][3] = $guest['phone']; $data[$i][4] = $guest['comment']; $i++; } $pdf = new PDF(); $pdf->SetFont('Arial', '', 8); $pdf->AddPage(); $pdf->ImprovedTable($header, $data);
<?php //Check User Session require 'functions.session.php'; DEFINE(LOGINPAGE, 'login.html'); if (!checkSession()) { echo '<script type="text/javascript">alert("Necessita fazer login primeiro")</script>'; redirectTo(LOGINPAGE, 0); die; } // Load Guests from database require 'class.guestlist.php'; $gl = new Guestlist(); //Style above here! // Lets print out all the users emails in one pretty line $emails = $gl->listGuestsEmails(); foreach ($emails as $email) { print $email['email'] . ';'; } //Style below here!
<?php //Check User Session require 'functions.session.php'; DEFINE(LOGINPAGE, 'login.html'); if (!checkSession()) { echo '<script type="text/javascript">alert("Necessita fazer login primeiro")</script>'; redirectTo(LOGINPAGE, 0); die; } // Load Guests from database require 'class.guestlist.php'; $gl = new Guestlist(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ecrã de Administração Guest List</title> <link href="style.css" media="screen" type="text/css" rel="stylesheet" /> <script language="JavaScript"> function go_there(id){ var where_to= confirm("Tem a certeza que pretende eliminar este registo?"); if (where_to== true){ window.location="post.php?action=delete&id="+id; } } </script> </head> <body> <div id="wrapper">
/** * list checked-in guests as RTF * * @since 2004-06-05 * @author Christian Ehret <*****@*****.**> */ $nocachecontrol = true; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once "../includes/fileselector.inc.php"; $bcat = -1; if ($request->GetVar('bcat', 'get') !== $request->undefined) { $bcat = $request->GetVar('bcat', 'get'); } include_once 'guestlistclass.inc.php'; $guestlist = new Guestlist(); $statarr = $guestlist->get($bcat); $children0 = $request->GetVar('children0', 'session'); $children1 = $request->GetVar('children1', 'session'); $children2 = $request->GetVar('children2', 'session'); $children3 = $request->GetVar('children3', 'session'); // $table = '\trowd\trgaph70\trleft-108\trrh513\trbrdrl\brdrs\brdrw15\brdrcf1 \trbrdrt\brdrs\brdrw15\brdrcf1 \trbrdrr\brdrs\brdrw15\brdrcf1 \trbrdrb\brdrs\brdrw15\brdrcf1 \trpaddl70\trpaddr70\trpaddfl3\trpaddfr3\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx1172\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx2453\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx3734\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx5013\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx6293\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx7573\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx8900\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx10227\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx11192\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx12157\clbrdrt\brdrw15\brdrs\brdrcf1\clbrdrb\brdrw15\brdrs\brdrcf1 \cellx13122\pard'; $table .= '\\trowd\\trgaph70\\trleft-108\\trrh513\\trbrdrl\\brdrs\\brdrw15\\brdrcf1 \\trbrdrt\\brdrs\\brdrw15\\brdrcf1 \\trbrdrr\\brdrs\\brdrw15\\brdrcf1 \\trbrdrb\\brdrs\\brdrw15\\brdrcf1 \\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx1172\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx2453\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx3734\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx5013\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx6293\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx7573\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx8900\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx10227\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx11192\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx12157\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx13122\\clbrdrt\\brdrw15\\brdrs\\brdrcf1\\clbrdrb\\brdrw15\\brdrs\\brdrcf1 \\cellx14087\\pard'; $table .= '\\intbl\\nowidctlpar\\b\\fs22 Zimmer\\cell Nachname\\cell Vorname\\cell von\\cell bis\\cell Buchungs-kategorie\\cell Buchungs-status\\cell Erwachsene\\cell ' . $children0 . '\\cell ' . $children1 . '\\cell ' . $children2 . '\\cell ' . $children3 . '\\cell\\row\\trowd\\trgaph70\\trleft-108\\trrh256\\trbrdrl\\brdrs\\brdrw15\\brdrcf1 \\trbrdrt\\brdrs\\brdrw15\\brdrcf1 \\trbrdrr\\brdrs\\brdrw15\\brdrcf1 \\trbrdrb\\brdrs\\brdrw15\\brdrcf1 \\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx1172\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx2453\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx3734\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx5013\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx6293\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx7573\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx8900\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx10227\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx11192\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx12157\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx13122\\clbrdrt\\brdrw15\\brdrs\\brdrcf1 \\cellx14087\\pard'; for ($i = 0; $i < count($statarr); $i++) { $table .= '\\intbl\\nowidctlpar\\b0 ' . $statarr[$i]['room'] . '\\cell ' . $statarr[$i]['lastname'] . '\\cell ' . $statarr[$i]['firstname'] . '\\cell ' . $statarr[$i]['startdate'] . '\\cell ' . $statarr[$i]['enddate'] . '\\cell ' . $statarr[$i]['bookingcat'] . '\\cell ' . $statarr[$i]['bookingtype'] . '\\cell ' . $statarr[$i]['person'] . '\\cell ' . $statarr[$i]['children0'] . '\\cell ' . $statarr[$i]['children1'] . '\\cell ' . $statarr[$i]['children2'] . '\\cell ' . $statarr[$i]['children3'] . '\\cell\\row\\pard'; } $table .= '\\nowidctlpar\\par'; // get RTF-Template $tplfile = selectfile('tpl_guest.rtf'); $tplHandle = fopen($tplfile, 'r');
* @since 2004-05-06 * @author Christian Ehret <*****@*****.**> */ $smartyType = "www"; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once 'guestlistclass.inc.php'; $smarty->assign("tpl_title", "Anwesenheitsliste"); $smarty->assign('tpl_nav', 'lists'); $smarty->assign('tpl_type', 'lists'); $smarty->assign('tpl_subnav', 'guestlist2'); $smarty->assign('tpl_children0_field', $request->GetVar('children0', 'session')); $smarty->assign('tpl_children1_field', $request->GetVar('children1', 'session')); $smarty->assign('tpl_children2_field', $request->GetVar('children2', 'session')); $smarty->assign('tpl_children3_field', $request->GetVar('children3', 'session')); $guestlist = new Guestlist(); include_once 'bookingcategoryclass.inc.php'; $bcat = new BookingCategory(); $smarty->assign('tpl_bookcat', $bcat->get()); $todaydate = getdate(); $day = $todaydate['mday']; $month = $todaydate['mon']; $year = $todaydate['year']; $thedate = "{$day}.{$month}.{$year}"; $theotherdate = "{$day}-{$month}-{$year}"; $smarty->assign('tpl_dates', $guestlist->getdates()); if ($request->GetVar('frm_start', 'post') !== $request->undefined) { $thestart = $request->GetVar('frm_start', 'post'); } else { $thestart = $month . '/' . $year; }
* * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * list of guests in a time period as RTF * * * @since 2004-06-05 * @author Christian Ehret <*****@*****.**> */ $nocachecontrol = true; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once "../includes/fileselector.inc.php"; include_once 'guestlistclass.inc.php'; $guestlist = new Guestlist(); $todaydate = getdate(); $day = $todaydate['mday']; $month = $todaydate['mon']; $year = $todaydate['year']; $thedate = "{$day}.{$month}.{$year}"; $bcat = -1; if ($request->GetVar('bcat', 'get') !== $request->undefined) { $bcat = $request->GetVar('bcat', 'get'); } if ($request->GetVar('start', 'get') !== $request->undefined) { $thestart = $request->GetVar('start', 'get'); } else { $thestart = $month . '/' . $year; } if ($request->GetVar('start1', 'get') !== $request->undefined) {
<?php //Check User Session require 'functions.session.php'; require 'class.guestlist.php'; DEFINE(LOGINPAGE, 'login.html'); if (!checkSession()) { echo '<script type="text/javascript">alert("Necessita fazer login primeiro")</script>'; redirectTo(LOGINPAGE, 0); die; } $gl = new Guestlist(); if ($_POST['add'] == "Enviar") { if (!$gl->createGuest($_POST['nome'], $_POST['email'], $_POST['telefone'], $comment = $_POST['comment'])) { echo '<script type="text/javascript">alert("Um dos campos e invalido. Registo nao efectuado!")</script>'; } redirectTo('admin.php', 0); } else { if ($_POST['edit'] == 'Modificar') { if (!$gl->editGuest("id=" . $_POST['id'], $_POST['nome'], $_POST['email'], $_POST['telefone'], $comment = $_POST['comment'])) { echo '<script type="text/javascript">alert("Um dos campos e invalido. Registo nao alterado!")</script>'; } redirectTo('admin.php', 0); } else { if ($_GET['action'] == 'delete') { $gl->deleteGuest('id = ' . $_GET['id']); redirectTo('admin.php', 0); } } }
include_once('bookingclass.inc.php'); include_once('roomclass.inc.php'); include_once('guestlistclass.inc.php'); $cal = New Calendar; $bcat = New BookingCategory; $room = New Room; $book = New Booking; $guestlist = New Guestlist; */ include_once 'calendarclass.inc.php'; include_once 'bookingcategoryclass.inc.php'; include_once 'bookingclass.inc.php'; include_once 'guestlistclass.inc.php'; $bcat = new BookingCategory(); $book = new Booking(); $guestlist = new Guestlist(); $cal = new Calendar(); $smarty->assign("tpl_title", "Zimmerplan"); $smarty->assign('tpl_nav', 'calendar'); $smarty->assign('tpl_type', 'calendar'); // check for old reservations $numoldres = $book->getnumoldreservations(); if ($numoldres > 0 && $request->GetVar('showoldres', 'Session') !== 'noshow') { $smarty->assign('tpl_oldreservations', 'true'); } else { $smarty->assign('tpl_oldreservations', 'false'); } $numbirthday = count($guestlist->getBirthdayReminders()); if ($numbirthday > 0 && $request->GetVar('showbirthdays', 'Session') !== 'noshow') { $smarty->assign('tpl_birthdays', 'true'); } else {
***************************************************************/ /** * list of birthdays in a month * * lists * * @since 2004-07-26 * @author Christian Ehret <*****@*****.**> */ $smartyType = "www"; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once 'guestlistclass.inc.php'; $smarty->assign("tpl_title", "Geburtstagsliste"); $smarty->assign('tpl_nav', 'lists'); $smarty->assign('tpl_type', 'lists'); $smarty->assign('tpl_subnav', 'birthday'); $guestlist = new Guestlist(); if ($request->GetVar('frm_month', 'post') !== $request->undefined) { $month = $request->GetVar('frm_month', 'post'); } else { $todaydate = getdate(); $day = $todaydate['mday']; $month = $todaydate['mon']; if ($month < 10) { $month = "0" . $month; } } $smarty->assign('tpl_month', $month); $smarty->assign('tpl_guests', $guestlist->getBirthdayList($month)); $smarty->display('list_birthday.tpl');
<?php //Check User Session require 'functions.session.php'; DEFINE(LOGINPAGE, 'login.html'); if (!checkSession()) { echo '<script type="text/javascript">alert("Necessita fazer login primeiro")</script>'; redirectTo(LOGINPAGE, 0); die; } if (!isset($_GET["id"])) { redirectTo('admin.php', 0); } require 'class.guestlist.php'; $gl = new Guestlist(); $id = $_GET['id']; $guest = $gl->listGuests("id={$id}"); $guest = $guest[0]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ecrã de Administração Guest List</title> <link href="style.css" media="screen" type="text/css" rel="stylesheet" /> </head> <body> <div id="wrapper"> <a href="admin.php" id="adminlogo">Back to Salsa Latina</a> <a href="session.php?logout=1" id="logout" class="button">Sair</a> <a href="pdf.php" id="export" class="button">Exportar para PDF</a>
* the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * A copy is found in the textfile GPL.txt and important notices to the license * from the author is found in LICENSE.txt distributed with these scripts. * * * This script 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. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * Show birthdays * * calendar * * 02/07/2004 by Christian Ehret chris@ehret.name */ $smartyType = "www"; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once 'guestlistclass.inc.php'; $guestlist = new Guestlist(); $smarty->assign('tpl_guests', $guestlist->getBirthdayReminders()); $sess->SetVar('showbirthdays', 'noshow'); $smarty->display('birthdays.tpl');
* * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * list checked-in guests * * guest * * @since 2004-06-05 * @author Christian Ehret <*****@*****.**> */ $smartyType = "www"; include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once 'guestlistclass.inc.php'; $guestlist = new Guestlist(); include_once 'bookingcategoryclass.inc.php'; $bcat = new BookingCategory(); $thebcat = -1; if ($request->GetVar('frm_bookcat', 'post') !== $request->undefined) { $thebcat = $request->GetVar('frm_bookcat', 'post'); } $smarty->assign('tpl_thebookcat', $thebcat); $smarty->assign("tpl_title", "Anwesenheitsliste"); $smarty->assign('tpl_nav', 'lists'); $smarty->assign('tpl_subnav', 'checkout'); $smarty->assign('tpl_children0_field', $request->GetVar('children0', 'session')); $smarty->assign('tpl_children1_field', $request->GetVar('children1', 'session')); $smarty->assign('tpl_children2_field', $request->GetVar('children2', 'session')); $smarty->assign('tpl_children3_field', $request->GetVar('children3', 'session')); $smarty->assign('tpl_bookcat', $bcat->get());
<?php //Check User Session require 'functions.session.php'; DEFINE(LOGINPAGE, 'login.html'); if (!checkSession()) { echo '<script type="text/javascript">alert("Necessita fazer login primeiro")</script>'; redirectTo(LOGINPAGE, 0); die; } // Load Guests from database require 'class.guestlist.php'; $gl = new Guestlist(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ecrã de Administração Guest List</title> <link href="style.css" media="screen" type="text/css" rel="stylesheet" /> </head> <body> <div id="wrapper"> <a href="admin.php" id="adminlogo">Back to Salsa Latina</a> <a href="session.php?logout=1" id="logout" class="button">Sair</a> <a href="pdf.php" id="export" class="button">Exportar para PDF</a> <a href="addnew.php" id="addguest" class="button">Adicionar novo Convidado</a> <br /><br /><div id="countGuests">Total de Convidados: <?php echo $gl->countGuests(); ?> </div>