English 中文(简体)
D. 时间档期预订问题
原标题:slot booking problem
  • 时间:2010-05-07 18:57:11
  •  标签:
  • php

我正在建立医生任命分档机制,在医生任命分档中,每个分位数将分成30分钟,每个分位数达到所有工作标准。 1个问题是,在两个地点,即2个接待地点,即1个选择尚未在非行确认和挽救的分档(radio button)。 不能选择其他接待。 如何这样做。 ......在这方面的任何帮助就是放弃。

最佳回答

实质上,

  • 我只要求预先排定时间,然后要求其余细节。

  • 在有空档的情况下,该机向服务器发出停机要求,以便其他客户无法使用。

  • 如果没有,它将收到一份小批通知,说明该排位无法使用,并点击现有的位置。

我将谈谈非洲宇宙航空研究开发机构(如果这是一个网络图)。 这是一个与“蓝军”问题类似的分配系统问题。

问题回答

This is a case of accessing "shared data". You ll need thread to make sure that only one thread has access to the data at a time to ensure it s integrity. The following might provide some ideas http://www.alternateinterior.com/2007/05/communicating-with-threads-in-php.html

我将利用日本宇宙航空研究开发机构/日本宇宙航空研究开发机构的一些职能,定期更新有关自由排位的数据,或者我会这样做更为简单——在保留任命时,只是检查任命,如果选择排位的话,你将重新引导用户选择另一个位置。

Add a "Locked By" field to the table. When booking a slot, do something like:

UPDATE tablename
SET LockedBy = userid, ...
WHERE LockedBy IS NULL

After the update, you can select to see if LockedBy is set to your userid. If not, then someone else must have beaten you to the punch, and you need to tell the user to pick a different slot.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签