<?php

class Checkbox_Apank_Form
{
	protected $ext = 'checkbox';
	
	public function createForm($data, $name)
	{
		$input = "<input type='".$this->ext."' id='$name'";
		foreach($data as $key => $row){
			$input.= " $key='$row'";
		}
		
		$input.= " class='".$this->ext."' > <div id='errorApank$name' class='errorApankform'></div>";
	
		return $input;
	}
	
	public function addChecked($form, $param, $val)
	{
		if($val == true){
			$form = str_ireplace('>', '', $form);
			$form = $form.' checked>';
		}
		
		return $form;
	}
}