<html>
<head>
<link href="../../css/pop_up style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../css/jquery-ui.css" />
<link rel="stylesheet" href="../../css/jquery.autocomplete.css" type="text/css" />
<script src="../../js/jquery/jquery.js" type="text/javascript"></script>
<script src="../../js/jquery/jquery-1.8.2.js"></script>
<script src="../../js/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../../js/jquery/autocomplete_jquery_plugin.js"></script>
<script src="../../js/user_rights_ajax.js" type="text/javascript"></script>
<script src="../../js/shortcut.js"  type="text/javascript"></script>
<script>
shortcut.add("Alt+u",function() 
{
	document.getElementById("user_type").focus();
});
shortcut.add("Alt+s",function() 
{
	document.getElementById("active_status").focus();
});
/*************************************** Function For Admin*********************************************************************/
function selectAll(source) {

		checkboxes = document.getElementsByName('admin_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************************************************************************************/
function get_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}
function checkcount() 
{
	var chk=true;
	jQuery(".id_field").each(function(i,val)
			  {
				  if(!this.checked)
				  {
					  chk=false;
				  }
				  return chk;
			  });
	//document.getElementById("vehicle_type_check_boxes").value=chk;
	//alert(chk);

}
	
/************************************************************************************************************/	
	
var kot1 =[];
var quantiy_num = [];
var  answers2 = [];	
function getsepchkval()
{	
kot1=[];
	quantiy_num = [];
	jQuery(".id_field").each(function()
	{
		 quantiy_num.push(this.value);
	});
	
	jQuery(".id_field:checked").each(function()
	{
		kot1.push(this.value);
		//quantiy_num.push(this.value);
	});
}

/***************************************Function for Master*********************************************************************/
function selectmaster(source) {
		checkboxes = document.getElementsByName('master_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/****************************************Function for Master Checked********************************************************************/
function master_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}
/*************************************** Function for Inward *********************************************************************/
function selectinward(source) {
		checkboxes = document.getElementsByName('inward_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/**************************************** Function For Inward Checked********************************************************************/
function inward_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}

/*********************************** Function for process *************************************************************************/
function selectprocess(source) {
		checkboxes = document.getElementsByName('process_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************ Function for process checked************************************************************************/
function process_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}

/*********************************** Function for Sales *************************************************************************/
function selectsales(source) {
		checkboxes = document.getElementsByName('sales_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************ Function for Sales checked************************************************************************/
function sales_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}

/*********************************** Function for Accounts *************************************************************************/
function selectaccount(source) {
		checkboxes = document.getElementsByName('account_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************ Function for Accounts checked************************************************************************/
function account_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}

/*********************************** Function for settings *************************************************************************/
function selectsetting(source) {
		checkboxes = document.getElementsByName('setting_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************ Function for settings checked************************************************************************/
function setting_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}

/*********************************** Function for reports *************************************************************************/
function selectreport(source) {
		checkboxes = document.getElementsByName('report_form');
		for(var i in checkboxes)
			checkboxes[i].checked = source.checked;

	}
/************************************ Function for reports checked************************************************************************/
function report_check_value()
{
     var answers = [];
    jQuery.each(jQuery('.id_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('overall_id').value=answers;
	return false;
}


</script>
</head>
<?php
error_reporting(0);
$edit_id=$_GET['edit_id'];
include("../../include/db.php");
if($_GET['edit_id']!='')
{
$user_table_display_style='style="display:inline;"';
} 
else
{
$user_table_display_styles='style="display:none;"';
}
 $id=$_GET[edit_id];
   $sql="select * from  user_rights ";
    $rs=mysql_query($sql);
	$sno=0;
    while($rsdata=mysql_fetch_array($rs))
     {
        $sno=$sno+1;
        $user_id=$rsdata['user_id'];
  		$user_name=$rsdata['user_name'];
  		$user_screen=$rsdata['user_screen'];
		$user_form_name=$rsdata['user_form_name'];
	}
?>

<style type="text/css">
.txt{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size:13px;}

.style2 {color: #FF0000}
.style7{font-family: Tahoma, Arial, Helvetica, sans-serif;font-size: 13px;}
.headings{ font-family:verdana; font-size:10px;}
</style>
<body style="margin:0px;" bgcolor="#f7f7f7">
    <table width="100%">
  <tr>
    <td colspan="6" class="heading" ><span class="h_title" style="margin-bottom:10px;"><strong>User Permission</strong></span></td>
  </tr>
   
  <tr>

  <td width="19" height="30" align="left" class="txt">&nbsp;</td>
  
  <td width="176" align="left" class="txt">User Name<span class="style2">*</span></td>
  <td colspan="3" class="field"><select name="user_name" id="user_name" tabindex="4"   onchange="user_right_clear_validate(this.value)"  style="width:200px; height:30px; border:1px solid #a1a1a1;">
    <?php
			  $sql="select * from user_type ORDER BY user_type_id ASC";
			  $rs=mysql_query($sql);
			  $rscount=mysql_num_rows($rs);
			  if($rscount!=0)
			  {
			  while($rsdata=mysql_fetch_object($rs))
			  {
			  ?>
    <option value="<?php echo $rsdata->user_type;?>"><?php echo $rsdata->user_type;?></option>
    <?php  }} ?>
  </select>
  <div  id="user_name_err_design" style="color:#FF0000;" ></div></td>
  </tr>
    <tr>
    <td colspan="6" align="right" class="txt">ALL&nbsp;&nbsp;
      <input type="checkbox" name="user_forms" id="user_forms" onClick="selectAll(this);get_check_value();selectinward(this);inward_check_value();selectmaster(this);master_check_value();selectprocess(this);process_check_value();selectsales(this);sales_check_value();selectaccount(this);account_check_value();selectsetting(this);setting_check_value();selectreport(this);report_check_value();"/></td>
  </tr>
        <tr>  
    <td align="left" class="style7">&nbsp;&nbsp;<span class="txt">&nbsp;&nbsp;</span></td>
        <td align="left" class="style7"><span class="txt" style="color:#CC3399">ADMIN
            <input type="checkbox" name="admin_form" id="admin_form"  onclick="selectAll(this);get_check_value();getsepchkval();checkcount();" class="id_field"/>
        </span></td>
        <td align="left" class="style7">&nbsp;</td>
        </tr>
        <tr>
          <td height="32" align="left" class="style7">&nbsp;</td>
        <td align="left" class="style7 txt"><input type="checkbox" name="account_yr" id="account_yr" class="id_field" onClick="get_check_value();checkcount();"/>Account Year</td>
        <td width="820" align="left" class="style7 txt"><input type="checkbox" name="user_type" id="user_type" />User Type</td>
          <td width="276" align="left" class="style7">&nbsp;</td>
        </tr><input type="text" name="overall_id" id="overall_id"  size="25" style="height:22px;">
        <tr>
          <td height="110"  colspan="8" align="left" class="style7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="2%" height="23">&nbsp;</td>
              <td width="98%" colspan="6" class="txt" style="color:#CC3399">MASTER CREATION<input type="checkbox" name="master_form" id="master_form"  onclick="selectmaster(this);master_check_value();"/></td>
            </tr>
            <tr>
              <td height="28">&nbsp;</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form"  /> Soaking Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Boiling Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Drying Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Hulling Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Polishing Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Bin Entry</td>
            </tr>
            <tr>
              <td height="28">&nbsp;</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Group Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Ledger Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" /> UOM</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" /> Alternative UOM</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Manufacture Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Godown &amp; Branch</td>
            </tr>
            <tr>
              <td height="26">&nbsp;</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Category Master</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Item Group Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Item Creation</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" />Item Rate Fixing</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" /> Taste Factor</td>
              <td class="txt"><input type="checkbox" name="master_form" id="master_form" /> Reason Entry</td>
            </tr>
            <tr>
              <td height="21" colspan="7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="2%" height="30">&nbsp;</td>
                  <td width="98%" colspan="6" class="txt" style="color:#CC3399">INWARD MODULE<input type="checkbox" name="inward_form" id="inward_form"  onclick="selectinward(this);inward_check_value();"/></td>
                </tr>
                <tr>
              <td height="30">&nbsp;</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Pre Sample Entry</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Paddy Purchase Order</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Paddy Purchase Entry</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Paddy Purchase Sample</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Purchase Return</td>
              <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Rice Purchase Order</td>
                </tr>
                <tr>
                  <td height="31">&nbsp;</td>
                  <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  />Rice Purchase Entry</td>
                  <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  />Rice Purchase Sample</td>
                  <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  />Inward List</td>
                  <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  />Batch Moving List</td>
                  <td class="txt"><input type="checkbox" name="inward_form" id="inward_form"  /> Rice Transfer</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="125" colspan="7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="2%" height="34">&nbsp;</td>
                      <td colspan="6"><span class="txt" style="color:#CC3399">PROCESS MODULE
                          <input type="checkbox" name="process_form" id="process_form"  onclick="selectprocess(this);process_check_value();"/>
                      </span></td>
                    </tr>
                    <tr>
                      <td height="31">&nbsp;</td>
                      <td width="15%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Request For Lot
                      </td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  /> 
                        Lot Conversion
</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Lot Sample Verification
                      </td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
Process Schedule Lot</td>
                      <td width="13%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Cleaning Entry</td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Bin No Stock(Paddy)
                      </td>
                    </tr>
                    <tr>
                      <td height="29">&nbsp;</td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Soaking Creation
                      </td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Boiling Creation</td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Drying Creation</td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
Process Hulling</td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
Process Polishing</td>
                      <td class="txt"> 
                        <input type="checkbox" name="process_form" id="process_form"  />
Packing Entry</td>
                    </tr>
                    <tr>
                      <td height="27">&nbsp;</td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Item Consumption
                      </td>
                      <td class="txt">
                        <input type="checkbox" name="process_form" id="process_form"  />
                        Item Transfer</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="27" colspan="7"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                      <td width="2%" height="34">&nbsp;</td>
                      <td colspan="6"><span class="txt" style="color:#CC3399">SALES
                          <input type="checkbox" name="sales_form" id="sales_form"  onclick="selectsales(this);sales_check_value();"/>
                      </span></td>
                    </tr>
                    <tr>
                      <td height="31">&nbsp;</td>
                      <td width="15%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Enquiry</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  /> 
                        Follow ups
</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Sales Order
                      </td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Whole Sale</td>
                      <td width="13%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Counter Sale</td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Feedback Followup</td>
                    </tr>
                    <tr>
                      <td height="29">&nbsp;</td>
                      <td class="txt">
                        <input type="checkbox" name="sales_form" id="sales_form"  />
                        Brand Name Stock
                      </td>
                      <td class="txt">&nbsp;</td>
                      <td class="txt">&nbsp;</td>
                      <td class="txt">&nbsp;</td>
                      <td class="txt">&nbsp;</td>
                      <td class="txt">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="29" colspan="7"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                      <td width="2%" height="34">&nbsp;</td>
                      <td colspan="6"><span class="txt" style="color:#CC3399">ACCOUNTS
                          <input type="checkbox" name="account_form" id="account_form"  onclick="selectaccount(this);account_check_value();"/>
                      </span></td>
                    </tr>
                    <tr>
                      <td height="31">&nbsp;</td>
                      <td width="15%" class="txt">
                        <input type="checkbox" name="account_form" id="account_form"  />
                        Payment Voucher</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="account_form" id="account_form"  />
                        Receipt Voucher</td>
                      <td width="17%" class="txt">&nbsp;</td>
                      <td width="18%" class="txt">&nbsp;</td>
                      <td width="13%" class="txt">&nbsp;</td>
                      <td width="18%" class="txt">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="31" colspan="7"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                      <td width="2%" height="34">&nbsp;</td>
                      <td colspan="6"><span class="txt" style="color:#CC3399">SETTINGS
                          <input type="checkbox" name="setting_form" id="setting_form"  onclick="selectsetting(this);setting_check_value();"/>
                      </span></td>
                    </tr>
                    <tr>
                      <td height="31">&nbsp;</td>
                      <td width="15%" class="txt">
                        <input type="checkbox" name="setting_form" id="setting_form"  />
                        Sales Settings</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="setting_form" id="setting_form"  />
                        Favourite Settings</td>
                      <td width="17%" class="txt">&nbsp;</td>
                      <td width="18%" class="txt">&nbsp;</td>
                      <td width="13%" class="txt">&nbsp;</td>
                      <td width="18%" class="txt">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="31" colspan="7"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                      <td width="2%" height="34">&nbsp;</td>
                      <td colspan="6"><span class="txt" style="color:#CC3399">REPORT
                          <input type="checkbox" name="report_form" id="report_form"  onclick="selectreport(this);report_check_value();"/>
                      </span></td>
                    </tr>
                    <tr>
                      <td height="31">&nbsp;</td>
                      <td width="15%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 1
                      </td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 2</td>
                      <td width="17%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 3</td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 4</td>
                      <td width="13%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 5</td>
                      <td width="18%" class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 6</td>
                    </tr>
                    <tr>
                      <td height="29">&nbsp;</td>
                      <td class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 7</td>
                      <td class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 8</td>
                      <td class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 9</td>
                      <td class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 10</td>
                      <td class="txt">
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 11</td>
                      <td class="txt"> 
                        <input type="checkbox" name="report_form" id="report_form"  />
                        Report 12</td>
                    </tr>
                    <tr>
                      </table></td>
                      </tr>
                      </table></td>
                      </tr>
                      </table></td>
                      </tr>
                    
                      </table></td>
                    </tr>
                  </table></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
</table>

</body>
</html>