forked from kevinowino869/mitrobill
getting ready for customizeable dashboard with widget
This commit is contained in:
@ -19,6 +19,7 @@ class Paginator
|
||||
$url .= '&' . http_build_query($search);
|
||||
}
|
||||
$url .= $append_url.'&p=';
|
||||
$url = Text::fixUrl($url);
|
||||
$totalReq = $query->count();
|
||||
$lastpage = ceil($totalReq / $per_page);
|
||||
$lpm1 = $lastpage - 1;
|
||||
|
@ -132,6 +132,14 @@ class Text
|
||||
}
|
||||
}
|
||||
|
||||
public static function fixUrl($url){
|
||||
//if url dont have ? then add it with replace first & to ?
|
||||
if(strpos($url, '?') === false && strpos($url, '&')!== false){
|
||||
return substr($url, 0, strpos($url, '&')). '?'. substr($url, strpos($url, '&')+1);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
// this will return & or ?
|
||||
public static function isQA(){
|
||||
global $config;
|
||||
|
50
system/autoload/Widget.php
Normal file
50
system/autoload/Widget.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
* by https://t.me/ibnux
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Validator class
|
||||
*/
|
||||
class Widget
|
||||
{
|
||||
|
||||
public static function rows($rows, $result){
|
||||
$result .= '<div class="row">';
|
||||
foreach($rows as $row){
|
||||
|
||||
}
|
||||
$result .= '</div>';
|
||||
}
|
||||
|
||||
public static function columns($cols, $result){
|
||||
$c = count($cols);
|
||||
switch($c){
|
||||
case 1:
|
||||
$result .= '<div class="col-md-12">';
|
||||
break;
|
||||
case 2:
|
||||
$result .= '<div class="col-md-6">';
|
||||
break;
|
||||
case 3:
|
||||
$result .= '<div class="col-md-4">';
|
||||
break;
|
||||
case 4:
|
||||
$result .= '<div class="col-md-4">';
|
||||
break;
|
||||
case 5:
|
||||
$result .= '<div class="col-md-4">';
|
||||
break;
|
||||
default:
|
||||
$result .= '<div class="col-md-1">';
|
||||
break;
|
||||
}
|
||||
|
||||
foreach($cols as $col){
|
||||
}
|
||||
$result .= '</div>';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user