<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.8.0
 *	LISENSE: FL4HLD2A8696 - https://www.flynax.com/flynax-software-eula.html
 *	PRODUCT: Real Estate Script
 *	DOMAIN : immofil.com
 *	FILE   : RLSMARTY.CLASS.PHP
 *
 *	This script is a commercial software and any kind of using it must be
 *	coordinate with Flynax Owners Team and be agree to Flynax License Agreement
 *
 *	This block may not be removed from this file or any other files with out
 *	permission of Flynax respective owners.
 *
 *	Copyrights Flynax Classifieds Software | 2020
 *	https://www.flynax.com
 *
 ******************************************************************************/

class rlSmarty
{
    /**
     * Convert string to url path
     *
     * @param string $string - string
     **/
    public function str2path($string = false)
    {
        return $GLOBALS['rlValid']->str2path($string);
    }

    /**
     * Convert to money format
     *
     * @param string $string
     **/
    public function str2money($string = false)
    {
        $len = strlen($string);
        $string = strrev($string);

        if (false !== strpos($string, '.')) {
            $rest = substr($string, 0, strpos($string, '.'));
            $string = substr($string, strpos($string, '.') + 1, $len);
            $len -= strlen($rest) + 1;
            $rest = strrev(substr(strrev($rest), 0, 2)) . ".";
        } elseif ($GLOBALS['config']['show_cents']) {
            $rest = '00.';
        }

        for ($i = 0; $i <= $len; $i++) {
            $val .= $string[$i];
            if ((($i + 1) % 3 == 0) && ($i + 1 < $len)) {
                $val .= $GLOBALS['config']['price_delimiter'];
            }
        }
        return strrev($rest . $val);
    }

    /**
     * blank flange
     **/
    public function assign_by_ref()
    {}
    public function assign()
    {}
    public function display()
    {}
    public function fetch()
    {}
    public function register_function()
    {}
    public function get_template_vars()
    {}
    public function listingUrl()
    {}
}
