Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($cmd == ""){
- $table_name = "";
- $sql="";
- if($option == "links") {
- $table_name = "short_linker";
- $sql = "SELECT * FROM $table_name $WHR";
- }
- else if($option == "users") {
- $table_name = "short_linker_users";
- $sql = "SELECT * FROM $table_name";
- }
- // echo $WHR;
- //exit;
- $result = mysqli_query($conn, $sql);
- $is_result = mysqli_num_rows($result);
- if($is_result == 0) { ?>
- <h2 style="margin: 50px;">No data found.</h2>
- <?php
- } else{
- ?>
- <table class="table" id="notstats" style="color: white;">
- <thead class="thead-dark">
- <tr>
- <?php
- if($option == "links"){ ?>
- <th scope="col">#</th>
- <th scope="col">Prefix</th>
- <th scope="col">Domain</th>
- <th scope="col">Suffix</th>
- <th scope="col">URL</th>
- <th scope="col">Operations</th>
- <?php }
- else if($option == "users"){ ?>
- <th scope="col">#</th>
- <th scope="col">Name</th>
- <th scope="col">Username</th>
- <th scope="col">Email</th>
- <th scope="col">Phone</th>
- <th scope="col">Last login</th>
- <th scope="col">Operations</th>
- <?php
- }
- ?>
- </tr>
- </thead>
- <tbody id="tb_body">
- <?php
- $count = 1;
- while($row = mysqli_fetch_assoc($result)){ ?>
- <tr>
- <td><b><?php echo $count; ?></b></td>
- <?php
- if($table_name == "short_linker_users"){
- echo "<td>$row[name]</td>";
- }
- ?>
- <td>
- <?php
- if($table_name == "short_linker") echo $row['prefix'];
- else if($table_name == "short_linker_users") echo $row['username'];
- ?>
- </td>
- <?php
- if($table_name == "short_linker"){
- $temp = $row['domain_id'];
- echo "<td>$all_domains[$temp]</td>";
- }
- ?>
- <td>
- <?php
- if($table_name == "short_linker") echo $row['suffix'];
- else if($table_name == "short_linker_users") echo $row['email'];
- ?>
- </td>
- <?php
- if($table_name == "short_linker_users"){
- echo "<td>$row[phone]</td>";
- } ?>
- <td>
- <?php
- if($table_name == "short_linker") { ?>
- <a href="<?php echo $row[url]; ?>"><?php echo $row['url']; ?> </a>
- <?php
- } else if($table_name == "short_linker_users") {
- echo $row['last_login_date'];
- }
- ?>
- </td>
- <td>
- <!-- <a href="<?php echo "$_SERVER[PHP_SELF]?cmd=delconfirm&ID=$row[ID]&option=$option"; ?>"> -->
- <a href="" class="operation-delete" id="<?php echo $row['ID']; ?>">
- <i class="fa fa-trash operations-icons"></i>
- </a>
- <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>
- <?php if($option == "links"){
- echo "<a href=\"statistics.php?ID=$row[ID]\"><i class=\"far fa-chart-bar operations-icons\"></i></a>";
- }
- ?>
- </td>
- </tr>
- <?php
- $count++;
- }
- ?>
- </tbody>
- </table>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement