<?php
require_once (dirname(__FILE__) ."/vision_constant.php");
$urlParse = parse_url($_SERVER['REQUEST_URI']);//parse url

if($urlParse['query'] == '' && empty($_REQUEST))
{
	$_REQUEST['vis_module']= $module ="selfhelp";
	$_REQUEST['vis_operation']= $operation = "view_selfhelp_group";
	$_REQUEST["vis_title"]='knowledgebase';
	$_REQUEST['vis_parent_id'] = VIS_SELFHELP_KNOWLEDGEBASE;
	$_REQUEST['vis_action'] = '/'.$_REQUEST['vis_module'].'/'.$_REQUEST['vis_operation'].'/'.$_REQUEST["vis_title"].'/'.$_REQUEST['vis_parent_id'];
}
else if(!empty($urlParse['query']) && empty($_REQUEST))
{
	$urlVariables =  explode('/',$urlParse['query']);
	$module = $urlVariables[1];
	if($urlVariables[2] == 'view-article') $operation ='view_article';
	if($urlVariables[2] == 'set-rating') $operation ='set_rating';
	$_REQUEST["vis_title"]=$urlVariables[3];
	$_REQUEST['vis_parent_id'] = $urlVariables[4];
	$_REQUEST['rate_ticket'] = '/'.$urlVariables[5];
	$title= '/'.$_REQUEST["vis_title"];
	$_REQUEST['vis_action'] = '/'.$module.'/'.$operation.'/'.$_REQUEST["vis_title"].'/'.$_REQUEST['vis_parent_id'].$_REQUEST['rate_ticket'];
}
else 
{
	$module = 	$_REQUEST["vis_module"] ;
	$operation = $_REQUEST["vis_operation"];
	$_REQUEST['vis_action'] = '/'.$_REQUEST['vis_module'].'/'.$_REQUEST['vis_operation'];
}
$_REQUEST["vis_module"]=$module; $_GET["vis_module"]=$module; $_POST["vis_module"]=$module;
$_REQUEST["vis_operation"]=$operation; $_GET["vis_operation"]=$operation; $_POST["vis_operation"]=$operation;
$request_data = $_REQUEST;

global $request_data ;
ob_start();

require_once (dirname(__FILE__) ."/integrate.php");
$_ticketdetails = ob_get_contents();
ob_end_clean();

$smarty->assign('vis_default_data', $_ticketdetails);

$templatefile="default";
?>
