Example #1
0
						<legend><b>Action Panel</b></legend>
						<form name="submitform" method="post" action="occurattributes.php" onsubmit="return verifySubmitForm(this)" >
							<div>
								<?php 
        $controlType = 'checkbox';
        if ($traitArr['props']) {
            $propArr = json_decode($traitArr['props']);
            if (isset($propArr['controlType'])) {
                $controlType = $propArr['controlType'];
            }
        }
        $attrStateArr = $attrManager->getTraitStates($traitID);
        $attributesCoded = array();
        $attrNotes = '';
        if ($mode == 2) {
            $attributesCoded = $attrManager->getCodedAttribute($traitID, $occid);
            $attrNotes = $attributesCoded['notes'];
            unset($attributesCoded['notes']);
        }
        if ($controlType == 'checkbox') {
            foreach ($attrStateArr as $sid => $sArr) {
                echo '<div title="' . $sArr['description'] . '"><input name="stateid[]" type="checkbox" value="' . $sid . '" ' . (in_array($sid, $attributesCoded) ? 'checked' : '') . ' /> ' . $sArr['name'] . '</div>';
            }
        } elseif ($controlType == 'radio') {
            foreach ($attrStateArr as $sid => $sArr) {
                echo '<div title="' . $sArr['description'] . '"><input name="stateid[]" type="radio" value="' . $sid . '" ' . (in_array($sid, $attributesCoded) ? 'checked' : '') . ' /> ' . $sArr['name'] . '</div>';
            }
        } elseif ($controlType == 'select') {
            echo '<select name="stateid">';
            echo '<option value="">Select State</option>';
            echo '<option value="">------------------------------</option>';