<html>
    <head>
        <title>Add Category</title>
    <head>
        <script type="text/javascript">
            function validateCategory()
            {
                if(trim(document.getElementById("var_name").value)=="")
                {
                    alert("Please enter group name.")
                    document.getElementById("var_name").focus();
                    return false;
                }
                else
                {
                    insertgroup();
                }
            }

            function insertgroup()
            {
                var postdata;
                postdata=$("#quickadd").serialize();
                $.ajax({
                    type:"POST",
                    url:"index.php?module=accesscontrol&action=insertgroupquick&ajax=Y",
                    data:postdata,
                    async:false,
                    success: function(data){

                        if(data==0)
                        {
                            alert("Error in inserting group.");
                            return false;
                        }
                        else
                        {
                            document.getElementById("usercombo").innerHTML=data;
                        }
                    }
                });
                $('#dialog-modal').dialog('close');
            }
        </script>
    </head>
    <body>
        <input type="hidden" name="totaldrp" id="totaldrp" value="<?= $total ?>" />
        <div class="clear"></div><br/>
        <div class="grid-list-inner-table-text">
            <form name="quickadd" id="quickadd" action='Javascript:;' method="post" >
                <input type="hidden" id="eid" name="eid" value="<?php echo $_REQUEST['eid']; ?>">
                <input type="hidden" name="hid_var_alias" id="hid_var_alias" value="">
                <table width="100%" border="0" cellspacing="4" cellpadding="0">
                    <tr>
                        <td valign="middle" align="left">Group Name : <span>(required)</span></td>
                        <td  valign="middle" align="left"><input type="text" style="width:320px;" class="add-new-user-textarea" id="var_name" name="var_name" /></td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">&nbsp;</td>
                        <td>
                            <br/>
                            <input type="image" onMouseOut="this.src='<?= GLOBAL_ADMIN_IMAGES_PATH ?>submit-button-blue.gif'" onMouseOver="this.src='<?= GLOBAL_ADMIN_IMAGES_PATH ?>submit-button-blue-hover.gif'" alt="Submit" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>submit-button-blue.gif" value="Submit" name="Submit" onClick="return validateCategory();">
                            <a href="javascript:" onclick= $('#dialog-modal').dialog('close');>
                                <img onMouseOut="this.src='<?= GLOBAL_ADMIN_IMAGES_PATH ?>cancel-button.jpg'" onMouseOver="this.src='<?= GLOBAL_ADMIN_IMAGES_PATH ?>cancel-button-hover.jpg'" alt="Cancel" src="<?= GLOBAL_ADMIN_IMAGES_PATH ?>cancel-button.jpg" value="Cancel" name="Cancel" />
                            </a>
                        </td>
                    </tr>
                </table>
            </form>
            <div style="height:15px; width:100%;"></div>
        </div>
    </body>
</html>