<?php
    
class attr_checkbox extends attr {
    function getDBType() {
    	return "int(1)";
    }

    function render_input() {
    	
		$html = '<input class="checkbox custom-control-input" id="chbx_' . $this->attr_name . '" type="checkbox" name="' . $this->attr_name . '" '.($this->getCurVal()?'checked':'').' value="1">';    	
		return $html;
    }
    
    function render_text( $crop = false ) {
		if ($this->getCurVal() ) $val = 'Да';
		else $val = 'Нет';
    	return $val;
    }


}

?>