Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
353 views
in Technique[技术] by (71.8m points)

mysql - room booking system in php

I have multiple rooms

  1. suite room - 10
  2. Ac Room - 8

data stored in mysql table

i have printed 10 div's using for loop with book button in suite rooms and 8 div's using for loop with book button in Ac room section

i have user booking form and i have saved user data with check in, check out date in another mysql table with particluar div's ID and room id

i want to change booked rooms with room id and div ids with another div i have code below

    <div class="dt-content" style="padding-bottom:0px;">
    <div class="row" style="margin-top:-25px;">
    <div class="col-12 col-sm-12 " >
    <h1 class="dt-page__title">Book Guest in <?php echo $recordrooms["room_name"]; ?> </h1>
    <div class="dt-card" >
    <div class="dt-card__body">
    <div class="form-row">
    <?php
    $no_of_rmm=$recordrooms["no_of_rooms"];
    $rmmnsend=$recordrooms["id"];
    
    for($x = 1; $x<=$no_of_rmm; $x++) { 
    $resultreview=mysql_query("
    select * 
      from guest_booking 
     where room_org_id = '$rmmnsend' 
       and booking_status = 'YES'
   ");
    while($recordreview=mysql_fetch_assoc($resultreview))
    {
    $rmmnsendlist=$recordreview["room_list_id"];
    if($x==$rmmnsendlist )
    {
    ?>
    <div class="col-sm-2 col-xs-6 mb-3">
    <a href="#" style="color:#fff;"><center><div class="card dt-card__full-height bg-gradient-redd text-white">
    <div class="card-body p-6">
    <p class="display-3 mb-1"><?php echo $x; ?></p>
    <p class="f-12">No Room booked</p>
    <span class="text-light f-12 font-weight-500 text- uppercase" style="cursor:pointer;"> Guest Details</span>
    </div>
    </div></center></a>
    </div>
    <?php
    }
    else
    {
    ?>
    <div class="col-sm-2 col-xs-6 mb-3">
    <a href="add-guest.php?roombookid=<?php echo $x; ?>&rmmid=<?php echo $rmmnsend; ?>" style="color:#fff;"><center><div class="card dt-card__full-height bg-gradient-greenn text-white">
    <div class="card-body p-6">

    <p class="display-3 mb-1"><?php echo $x; ?></p>
    <p class="f-12"> No Room Available</p>
    <span class="text-light f-12 font-weight-500 text- uppercase" style="cursor:pointer;">Book Room</span>
    </div>

    </div></center></a>
    </div>
    <?php 
    }}} 
    ?>
    </div></div></div></div></div></div>
    <?php  
    }
    ?>

enter image description here

The div's showing multiple please help me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...