Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. if($cmd == ""){
  2. $table_name = "";
  3. $sql="";
  4. if($option == "links") {
  5. $table_name = "short_linker";
  6. $sql = "SELECT * FROM $table_name $WHR";
  7. }
  8. else if($option == "users") {
  9. $table_name = "short_linker_users";
  10. $sql = "SELECT * FROM $table_name";
  11. }
  12. // echo $WHR;
  13. //exit;
  14. $result = mysqli_query($conn, $sql);
  15. $is_result = mysqli_num_rows($result);
  16. if($is_result == 0) { ?>
  17. <h2 style="margin: 50px;">No data found.</h2>
  18. <?php
  19. } else{
  20. ?>
  21.  
  22. <table class="table" id="notstats" style="color: white;">
  23. <thead class="thead-dark">
  24. <tr>
  25. <?php
  26. if($option == "links"){ ?>
  27. <th scope="col">#</th>
  28. <th scope="col">Prefix</th>
  29. <th scope="col">Domain</th>
  30. <th scope="col">Suffix</th>
  31. <th scope="col">URL</th>
  32. <th scope="col">Operations</th>
  33. <?php }
  34. else if($option == "users"){ ?>
  35. <th scope="col">#</th>
  36. <th scope="col">Name</th>
  37. <th scope="col">Username</th>
  38. <th scope="col">Email</th>
  39. <th scope="col">Phone</th>
  40. <th scope="col">Last login</th>
  41. <th scope="col">Operations</th>
  42. <?php
  43. }
  44. ?>
  45. </tr>
  46. </thead>
  47. <tbody id="tb_body">
  48. <?php
  49. $count = 1;
  50.  
  51. while($row = mysqli_fetch_assoc($result)){ ?>
  52. <tr>
  53. <td><b><?php echo $count; ?></b></td>
  54. <?php
  55. if($table_name == "short_linker_users"){
  56. echo "<td>$row[name]</td>";
  57. }
  58. ?>
  59. <td>
  60. <?php
  61. if($table_name == "short_linker") echo $row['prefix'];
  62. else if($table_name == "short_linker_users") echo $row['username'];
  63. ?>
  64. </td>
  65. <?php
  66. if($table_name == "short_linker"){
  67. $temp = $row['domain_id'];
  68. echo "<td>$all_domains[$temp]</td>";
  69. }
  70. ?>
  71. <td>
  72. <?php
  73. if($table_name == "short_linker") echo $row['suffix'];
  74. else if($table_name == "short_linker_users") echo $row['email'];
  75. ?>
  76. </td>
  77. <?php
  78. if($table_name == "short_linker_users"){
  79. echo "<td>$row[phone]</td>";
  80. } ?>
  81. <td>
  82. <?php
  83. if($table_name == "short_linker") { ?>
  84. <a href="<?php echo $row[url]; ?>"><?php echo $row['url']; ?> </a>
  85. <?php
  86. } else if($table_name == "short_linker_users") {
  87. echo $row['last_login_date'];
  88. }
  89. ?>
  90. </td>
  91.  
  92. <td>
  93. <!-- <a href="<?php echo "$_SERVER[PHP_SELF]?cmd=delconfirm&ID=$row[ID]&option=$option"; ?>"> -->
  94. <a href="" class="operation-delete" id="<?php echo $row['ID']; ?>">
  95. <i class="fa fa-trash operations-icons"></i>
  96. </a>
  97. <a href="<?php echo $_SERVER[PHP_SELF]."?cmd=form&ID=$row[ID]&option=$option"; ?>" id="edit" data-id="<?php echo $row['ID'];?>"><i class="far fa-edit operations-icons"></i></a>
  98. <?php if($option == "links"){
  99. echo "<a href=\"statistics.php?ID=$row[ID]\"><i class=\"far fa-chart-bar operations-icons\"></i></a>";
  100. }
  101. ?>
  102. </td>
  103. </tr>
  104.  
  105. <?php
  106. $count++;
  107. }
  108. ?>
  109. </tbody>
  110. </table>
  111. <?php
  112. }
  113. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement