» » jQuery election seat reservations online (theater piece)

 

jQuery election seat reservations online (theater piece)

Author: bamboo06 on 17-11-2014, 00:58, views: 98860

76
When our online ticketing (such as movie tickets, tickets, etc.) can choose their own seat. Developers listed seating seats on the page, the user can see at a glance the seat and payment can be selected. In this paper, cinema tickets, for example, to show you how to choose seats, seat selection data processing.

Here, I'll give you about a jQuery plugin based online seat selection: jQuery Seat Charts, it supports custom seat types and prices, support for custom styles, support settings are not optional seat, also supports keyboard control seat.
HTML
We assume that entered the film "Gingerclown" The seat selection page, the page layout see the big picture above, left of the page will appear in the # seat-map in theater seating layout, the right side of # booking-details display movie-related information as well as selected seating information # selected-seats and fares amounts of information, choose your seat confirmed after payment page to complete the payment.
   <div class="demo">
   		<div id="seat-map">
			<div class="front">SCREEN</div>					
		</div>
		<div class="booking-details">
			<p>Movie: <span> Gingerclown</span></p>
			<p>Time: <span>November 3, 21:00</span></p>
			<p>Seat: </p>
			<ul id="selected-seats"></ul>
			<p>Tickets: <span id="counter">0</span></p>
			<p>Total: <b>$<span id="total">0</span></b></p>
					
			<button class="checkout-button">BUY</button>
					
			<div id="legend"></div>
		</div>
		<div style="clear:both"></div>
   </div>

CSS
Use CSS to beautify the various elements of the page, especially seating list layout for the seat status (sold, optional seats, has been elected seats, etc.) set up different styles, we have collated CSS code, of course, you can own project page style themselves modify any CSS code.
.front{width: 300px;margin: 5px 32px 45px 32px;background-color: #f0f0f0; color: #666;text-align: center;padding: 3px;border-radius: 5px;} 
.booking-details {float: right;position: relative;width:200px;height: 450px; } 
.booking-details h3 {margin: 5px 5px 0 0;font-size: 16px;} 
.booking-details p{line-height:26px; font-size:16px; color:#999} 
.booking-details p span{color:#666} 
div.seatCharts-cell {color: #182C4E;height: 25px;width: 25px;line-height: 25px;margin: 3px;float: left;text-align: center;outline: none;font-size: 13px;} 
div.seatCharts-seat {color: #fff;cursor: pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius: 5px;} 
div.seatCharts-row {height: 35px;} 
div.seatCharts-seat.available {background-color: #B9DEA0;} 
div.seatCharts-seat.focused {background-color: #76B474;border: none;} 
div.seatCharts-seat.selected {background-color: #E6CAC4;} 
div.seatCharts-seat.unavailable {background-color: #472B34;cursor: not-allowed;} 
div.seatCharts-container {border-right: 1px dotted #adadad;width: 400px;padding: 20px;float: left;} 
div.seatCharts-legend {padding-left: 0px;position: absolute;bottom: 16px;} 
ul.seatCharts-legendList {padding-left: 0px;} 
.seatCharts-legendItem{float:left; width:90px;margin-top: 10px;line-height: 2;} 
span.seatCharts-legendDescription {margin-left: 5px;line-height: 30px;} 
.checkout-button {display: block;width:80px; height:24px; line-height:20px;margin: 10px auto;border:1px solid #999;font-size: 14px; cursor:pointer} 
#selected-seats {max-height: 150px;overflow-y: auto;overflow-x: none;width: 200px;} 
#selected-seats li{float:left; width:72px; height:26px; line-height:26px; border:1px solid #d3d3d3; background:#f7f7f7; margin:6px; font-size:14px; font-weight:bold; text-align:center} 

jQuery
This example is based on jQuery, so do not forget to load jquery library and the first elected seat plugins: jQuery Seat Charts.
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript" src="jquery.seat-charts.min.js"></script> 

Next, we define such a good fare, seating area, the number of votes, a total amount of such elements, then call the plugin:. $ ('# Seat-map') seatCharts ().
We first set up seating chart, an auditorium seating is fixed good. In this example, the third row is the aisle, as well as 34 rows to the right vacancy exports, the last row we set up a couple of blocks, then the theater's layout is this:
aaaaaaaaaa
aaaaaaaaaa
__________
aaaaaaaa__
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aa__aa__aa
We use the letter A represents a seat, represented by the symbol _ empty, ie no seats, of course, you can also use a, b, c, etc. represent different levels of seating.
Then define the legend style, the key is detective click event click (): When the user clicks on the seat, if the seat status is optional (available), then click on the rear seat, the seat information (several rows) was added to the right of the selected Block list and calculate the total number of votes and the total amount; if the seat status is checked (selected), then click on the seat again, it will be selected seating information is deleted from the list on the right seat, and the state is set to election; if the seat status is already sold (unavailable), you can not click on the seat. Seat number last used state get () method to set Sold Sold. The following is a detailed code:
var price = 10; //price
$(document).ready(function() {
	var $cart = $('#selected-seats'), //Sitting Area
	$counter = $('#counter'), //Votes
	$total = $('#total'); //Total money
	
	var sc = $('#seat-map').seatCharts({
		map: [  //Seating chart
			'aaaaaaaaaa',
            'aaaaaaaaaa',
            '__________',
            'aaaaaaaa__',
            'aaaaaaaaaa',
			'aaaaaaaaaa',
			'aaaaaaaaaa',
			'aaaaaaaaaa',
			'aaaaaaaaaa',
            'aa__aa__aa'
		],
		naming : {
			top : false,
			getLabel : function (character, row, column) {
				return column;
			}
		},
		legend : { //Definition legend
			node : $('#legend'),
			items : [
				[ 'a', 'available',   'Option' ],
				[ 'a', 'unavailable', 'Sold']
			]					
		},
		click: function () { //Click event
			if (this.status() == 'available') { //optional seat
				$('<li>R'+(this.settings.row+1)+' S'+this.settings.label+'</li>')
					.attr('id', 'cart-item-'+this.settings.id)
					.data('seatId', this.settings.id)
					.appendTo($cart);

				$counter.text(sc.find('selected').length+1);
				$total.text(recalculateTotal(sc)+price);
							
				return 'selected';
			} else if (this.status() == 'selected') { //Checked
					//Update Number
					$counter.text(sc.find('selected').length-1);
					//update totalnum
					$total.text(recalculateTotal(sc)-price);
						
					//Delete reservation
					$('#cart-item-'+this.settings.id).remove();
					//optional
					return 'available';
			} else if (this.status() == 'unavailable') { //sold
				return 'unavailable';
			} else {
				return this.style();
			}
		}
	});
	//sold seat
	sc.get(['1_2', '4_4','4_5','6_6','6_7','8_5','8_6','8_7','8_8', '10_1', '10_2']).status('unavailable');
		
});
//sum total money
function recalculateTotal(sc) {
	var total = 0;
	sc.find('selected').each(function () {
		total += price;
	});
			
	return total;
}

Explanation
jQuery Seat Charts plugin provides multiple options to set and method calls, specifically with reference to the project's official website: https: //github.com/mateuszmarkowski/jQuery-Seat-Charts.
Next, GOOCODE will provide you with jQuery Seat Charts richer application example, we can use the plug-in applications to the aircraft cabin seat selection, train / car seat selection, conference tournament election seat auditorium, a restaurant restaurant seat selection, etc. Please pay attention to our site.

Category: Javascript / Plugins

Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.
<
  • 0 Comments
  • 0 Articles
28 May 2017 21:06

Michaelmat

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
We create, produce and film business portraits, capturing an event’s unique atmosphere. We provide exhilarant, intelligible information and training videos. We concept attractive product videos as well as entertaining advertising and promotion videos.videoproduktion preise

<
  • 0 Comments
  • 0 Articles
28 May 2017 22:57

shaun tait

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
A debt of gratitude is in order for the post it helped me a great deal in my venture, Do my Research Paper for Me however how do check which seats are sold out on the off chance that I am utilizing mysql database to store the seat reservations

<
  • 0 Comments
  • 0 Articles
29 May 2017 20:44

Darrell78Kax

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
В жизни каждого расточка постелей коленвала автолюбителя наступает такой момент, буде приходится постоянно давать самому. Засучивать рукава, брать первопричина в руки и сам обслуживать, диагностировать несовершенство, штопать иначе тюнинговать принадлежащий автомобиль. Причин, договор которым благоверный пытается весь исполнять своими руками, - множество. Это, замышлять: повреждение человека осматривать и понять устройство своего автомобиля и выучить чему-то новому. А для кого-то "поковыряться" в машине - это статуя нежных расточка постелей коленвала и глубоких чувств к своему верному, железному другу. Для других улучшение своими руками - это незатейный очертание сэкономить деньги. Однако, какими пытать мотивами не руководствовался единица, ради успешного решения поставленных задач ему довольно необходима информация. То трапезничать: цель коль бедность отремонтировать личное транспортное тропа своими силами - употреблять, а необходимых знаний для этого, - нет. И, естественно, возникают вопросы подле такого характера: Alias всё правильно сделать? Какая последовательность выполнения работы? Лже не допустить досадных ошибок? Кто орудие порядком необходим? И единовластно выбрать качественные запчасти?

<
  • 0 Comments
  • 0 Articles
30 May 2017 20:11

Davidtwext

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Ежели воздушные шарики магазин Вы хотите, воеже Ваше событие было неповторимым —
мы воплотим это в реальность и найдём самое идеальное решение.
Лень декора partybunny.ru — это каста профессиональных
декораторов - оформителей, флориста и кондитера, аниматоров, имеющих анализ и желание выполнять каждое мера особенным.

С июля 2016г Электросушилка бытовая ЭСБ-11/18-300 «Волтера» электросушилка бытовая ЭСБ"Волтера-1000" выпускается с капилярным термостатом, позволяющим взамен двух устанавливаемых температурных режимов 40'C и 60'C в рабочей зоне, с более высокой точностью регулировать температуру после 30'C заблаговременно 75'C. Исключая того, в рабочей зоне нагревательного элемента, типичный установлен термостат, повышающий пожаробезопасность данного изделия

<
  • 0 Comments
  • 0 Articles
31 May 2017 11:31

BrianEduro

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Много информации о строительстве на даче sovet-sadovody.ru

<
  • 0 Comments
  • 0 Articles
7 June 2017 18:42

BruceSum

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Свиная вырезка — отличное Лист сетчатый для ВОЛТЕРА-1000 мясо дабы различных экспериментов. Блюда www.naschi.ru из вырезки отличаются нежностью и быстрым приготовлением. Приложив все горсточка усилий, позволительно приготовить Лист сетчатый для ВОЛТЕРА-1000 отличное нарядное блюдо.

<
  • 0 Comments
  • 0 Articles
11 June 2017 07:33

Davidunsab

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Последние новости здесь www.planetoday.ru

<
  • 0 Comments
  • 0 Articles
17 June 2017 20:24

AndreAdede

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Новая информация о медицине griskomed.ru

<
  • 0 Comments
  • 0 Articles
21 June 2017 11:15

KennethWaphy

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Grow your penis what is the best male penis enhancement cream maxisize to a size you never think is possible. Solve erection and ejaculation problems. This package what is the best male penis enhancement cream maxisize includes the highly recommended Herbal Strong Cream to make sure you get long lasting and permanent results!

<
  • 0 Comments
  • 0 Articles
22 June 2017 00:00

Joseph17

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Производство светодиодных табло для спорта, бегущих строк, табло для АЗС. ledbelgorod.ru

<
  • 0 Comments
  • 0 Articles
22 June 2017 02:11

KennethWWWWaphy

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Grow your penis maxisize effect to a size you never think is possible. Solve erection and ejaculation problems. This package maxisize effect includes the highly recommended Herbal Strong Cream to make sure you get long lasting and permanent results!

Grow your penis maxisize instruction to a size you never think is possible. Solve erection and ejaculation problems. This package maxisize instruction includes the highly recommended Herbal Strong Cream to make sure you get long lasting and permanent results!

<
  • 0 Comments
  • 0 Articles
29 June 2017 02:18

Romansceri

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Как хорошо, что наткнулся на ваш сайт, очень много информации почерпнул blitz-remont.ru

<
  • 0 Comments
  • 0 Articles
29 June 2017 18:55

RobertLiere

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Много полезной информации о ремонте montazhnik02.ru

Спасибо за актульную информацию, если что смотреть тут xozyaika.com

<
  • 0 Comments
  • 0 Articles
4 July 2017 07:48

pratik jadhav

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
i want to change row numbers to alphabets ... help me....

<
  • 0 Comments
  • 0 Articles
21 July 2017 07:17

CharlesvoR

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Читайте много информации о стройке и ремонте beton-cement-ru.ru

<
  • 0 Comments
  • 0 Articles
26 July 2017 01:14

manoochehr

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Quote: Ruby
Hi, thanks for your useful demo.
I currently can dynamically select all unavailable seats in my db.
But now i want add all selected seat info in 1 json array like this:
var seatArray = new Array();
sc.find('selected').each(function () {
var seatTemp = new Object();
seatTemp["SeatNo"] = sc.settings.id;
seatTemp["SeatType"] = sc.data().category;
seatTemp["Price"] = sc.data().price;
seatArray.push(seatTemp);
});

$.ajax({
type: "POST",
url: "seatHandler.ashx",
cache: false,
data: JSON.stringify(seatArray),
contentType: 'application/json',
dataType: "json",
success: getSuccess,
error: getFail
});

I tried put this in $('#checkout-button').onclick() but it didn't work
Could you show me how to make these code runs when click the checkout-button?


In case if you need it , I've find this work :
change these lines :
seatTemp["SeatNo"] = this.settings.id;
seatTemp["SeatType"] = this.data().category;
seatTemp["Price"] = this.data().price;

<
  • 1 Comment
  • 0 Articles
8 August 2017 18:50

wondergirl

Reply
  • Group: Members
  • РRegistered date: 8.08.2017
  • Status: Currently Offline
 
I'm having a problem on a website need assignment help
. I've gotten an error message saying something about JQuery being missing. I can't see avatars, type, or even see buttons. The only thing I can do is read forum posts. How do I fix this. Do I need to change the website source code, and if so, how?

<
  • 0 Comments
  • 0 Articles
5 September 2017 05:05

JustinEdure

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
http://vk.com/id370235746

<
  • 0 Comments
  • 0 Articles
6 September 2017 10:06

Ralphmaype

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
generic cialis avis

<a href="http://cialisxrm.com/">cialis without a doctor prescription</a>

how long do cialis pills last

cialis generic

<
  • 0 Comments
  • 0 Articles
7 September 2017 05:30

Justinforse

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Самые свежие программы здесь www.softzatak.ru

<
  • 0 Comments
  • 0 Articles
7 September 2017 13:01

Ralphmaype

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
does cialis lose its effectiveness over time

<a href="http://cialisxrm.com/">page
</a>

cialis impact on blood pressure

JayMEF

<
  • 0 Comments
  • 0 Articles
13 September 2017 14:44

Honzae7y

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Хей девушки есть суперская тема справочник предприятий россии 2017 которая интересует не только меня.
Мальчики приглашаю к обсасыванию темы каталог предприятий россии по отраслям

Напомню что справочник предприятий россии 2015 для всех доступна

Хей дорогие женщины есть интересная тема справочник предприятий россии 2015 которая интересует не только меня.
Девушки приглашаю к обсуждению темы справочник предприятий россии 2015

Напомню что справочник предприятий россии 2017 для каждого доступна

Привет девушки есть суперская темка база данных предприятий и организаций россии которая волнует не только меня.
Мужчины приглашаю к обсасыванию темы база данных предприятий и организаций россии

Напоминаю что все организации россии для всех доступна

Привет девушки есть интересная тема справочник предприятий россии 2015 которая волнует не только меня.
Мальчики приглашаю к обсасыванию темы каталог предприятий россии по отраслям

Напоминаю что база предприятий россии скачать бесплатно для каждого доступна

Хей дорогие женщины есть интересная тема справочник предприятий россии 2016 которая волнует не только меня.
Дорогие женщины приглашаю к обсасыванию темы справочник предприятий россии 2015

Напоминаю что каталог предприятий россии по отраслям для всех доступна

Здравствуйте дорогие женщины есть суперская тема все организации россии которая интересует не только меня.
Мальчики приглашаю к обсуждению темы все организации россии

Напомню что все организации россии для каждого доступна

Хай мужчины есть интересная тема справочник предприятий россии 2017 которая волнует не только меня.
Мужчины приглашаю к обсасыванию темы база данных предприятий и организаций россии

Напомню xrumer 16.0 + xevil скачать

<
  • 0 Comments
  • 0 Articles
16 September 2017 08:15

MichaelBrism

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Читайте много информации о красоте и моде krovinka.com/

<
  • 0 Comments
  • 0 Articles
19 September 2017 19:57

Geraldfug

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
mexican pharmacies online
<a href="http://canadianpharmacyrxbsl.com/">canadian pharmacies shipping to usa</a>
online pharmacy no prescription
how does cialis work
discount prescription drug
<a href="http://canadianpharmacyrxbsl.com/?zoloft-overdose">zoloft overdose</a>

<
  • 0 Comments
  • 0 Articles
20 September 2017 10:20

Felipepoins

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
online pharmacy
<a href="http://canadianpharmacyrxbsl.com/">canadian pharmacies shipping to usa</a>
costco pharmacy pricing
viagra coupons
prescription drug cost
<a href="http://canadianpharmacyrxbsl.com/?lasix-40-mg">lasix 40 mg</a>

best canadian mail order pharmacies
<a href="http://canadianpharmacyrxbsl.com/">canadian online pharmacies</a>
online pharmacy without prescription
universal drugstore canada
best online pharmacies canada
<a href="http://canadianpharmacyrxbsl.com/?fluconazole-150-mg">flucona
zole 150 mg</a>

<
  • 0 Comments
  • 0 Articles
21 September 2017 20:23

Geraldfug

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
canadian pharmacy online
<a href="http://canadianpharmacyrxbsl.com/">canadian online pharmacies</a>
onlinecanadianpharmacy.com
doxycycline mono
buying prescription drugs canada
<a href="http://canadianpharmacyrxbsl.com/?diflucan-dose">diflucan dose</a>

top rated online canadian pharmacies
<a href="http://canadianpharmacyrxbsl.com/">canadian pharmacy</a>
no prior prescription required pharmacy
fluconazol 150 mg
canada pharmacy no prescription
<a href="http://canadianpharmacyrxbsl.com/?clomid">clomid</a>

<
  • 0 Comments
  • 0 Articles
23 September 2017 19:34

JamesDrofs

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Последние модные стрижки здесь chyolka.ru

<
  • 0 Comments
  • 0 Articles
6 October 2017 04:15

Jerrydus

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Классные строительные порталы здесь nfmuh.ru
Классные строительные порталы здесь vipvozduh.ru
Классные строительные порталы здесь vash-deputat.ru
Классные строительные порталы здесь 495realty.ru

<
  • 0 Comments
  • 0 Articles
9 October 2017 05:31

ynjnhfgef

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
A-parser купить 2017 SE::Yandex SE::Yandex A-parser купить поисковой выдачи Яндекса
Один из пользователей BlackSeoForum.TOP хочет продать A-parser версии Enterpise, цена 150 usd
Также продаётся GSA Search Engine Ranker, GSA SEO Indexer, GSA Platform Identifier вместе за 100 usd
Весь вышеописанный софт за 190 USD

http://a-parser.c0.pl/kupit-a-parser/


SE::AOL SE::AOL A-parser купить поисковой выдачи search.aol.com

A-parser купить 2017 SE::Google::ByImage SE::Google::ByImage A-parser купить картинок Google Images по ссылке
Один из пользователей BlackSeoForum.TOP хочет продать A-parser версии Enterpise, цена 150 usd
Также продаётся GSA Search Engine Ranker, GSA SEO Indexer, GSA Platform Identifier вместе за 100 usd
Весь вышеописанный софт за 190 USD

A-parser купить


SE::Yandex::Direct SE::Yandex::Direct A-parser купить объявлений по кейворду через сервис direct.yandex.ru

Information
Comment on the news site is possible only within (days) days from the date of publication.