Advertisement
Guest User

Untitled

a guest
Apr 14th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. <html>
  2. <head><title>Updation</title>
  3. <link rel="stylesheet" href="css/bookstyles.css">
  4. <link rel="stylesheet" href="css/jquery-ui.css">
  5. <script src="js/jquery-1.12.4.js"></script>
  6. <script src="js/jquery-ui.js"></script>
  7. </head>
  8. <body>
  9.  
  10. <div class="container">
  11.  
  12. <style>
  13. #display {
  14. color:red;
  15. font-size:12px;
  16. text-align:center;
  17. }
  18. .logo {
  19. padding:5px;
  20. float:right;
  21. }
  22. header {
  23. background-color:#074e7c;
  24. height:60px;
  25. width:100%;
  26. text-align:center;
  27. color:white;
  28. font-size:40px;
  29.  
  30. }
  31. #wrap {
  32. text-align:center;
  33. }
  34. </style>
  35.  
  36. <body>
  37. <div id="display">
  38.  
  39.  
  40. <?php
  41. include('db.php');
  42. include('header/page_header.php');
  43. error_reporting(0);
  44. if(isset($_GET['user_Id']))
  45. {
  46. $userid=$_GET['user_Id'];
  47. echo $userid;
  48.  
  49. $s="select * from coeds_user where userId=$userid";
  50. echo $s;
  51. $query1=mysql_query($s);
  52. $res=mysql_fetch_array($query1);
  53.  
  54. ?>
  55.  
  56.  
  57.  
  58. <form action="#" name="user_update" method="post">
  59. <input type="hidden" name="user_Id" id="user_Id" value="<?php if(isset($userid)) echo $userid ;?>">
  60. <table align='center' border='1'>
  61.  
  62. <tr>
  63.  
  64. <td> <label for="userName">UserName</label></td>
  65. <td ><input id="userName" name="userName" id="search_input" type="text" value="<?php echo $res['userName'];?> "/></td>
  66.  
  67.  
  68. </tr>
  69. <tr>
  70. <td> <label for="userEmail">Email</label></td>
  71. <td ><input id="userEmail" name="userEmail" class="text" type="text" value="<?php echo $res['userEmail'];?> " /></td>
  72. </tr>
  73. <tr>
  74. <td>
  75. <label for="userPassword">password</label></td>
  76. <td ><input id="userPassword" name="userPassword" class="text" type="password" value="<?php echo $res['userPassword'];?> "/></td>
  77.  
  78.  
  79. </tr>
  80. <tr>
  81. <td>
  82. <label for="expiry_date">ExpiryDate</label></td>
  83. <td ><input id="expiry_date" name="expiry_date" class="text" type="text" value="<?php echo $res['expiry_date'];?> "/></td>
  84.  
  85.  
  86. </tr>
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. </table>
  97.  
  98. <input type="submit" name="modify" id="modify" value="modify" class="enable" disabled="disabled"/ >
  99. <?php
  100. }
  101. ?>
  102. <?php
  103.  
  104. include('db.php');
  105. if(isset($_POST['user_Id']))
  106. {
  107. $userid=$_POST['user_Id'];
  108. echo $userid;
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116. $s="select * from coeds_user";
  117. $query=mysql_query($s);
  118. $display.="<table border='1'>";
  119. $display.="<tr><th>UserId</th><th>UserName</th><th>UserEmail</th><th>UserPassword</th><th>RegDate</th><th>RegistrationKey</th></tr>";
  120. while($res=mysql_fetch_array($query))
  121. {
  122. $display.="<tr>";
  123. $display.="<td>".$res['userId']."</td>";
  124. $display.="<td>".$res['userName']."</td>";
  125. $display.="<td>".$res['userEmail']."</td>";
  126. $display.="<td>".$res['userPassword']."</td>";
  127. $display.="<td>".$res['regDate']."</td>";
  128. $display.="<td>".$res['registration_key']."</td>";
  129. $display.="<td>".$res['expiry_date']."</td>";
  130. $display.="</tr>";
  131. }
  132. $display.="</table>";
  133. //header('location:users1.php');
  134. echo $display;
  135.  
  136.  
  137.  
  138.  
  139. ?>
  140. </div>
  141.  
  142.  
  143. </body>
  144. <script type="text/javascript" >
  145. $(document).ready(function() {
  146. $( "#expiry_date" ).datepicker();
  147.  
  148. });
  149. </script>
  150. <script type="text/javascript" >
  151. $(document).ready(function() {
  152. $(function () {
  153. $( '.text' ).Keyup(function() {
  154. alert(" 1 hi");
  155. if ($(this).val() == '') {
  156. alert("2 hi");
  157.  
  158. $('#modify').prop('disabled', true);
  159. } else {
  160. alert("3 hi");
  161.  
  162. //$('input[type="submit"]').removeAttr('disabled');
  163. $('#modify').prop('disabled', false);
  164.  
  165.  
  166. $('#modify').click(function(e) {
  167.  
  168.  
  169. alert("hi");
  170. var userid=$("#user_Id").val();
  171. var userName=$("#userName").val();
  172. var userEmail=$("#userEmail").val();
  173. var userPassword=$("#userPassword").val();
  174. var expiry_date=$("#expiry_date").val();
  175.  
  176. var dataString='user_Id='+userid+'&userName='+userName+'&userEmail='+userEmail+'&userPassword='+userPassword+'&expiry_date='+expiry_date;
  177.  
  178. alert(dataString);
  179. $.ajax({
  180.  
  181.  
  182. type: "POST",
  183.  
  184. data: dataString,
  185. url: "edit_user_details.php",
  186. cache: false,
  187.  
  188. success: function(result){
  189. alert(result);
  190. $('#display').html(result);
  191.  
  192. window.location.href="users1.php";
  193.  
  194.  
  195.  
  196.  
  197.  
  198. },
  199.  
  200.  
  201.  
  202.  
  203.  
  204. error: function (xhr, ajaxOptions, thrownError) {
  205. alert(xhr.status);
  206. alert(thrownError);
  207. }
  208.  
  209.  
  210.  
  211. });
  212. });
  213. }
  214. });
  215. });
  216.  
  217. });
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225. </script>
  226.  
  227.  
  228. </form>
  229. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement