homepage.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. if (isset($_POST['confirm']) && !empty($_POST['msgid'])) {
  3. $error = $cnfrmSuccess = '';
  4. $pollCnfrm = $SWITCHEPP->WgsSwitchEppAckConfirm($_POST['msgid']);
  5. if ($pollCnfrm['status'] == 'error')
  6. $error = $pollCnfrm['msg'];
  7. elseif ($pollCnfrm['status'] == 'success')
  8. $cnfrmSuccess = $pollCnfrm['msg'];
  9. } elseif (isset($_POST['confirm']) && empty($_POST['msgid']))
  10. $error = 'msgId is missing!';
  11. if (isset($_POST['getpoll']) && !empty($_POST['getpoll'])) {
  12. $error = $success = '';
  13. $pollList = $SWITCHEPP->WgsSwitchEppGetPoll();
  14. if ($pollList['status'] == 'error')
  15. $error = $pollList['msg'];
  16. elseif ($pollList['status'] == 'success')
  17. $success = $pollList['msg'];
  18. if (!empty($success)) {
  19. $pollArr = simplexml_load_string($pollList['resp']);
  20. $msgid = $pollList['msgid'];
  21. $domainName = $pollArr->response->resData->children("domain", true)->trnData->name;
  22. $status = $pollArr->response->resData->children("domain", true)->trnData->trStatus;
  23. $reDate = substr($pollArr->response->resData->children("domain", true)->trnData->reDate, 0, 10);
  24. $pollMsg = $pollArr->response->msgQ->msg;
  25. }
  26. }
  27. include 'header.php';
  28. ?>
  29. <div class="poll_cont">
  30. <form method="post" action="">
  31. <input type="submit" name="getpoll" value="Get Poll">
  32. </form>
  33. <?php
  34. if (!empty($error))
  35. echo '<div class="pollerror">' . $error . '</div>';
  36. elseif (!empty($cnfrmSuccess))
  37. echo '<div class="pollsuccess">' . $cnfrmSuccess . '</div>';
  38. elseif (!empty($success)) {
  39. echo '<div class="pollsuccess">' . $success . '</div>';
  40. ?>
  41. <form action="" method="post">
  42. <input type="hidden" name="msgid" value="<?php echo $msgid ?>">
  43. <table class="datatable" style="width: 100%;">
  44. <thead>
  45. <th>Domain Name</th>
  46. <th>Status</th>
  47. <th>Msg</th>
  48. <th>Reg. Date</th>
  49. <th>Action</th>
  50. </thead>
  51. <tbody>
  52. <?php if (!empty($msgid)) { ?>
  53. <td><?php echo $domainName; ?></td>
  54. <td><?php echo $status; ?></td>
  55. <td><?php echo $pollMsg; ?></td>
  56. <td><?php echo $reDate; ?></td>
  57. <td><input type="submit" name="confirm" value="Confirm"></td>
  58. <?php } else { ?>
  59. <td colspan="100%">No messages</td>
  60. <?php } ?>
  61. </tbody>
  62. </table>
  63. </form>
  64. <?php } ?>
  65. </div>
  66. <style>
  67. .poll_cont {
  68. text-align: center;
  69. }
  70. .poll_cont input[type="submit"] {
  71. background: green;
  72. border: 1px solid green;
  73. color: #fff;
  74. padding: 8px 20px;
  75. }
  76. .pollsuccess {
  77. background: #cbf39f;
  78. margin: 10px;
  79. padding: 10px;
  80. color: #406f0b;
  81. }
  82. .pollerror {
  83. background: #f5d2d2;
  84. margin: 10px;
  85. padding: 10px;
  86. color: #bb1313;
  87. }
  88. </style>