Question

Design a site to book a conference room. Consider the factors required to choose an appropriate...

Design a site to book a conference room.

Consider the factors required to choose an appropriate room. Support both fixed and flexible requirements. What information do you need to provide so that users are confident that they have chosen the right room?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

HTML5/JavaScript

<div id="dp"></div> <script> var dp = new DayPilot.Scheduler("dp"); dp.init(); </script>

Adjusting Scheduler Scale and Time Headers

<div id="dp"></div> <script type="text/javascript"> var dp = new DayPilot.Scheduler("dp"); dp.startDate = DayPilot.Date.today().firstDayOfMonth(); dp.days = DayPilot.Date.today().daysInMonth(); dp.scale = "Day"; dp.timeHeaders = [ { groupBy: "Month", format: "MMMM yyyy" }, { groupBy: "Day", format: "d" } ]; dp.init(); </script>

Loading Conference Rooms

We want to display the service rooms as Scheduler resources on the vertical (Y) axis. The room data is stored in the MySQL database and we will need to load them from the server using a REST API. We can use jQuery $.post() to load the room data using an HTTP call.

DEMO September 2019 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 18 19 Room 1 Room 2 Room 3 Room 4 Room 5JavaScript

function loadResources() { $.post("backend_rooms.php", function(data) { dp.resources = data; dp.update(); }); }

The Scheduler also provides a shortcut rows.load() method that lets us simplify the room loading function:

function loadResources() {   dp.rows.load("backend_rooms.php"); }

The server-side backend_rooms.php script is a simple JSON endpoint that returns the Service room data in the following format:

[ {"id":"1","name":"Room 1","capacity":"2","status":"Dirty"}, {"id":"2","name":"Room 2","capacity":"2","status":"Cleanup"}, {"id":"3","name":"Room 3","capacity":"2","status":"Ready"}, {"id":"4","name":"Room 4","capacity":"4","status":"Ready"}, {"id":"5","name":"Room 5","capacity":"1","status":"Ready"} ]

The PHP script loads the rooms from MySQL database and returns a JSON array. In addition to the required properties (id and name), the response also includes additional room data (status and capacity) which we will use later to customize the front desk view.

backend_rooms.php

<?php require_once '_db.php'; $stmt = $db->prepare("SELECT * FROM rooms ORDER BY name"); $stmt->execute(); $rooms = $stmt->fetchAll(); class Room {} $result = array(); foreach($rooms as $room) { $r = new Room(); $r->id = $room['id']; $r->name = $room['name']; $r->capacity = $room['capacity']; $r->status = $room['status']; $result[] = $r; } header('Content-Type: application/json'); echo json_encode($result); ?>

Our application stores additional room information in the database (capacity, status) and we would like to display them in the reservation overview in additional row header columns. The columns can be defined using rowHeaderColumns property.

JavaScript

dp.rowHeaderColumns = [ {title: "Room", width: 80}, {title: "Capacity", width: 80}, {title: "Status", width: 80} ];

There is a special rendering event (onBeforeResHeaderRender) that will let us customize the row headers. We will create a new event handler to map the room data to columns.

JavaScript

dp.onBeforeResHeaderRender = function(args) { var beds = function(count) { return count + " bed" + (count > 1 ? "s" : ""); }; args.resource.columns[0].html = beds(args.resource.capacity); args.resource.columns[1].html = args.resource.status; switch (args.resource.status) { case "Dirty": args.resource.cssClass = "status_dirty"; break; case "Cleanup": args.resource.cssClass = "status_cleanup"; break; } };

We have added custom CSS classes to the room headers depending on the room status ("status_dirty", "status_cleanup").

Our Scheduler component uses the built-in CSS theme ("scheduler_default"). We can extend the theme by overriding specified classes. This will let us modify the row appearance depending on the room status.

<style type="text/css"> .scheduler_default_rowheader_inner { border-right: 1px solid #ccc; } .scheduler_default_rowheader.scheduler_default_rowheadercol2 { background: #fff; } .scheduler_default_rowheadercol2 .scheduler_default_rowheader_inner { top: 2px; bottom: 2px; left: 2px; background-color: transparent; border-left: 5px solid #1a9d13; /* green */ border-right: 0px none; } .status_dirty.scheduler_default_rowheadercol2 .scheduler_default_rowheader_inner { border-left: 5px solid #ea3624; /* red */ } .status_cleanup.scheduler_default_rowheadercol2 .scheduler_default_rowheader_inner { border-left: 5px solid #f9ba25; /* orange */ } </style>

Now we want to load the reservations (events) from MySQL database. Again, we will use a call to the REST API and update the view as soon as the response arrives.

JavaScript

function loadEvents() { var start = dp.visibleStart(); var end = dp.visibleEnd(); $.post("backend_events.php", { start: start.toString(), end: end.toString() }, function(data) { dp.events.list = data; dp.update(); } ); }
Add a comment
Know the answer?
Add Answer to:
Design a site to book a conference room. Consider the factors required to choose an appropriate...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Your project will require you to develop a database design to solve a real-life data management...

    Your project will require you to develop a database design to solve a real-life data management problem. It can be any problem in your work environment or for another organization, for example, a bookstore (think of how Amazon uses databases), a course management system (think of how a university manages courses), a bank (think of how your bank works), and an online auction site (think of how Ebay works). You will develop a database to solve this problem You will...

  • You are the lead human–computer interaction (HCI) engineer on a major design project for an organization...

    You are the lead human–computer interaction (HCI) engineer on a major design project for an organization of your choice. Employees or customers will use this new system and user interface (UI) design to perform data entry for the organization. The UI will need to provide the required input and output to characterize the type of data collected by the organization. Choose an organization, such as a business, nonprofit group, government, or another organization. Provide a description of your chosen organization,...

  • You are the lead human–computer interaction (HCI) engineer on a major design project for an organization...

    You are the lead human–computer interaction (HCI) engineer on a major design project for an organization of your choice. Employees or customers will use this new system and user interface (UI) design to perform data entry for the organization. The UI will need to provide the required input and output to characterize the type of data collected by the organization. Choose an organization, such as a business, nonprofit group, government, or another organization. Provide a description of your chosen organization,...

  • You are to select 1 business that does not already have a Web site, and develop...

    You are to select 1 business that does not already have a Web site, and develop an Internet strategy for it. Most large corporations already have Web sites, so you may have to think of something on a smaller scale such as a local bike store. Sole proprietorship businesses that provide services like car repair, house cleaning, tax preparation, and that use the Internet and similar services are also good options. You will also consider and describe how the business...

  • Design an original, professional web site following the specifications listed below. This web sit...

    Design an original, professional web site following the specifications listed below. This web site will be for a business you plan to set up for yourself or for someone else. The following is a detailed list of the requirements for your web site. READ them carefully. Instructions - Web Site Requirements for the web site: General: You will thoroughly test all your pages in more than one browser. All links MUST work. All graphics must show on the page. All...

  • Competency Design nursing care strategies which incorporate genetic and genomic risk factors. Scenario You are feeling...

    Competency Design nursing care strategies which incorporate genetic and genomic risk factors. Scenario You are feeling passionate about developing information to share with your clients and families that have positive genetic testing results. A young couple approaches you concerned that they may have a child with Down syndrome as both the male and female in the relationship have siblings with Down syndrome. You decide to create an educational document that supports the family in their search for more information. Describe...

  • 2. Instead of using the "cook book" procedure, repeat #1 using 'rltoor in Matlab. The input...

    2. Instead of using the "cook book" procedure, repeat #1 using 'rltoor in Matlab. The input to 'tltool is the open-loop transfer function. Add the following specifications before adding your compensator: · ζ20.8 26 To add specifications, right click on the root locus and select "Design Requirements", then "New". You may also need to adjust the axes on the figure before adding your compensator. Right click on the figure somewhere in the non-shaded area, then select "Properties", then the "Limits"...

  • FIRST, you need to choose a firm: For this assignment, choose any firm except (a) those...

    FIRST, you need to choose a firm: For this assignment, choose any firm except (a) those firms presently being used by the groups in this course (GM, Alphabet (Google), Amazon, Tesla, Apple, Walmart) or (b) any firm that you are using or mentioning in your individual writeup assignment (which is totally different from this assignment). Note that you MAY choose a firm you have recently worked for or are working for as well, as long you have/can get sufficient information...

  • Company LL bean. You are to present a discussion of Demographic market segments and all 4 marketing mix appropriate to the segment. How you choose to present your recommendations is one of the choices...

    Company LL bean. You are to present a discussion of Demographic market segments and all 4 marketing mix appropriate to the segment. How you choose to present your recommendations is one of the choices your group should make, and it will depend a great deal on your product choice and all the other variables. However, your report should include: • Why you are focusing on demographic? You will have already described your selection criteria, but why have you chosen this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT