403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 8.2.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/galaxynail.com/wadmin/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/galaxynail.com/wadmin/helpers/str_helper.php
<?php
function get_loaimay($str='')
{
	if($str=='den')
		return 'Trắng đen';
	elseif($str=='mau')
		return 'Màu';
	else
		return '';
}
function get_status($status){
    if($status == 1){
        return 'Chưa xác nhận';
    }else if($status == 2){
        return 'Đã xác nhận';
    }else if($status == 3){
        return 'Đang xử lý';
    }else if($status == 4){
        return 'Đã thanh toán';
    }else if($status == 5){
        return 'Đã hủy';
    }
} 
function unique_id($list)
{
	$arr = explode(',',$list);
	$arr = array_unique($arr);
	$arr = implode(",",$arr);
	return $arr;
}
/*function to_number($str)
{
	$num = (int) preg_replace('/[^0-9]/', '', $str);
	return $num ;
}*/
function to_phone($str)
{
	$num = (string) preg_replace("/(\.|,|'| )/", '', $str);
	return $num ;
}
function pricevn($price)
{
	$price = intval($price);
	if(empty($price)) return 'call' ;
	return number_format($price, 0,',',".") ;
}
/*function pricevn($price,$unit='đ')
{
	$vnd = number_format($price,0,".",",") ; 
	return $vnd.' '.$unit ;	
}*/
function str_limit($str, $n = 300)
{
	if (strlen($str) <= $n)
	{
		return $str;
	}
	
	$limit = strpos($str,' ', $n) ;
	while($limit==false&&$n>1)
	{    
		$n--;
		$limit = strpos($str,' ', $n) ;
	}
	$limit = $limit ? $limit : $n ;
	$out = substr($str, 0, $limit) ;
	return $out.' ...' ;
}

function kodau($str)
{
	$str = trim($str);
	$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
	$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
	$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
	$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
	$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
	$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
	$str = preg_replace("/(đ)/", 'd', $str);
	$str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
	$str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
	$str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
	$str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
	$str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
	$str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
	$str = preg_replace("/(Đ)/", 'D', $str);
	$str = preg_replace("/( )/", '-', $str);
	$str = preg_replace("/(\'|\"|`|&|,|\.|\?)/", '', $str);
	$str = preg_replace("/(---|--)/", '-', $str);
	
	$pattern = '/([^a-z0-9\-\._])/i';
	$str = preg_replace($pattern, '', $str);
		
	$str = strtolower($str);
	return $str;
}
function alias($str)
{
	$str = trim($str);
	$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
	$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
	$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
	$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
	$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
	$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
	$str = preg_replace("/(đ)/", 'd', $str);
	$str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
	$str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
	$str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
	$str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
	$str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
	$str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
	$str = preg_replace("/(Đ)/", 'D', $str);
	$str = preg_replace("/( )/", '-', $str);
	$str = preg_replace("/(\'|\"|`|&|,|\.|\?)/", '', $str);
	$str = preg_replace("/(--|---)/", '-', $str);
	
	$pattern = '/([^a-z0-9\-\._])/i';
	$str = preg_replace($pattern, '', $str);
	
	$str = str_replace("--","-",$str);
	$str = strtolower($str);
	return $str;
}

function truncate($text, $length, $suffix = '&hellip;', $isHTML = true)
{
    $i = 0;
    $simpleTags=array('br'=>true,'hr'=>true,'input'=>true,'image'=>true,'link'=>true,'meta'=>true);
    $tags = array();
    if($isHTML){
        preg_match_all('/<[^>]+>([^<]*)/', $text, $m, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
        foreach($m as $o){
            if($o[0][1] - $i >= $length)
                break;
            $t = substr(strtok($o[0][0], " \t\n\r\0\x0B>"), 1);
            // test if the tag is unpaired, then we mustn't save them
            if($t[0] != '/' && (!isset($simpleTags[$t])))
                $tags[] = $t;
            elseif(end($tags) == substr($t, 1))
                array_pop($tags);
            $i += $o[1][1] - $o[0][1];
        }
    }

    // output without closing tags
    $output = substr($text, 0, $length = min(strlen($text),  $length + $i));
    // closing tags
    $output2 = (count($tags = array_reverse($tags)) ? '</' . implode('></', $tags) . '>' : '');

    // Find last space or HTML tag (solving problem with last space in HTML tag eg. <span class="new">)
    $pos = (int)end(end(preg_split('/<.*>| /', $output, -1, PREG_SPLIT_OFFSET_CAPTURE)));
    // Append closing tags to output
    $output.=$output2;

    // Get everything until last space
    $one = substr($output, 0, $pos);
    // Get the rest
    $two = substr($output, $pos, (strlen($output) - $pos));
    // Extract all tags from the last bit
    preg_match_all('/<(.*?)>/s', $two, $tags);
    // Add suffix if needed
    if (strlen($text) > $length) { $one .= $suffix; }
    // Re-attach tags
    $output = $one . implode($tags[0]);

    //added to remove  unnecessary closure
    $output = str_replace('</!-->','',$output); 

    return $output;
}	

function searchBar($class=array(),$option,$url_search)
{
    $CI =& get_instance();
    $search_bar = isset($class['search_bar'])?$class['search_bar']:'search_bar';
    $key_search = isset($class['key_search'])?$class['key_search']:'key_search';
    $field_search = isset($class['field_search'])?$class['field_search']:'field_search';
    $btn_search = isset($class['btn_search'])?$class['btn_search']:'btn_search';


    $html_search  = '<div class="'.$search_bar.'">';
    $html_search .= '<input onkeyup="auto_search(\''.$url_search.'\')" onblur="auto_search(\''.$url_search.'\')" onfocus="this.value=\'\'" class="'.$key_search.'" name="key_search" id="key_search" type="text" value="'.($CI->session->userdata('key_search')?$CI->session->userdata('key_search'):'').'"/>&nbsp;';
    $html_search .= '<select class="'.$field_search.'" name="field_search" id="field_search">';
    foreach($option as $key=>$value){
        $html_search .= '<option '.($CI->session->userdata('field_search')==$key?'selected':'').' value="'.$key.'">'.$value.'</option>';
    }
    $html_search .= '</select>&nbsp;';
    //$html_search .= ' <input class="'.$btn_search.'" name="btn_search" id="btn_search" type="submit" value="Search"/>';
    $html_search .= '</div>';

    return $html_search;
}
function get_img_name($img_link)
{
	$arr = explode('/', $img_link);
	$img_name = end($arr) ;
	return $img_name;
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit