PageRenderTime 114ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/pages_old/room_edit.php

https://bitbucket.org/deba666/accitsoftware
PHP | 144 lines | 136 code | 8 blank | 0 comment | 5 complexity | 0716bad7467d6be1fb339aaf567579b8 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. if($_POST['room_code'])
  3. {
  4. 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']))
  5. $_SESSION['s_msg']="<strong>Well done!</strong> room successfully updated";
  6. else
  7. $_SESSION['e_msg']="<strong>Oh snap!</strong> Room is not updated";
  8. }
  9. if($_GET['rid'])
  10. {
  11. $cond="where `ROOM_NO`=".$_GET['rid'];
  12. $row=getRows($cond,'room');
  13. }
  14. ?>
  15. <div class="right_col" role="main">
  16. <div class="">
  17. <div class="col-md-12 col-sm-12 col-xs-12">
  18. <div class="page-title">
  19. <div class="title_left">
  20. <?php
  21. if($_SESSION['s_msg'] || $_SESSION['e_msg'])
  22. {
  23. ?>
  24. <div class="alert <?=($_SESSION['s_msg'])?'alert-success':'alert-error'?> fade in">
  25. <button data-dismiss="alert" class="close" type="button">×</button>
  26. <?=($_SESSION['s_msg'])?$_SESSION['s_msg']:$_SESSION['e_msg']?>
  27. </div>
  28. <?php
  29. unset($_SESSION['s_msg']);
  30. unset($_SESSION['e_msg']);
  31. }
  32. ?>
  33. <h3>Modify Room</h3>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="clearfix"></div>
  38. <div class="row">
  39. <div class="col-md-12 col-sm-12 col-xs-12">
  40. <div class="x_panel">
  41. <div class="clearfix"></div>
  42. <div class="x_content">
  43. <div class="row">
  44. <div class="col-md-12 col-sm-12 col-xs-12">
  45. <div class="x_panel recent-app">
  46. <div class="x_content">
  47. <div class="student-account-page edit-faculty-page">
  48. <!-- Nav tabs -->
  49. <div class="card">
  50. <div class="all-students-list add student">
  51. <div class="add-student-section">
  52. <form method="post" action="" class="form-horizontal form-label-left">
  53. <div class="item form-group">
  54. <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Room Code:</label>
  55. <div class="col-md-9 col-sm-9 col-xs-12">
  56. <div class="row">
  57. <div class="col-md-7 col-sm-7 col-xs-12">
  58. <input type="text" required="" value="<?=$row[0]['ROOM_CODE']?>" name="room_code" class="form-control col-md-12 col-xs-12" id="name">
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="item form-group">
  64. <input type="hidden" value="unread" name="status">
  65. <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Room Name:</label>
  66. <div class="col-md-9 col-sm-9 col-xs-12">
  67. <div class="row">
  68. <div class="col-md-7 col-sm-7 col-xs-12">
  69. <input type="text" required="" value="<?=$row[0]['ROOM_DESC']?>" name="room_name" class="form-control col-md-12 col-xs-12" id="name">
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="item form-group">
  75. <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Capacity</label>
  76. <div class="col-md-4 col-sm-6 col-xs-6">
  77. <div class="row">
  78. <div class="col-md-4 col-sm-4 col-xs-12">
  79. <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">
  80. </div>
  81. </div>
  82. </div>
  83. <div class="col-md-2 col-sm-2 col-xs-2">
  84. <div class="col-md-6 col-sm-4 col-xs-12">
  85. <label class="pull-left">
  86. <label class="radio">
  87. <input type="radio" <?=($row[0]['STATUS'])?'checked="checked"':''?> value="1" name="is_active">
  88. Active</label>
  89. <label class="radio" style="float: right; top: -26px; right: -74px;">
  90. <input type="radio" <?=(!$row[0]['STATUS'])?'checked="checked"':''?> value="0" name="is_active">
  91. Inactive</label>
  92. </label>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="item form-group">
  97. <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12">Location</label>
  98. <div class="col-md-7 col-sm-7 col-xs-12">
  99. <div class="row">
  100. <div class="col-md-6 col-sm-4 col-xs-12">
  101. <select class="form-control" name="location">
  102. <option value="1">SYDNEY</option>
  103. <option value="2">KOLKATA</option>
  104. </select>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="item form-group">
  110. <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
  111. <div class="col-md-9 col-sm-9 col-xs-12">
  112. <div class="row">
  113. <div class="col-md-6 col-sm-4 col-xs-12">
  114. <p class="pull-left">
  115. <button class="btn btn-primary">Cancel</button>
  116. <button class="btn btn-success" type="submit">Submit</button>
  117. </p>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </form>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>