Online Auditorium Booking System First
Online Auditorium Booking System First
GENERAL INTRODUCTION
1.1 INTRODUCTION
clients to book a facility in an auditorium. The system provides a platform to check for days that
each facility in the auditorium is available, make reservations, make payments and finally book
for the selected date and time. Users can use this program directly on their web browsers and no
need to install it. An Auditorium is a large building that is designed to hold a convention, where
individuals and groups gather to promote and share common interests. Convention centers
typically offer sufficient floor area to accommodate several thousand attendees. Very large
venues, suitable for major trade shows, are sometimes known as exhibition halls. Auditoriums
rooms, and conference rooms. Currently, there is a lengthy process involved in securing a place
in an Auditorium, which takes a lot of time and creates so many inconveniences to clients. To
solve the above problem, we decided to develop a system that will give people who are
interested in booking a particular, a platform where they can just be in their comfort zones and
check for days vacant for booking, make reservations, make payment and successfully book a
space in the event center. The order has four (4) steps, after accessing the web page, a new client
has to sign up whereas an old client can just log in with their previous credentials. After logging
in, the next step is to check the availability of facilities, next is to select date and time available
for a required event. Clients therefore can make a reservation from there and must proceed to
fulfil their necessary financial obligations to successfully book the required space or else their
1
reservations automatically expirers after 12 hours. After payment is successfully done, an email
1.2 Background
Information Technology has become the driver or the lifeblood of today’s economy, as such for
any society or community to stay relevant and competitive in this information age, they have to
People or organizations who are interested in securing a space in an Event center go through a
lengthy and tiring process. For this reason, the authors of this proposal are suggesting an online
Online booking system for an event center is a web-based application that allows people or
organizations who are interested in securing a place in the Event center to acquire every detail
they need about the auditorium, check on dates that the facility is available for use and
successfully secure the facility required for an event. The system is intended to aid clients to
It is for the reason that the authors of this research believe that the development of a specialize
Online booking system for an Event center will save time, money and stress involved in moving
Booking an event center can be a time consuming and stressful task for clients especially during
peak hours. Clients have to rush to the auditorium facility manager to make enquiries about
availability of space on specified dates for their events and may still have to go through the stress
2
of writing a letter, wait for the approval of the manager before any further process such as
knowing the cost of the capacity of the facility needed by the clients and the availability of the
specified date could be communicated to the client. This current system of securing a space for
an event in an Event center actually generates so much inconvenience to clients due to the hectic
Besides the time consumed to manually book the facility, it can also be hectic and tiring for
clients to move around securing a space for a said program. This can also be avoided with the aid
This project entails developing a well-organised automated system to aid clients secure a space
in an Auditorium with ease. The project will be completed before the end of March 2020.
Modules of the website will include checking availability of dates and time, booking facilities,
making reservations, making e-payments and keeping records for accountability. It will also
include the platform of payment, be it through mobile money, VISA, Skrill, and so many other
payment options depending on the cost of the facility interested. The system will also contain
tabs such as about page which gives a brief statement about the Auditorium and its operations,
contact page which gives clients details of the management of the facility in order to reach them
in case they need assistance so those extra tabs gives clients a fair knowledge about the
3
1.5 Limitations of the study
Records are difficult to keep and retrieve which makes accountability difficult.
1.6 OBJECTIVE
The objectives are divided into general objectives and specific objectives.
The main aim will be to create Booking Management System for an Auditorium.
To build an automated system that will keep records of the facility bookings for future
To design an electronic booking solution that will save time, money and create relief for
1.7 Methodology
to introduce a process model that will be used. A process model guides the order of project
4
activities and represents the life cycle of a project. The model that will be used is the waterfall
model.
The waterfall model is a linear, sequential approach to the software development life cycle
emphasizes a logical progression of steps. Similar to the direction water flows over the edge of a
cliff, distinct endpoints or goals are set for each phase of development and cannot be revisited
after completion. The term was first introduced in a paper published in 1970 by Dr. Winston W.
1. Requirements: Potential requirements, deadlines and guidelines for the project are
analyzed and placed into a functional specification. This stage handles the defining and
and business logic that will guide production. This is also when financial and technical
services.
requirements designated in the prior stages. Typically, the system is designed in smaller
5
5. Testing: This is when quality assurance, unit, system and beta tests take place to report
issues that may need to be resolved. This may cause a forced repeat of the coding stage
for debugging. If the system passes the tests, the waterfall continues forward.
to improve, update and enhance the final product. This could include releasing patch
The project as supervised by Mr Henry Matey is based on two parts, building of a website
system and a report or documentation for the system. The first part is building of the online
booking management system which serves as the platform for users to book facilities from their
mobile phones or computers. In building the site, the GUI was an important phase. Every
customer should find it easy to use therefore so much time was spent on the GUI of the system.
The report of the system on the other hand consists of five chapters, with each chapter based on a
particular curriculum. Chapter 1 consists of the introduction to the organisation of the study.
Chapter 2 is the literature review of the study. Chapter 3, the system analysis and design of the
proposed system. Chapter 4 based on the implementation and evaluation of the project. Chapter
6
CHAPTER TWO (2)
LITERATURE REVIEW
2.1 INTRODUCTION
In our own words, An Auditorium booking system is a web-based application, which allows
clients to book or secure a space in an auditorium from their comfort zones for various events.
In other to get a clear understanding on this project, we made use of different research material
such as books, interviews, online sites, magazines, tutorial videos and many others. This helped
Taking UPSA auditorium as an example, it was officially inaugurated on May 8, 2019. The
auditorium is a 3,550 capacity. The main aim of putting up such a commendable auditorium is to
provide space to accommodate students for various activities. The auditorium is also opened for
the entire public to book for decent events. The auditorium entails variety of spaces such as the
main auditorium, conference rooms, and lobby rooms to host various events at a reasonable cost.
This would help to generate revenue for the university. [ CITATION htt19 \l 1033 ]
Seminar Hall Booking Management System allows users to view availability dates of a particular
seminar hall and also the facilities in the hall like capacity, microphones, projector, etc. This
provides user-friendly environment while booking the seminar hall and it gives suggestion
7
regarding the selection of seminar hall based on the capacity and availability. The concern
department head can view the list of the request. The acceptance and rejection can be viewed by
Sunshine Online Booking Management System allows sunshine hospital employee users
and external users to book auditorium as per their expected event schedules. Any user
internal or external has to raise a request for auditorium booking and it will be approved
by admin. A logged in user can check availability date wise and hourly wise too. A user
will have the option to provide the hourly availability information too while raising the
request. Once approved, an email notification would be sent over confirming the
booking.
User stories Sunshine Auditorium Management System Seminar Hall Management System
Login Form √ √
Registration √ √
form
Booking form √
Booking √
suggestion
8
form
Check √ √
availability
The figure above depicts all the two systems and they give room for clients and users to register,
login, book, and check availability. Seminar hall is improved to suggest booking.
None of the systems has the possibility for users to leave a message and also provide images of a
None of the systems also has the function of sending emails to clients to confirm their booking.
None of the systems has the possibility for clients to secure a facility more than a day.
The proposed system is developing an auditorium booking management system for UPSA
auditorium that allows everyone to make bookings of a facility irrespective of their destination
with the aid of an internet. Clients have to just be in their comfort zones, access the site, register
or login, check availability, and if possible, book, and make payment to validate booking. Email
verifications will be sent to clients to confirm a successful booking. Clients can make payments
with mobile money, visa or skrill depending on the amount of the interested facility.
The problems with the existing systems are the inability of clients to leave a message for
management and seeing a particular facility they want to book and use. This system is developed
9
2.5 CONCLUSION
Unlike the above sites, the proposed system will have a database that will make it possible for
checking of records of a particular facility booked at a specific time. This will ensure clarity and
ease of accountability. Clients will also be made to leave messages for management. Email
CHAPTER 3
10
3.1 INTRODUCTION
This chapter describes the methodology that was used to develop the web-based
associated with a particular set of paradigmatic assumptions that we will use to conduct
our research. [CITATION Ala05 \l 1033 ] Insists that when conducting a research
Firstly, the methodology should be the most appropriate to achieve objectives of the research.
Secondly, it should be made possible to replicate the methodology used in other researches of the
same nature.
This research study was conducted based on the waterfall model. Methodology plays an
important role in implementing this research study accordingly. The details of the
Software life cycle is a general model of software development process, including all the
software life cycle model is composed of a number of clearly defined and distinct work
phases, which can be used to plan test, design, build, and test and deliver the web-based
application. Software life cycle aims to produce high systems that meet and exceed
through each clearly defined phases, within scheduled periods and cost estimates.
Software life cycle captures the order in which these activities are to be taken.
11
3.2 CRYSTALIZATION OF THE PROBLEM
The system allows client to conveniently navigate through the website to check dates
available for reservations and successfully booking the facility from their comfort zones.
Clients can also make enquiries, payments, cancellation of bookings and so many other
actions on the website. It actually saves time because clients can access and utilize the
website from anywhere and at any time. They do not need to come all the way to the
This part of the research proposal involves the use of system analysis and design as a tool. It is
dedicated to the requirement collection (done with the collaboration of the client), the design of
the system, done using UML use cases and class diagrams, and of the relational database, done
A new user can register, or login to the website if he/she has already registered. After the
user enters the login credentials, the user’s information is going to be stored in the
browser’s local storage. This information is going to facilitate authenticating the type of
user on other pages of the website. After a successful log in, the client is eligible to check
for dates and times available for booking, he or she can further make a reservation and
then proceed to make payment using the payment options available. A successful booking
is made after the administrator confirms receipt of the payment else reservation expires
after 12 hours.
12
3.3.2 FUNCTIONAL REQUIREMENT
Functional requirement defines the specific function that the system performs, in conjunction
with the data operated by the functions. The functional requirements are presented in scenarios
that depict an operational user from the perspective of its end users. Below are examples of all
the system features and an enumeration of the entire specific requirement associated with these
features. The system shall incorporate mechanism to authenticate its users and the system shall
verify and validate all user input and should notify in case of error detection and should help the
Non-functional requirements address aspects of the system other than the specific functions it
performs. These aspects include system performance, costs, and such general system
address aspects of the system development process and operational personnel. It includes the
following:
The system shall provide attractive graphical interface for the user.
13
notification, interfaces and securities. Some of the hardware and software,
Server side
Ram 4 GB
Client side
Ram 2 GB
Server side
of server OS
14
Back End :- MYSQL
Client side
Operating System
higher version.
START
VIEW WEBSITE
Reserve a date
Valid user Id &
password
Pay Cancel
15
Admin
Update info. Log out
Stop
16
Login request
Login
Client
Auditoriu
m
Booking
Administrator Manageme Confirm
nt system
17
ADMIN
BOOKING
SYSTEM USER
MANAGER
The first step for the functional requirement collection are the use cases. Use
They are used in order to: design system from user’s perspective,
visible behavior. Here are the use cases for the auditorium booking system
project (there are two actors for the system: a client and an administrator).
SIGN UP / SIGN IN
SELECT PREFERRED
FACILITY AND
SERVICE
CHECK TERMS
CLIENT AND
CONDITIONS
AND PAYMENT
METHODS
MAKE PAYMENT
CONFIRM
19
DEPOSIT MADE
BY CLIENTS
APPROVE OR
DECLINE
BOOKINGS
REVIEW
REPORTS OF
THE VARIOUS
TRANSACTIONS
WITHIN A
ADMINISTRATOR
20
3.5 TOOL USED
The auditorium booking management system followed the totally dynamic web based
rule. In this system, we used some web programming languages. The following software,
tools & frameworks were selected and used for accomplishing the project:
i. HTML
First developed by Tim Berners-Lee in 1990, HTML is short for Hypertext Markup Language.
HTML is used to create electronic documents (called pages) that are displayed on the World
Wide Web. Each page contains a series of connections to other pages called hyperlinks. Every
web page you see on the Internet is written using one version of HTML code or another. HTML
code ensures the proper formatting of text and images for your Internet browser. Without HTML,
a browser would not know how to display text as elements or load images or other elements.
HTML also provides a basic structure of the page, upon which Cascading Style Sheets are
overlaid to change its appearance. One could think of HTML as the bones (structure) of a web
21
ii. Bootstrap / Cascading Style Sheets
Bootstrap and Cascading Style Sheets are languages used for describing the presentation
of Web pages, including colors, layout and fonts. It allows one to adapt the presentation to
different types of devices, such as large screens, small, or printers. They are independent
PHP (recursive acronym for PHP Hypertext Pre-processor) is a widely used open source
general purpose scripting language that is especially suited for web development and can
be embedded into HTML. Since this project will be based online, it will be appropriate to
develop this project using PHP. It is a server side scripting language that is used to
develop dynamic web content and allows for the communication with the database.
databases, a large set of structured data, and run operations on the data requested by
numerous users. SQL Server 2008 the best version we intended to use to manage the
v. JavaScript
22
functions. For web pages, it is also known as the multi-paradigm scripting language.
However, many non-browser environments also contain java script. It runs on the client
side of the web pages. It is used to design how the web pages’ treat on the incident of an
event. It is easy to learn and broadly used to control web pages’ attitude
3.6 CONCLUSION
In this chapter, we have discussed about the platforms and technical object that is used in
our entire project. We used PHP Code Igniter to develop our web site. With the help of
Bootstrap, we design and align our website’s TEXT contents and connect the website to
MySQL database server for storing and retrieving data from the RDBMS. The overall
work is based on PHP Code Igniter and MySQL, which are very popular platform.
23
CHAPTER 4
4.1 INTRODUCTION
The process of checking whether the developed system is working according to the
original requirements and objectives of clients is known as system testing. There are
basically two sources of data for testing. These are Live and Artificial. Live data are
actually extracted from the organization’s files. Artificial data are generated for test
purposes only.
The purpose of system testing is to test the system systematically. It is the application
developer’s last opportunity to check that the system works before asking the users to
accept it.
Therefore, it is often split between test running and bug fixing. This helps ensure adequate
control over the way corrections are applied to the system and system test version control
documents are kept. System testing incorporates a number of other classes of testing.
The first level of test is unit testing. The purpose of unit testing is to ensure that each
programmer writes a test plan. A test Plan is a document that describes the
objectives, scope, approach, and focus of a software testing effort. This includes a
number of test runs such as the valid paths through the code, the exception and error
handling paths.
24
4.2.2 Functional testing
Functional testing is a type of software testing whereby the system is tested against
the functional requirement. Features are tested by feeding them input and
examining the output. Functional testing ensures that the requirements are satisfied
Usability testing is method used to evaluate how easy a website is to use. The tests
take place with real users to measure how usable a website is and how easy it is for
users to reach their goals. This testing takes place with actual user or customers of
the product.
acceptability. The purpose of this test is to evaluate the systems compliance with the
This involves testing individual page elements and checking that each one appears in
the right shape, position, and size. By using visual testing combined with your
existing developer tests, you'll be able to detect visual issues in the early stages of
As technologies change, many organizations find themselves needing to change over their
computer information systems. Upgrading these systems help them optimize their efficiency and
25
remain competitive. Common changeover areas include security systems, database systems,
accounting systems and managerial information systems. Deciding which changeover technique
will work best for a particular company depends on the type of changeover and degree of risk for
the company.
In a parallel changeover, the new system runs simultaneously with the old for a given period of
time. Of all the techniques, this tends to be the most popular, mainly because it carries the lowest
risk. If something goes wrong at any point, the entire system can be reverted back to its original
state. A primary disadvantage in running two systems at the same time is higher costs. The
Direct changeover, also referred to as immediate replacement, tends to be the least favorite of the
changeover techniques. In a direct changeover, the entire system is replaced instantly. Basically,
as soon as the new system is powered up, the old system is shut down. This type of changeover
carries the most risk because, if something goes wrong, reverting back to the old system usually
is impossible. Using the direct changeover technique tends to work best in situations where a
system failure isn't critical enough to result in a disaster for the company.
The phased changeover technique is considered a compromise between parallel and direct
changeovers. In a phased changeover, the new system is implemented one stage at a time. As an
example, consider a company working toward installing a new financial system. Implementing
26
the new system one department at a time, the company converts accounts receivable, accounts
payable, payroll, and so on. Advantages to phased changeovers are their low cost and isolated
errors. The main disadvantage is the process takes a long time to complete because phases need
to be implemented separately.
With a pilot changeover, the new system is tried out at a test site before launching it company-
wide. For example, a bank may first test the system at one of its branches. This branch is referred
to as the pilot, or beta, site for the program. Since parallel changeovers tend to be expensive,
using the pilot changeover technique allows companies to run the new system next to their old
but on a much smaller scale. This makes the pilot changeover method much more cost-effective.
After the kinks are worked out of the system at the test site, companies usually opt to use the
direct changeover technique to launch the system company-wide. [ CITATION Tanya \l 1033 ]
Due to the numerous complaints of the stressful process from clients and the facility managers,
the researchers intend to consider the direct change over in implementing the proposed system to
27
4.4 SYSTEM DOCUMENTATION
28
Description: this page presents the client or the user to sign in or create an account to
29
Figure 4.4.3: Facilities page
This page allows selecting and having a view of the facilities available in the
30
figure 4.4.4: Facilities selection page
31
Figure 4.4.5: Payment options page
32
Figure 4.4.6: Payment page
facility and service. It also present terms and conditions, policies, and
33
Figure 4.4.7: Leave a message page
This allows users and clients to leave suggestions or messages for the
34
Figure 4.4.9: Records Page
This page allows the administrator to view the details fed in by the clients.
35
Figure 4.4.1.1 Details of Facility page
This allows the administrator to enter details of a preferred facility.
36
This interface enables the administrator to add a new service for users who want to
This presents the administrator with the details being fed by the clients.
37
Figure 4.4.1.4: Report Generation Page
This presents the administrator an opportunity to view and generate the details
38
Figure 4.4.1.5: Policies Page
This enables to view the terms and conditions, policies, and declarations of the
auditorium.
39
Figure 4.5.6: Local server page
40
CHAPTER 5
5.1 INTRODUCTION
Recently, internet has become very common which people use every time. Internet is used
through desktop, laptop, tablets and smart phones that can be found in the hands of a great
number of people in the world. The documented auditorium booking management project
is actually an attempt to establish a system by which the users can book the UPSA
auditorium from their comfort zones. It was a very challenging project due to the
distractions of the novel corona virus pandemic, we could not collect as much data as we
needed but we endeavored to fully complete it at the required period. At the initial stage,
we did not know how the interface would be. Though it is challenging to build up a new
project, we have built it. We think it is the first auditorium booking management system
for UPSA. Clients can successfully secure spaces in the auditorium within few minutes
without having to move to the school hence valuable time will be saved.
5.2 SUMMARY
Auditorium Booking Management System is a platform that provides interested parties the
opportunity to secure a space or facility in an auditorium irrespective of the place you are,
provided you are connected or have access to the internet. This has saved the time and has ease
clients’ efforts to booking a space. Online Auditorium Booking Management System has made
booking of facilities easier, faster, and convenient and has driven business to a new phase,
compelling competitors to make adjustments in order to prevent them from lagging behind. The
41
outcome of this project underscores the need for auditorium managers to take online market
seriously. Our survey established that stakeholders of the auditorium are fed up with the hectic
process the manual process presents them and they would like a technology driven process that
5.3 RECOMMENDATIONS
User requirements keep changing as the system is being used. Some of the future
ii. Because it is based on object-oriented design, any further changes can be easily
adaptable.
iii. Based on the future security issues, security can be improved using emerging
technologies.
5.4 CONCLUSION
The “Auditorium booking management system” was successfully developed and is tested
for accuracy and quality. During this project, we have accomplished all the objectives and
42
References
Ahmed, S. (2016, 12 27). quora. Retrieved from https://www.quora.com/What-is-PHP-programing
43
APPENDICES
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use Session;
use DB;
use App\User;
use App\Facility;
use App\Service;
use App\FacilityImages;
use App\BookingFacility;
//
return view('admin.login');
44
return view('admin.home');
Auth::logout();
return redirect('/admin/login');
$result = '';
return $result;
return redirect()->intended('/admin/home');
return back();
$users = User::all();
return view('admin.account',compact('users'));
45
}
$del = User::where('id',$r->id)->delete();
if($del){
return ['status'=>'success'];
return ['status'=>'error'];
$add = User::create([
'username'=>$r->username,
'password'=>bcrypt($r->password)
]);
if($add){
return back();
return back();
return view('admin.addfacility');
46
public function saveFacility(Request $r){
//return $r->all();
$confadd = [];
$musicadd= [];
for($i=1;$i<=$r->conf_add_count;$i++){
array_push($confadd,['conf_add_amount'=>$r->{'conf_add_amount'.$i},'conf_add_hour'=>$r-
>{'conf_add_hour'.$i}]);
for($i=1;$i<=$r->music_add_count;$i++){
array_push($musicadd,['music_add_amount'=>$r->{'music_add_amount'.
$i},'music_add_hour'=>$r->{'music_add_hour'.$i}]);
$mainimage = null;
if($file = $r->file('main_image')){
$ext = $file->extension();
$newname = $this->generateRandomNumber(20).'.'.$ext;
$file->move('storage', $newname);
$mainimage = $newname;
$add = Facility::create([
'name'=>$r->name,
47
'description'=>$r->description,
'capacity'=>$r->capacity,
'conf_fixed_price'=>$r->conf_amount,
'conf_fixed_hours'=>$r->conf_hours,
'conf_additional_price'=>json_encode($confadd),
'music_fixed_price'=>$r->music_amount,
'music_fixed_hours'=>$r->music_hours,
'image'=>$mainimage,
'music_additional_price'=>json_encode($musicadd)
]);
if($add){
if($r->hasFile('supporting_images')){
$files = $r->file('supporting_images');
foreach($files as $file) {
$ext = $file->extension();
$newname = $this->generateRandomNumber(20).'.'.$ext;
$file->move('storage', $newname);
FacilityImages::create([
'facility_id'=>$add->id,
'image'=> $newname
]);
return back();
48
}
else{
return back();
$facilities = Facility::all();
return view('admin.facilitylist',compact('facilities'));
$del = Facility::where('id',$r->id)->delete();
if($del){
return ['status'=>'success'];
}else{
return ['status'=>'error'];
return view('admin.addservice');
49
//return $r->all();
$confadd= [];
for($i=1;$i<=$r->conf_add_count;$i++){
array_push($confadd,['add_amount'=>$r->{'conf_add_amount'.$i},'add_hour'=>$r-
>{'conf_add_hour'.$i}]);
$add = Service::create([
'name'=>$r->name,
'description'=>$r->description,
'type'=>$r->type,
'fixed_price'=>$r->conf_amount,
'fixed_hours'=>$r->conf_hours,
'additional_price'=>json_encode($confadd)
]);
if($add){
return back();
else{
return back();
50
$services = Service::all();
return view('admin.servicelist',compact('services'));
$del = Service::where('id',$r->id)->delete();
if($del){
return ['status'=>'success'];
}else{
return ['status'=>'error'];
return view('admin.client');
Facility::where('id',$id)->update(['status'=>$status]);
return redirect('/admin/facilitylist');
$settings = DB::table('settings')->where('id',1)->first();
return view('admin.settings',compact('settings'));
51
public function saveSettings(Request $r){
$save = DB::table('settings')->where('id',1)->update([
'terms'=>$r->terms,
'policy'=>$r->policy,
'declaration'=>$r->declaration
]);
return back();
$messages = DB::table('messages')->orderBy('id','DESC')->get();
return view('admin.messages',compact('messages'));
return view('admin.reports');
$dates = explode('-',$r->dateranges);
if($r->facilities=='all'){
$bookings = BookingFacility::where('startdate','>=',$startdate)->where('enddate','<=',$enddate)-
>get();
52
}else{
$bookings = BookingFacility::where('facility_id',$r->facilities)->where('startdate','>=',$startdate)-
>where('enddate','<=',$enddate)->get();
return view('admin.reports',compact('bookings'));
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Client;
use Session;
use Auth;
use Hash;
use App\Facility;
use App\Service;
use App\Slydepay\SlydeIntegrated;
use App\Booking;
use App\BookingFacility;
use Mail;
use DB;
53
//
return view('book');
//return $r->all();
$dates = explode('-',$r->thedate);
if(BookingFacility::where('facility_id',$r->facility)->where('startdate','>=',$startdate)-
>where('enddate','<=',$enddate)->exists()){
return back();
return back();
$result = '';
return $result;
54
public function login(){
return view('login');
return view('signup');
Auth::guard('client')->logout();
return redirect('/');
$checkemail = Client::where('email',$r->email)->exists();
if($checkemail){
return back();
$token = $this->generateRandomNumber(20);
$add = Client::create([
'surname'=>$r->surname,
'othernames'=>$r->othernames,
55
'phone'=>$r->phone,
'email'=>$r->email,
'password'=>bcrypt($r->password),
'emailtoken'=>$token
]);
if($add){
try{
$link = url('/activate').'/'.$token.'/'.$add->id;
});
}catch(\Exception $e){}
return redirect('/login');
return back();
$find = Client::where('emailtoken',$token)->where('id',$id)->exists();
if($find){
Client::where('id',$id)->update([
'activated'=>1,
56
'emailtoken'=>''
]);
return redirect('/login');
}else{
return view('errors.404');
if(env('VALIDATEBEFORELOGIN','false')=='true'){
$check = Client::where('email',$r->email)->where('activated',0)->exists();
if($check){
Session::flash('error','Sorry.. Your Account has not been activated.. Please check your email and
activated it or Contact System Admin');
return back();
return redirect()->intended('/book');
return back();
57
Session::put('eventdetails',$r->all());
$getdate = explode('-',$r->eventdate);
$getdate[0] = $this->formatDate(trim($getdate[0]));
$getdate[1] = $this->formatDate(trim($getdate[1]));
if(Booking::where('startdate','>=',$getdate[0])->where('enddate','<=',$getdate[1])->exists()){
Session::flash('error','Sorry the date you selected is not available.. Choose another event date');
return back();
return redirect('/book1');
if(!Session::has('eventdetails')){
return redirect('/book');
//dd(Session::get('eventdetails'));
$facilities = Facility::where('status',1)->get();
return view('book1',compact('facilities'));
if(Session::has('cart')){
$cart = Session::get('cart');
}else{
$cart = [];
58
array_push($cart,$r->except(['_token']));
Session::put('cart',$cart);
return back();
if(!Session::has('eventdetails')){
return redirect('/book');
if(!Session::has('cart')){
return redirect('/book1');
$cart = Session::get('cart');
//dd($cart);
if(count($cart)==0){
return redirect('/book1');
$services = Service::all();
return view('book2',compact('cart','services'));
return view('account');
59
}
$client = Client::where('id',Auth::guard('client')->user()->id)->first();
if(Hash::check($r->oldpassword,$client->password)){
$client->password = bcrypt($r->password);
$client->save();
return back();
return back();
$cust_ref = $this->generateRandomNumber(10);
$pay = SlydeIntegrated::createInvoice($cust_ref,$r->description,$r->amount);
//dd($pay);
if($pay['status']=='success'){
Session::put('paydetails',['cust_ref'=>$cust_ref,'amount'=>$r->amount]);
return redirect("https://app.slydepay.com/paylive/detailsnew.aspx?pay_token=".$pay['response']-
>result->payToken);
return back();
60
public function formatDate($date){
$datepart = explode('/',$getpart[0]);
$newdate = $datepart[2].'-'.$datepart[1].'-'.$datepart[0];
if(isset($r->status)){
if($r->status==0){
$ev = Session::get('eventdetails');
$cart = Session::get('cart');
$paydetails = Session::get('paydetails');
$dates = explode('-',$ev['eventdate']);
$savetodb = Booking::create([
'nameofperson'=>$ev['nameofperson'],
'website'=>$ev['website'],
'rep_person'=>$ev['rep_person'],
'rep_phone'=>$ev['rep_phone'],
'rep_email'=>$ev['rep_email'],
'description'=>$ev['description'],
'expnopeople'=>$ev['expnopeople'],
'expnocars'=>$ev['expnocars'],
61
'startdate'=>$startdate,
'enddate'=>$enddate,
'extrainfo'=>$ev['extrainfo'],
'highprofile'=>$ev['highprofile'],
'package'=>json_encode($cart),
'haspaid'=>1,
'amountpaid'=>$paydetails['amount'],
'payment_method'=>'',
'reference'=>$r->cust_ref,
'date_paid'=>date('Y-m-d H:i:s'),
'client_id'=>Auth::guard('client')->user()->id,
]);
// $evdate = explode('-',$ev['eventdate']);
$facilitybooked = [];
foreach($cart as $c){
$getdate = explode('-',$c['date']);
$getdate[0] = $this->formatDate(trim($getdate[0]));
$getdate[1] = $this->formatDate(trim($getdate[1]));
BookingFacility::create([
'booking_id'=>$savetodb->id,
'facility_id'=>$c['id'],
'type'=>$c['type'],
'thedate'=>$startdate,
'startdate'=>$getdate[0],
'enddate'=>$getdate[1]
62
]);
array_push($facilitybooked,Facility::where('id',$c['id'])->first(['name'])->name);
try{
$data = [
'surname'=>Auth::guard('client')->user()->surname,
'nameofperson'=>$ev['nameofperson'],
'website'=>$ev['website'],
'description'=>$ev['description'],
'amountpaid'=>$paydetails['amount'],
'facilities'=>$facilitybooked
];
Mail::send('emails.afterpurchase',$data,function ($m){
$m->to(Auth::guard('client')->user()->email)->subject('Order Summary');
});
}catch(\Exception $e){}
return redirect('/book2');
63
Session::flash('error','Payment was not successful.. Try again');
return redirect('/book2');
return redirect('/book2');
$payment = Booking::where('client_id',Auth::guard('client')->user()->id)->get();
return view('payment',compact('payment'));
$cart = Session::get('cart');
if(count($cart)==0){
return back();
unset($cart[$index]);
$cart = array_values($cart);
//$ct = array_splice($cart,$index,1);
Session::put('cart',$cart);
return back();
64
}
$facilities = Facility::get();
return view('gallery',compact('facilities'));
return view('messages');
$save = DB::table('messages')->insert([
'client_id'=>Auth::guard('client')->user()->id,
'message'=>$r->message
]);
return back();
65