var type_page = 0;
var type_color = 0;
var id_type_page = 0;
var id_emp = 0;
var type_mony = 0;
var type_login = 0;
var emp_acc = [];
var username = "";
var password = "";
var page_key = 0;
var nav_1 = 0;
var nav_2 = 0;
var nav_3 = 0;
var nav_4 = 0;
var nav_5 = 0;
var cus_c = 0;
var color_page= 0;



$(document).ready(function () {
	get_page();
	if(type_login == 0)
	{
		$('#login_emp').modal('show');
		$('.wrapper').hide();
		$('#username_login').focus();
	}
	setTimeout( function(){
        $('#slider').css("background-color", "rgb(52, 58, 64)");
    },500);

	
});
document.addEventListener("keydown", function(event) {
	var x = event.which;
  	if(x == 17) 
	{
		if(nav_5 == 1)
		{
			if(page_key == 17)
			{
				$("#parcode").focus();
			}else{
				pos()
				page_key = 17;	
			}
		}
	}
  	if(x == 16) 
	{
		if(nav_4 == 1)
		{
			if(page_key == 16)
			{
				if(type_login != 0)
				{				
					open_cus()
				}
			}else{
				cus()
				
				page_key = 16;	
			}
		}
	}
	if(type_login == 1)
	{
		if(x == 37)
		{
			if(nav_2 == 0)
			{
				toggle_slider();
			}
		}
		if(x == 39)
		{
			if(nav_2 == 0)
			{
				toggle_slider();
			}
		}
		if(x == 38)
		{
			if(nav_1 == 0)
			{
				$('#nav2').fadeToggle()
			}
		}
		if(x == 40)
		{
			if(nav_1 == 0)
			{
				$('#nav2').fadeToggle()
			}
		}
		if(x == 48 || x == 96)
		{
			//page_index()
		}
		if(x == 110)
		{
			if(nav_3 == 1)
			{
				if(type_color == 0)
				{
					save_mode_sys(1)
				}else{
					save_mode_sys(0)
				}				
			}
		}
	}
})

/* window.onbeforeunload = function (e) {
    // Cancel the event
    e.preventDefault();

    // Chrome requires returnValue to be set
    e.returnValue = 'Really want to quit the game?';
};

//Prevent Ctrl+S (and Ctrl+W for old browsers and Edge)
document.onkeydown = function (e) {
    e = e || window.event;//Get event

    if (!e.ctrlKey) return;

    var code = e.which || e.keyCode;//Get key code

    switch (code) {
        case 83://Block Ctrl+S
        case 87://Block Ctrl+W -- Not work in Chrome and new Firefox
            e.preventDefault();
            e.stopPropagation();
            break;
    }
};
$(document).ready(function(){
    $(document).on("contextmenu",function(e){
        if(e.target.nodeName != "INPUT" && e.target.nodeName != "TEXTAREA")
             e.preventDefault();
             alert("not work from this site");
     });
 });

document.onkeydown = function(e) {
        if (e.ctrlKey && 
            (e.keyCode === 67 || 
             e.keyCode === 86 || 
             e.keyCode === 85 || 
             e.keyCode === 117)) {
                 alert("not work from this site");
            return false;
        } else {
            return true;
        }
};
$(document).keypress("u",function(e) {
  if(e.ctrlKey)
  {
return false;
alert("not work from this site");
}
else
{
return true;
}
}); */
function login()
{
	username = $('#username_login').val();
	password = $('#password_login').val();
	var txt = "select * from `emp` where `username` = '"+username+"' and `password` = '"+password+"' and `login_emp` = '1' and `active_emp` = '0'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:2},
		success:function(data)
		{
			if(data.num == 0)
			{
				id_emp = 0;
				emp_acc = [];
				$('#username_login').val('');
				$('#password_login').val('');
				sweetAlert("كلمة السر او اسم المستخدم غير صحيح","","error");
				push_emp_login("insert into `login_emp` (`id_emp`,`user`,`pass`,`date`) values('"+id_emp+"','"+username+"','"+password+"','"+date_today+"')");
			}else{
				active();
				
				$('.wrapper').show();
				$('#login_emp').modal('hide');
				var txt = "select * from `emp` where `username` = '"+username+"' and `password` = '"+password+"' and `login_emp` = '1' and `active_emp` = '0'";
				$.ajax({
					url:"model/class/class.php",
					type:"POST",
					dataType:"JSON",
					data:{txt:txt,type:1},
					success:function(data)
					{
						id_emp = data[0].id_emp;
						emp_acc[0] = data[0].c_1;
						emp_acc[1] = data[0].c_1;
						emp_acc[2] = data[0].c_2;
						emp_acc[3] = data[0].c_3;
						emp_acc[4] = data[0].c_4;
						emp_acc[5] = data[0].c_5;
						emp_acc[6] = data[0].c_6;
						emp_acc[7] = data[0].c_7;
						emp_acc[8] = data[0].c_8;
						emp_acc[9] = data[0].c_9;
						emp_acc[10] = data[0].c_10;
						emp_acc[11] = data[0].c_11;
						emp_acc[12] = data[0].c_12;
						emp_acc[13] = data[0].c_13;
						emp_acc[14] = data[0].c_14;
						emp_acc[15] = data[0].c_15;
						emp_acc[16] = data[0].c_16;
						emp_acc[17] = data[0].c_17;
						emp_acc[18] = data[0].c_18;
						emp_acc[19] = data[0].c_19;
						emp_acc[20] = data[0].c_20;
						emp_acc[21] = data[0].c_21;
						emp_acc[22] = data[0].c_22;
						color_page = data[0].color_emp;

						if(data[0].c_22 == 0){
							$('.emp_cc_22').hide()
						}
						page_index();
						$('.nav-treeview').css('display','none')
						push_emp_login("insert into `login_emp` (`id_emp`,`user`,`pass`,`date`) values('"+id_emp+"','"+username+"','"+password+"','"+date_today+"')");
						push_acc();
						type_login = 1;
						//c_img('./assets/img/b.png')
					}
				})
			}
		}
	})
	//push_acc();
}
function page_index()
{
	$('#pg_body').html('');
	var txt = `

	<div class="card-body">
	<div class="row col-12">
  
  
  
  <div class="col-12" style="height:25px">
  
  </div>
  
  
  <div class="callout callout-info col-12" onclick=" get_new_cus()">
  <h5>العملاء الجدد</h5>
  
  <p class="ss_1">0 </p>
  </div>
  <div class="callout callout-info col-12" onclick="get_rev_cus()">
  <h5>حضور العملاء</h5>
  
  <p class="ss_2">0</p>
  </div>
  
  
  
  
  <br/>
  <br/>
  <hr/>
  
  

  
  <div class="callout callout-info col-12" onclick="get_paid_cus()">
  <h5>الاستلامات</h5>
  
  <p class="ss_4">0 $</p>
  </div>
  <div class="callout callout-success col-12" onclick="get_pro_cus()">
  <h5>المبيعات</h5>
  
  <p class="ss_5">0 $</p>
  </div>
  

  <div class="callout callout-danger col-12" onclick="get_exp_cus()">
  <h5>المصاريف</h5>
  
  <p class="ss_6">0 $</p>
  </div>
  
  
  
  <br/>
  <br/>
  <hr/>
  
	</div>
	 </div>
  
	`
	$('#pg_body').html(txt);
  
	$.ajax({
	  url:"model/class/index_page.php",
	  type:"POST",
	  dataType:"JSON",
	  success:function(data){
		$('.ss_1').html(data.new_cus);
		$('.ss_2').html(data.rev_cus);
		$('.ss_6').html(data.active_cus);
		if(data.paid  == null){
		  $('.ss_4').html(" 0 $ ");
		}else{
		  $('.ss_4').html( data.paid+" $ ");
		}
  
		if(data.sales  == null){
		  $('.ss_5').html(" 0 $ ");
		}else{
		  $('.ss_5').html( data.sales+" $ ");
		}
		if(data.exp  == null){
			$('.ss_6').html(" 0 $ ");
		  }else{
			$('.ss_6').html( data.exp+" $ ");
		  }
	  }
	})
  
  
  
active();
get_page();

}
function get_select_cata(txt,id_select)
{
	$('#'+id_select).html('');
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			var l = response.length;
			for(var i = 0;i < l;i++)
			{
				var html_code = "<option value="+response[i].id_cata+">"+response[i].name_cata+"</option>";
				$('#'+id_select).append(html_code);
			}
		}
	})
}
function get_select_cat(txt,id_select)
{
	$('#'+id_select).html('');
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			var l = response.length;
			for(var i = 0;i < l;i++)
			{
				var html_code = "<option value="+response[i].id_cat+">"+response[i].name_cat+"</option>";
				$('#'+id_select).append(html_code);
			}
		}
	})
}
function get_select_member(txt,id_select)
{
	$('#'+id_select).html('');
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			var l = response.length;
			for(var i = 0;i < l;i++)
			{
				var html_code = "<option value="+response[i].id_member+">"+response[i].name_member+"</option>";
				$('#'+id_select).append(html_code);
			}
		}
	})
}
function push_option(value,id_select,id_model)  
{
    setTimeout( function(){
            $('#'+id_select).val(value);
            $('#'+id_model).modal('show');
    },150);
}
function insert_mony(id,type)
{
	$('.form-control').val('');
	if(emp_acc[18] == 0){
		sweetAlert('لا يوجد صلاحيه','','error')
	}else{
		$('#modal_mony').modal('show');
		id_type_page = id;
		type_mony = type;
	
		$('#date_mony').val(date_today)
	
		get_select_cata("select * from `cata` where 1 ","select_member_mony");
	}

}
function get_select_cata(txt,id_select)
{
	$('#'+id_select).html('');
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			var l = response.length;
			for(var i = 0;i < l;i++)
			{
				var html_code = "<option value="+response[i].id_cata+">"+response[i].name_cata+"</option>";
				$('#'+id_select).append(html_code);
			}
		}
	})
}
function get_select_sup(txt,id_select)
{
	$('#'+id_select).html('');
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			var l = response.length;
			for(var i = 0;i < l;i++)
			{
				var html_code = "<option value="+response[i].id_sup+">"+response[i].name_sup+"</option>";
				$('#'+id_select).append(html_code);
			}
		}
	})
}
function save_mony()
{
	if(type_mony == 0)
	{
		var name_table = "exp";
	}else{
		var name_table = "inp";
	}
	var i_m = $('#select_member_mony').val();
	var value = $('#value_mony').val();
	var date = $('#date_mony').val();
	var comment = $('#commant_mony').val();
	var txt = "insert into `"+name_table+"_mony` (`id_"+name_table+"`,`id_user`,`value_"+name_table+"`,`comment_"+name_table+"`,`date_"+name_table+"`, `id_member`) values ('"+id_type_page+"','"+id_emp+"','"+value+"','"+comment+"','"+date+"','"+i_m+"')";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:0},
		success:function()
		{
			success();
		}
	})
}
function push_emp_login(txt)
{
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:0},
		success:function()
		{

		}
	})
}
function get_page()
{
	page_key = 0;
	random_number()
   //$('.all').prop('style', 'background-image: url("./assets/img/bb.png");background-repeat: repeat;');
	var txt = "select * from `emp` where `id_emp` = '"+id_emp+"'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(data)
		{
			type_color = data[0].type_sys;
			$('#ul_date').text(date_today);
							$('.modal-content').css("color","black");
				$('table').prop("class","table table-light");
				$('body').css("background-color",color_page);
				$('#sidebar').css("background-color",color_page);
				$('table').prop("style","");
				//$('#sidebar').css("background-color","#7386D5");
				$('.modal-content').css("background-color","white");
				$('#nav2').prop("class","navbar navbar-expand-lg navbar-light bg-light");
				//$('#sidebar').prop("style","background-color:#343A40");
				$('#sidebar').css("filter",""+color_page+"(100%)");
			
				$('.card1').css("background-color","white");
				$('.class_body_rev').prop("style","color:black;background-color:white;margin-top:15px");
				$('.class_input_pos').prop("style","color:black;background-color:white;margin-top:15px;height:100px;");
		}
	})
}
function get_page_t()
{
	//page_key = 0;
   //$('.all').prop('style', 'background-image: url("./assets/img/bb.png");background-repeat: repeat;');
	var txt = "select * from `emp` where `id_emp` = '"+id_emp+"'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(data)
		{
			type_color = data[0].type_sys;
			$('#ul_date').text(date_today);
							$('.modal-content').css("color","black");
				$('table').prop("class","table table-light");
				$('body').css("background-color",color_page);
				$('#sidebar').css("background-color",color_page);
				$('table').prop("style","");
				//$('#sidebar').css("background-color","#7386D5");
				$('.modal-content').css("background-color","white");
				$('#nav2').prop("class","navbar navbar-expand-lg navbar-light bg-light");
				//$('#sidebar').prop("style","background-color:#343A40");
				$('#sidebar').css("filter",""+color_page+"(100%)");
			
				$('.card1').css("background-color","white");
				$('.class_body_rev').prop("style","color:black;background-color:white;margin-top:15px");
				$('.class_input_pos').prop("style","color:black;background-color:white;margin-top:15px;height:100px;");
		}
	})
}
function push_acc()
{
	var length = emp_acc.length;
	for(var i = 0;i < length;i++)
	{
		var ii = i + 1;
		//alert(ii);
		if(emp_acc[i] == 0)
		{
			$('.c_'+ii).hide();
		}else{
			$('.c_'+ii).show();
		}
		if(emp_acc[5]  == 1 &&  emp_acc[6] == 1 && emp_acc[7] == 1)
		{
			
		}
		if(emp_acc[1] == 1 && emp_acc[2] == 1 && emp_acc[3] == 1)
		{
			$('.cus_c_1').show();
			$('.cus').show();
		}else{
			$('.cus_c_1').hide();
			$('.cus').hide();
		}
		if(emp_acc[1] == 1 || emp_acc[2] == 1  || emp_acc[3] == 1)
		{
			$('.cus').show();
		}
		if(emp_acc[4] == 1 && emp_acc[5] == 1 && emp_acc[6] == 1)
		{
			$('.pro_c_1').show();
		}else{
			$('.pro_c_1').hide();
		}
		if(emp_acc[4] == 1 || emp_acc[5] == 1 || emp_acc[6] == 1)
		{
			$('.pro').show();

		}else{
			$('.pro').hide();
		}
	}
}
function logout()
{
	type_login = 0;
	id_emp = 0;
	 emp_acc = [];
   username = "";
   password = "";
   $('.form-control').val('');
   $('#login_emp').modal('show');
   $('.wrapper').hide();
   page_index();
   $('#username_login').focus();
}
function active()
{
	$.ajax({
		url:"model/class/c_1.php",
		dataType:"JSON",
		success:function(data)
		{

			$('#date_renew').text(data.end);
			$('#day_renew').text(data.aa);
			if(data.a == 1)
			{

			}else{
			//	$('body').html('');
			//	$('body').html('<h1>يجب تجديد البرنامج</h1>')
			}
			if(data.b == 0)
			{
		//		$('body').html('');
//$('body').html('<h1>تم قرصنة البرنامج وذالك يعرضك للمسالة القانونية</h1>')			
			}
		}
	})
}
function del_table_1(id_type,id_table)
{
	id_type_page = id_type;
	if(id_table == 0)
	{
		var txt  = "update `jobs` set `active_job` = '1' where `id_job` = '"+id_type_page+"'";
	}
	if(id_table == 1)
	{
		var txt  = "update `branch` set `active_branch` = '1' where `id_branch` = "+id_type_page+"";
	}
		if(id_table == 2)
	{
		var txt  = "update `emp` set `active_emp` = '1' where `id_emp` = "+id_type_page+"";

	}
		if(id_table == 3)
	{
		var txt  = "update `cata` set `active_cata` = '1' where `id_cata` = "+id_type_page+"";

	}
		if(id_table == 4)
	{
		var txt  = "update `cat` set `active_cat` = '1' where `id_cat` = "+id_type_page+"";

	}
		if(id_table == 5)
	{
		var txt  = "update `pro` set `active_pro` = '1' where `id_pro` = "+id_type_page+"";

	}
		if(id_table == 6)
	{
		var txt  = "update `expen` set `active_expense` = '1' where `id_expense` = "+id_type_page+"";
	}
		if(id_table == 7)
	{
		var txt  = "update `inp` set `active_inp` = '1' where `id_inp` = "+id_type_page+"";

	}
	if(id_table == 9)
	{
		var txt  = "update `member` set `active_member` = '1' where `id_member` = "+id_type_page+"";

	}
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:0},
		success:function()
		{
			success()
			// if(id_table == 6){
			// 	get_last_rev();
			// }
		}
	})
}
function get_cus_info(id)
{
	id_type_page = id;
	$.ajax({
		url:"model/class/cus_s.php",
		type:"POST",
		dataType:"JSON",
		data:{id:id},
		success:function(data)
		{
			$('#view_cus').modal('show');
			$('#v_name').val(data.name);
			$('#card_id').val(data.card);
			$('#v_type').val(data.v_type);
			$('#v_mony').val(data.v_mony);
			$('#value_date_end').val(data.end);
			var firstTabEl = document.querySelector('#view_cus li:last-child a')
			var firstTab = new bootstrap.Tab(firstTabEl)
		  
			firstTab.show()	
			var firstTabEl = document.querySelector('#view_cus li:first-child a')
			var firstTab = new bootstrap.Tab(firstTabEl)
		  
			firstTab.show()			
		}
	})
}
$('#nav_1').change(function(){
	if(nav_1 == 0)
	{
		nav_1 = 1;
	}else{
		nav_1 = 0;
	}
});
$('#nav_2').change(function(){
	if(nav_2 == 0)
	{
		nav_2 = 1;
	}else{
		nav_2 = 0;
	}
});
$('#nav_3').change(function(){
	if(nav_3 == 0)
	{
		nav_3 = 1;
	}else{
		nav_3 = 0;
	}
});
$('#nav_4').change(function(){
	if(nav_4 == 0)
	{
		nav_4 = 1;
	}else{
		nav_4 = 0;
	}
});
$('#nav_5').change(function(){
	if(nav_5 == 0)
	{
		nav_5 = 1;
	}else{
		nav_5 = 0;
	}
});
function c_color(color)
{
	$('body').css('background-image','none');
	$('.all').css('background-image','none');
	$('body').css("background-color",color);

	color_page = color;
	
}
function end()
{
	window.close();
}
var elem = document.documentElement;

/* View in fullscreen */
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.mozRequestFullScreen) { /* Firefox */
    elem.mozRequestFullScreen();
  } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE/Edge */
    elem.msRequestFullscreen();
  }
}
function get_end_cus()
{
	var txt = "select * from `cus` where `memeber_end` <= '"+date_today+"' and `cus_active` = '0'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:2},
		success:function(data)
		{
			//alert(data.num)
			$('.re0').text(data.num)
		}
	})

}

function r_e()
{

	$('#rre_1').html('')
	var txt = "select * from `cus` where `memeber_end` <= '"+date_today+"' and `cus_active` = '0'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(response)
		{
			//alert(data.num)
			var l = response.length;
			for(var i = 0; i <= l;i++)
			{
				var html_code = `<td>`+response[i].name_cus+`</td><td>`+response[i].id_scanner+`</td><td>`+response[i].phone_cus+`</td>`;
				$('#rre_1').append(html_code);

			}
			
		}
	})
	$('#rre').modal('show')
		
}
function vaild_card_check(code)
{
	var txt = "select * from `pma_card` where `id_card` = '"+code+"'";
	$.ajax({
		url:"model/card.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:2},
		success:function(data)
		{
			if(data.num == 0)
			{
				$('#number_cus').val('');
				return ;
			}else{
				if(id_type_page == 0)
				{
					var txt = "select * from `cus` where `id_scanner` = '"+code+"' and `cus_active` = '0'";
				}else{
					var txt = "select * from `cus` where `id_scanner` = '"+code+"' and `id_cus` != '"+id_type_page+"' and `cus_active` = '0'";
				}
				$.ajax({
					url:"model/class/class.php",
					type:"POST",
					dataType:"JSON",
					data:{txt:txt,type:2},
					success:function(data)
					{
			
						if(data.num == 0)
						{
							sweetAlert("الرقم متاح","","success");
						}else{
							sweetAlert("تم استخدام الرقم من قبل","","error");
							$('#number_cus').val('');
						}
					}
				})
			}
		}
	})
}
function open_emp_set()
{
	var txt = "select * from `emp` where `id_emp` = '"+id_emp+"'";
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:1},
		success:function(data)
		{
			$('#name_emp_set').val(data[0].name_emp);
			$('#pass_emp_set').val(data[0].password);
			color_page = data[0].color_emp;
			$('#emp_set').modal('show')

		}
	})
}
function save_emp_set()
{
	var name = $('#name_emp_set').val();
	var pass= $('#pass_emp_set').val();
	var color = color_page;
	var txt = "update `emp` set `name_emp` = '"+name+"',`password` = '"+pass+"' , `color_emp` = '"+color+"' where `id_emp` = '"+id_emp+"'";
	send_data(txt)
}
function send_data(txt)
{
	$.ajax({
		url:"model/class/class.php",
		type:"POST",
		dataType:"JSON",
		data:{txt:txt,type:0},
		success:function(data)
		{
			success()
		}
	})
}

get_end_cus()


function random_number() {
	var x = Math.floor((Math.random() * 10) + 1);
	
	$('#sidebar').css('background-image', 'url(images/b' + x + '.jpg)');
}
random_number()


function acc_check(num,callback){
	if(emp_acc[num] == 0){
		sweetAlert("لا يوجد صلاحيه","","error")
	}else{
		callback
	}
}


function acc_custem(num,type,id){
	// add and delete emp

	if(type == 0){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			get_emp(id)
		}
	}

	if(type == 1){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			del_table_1(id,2)
		}
	}
	if(type == 2){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			open_emp()
		}
	}

	if(type == 3){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			acc_login(id)
		}
	}
	if(type == 4){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			open_member()
		}
	}
	if(type == 5){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			get_member(id)
		}
	}
	if(type == 6){
		if(emp_acc[num] == 0){
			sweetAlert("لا يوجد صلاحيه","","error")
		}else{
			del_table_1(id,9)
		}
	}
	
}

