<?php
$this->load->view('includes/header.php');
?>

  <script type="text/javascript">
		
		 $(function() {
/*// Jquery auto complete
$('#txt_custname').val("");
			$('#txt_custid').val("");
			
			
            $("#txt_custid").autocomplete({
                source: "<?php//echo $this->config->item('base_url');?>/admin/admin_role/search_sap_cust/kunnr",
                minLength: 2,
                select: function(event, ui) {
                    $('#txt_custid').val(ui.item.txt_custid);
                    $('#txt_custname').val(ui.item.txt_custname);
			    }
            });
			
			
            $("#txt_custname").autocomplete({
                source: "<?php// echo $this->config->item('base_url');?>/admin/admin_role/search_sap_cust/name1",
                minLength: 2,
                select: function(event, ui) {
                    $('#txt_custid').val(ui.item.txt_custid);
                    $('#txt_custname').val(ui.item.txt_custname);
			    }
            });*/
			
				//Jquery tab
				$('#tabs').tabs();
			
			//Jquery checkbox tree
			 $(document).ready(function() {
             $('#tree1').checkboxTree();
        });	
});
		
	/*	$(document).ready(function(){            
            $("#button2").click(function(){
                
				
				 var txt_custid = $("#txt_custid").val();
                 var txt_custname = $("#txt_custname").val();
               
                
                $.ajax({
                    url : "<?php//echo base_url() ?>admin/admin_role/add_cust_auth/<?php//echo $this->uri->segment(4); ?>",
                    type: "post",
                    beforeSend: function(){
                                        $("#data").html("Loading...");
                                    },
					dataType: "json",
                    data: "txt_custid="+txt_custid+"&txt_custname="+txt_custname+"&roleid=",
					cache:false,
                    success:   function(data){
					$("#notifikasi").html(data.message).addClass(data.class);
					$("#notifikasi").fadeIn(2500); 
					$("#notifikasi").fadeOut(2500); 
					$("#data").load("<?php//echo base_url() ?>admin/admin_role/edit_role/<?php//echo $this->uri->segment(4); ?> #data");	
					$("#txt_custid").val("").focus();
					$("#txt_custname").val("");
					
					//$("#notifikasi").fadeOut(10000); 
					//$("#notifikasi").html(data.message).css({'background-color' : data.bg_color}).fadeIn('slow'); 
          			}
                });            	
            });
			

 });*/
		
/*function del_rolecust(roleid,kunnr){
			
            $().ready(function(){      
			      if(confirm("Delete customer with ID "+kunnr+" ?")){  
				                                
                $.ajax({                    
                    url : "<?php//echo base_url() ?>admin/admin_role/del_rolecust/"+roleid+"/"+kunnr,     
					beforeSend: function(){
                                        $("#data").html("Loading...");
                                    },
					dataType: "json",
					cache:false,
                    success:   function(data){
					$("#notifikasi").html(data.message).addClass(data.class);
					$("#notifikasi").fadeIn(2500); 
					$("#notifikasi").fadeOut(2500); 
					$("#data").load("<?php//echo base_url() ?>admin/admin_role/edit_role/"+roleid+" #data");	
          			} 
					           
                }); 
				 }             
            });      
				 
 }*/
</script>
<?
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
?>
<form name="form1" method="post" action="<?php echo $form_action ?>">
  <table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="10%">Role name</td>
      <td width="1%">:</td>
      <td width="89%"><label for="txt_menu"></label>
        <label for="txt_rname"></label>
      <input name="txt_rname" type="text" class="element" id="txt_rname" value="<?php echo set_value('txt_rname', isset($default['txt_rname']) ? $default['txt_rname'] : ''); ?>" size="30" maxlength="30" <?php echo isset($default['readonly_txt_rname']) ? $default['readonly_txt_rname'] : ''; ?>  /> 
        <font class="required">*</font></td>
    </tr>
    <tr>
      <td>Short description</td>
      <td>:</td>
      <td><label for="txt_rdesc"></label>        <label for="cb_pmenu">
        <input name="txt_rdesc" type="text" class="element" id="txt_rdesc" value="<?php echo set_value('txt_rdesc', isset($default['txt_rdesc']) ? $default['txt_rdesc'] : ''); ?>" size="35" maxlength="35"   />
      <font class="required">*</font></label></td>
    </tr>
  </table><br />
 <div id="tabs">
        <ul>
          <li><a href="#tabs-1">Transaction Auth</a></li>
          <li><a href="#tabs-2">Menu Auth</a></li>
    </ul>
        <div id="tabs-1">
          <p>
            <input name="chk_view" type="checkbox" id="chk_view" value="1"  <?php echo set_checkbox('chk_view', '1', isset($default['chk_view']) && $default['chk_view']=='1'  ? TRUE : FALSE ); ?> />
            View
            <input name="chk_add" type="checkbox" id="chk_add" value="1" <?php echo set_checkbox('chk_add', '1', isset($default['chk_add']) && $default['chk_add']=='1'  ? TRUE : FALSE ); ?> />
            Add
            <input name="chk_update" type="checkbox" id="chk_update" value="1" <?php echo set_checkbox('chk_update', '1', isset($default['chk_update']) && $default['chk_update']=='1'  ? TRUE : FALSE ); ?>/>
            <label for="chk_add"></label>
            Update
            <input name="chk_delete" type="checkbox" id="chk_delete" value="1" <?php echo set_checkbox('chk_delete', '1', isset($default['chk_delete']) && $default['chk_delete']=='1'  ? TRUE : FALSE ); ?> />
            Delete
            <input name="chk_app" type="checkbox" id="chk_app" value="1" <?php echo set_checkbox('chk_app', '1', isset($default['chk_app']) && $default['chk_app']=='1'  ? TRUE : FALSE ); ?> />
            Approval  <input name="chk_cancel" type="checkbox" id="chk_cancel" value="1" <?php echo set_checkbox('chk_cancel', '1', isset($default['chk_cancel']) && $default['chk_cancel']=='1'  ? TRUE : FALSE ); ?> />
            Cancel<font class="required">*</font></p>
        </div>
        <div id="tabs-2">
        <?php echo $menu ?></div>
 
  </div><br />
  <input type="submit" name="button" id="button" value="Submit" class="button" />
</form>

<?php
if ( ! empty($link))
	{
		echo '<p id="bottom_link">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>
