isadminli(); @$users_page = $_GET['upage']; @$links_page = $_GET['lpage']; @$admin_links_page = $_GET['alpage']; function table_length($table_name) { global $mysqli; if ($table_name == "redirinfo") { $colname = "rurl"; } else if ($table_name == "auth") { $colname = "username"; } $result = $mysqli->query("SELECT COUNT(`{$colname}`) FROM `{$table_name}`;") or showerror(); $count = ($result->fetch_assoc()); $count = (double) $count["COUNT(`{$colname}`)"]; $pages = $count / 30; return ceil($pages); } function paginate_table($current_page = 0, $total_pages = 0, $pag_name, $sel_name) { $markup = ''; return $markup; } function user_link_table_length($current_user) { global $mysqli; $current_user = $mysqli->real_escape_string($current_user); $result = $mysqli->query("SELECT COUNT(`rurl`) FROM `redirinfo` WHERE `user` = '{$current_user}';") or showerror(); $count = ($result->fetch_assoc()); $count = (double) $count["COUNT(`rurl`)"]; $pages = $count / 30; return ceil($pages); } if (!is_array($auth->islogged())) { echo "

You must login to access this page.


Home"; require_once '../layout-footerlg.php'; die(); } else { $userinfo = $auth->islogged(); function fetchurls($lstart = 0, $limit = 30) { global $userinfo; global $mysqli; $sqr = "SELECT `baseval`,`rurl`,`date`,`lkey` FROM `redirinfo` WHERE user = '{$mysqli->real_escape_string($userinfo['username'])}' ORDER BY `rid` LIMIT {$lstart} , 30;"; $res = $mysqli->query($sqr); $links = mysqli_fetch_all($res, MYSQLI_ASSOC); $linkshtml = ''; foreach ($links as $link) { $is_secret = "False"; if (strlen($link['lkey']) > 1) { $is_secret = "True"; } $linkshtml = $linkshtml . "' . "' . "' . ""; } $linkshtml = $linkshtml . "
Link endingLong LinkDateSecret
" . $link['baseval'] . '" . substr($link['rurl'], 0, 255) . '" . $link['date'] . '" . $is_secret . "
"; return $linkshtml; } $links_total_pages = user_link_table_length($userinfo['username']); $linkshtml = false; if ($links_page && is_numeric($links_page)) { // If valid links page $links_page = intval($links_page); if ($links_page < $links_total_pages && $links_page > 0) { $ls = (30 * $links_page); $lim = 30; $linkshtml = fetchurls($ls, $lim); } } if ($linkshtml == false) { $linkshtml = fetchurls(); $links_page = 0; } $linkshtml .= paginate_table($links_page, $links_total_pages, "lpage", "links"); echo "

Polr Dashboard


"; echo ''; echo '

Welcome to '.$wsn.'\'s Polr dashboard.

'.$msges.'

Change password

Old Password: New Password:
'; if ($isadmin == true) { echo '

'; echo '

Polr Links:

' . $linksadmin . '

Polr Users

' . $usersadmin. ''; echo '

Disable a Link

'; echo ''; echo '
Disable '; echo 'Enable
'; if ($debug == 1) { '
Debug Variables:
Default IP Fetch: ' . $ip . '
X-Forwarded-For:' . @$headers['X-Forwarded-For'] . '
Forwarded-For' . @$headers['forwarded-for']; } } echo '
'; }