Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 有谁做过预约挂号医生排班的程序,给个思路。

有谁做过预约挂号医生排班的程序,给个思路。

Jun 23, 2016 pm 01:52 PM
doctor Ideas reserve

个一个在线预约挂号,在医生排排班的时候,可以自定义每个时间段可以预约的人数,当然时间段也可以自定义,我这里时间段是一个小时的,比如8:00-9:00.......17:00-18:00,一天8个小时分为8个时间段。排班时间是星期一到星期日。哪位给个具体思路,谢谢了。


回复讨论(解决方案)

首先用一???????段及每???段最多可以??的人?,或者用??表也可以。
例如每???段只能??20?人。
$t = array(
     array('08:00', '09:00', 20),
      ....
     .....
     array('17:00', '18:00', 20),
);

然後,用一?表????人?,大概字段如下
id        自增
mid    用?id 或什?唯一身份??的?西,或email也可以,用??查是否重???用。
date   日期
t          ??段??,用????也可
num  ??人?

?有用?要??,先判?是否在允?????段?,如果是,再判?,???段?是否已????,如未??增加一???。

例如有一?用?在8:00-9:00 ????段??,可以??判?。
select num from table where date='2014-06-10' and t=0;

如返回的num小於 20,?insert。

如果要加上取消??功能,可以也?一?取消??限期,起?在9:00前10分?不能取消,???好。大概思路是??。



如果星期一和星期日等的可以????不同,那$t?????再分多一?做星期的key。如果是??建?做成??表,方便管理。

$t = array(
   'MON' => array(
     array('08:00', '09:00', 20),
      ....
     .....
     array('17:00', '18:00', 20),
  ),
  'TUE' => array(

  )
);

先设计数据库,表doctors(医生),表order(预约),表work(排班)
每次生成预约号,先去检索排班表,排班表里面如果当天的没有创建,先创建。
排班额外建表,就可以手动修改设置。

楼上的那种虽然有道理,但是你不能保证那个医生那一天那个点就一定会上班,可能遇到某些情况不上班或者有事耽误
所以不能写死在程序中。

把时间段的时间,存入数据库或者数组,当成一个类别处理,预定的时候,选取类别即可。

学习一下~

首先用一???????段及每???段最多可以??的人?,或者用??表也可以。
例如每???段只能??20?人。
$t = array(
     array('08:00', '09:00', 20),
      ....
     .....
     array('17:00', '18:00', 20),
);

然後,用一?表????人?,大概字段如下
id        自增
mid    用?id 或什?唯一身份??的?西,或email也可以,用??查是否重???用。
date   日期
t          ??段??,用????也可
num  ??人?

?有用?要??,先判?是否在允?????段?,如果是,再判?,???段?是否已????,如未??增加一???。

例如有一?用?在8:00-9:00 ????段??,可以??判?。
select num from table where date='2014-06-10' and t=0;

如返回的num小於 20,?insert。

如果要加上取消??功能,可以也?一?取消??限期,起?在9:00前10分?不能取消,???好。大概思路是??。

有点晕乎乎的,不太懂你的意思

LZ用3楼的方案吧。其实你的需求,无非是要搞清楚,有哪些医生,排班的情况,预约的情况。用数据库操作灵活些。

既然复杂就用数据表来做,方便管理

数据表结构如下:

doctor 表,记录医生信息
doctor_id 医生id   PK
name      医生名称

timeline 表,记录每个医生每天每个时段的能预约的信息,这个需要每隔一段时间做一次新增和删除,新增加新日期预约时间,删除过期的.星期没有用了,因为直接用日期来定比较好。
tid        timeline id         PK
doctor_id  医生id              FK
date       日期
quota      允许预约的人数
starttime  时段开始语          例8:00
endtime    时段结束            例9:00
status     该时段是否允许预约  0 否 1允许

order 预约表,记录用户预约的情况
order_id   预约id PK
userid     用户id -> 会员系统这个你自己想 FK
tid        预约了的时段id                 FK
addtime    预约时间

流程:
首先先输入doctor 和 timeline 数据,如下

共有两个医生
doctor_id name
1         d1
2         d2

在2014-06-11这天的班表,doctor1别8个时间段全满,doctor2 则只有6个时间段需要工作
tid doctor_id  date        quota starttime endtime status
1       1       2014-06-11   10     08:00    09:00     1
2       1       2014-06-11   10     09:00    10:00     1
3       1       2014-06-11   10     10:00    11:00     1
4       1       2014-06-11   12     11:00    12:00     1
5       1       2014-06-11   12     14:00    15:00     1
6       1       2014-06-11   8        15:00    16:00     1
7       1       2014-06-11   10     16:00    17:00     1
8       1       2014-06-11   5        17:00    18:00     1
9       2       2014-06-11   10      08:00    09:00     1
10     2       2014-06-11   10      09:00    10:00     1
11     2       2014-06-11   10     10:00    11:00     1
12     2       2014-06-11   12     14:00    15:00     1
13     2       2014-06-11   10     16:00    17:00     1
14     2       2014-06-11   5       17:00    18:00     1


预约
第一位用户useid=1 要预约 2014-06-11 11:00~12:00 doctor1
首先判断timeline 中 doctor_id=1 date=2014-06-11 starttime=11:00 endtie=12:00 quota>0的记录是否存在
如果不存在,返回提示没有预约的时段或名额已满
如果存在
1。在order表新增一条记录
order_id userid tid       addtime
  1                 1      4   2014-06-09 10:29:29
2.将timeline tid=4 的 quota-1,那记录就会变成

4      1       2014-06-11   11     11:00    12:00     1

流程就是这样,应该很明白了吧。

读不起了各位,最近一段时间出差去了,昨天才回来,看了下8楼的方法,这样的话每次都要新增一次,而且都是手动输入数据,如果按星期的话,那没个一个星期就要更新一次。好像时间是写死了

读不起了各位,最近一段时间出差去了,昨天才回来,看了下8楼的方法,这样的话每次都要新增一次,而且都是手动输入数据,如果按星期的话,那没个一个星期就要更新一次。好像时间是写死了



??不是?死的。你什??候需要工作,才添加入班表。

可以?置?期班表及??班表。

例如?生A,每?星期一~五都是8:00~12:00工作。可以?多一?表???期班表,然後另一?表????班表。

例如今天,星期一,正常是8:00~12:00?生A上班的,但??有事,需要改成下午14:00~18:00。??就把14:00~18:00?入今天??班表。但判?今日有??班表的,?按??班表去??。否?按?期班表??即可。大概思路是??了。

读不起了各位,最近一段时间出差去了,昨天才回来,看了下8楼的方法,这样的话每次都要新增一次,而且都是手动输入数据,如果按星期的话,那没个一个星期就要更新一次。好像时间是写死了



你究竟想要做什么?把思路先理清楚了!
你不是“预约”吗?怎么可能每周是一样的?
如果我约在明天,难道明天的明天也有效吗?日期当然是定死的!

我只需要7天时间进行循环,当天预约明天的,比如:2014-6-25(星期三)?2014-7-1(星期二),不管怎么排班我都是以7天时间为准,这个具体要怎么体现呢,照你那方法我都不知道在页面和程序上怎么去体现了。


读不起了各位,最近一段时间出差去了,昨天才回来,看了下8楼的方法,这样的话每次都要新增一次,而且都是手动输入数据,如果按星期的话,那没个一个星期就要更新一次。好像时间是写死了



??不是?死的。你什??候需要工作,才添加入班表。

可以?置?期班表及??班表。

例如?生A,每?星期一~五都是8:00~12:00工作。可以?多一?表???期班表,然後另一?表????班表。

例如今天,星期一,正常是8:00~12:00?生A上班的,但??有事,需要改成下午14:00~18:00。??就把14:00~18:00?入今天??班表。但判?今日有??班表的,?按??班表去??。否?按?期班表??即可。大概思路是??了。

可以这样,你先做一天排一次的,做出来以后再改成7天循环的。

可以这样,你先做一天排一次的,做出来以后再改成7天循环的。

你那个方法我可以理解成这样的吗?我做成这样的如图: ,这个是7天自动循环的,每天的时间段和人数自定义,但是这个SQL语句该怎么写呢?麻烦你了,最早那个思路客户不满意,菲的弄成这个得

字段为:
日期、专家、时段1、时段2......时段10
即每个专家每天一条记录

字段为:
日期、专家、时段1、时段2......时段10
即每个专家每天一条记录

那照这样的话,那不是每天都要进行一次排班

为什么呢?
只不过是将你的表单(#14 的截图)中的每一天作为一条记录保存而已
如果你的表单是对一周的设定,那么提交后就按天保存成 7 条记录就是了

为什么呢?
只不过是将你的表单(#14 的截图)中的每一天作为一条记录保存而已
如果你的表单是对一周的设定,那么提交后就按天保存成 7 条记录就是了

那这样的话,保存的时候是同多循环插入数据(还是数组),我要保存的是时间段还有每个时间段对应的人数

首先想?下?主的是,?些????段以及???段允???的人?或者其它信息是由每??家自己?置的?是系??置的

如果是?家自己?置的那你??可以??
首先你??有一???段的配置信息表,????段如8.00,   9.00或者?以半?小?如8.30,  9.00, 9.30等,每???是一???

然後?家在?置?,把?些??全部列出?,由?生自己去定???段,如8:00-9:00,允?的??人?等信息,?置好後再?入??

患者看信息?,把最近七天的?家?置的??段以及相?信息?用出?即可.

首先想?下?主的是,?些????段以及???段允???的人?或者其它信息是由每??家自己?置的?是系??置的

如果是?家自己?置的那你??可以??
首先你??有一???段的配置信息表,????段如8.00,   9.00或者?以半?小?如8.30,  9.00, 9.30等,每???是一???

然後?家在?置?,把?些??全部列出?,由?生自己去定???段,如8:00-9:00,允?的??人?等信息,?置好後再?入??

患者看信息?,把最近七天的?家?置的??段以及相?信息?用出?即可.

我这个是系统设置的,保不齐以后有医生自己进行排班。

如果你的输入框命名成这样的形式:
时段1
时段2
提交后不就都对应上了吗?

如果你是用 mysqli 或 pdo 扩展的话,绑定一下参数,就可循环插入,没有什么开销
如果是用 mysql 就组装一下指令串,也不是什么难事

为了系统的兼容性,最好是每天每个时段单独设置存到数据库里。

如果你的输入框命名成这样的形式:
时段1
时段2
提交后不就都对应上了吗?

如果你是用 mysqli 或 pdo 扩展的话,绑定一下参数,就可循环插入,没有什么开销
如果是用 mysql 就组装一下指令串,也不是什么难事

你这种方法我都迷糊了,也不知道是我钻牛角尖了,还是不懂这个,再次截图

如果哪位真好心,直接给我写成代码吧,拜托了,问题解决,我再追加50分

其?,思路你懂了??

如果不懂,就算?你代?,也?有用。

没人愿意吗?

其?,思路你懂了??

如果不懂,就算?你代?,也?有用。



其?,思路你懂了??

如果不懂,就算?你代?,也?有用。


各位给帮忙看下这个事怎么回事,http://jcy.xys.gov.cn/已经放到服务器了,怎么还是本地路径呢,这个解决了我结贴给分,拖得时间太长了,对不起大家了。。

?片你在模板中?死吧。http://localhost/xyjcy_network/templates/default/images/xjweibo.jpg


读不起了各位,最近一段时间出差去了,昨天才回来,看了下8楼的方法,这样的话每次都要新增一次,而且都是手动输入数据,如果按星期的话,那没个一个星期就要更新一次。好像时间是写死了



你究竟想要做什么?把思路先理清楚了!
你不是“预约”吗?怎么可能每周是一样的?
如果我约在明天,难道明天的明天也有效吗?日期当然是定死的!
版主,请教下
网站上的doc文件打开时也不提示是否下载或者打开,直接打开就是乱码,不知道这是怎么回事呢?

你没有发送下载的头?

你没有发送下载的头?


文件直接是编辑器上传的,在虚拟空间都好好的,放到客户服务器上就不行了,打开内容就是乱码。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

'Blade and Soul 2' new PV for Chinese server revealed, reservations for all platforms open today 'Blade and Soul 2' new PV for Chinese server revealed, reservations for all platforms open today Apr 09, 2024 pm 02:49 PM

The national server of "Blade and Soul 2" announced today that pre-orders have been opened for all platforms. The Chinese version of "Blade and Soul 2" will be jointly operated by Xiaoming Taiji and Tencent Games. In order to inherit the gameplay features of the Blade and Soul IP and bring a more extreme gaming experience to Ganoderma fans, the development team of "Sword and Soul 2" is working intensively to optimize and upgrade the graphics, combat operations, new gameplay, etc. for the Chinese version. At the same time, in order to let everyone understand the optimization content of the Chinese server of "Blade and Soul 2" in advance, the development team specially sent a handwritten letter to Chinese players! The NCSOFT development team sends a letter to players: "Blade and Soul 2" will be reborn. Hello everyone, Chinese players. This is the first time that we, as the development team of "Blade and Soul 2", would like to say hello to everyone who has been paying attention to Blade and Soul. At the beginning of the new year, we are excited

How to schedule a live broadcast in Fangtianxia How to schedule a live broadcast in Fangtianxia Mar 19, 2024 am 08:01 AM

In today's digital era, live broadcast has become an extremely popular interactive method, which not only provides people with a new entertainment experience, but also provides a more intuitive and efficient promotion channel for enterprises and institutions. In the field of real estate, Fangtianxia has become the preferred platform for many home buyers and real estate practitioners with its professional real estate information and high-quality services. The live broadcast function of Fang Tianxia provides users with an intuitive understanding of real estate market dynamics. So how can you make an appointment for the live broadcast of your interest in the Fang Tianxia app? Users who want to know more can follow this article. Find out! Click on the city option above and select the city where you want to buy a house. Click "Live Viewing" on the homepage interface as shown in the picture. Select the type as shown in the picture, new house recommendation or second house

How to schedule a video conference on DingTalk How to schedule a video conference on DingTalk Mar 29, 2024 pm 03:36 PM

1. Open the software, click on the four square work icons in the table below, and then click on the [Video Conferencing] icon. 2. On the video conference page, click the [Reserve Meeting] button. 3. Click the icon [+] at the top of the page to add participants. 4. Fill in the meeting topic, meeting time, meeting duration and other contents in order, and click the [OK] button. 5. Pay attention to the number of people and meeting time displayed on the opening page, and click [Start Meeting].

How can Air Travel Zongheng help others make reservations and select seats? How can Air Travel Zongheng help others check in and select seats? How can Air Travel Zongheng help others make reservations and select seats? How can Air Travel Zongheng help others check in and select seats? Mar 22, 2024 am 08:50 AM

Air Travel Zongheng allows you to better complete various travels. If you want to fly, you can come here to purchase tickets. There are many functions, and they can help you provide a lot of strategies, which can make you more comfortable. Everyone has made all kinds of preparations in advance. The entire travel service is very comprehensive and easy to operate. Not only can you book tickets and select seats, but it can also help you check flight information and make it convenient for you to pick up the airport. I support everyone in helping others here. Let’s take a look at the check-in and seat selection. How to help others check in and select seats for flights: 1. First open the software and select "Toolbox". 2. Then select "Mobile Seat Selection". 3. Then select “Select Seats with Companion&

Blue Star Travel Yao Reservation Entrance Blue Star Travel Yao Reservation Entrance Mar 21, 2024 pm 07:17 PM

Blue Star Travel Yao opened game reservations after it was exposed. Many players were very interested after seeing the game's actual demonstration video. If they want to know how to reserve the game, this article will bring you Blue Star Travel Yao Make a reservation for the entrance, friends in need come and have a look. Blue Star Travel Yao Reservation Entrance Reservation Entrance: 1. After we enter the official website of Blue Star Travel Yao, we can see that the game is open for reservation on the homepage of the official website. Click Reserve Now in the lower left corner. 2. Then we enter the Manjiu pass and log in to the reservation entrance. 3. After logging in, we select the reservation platform we want. If we are qualified, it will be issued on the corresponding platform. 4. After selecting, our reservation is completed.

Damai how to cancel reservation and grab tickets Damai how to cancel reservation and grab tickets Mar 29, 2024 am 08:41 AM

Damai's ticket reservation function indeed provides us with great convenience, allowing us to lock in our favorite performance tickets in advance and ensure that we do not miss any wonderful performances. However, sometimes we may choose the wrong tickets for various reasons during the reservation process, or need to cancel the reservation function for other reasons. However, many users do not know how to cancel, so the following article will provide you with the joy of cancellation in detail. The steps are introduced, I hope it can help everyone. How to cancel reservations and grab tickets in Damai? First click to open Damai software, enter the home page and switch to the site. In the member, fare, and my pages, click [My] in the lower right corner here. 2. Then you need to click the [Want to Watch & Want to Play] button on my page, and then click [Show]; 3. Finally, I

How to cancel Tencent Video reservation How to cancel Tencent Video reservation Mar 08, 2024 am 08:22 AM

Tencent video software not only provides us with a rich variety of film and television content, but also allows us to reserve films and television works that have not yet been released in advance. However, sometimes we may want to cancel a previous appointment for some reason. So, how to cancel the reservation in Tencent Video? In the following, the editor of this site will bring you a detailed introduction. Users who want to know more, please continue this article! How to cancel Tencent Video reservation? Answer: [Tencent Video]-[Personal Center]-[Reservation/Add]-[My Reservation]-[Edit]-[Remove]. Specific steps: 1. First open the Tencent video software. After entering the homepage, you can switch to the short video, member center, message, and personal center pages. Here we click the [Personal Center] button; 2.

The server opens today and reservations are overwhelming! 'Drunken Eight Immortals' New Year's first server 'Dragon and Tiger Leaping' is now online The server opens today and reservations are overwhelming! 'Drunken Eight Immortals' New Year's first server 'Dragon and Tiger Leaping' is now online Feb 29, 2024 pm 08:00 PM

Today at 15:00, the first New Year server of "Drunken Eight Immortals" will be launched! As a ten-year-old turn-based system, its unique "Soaring in the Clouds and Driving the Mist", "Battle Weather" and complete trading system make it very popular among players~ With the new server coming, let Xiaolongren introduce it to everyone. Introduce it! "Drunken Eight Immortals" takes "Eight Immortals' Journey to the East" as the background to construct a dream-like world of the Eight Immortals and Three Realms. Here, you can not only experience "flying in the clouds and riding the mist" and enjoy "ranking in the immortal class", but you can also enjoy the ever-changing battlefield and use "battle weather" to turn the tide of the battle. Not only that, hundreds of powerful cute pets and unique gameplay will also allow you to say goodbye to the game shortage completely. You can play whatever you want in PVP, PVE, and PVX! In order to have a more realistic game screen, so that fairy friends can experience it immersively

See all articles