<?php
/**
 * @author chayn1k [3DaVinci]
 */

$NETCAT_FOLDER = join( strstr(__FILE__, "/") ? "/" : "\\", array_slice( preg_split("/[\/\\\]+/", __FILE__), 0, -5 ) ).( strstr(__FILE__, "/") ? "/" : "\\" );
include_once ($NETCAT_FOLDER."vars.inc.php");
require_once ($ROOT_FOLDER."connect_io.php");

$nc_core->modules->load_env();

Authorize();
if ( !is_object($perm) || !$perm->isSupervisor()) die("");


$result_arr = array ();
$radio +=  0;

switch ( $tname ){
	case 'pay_button_alternate' :
		$res = true;
		$ttext = $dv_imoney->TMPL->templates["pay_button"];
		break;
	case 'pay_form_alternate' :
		$res = true;
		$ttext = $dv_imoney->TMPL->templates["pay_form"];
		break;

	default :
		$res = false;
		break;
};

$result_arr["res"] = $res;

if ($res) {
	$result_arr["ident"] = $tname;
	$result_arr["ttext"] = preg_replace('/(\$)/m','\\\$',$ttext);
}

$result = json_encode($result_arr);

ob_end_clean();
echo $result;


