<?php

CLASS rasio_form
{
	public function callForm()
	{
		$folder = dirname(__FILE__).'/form';
		$dir = opendir($folder);
		
		while($file = readdir($dir)){
			if ($file == "." or $file == "..")continue;
				$fileType = explode('.', $file);
				if(strtoupper($fileType[1]) == 'PHP' ){
					include $folder.'/'.$file;
				}
		} 	
		closedir($dir);
	}

	public function hidden($key, $data, $name, $no, $label)
	{
		$className = ucfirst($key).'_Apank_Form';
		$class = new $className;
		return $class->createForm($data, $name, $no, $label);
	}

	public function text($key, $data, $name, $no, $label)
	{
		$className = ucfirst($key).'_Apank_Form';
		$class = new $className;
		return $class->createForm($data, $name, $no, $label);
	}

	public function button($key, $data, $name, $no, $label)
	{
		$className = ucfirst($key).'_Apank_Form';
		$class = new $className;
		return $class->createForm($data, $name, $no, $label);
	}
	
	public function textarea($key, $data, $name, $no, $label)
	{
		$className = ucfirst($key).'_Apank_Form';
		$class = new $className;
		return $class->createForm($data, $name, $no, $label);
	}
	
	public function password($key, $data, $name, $no, $label)
	{
		$className = ucfirst($key).'_Apank_Form';
		$class = new $className;
		return $class->createForm($data, $name, $no, $label);
	}
}