$contentStr .= "<script type='text/javascript'>\r\r            // listen for submit\r            \$('#form').submit(function(event) {                \r                if (hiddenclick == 1) {\r                //alert('done');\r                    return true;\r                }\r                \$('#" . $name . "').appendGrid('removeEmptyRows');\r                \r                var allData = \$('#" . $name . "').appendGrid('getAllValue');\r                \$('#hiddengrid').val(JSON.stringify(allData));\r                //alert(JSON.stringify(allData));\r                \r                event.preventDefault();\r                event.stopPropagation();\r                \r                // now click the hidden submit (FF does not submit form if an input was removed from the form :(:)\r                // http://stackoverflow.com/questions/11582981/submit-fails-after-input-is-removed-from-form-in-firefox\r                hiddenclick = 1;\r                \$('#form-foo-submit').click();                \r                return false;\r            });            \r            ";
    $contentStr .= "</script>";
    $contentStr .= '<script src="js/bootstrap-select/bootstrap-select-min.js"></script>';
    $contentStr .= '<link href="css/bootstrap-select.css" type="text/css" rel="stylesheet">';
    return $contentStr;
}
function hhGridExisting($variables)
{
    $contentStr = '';
    $contentStr .= addGrid($variables, "hhGridExisting", "3", getCurrentHHMembers(3));
    return $contentStr;
}
function hhGridNew($variables)
{
Example #2
0
function addBackground($image, $width, $height, $opaque, $noisy, $hasGrid, $hasScribble, $morph)
{
    $background = imagecreatetruecolor($width * 2, $height * 2);
    $white = imagecolorallocate($background, 255, 255, 255);
    imagefill($background, 0, 0, $white);
    if ($opaque) {
        imagefill($background, 0, 0, imagecolorallocate($background, 100, 100, 100));
    }
    if ($noisy) {
        addNoise($background, $width * 2, $height * 2);
    }
    if ($hasGrid) {
        addGrid($background, $width * 2, $height * 2);
    }
    if ($hasScribble) {
        addScribble($background, $width * 2, $height * 2);
    }
    if ($morph) {
        morphImage($background, $width * 2, $height * 2);
    }
    imagecopy($image, $background, 0, 0, 30, 30, $width, $height);
    if (!$opaque) {
        imagecolortransparent($image, $white);
    }
}