/administrator/pages_old/room_edit.php
PHP | 144 lines | 136 code | 8 blank | 0 comment | 5 complexity | 0716bad7467d6be1fb339aaf567579b8 MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- if($_POST['room_code'])
- {
- if(mysql_query("UPDATE `room` SET `ROOM_CODE`='".$_POST['room_code']."', `ROOM_DESC`='".$_POST['room_name']."', `ROOM_CAPACITY`='".$_POST['capacity']."', `LOCATION_NO`='".$_POST['location']."', `STATUS`='".$_POST['is_active']."' WHERE `ROOM_NO`=".$_GET['rid']))
- $_SESSION['s_msg']="<strong>Well done!</strong> room successfully updated";
- else
- $_SESSION['e_msg']="<strong>Oh snap!</strong> Room is not updated";
- }
- if($_GET['rid'])
- {
- $cond="where `ROOM_NO`=".$_GET['rid'];
- $row=getRows($cond,'room');
- }
- ?>
- <div class="right_col" role="main">
- <div class="">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="page-title">
- <div class="title_left">
- <?php
- if($_SESSION['s_msg'] || $_SESSION['e_msg'])
- {
- ?>
- <div class="alert <?=($_SESSION['s_msg'])?'alert-success':'alert-error'?> fade in">
- <button data-dismiss="alert" class="close" type="button">×</button>
- <?=($_SESSION['s_msg'])?$_SESSION['s_msg']:$_SESSION['e_msg']?>
- </div>
- <?php
- unset($_SESSION['s_msg']);
- unset($_SESSION['e_msg']);
- }
- ?>
- <h3>Modify Room</h3>
- </div>
- </div>
- </div>
- <div class="clearfix"></div>
- <div class="row">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="x_panel">
- <div class="clearfix"></div>
- <div class="x_content">
- <div class="row">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="x_panel recent-app">
- <div class="x_content">
- <div class="student-account-page edit-faculty-page">
- <!-- Nav tabs -->
- <div class="card">
- <div class="all-students-list add student">
- <div class="add-student-section">
-
- <form method="post" action="" class="form-horizontal form-label-left">
- <div class="item form-group">
- <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Room Code:</label>
- <div class="col-md-9 col-sm-9 col-xs-12">
- <div class="row">
- <div class="col-md-7 col-sm-7 col-xs-12">
- <input type="text" required="" value="<?=$row[0]['ROOM_CODE']?>" name="room_code" class="form-control col-md-12 col-xs-12" id="name">
- </div>
- </div>
- </div>
- </div>
- <div class="item form-group">
- <input type="hidden" value="unread" name="status">
- <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Room Name:</label>
- <div class="col-md-9 col-sm-9 col-xs-12">
- <div class="row">
- <div class="col-md-7 col-sm-7 col-xs-12">
- <input type="text" required="" value="<?=$row[0]['ROOM_DESC']?>" name="room_name" class="form-control col-md-12 col-xs-12" id="name">
- </div>
- </div>
- </div>
- </div>
- <div class="item form-group">
- <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Capacity</label>
- <div class="col-md-4 col-sm-6 col-xs-6">
- <div class="row">
- <div class="col-md-4 col-sm-4 col-xs-12">
- <input type="number" step="1" min="1" max="" name="capacity" id="capacity" value="<?=$row[0]['ROOM_CAPACITY']?>" title="capacity" class="form-control input-text qty text" size="4">
- </div>
- </div>
- </div>
- <div class="col-md-2 col-sm-2 col-xs-2">
- <div class="col-md-6 col-sm-4 col-xs-12">
- <label class="pull-left">
- <label class="radio">
- <input type="radio" <?=($row[0]['STATUS'])?'checked="checked"':''?> value="1" name="is_active">
- Active</label>
- <label class="radio" style="float: right; top: -26px; right: -74px;">
- <input type="radio" <?=(!$row[0]['STATUS'])?'checked="checked"':''?> value="0" name="is_active">
- Inactive</label>
- </label>
- </div>
- </div>
- </div>
- <div class="item form-group">
- <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Location</label>
- <div class="col-md-7 col-sm-7 col-xs-12">
- <div class="row">
- <div class="col-md-6 col-sm-4 col-xs-12">
- <select class="form-control" name="location">
- <option value="1">SYDNEY</option>
- <option value="2">KOLKATA</option>
- </select>
- </div>
-
- </div>
-
- </div>
-
- </div>
- <div class="item form-group">
- <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
- <div class="col-md-9 col-sm-9 col-xs-12">
- <div class="row">
- <div class="col-md-6 col-sm-4 col-xs-12">
- <p class="pull-left">
- <button class="btn btn-primary">Cancel</button>
- <button class="btn btn-success" type="submit">Submit</button>
- </p>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>