Guest User

Untitled

a guest
Feb 4th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>الرد على التذكرة</title>
  6. <style>
  7.  
  8. .table, tr, td {border: 1px solid black; text-align:center}
  9. .contents { position:static}
  10. p1 {font-size:15px; font-weight:bolder}
  11. .inputresponse {resize:none}
  12. </style>
  13. </head>
  14. <body class="body">
  15. <div class="contents" align="right">
  16. <?php
  17.  
  18. include 'config.php';
  19.  
  20.  
  21.  
  22. $sql = "SELECT * FROM contact ORDER BY id";
  23.  
  24. $con->set_charset('utf8');
  25. $users = mysqli_query($con,$sql);
  26.  
  27. if(isset($_POST['send'])){
  28.    
  29.         $repsonse = $_POST['response'];
  30.        
  31.         if(!isset($_GET['id'])){
  32.            
  33.         $result = ("UPDATE contact SET response ='$response' WHERE id= $row[id]");
  34.        
  35.         $rst = mysqli_query($con,$result);
  36.        
  37.        
  38.        
  39.        
  40.        
  41.    
  42.        
  43. }
  44. }
  45.  
  46. ?>
  47. <table class="table">
  48. <?php
  49. while($row = mysqli_fetch_array($users)) {
  50.    
  51. ?>
  52.  
  53.  
  54. <form id="<?php echo $row[id] ?>" method="post" name="respone" action="addresponse.php">
  55. <tr>
  56. <td> <p1> الإسم </p1> </td>
  57. <tr>
  58. <td> <?php echo $row[name] ?> </td>
  59. </tr>
  60. <tr>
  61. <td> <p1> رقم التذكرة</p1> </td>
  62. </tr>
  63. <tr>
  64. <td> <?php echo $row[ticketnumber] ?> </td>
  65. </tr>
  66. <tr>
  67. <td> <p1> الإيميل</p1> </td>
  68. </tr>
  69. <tr>
  70. <td> <?php echo $row[email] ?> </td>
  71. </tr>
  72. <tr>
  73. <td> <p1>  الموضوع </p1> </td>
  74. </tr>
  75. <tr>
  76. <td> <?php echo $row[subject] ?> </td>
  77. </tr>
  78. <tr>
  79. <td> <p1> الرد </p1> </td>
  80. </tr>
  81. <tr>
  82. <td>  <textarea name="response" rows="5" dir="rtl" class="inputresponse"> </textarea> </td>
  83. </tr>
  84. <tr>
  85. <td> <input type="submit" value="إرسال" name="send"> </td>
  86. </tr>
  87. <tr>
  88. <td>
  89. <?php
  90. }
  91.  
  92. if($rst){
  93.     echo "تم الإرسال";
  94.    
  95. } else {
  96.    
  97.     echo " لم يتم الإرسال";
  98. }
  99. ?>
  100. </form>
  101. </table>
  102. </div>
  103. </body>
  104. </html>
Add Comment
Please, Sign In to add comment