<?php

class Textarea_Apank_Form
{
	protected $ext = 'textarea';
	
	public function createForm($data, $name, $no, $label)
	{
		$input = "<textarea type='".$this->ext."' id='$name'";
		foreach($data as $key => $row){
			$input.= " $key='$row'";
		}
		
		$input.= " class='".$this->ext." urut_$no' no='$no' label='$label'></textarea> <div id='errorApank$name' class='errorApankform'></div>";
	
		return $input;
	}
	
	public function addVal($form, $param){
		$ex = explode('><', $form);

		$form = $ex[0].'>';
		
		$form.= $param;
		
		for($i = count($ex) - 2; $i < count($ex); $i++){
			
			if($i == count($ex) - 2){
				$form.= '<';
			}else{
				$form.= '><';
			}
			
			$form.= $ex[$i];
		}
		
		return $form;
	}
}