Revonzy Mini Shell

Şuanki Dizin: /home/shrishtiarchitec/www/adminpanel/clients/
Dosya Yükle :
Şuanki Dosya : /home/shrishtiarchitec/www/adminpanel/clients/client.js

// JavaScript Document
$(document).ready(function(){
		$('#loading').hide();
 
	//////////////////////////////////
	// Add Sector form validation
	////////////////////////////////////
    $("#clientFrm").validate({
	  rules: 
		{ 
			
			name:
			{
				required:true,
			},
			location: 
			{ 
				required: true,
			},
			project: 
			{ 
				required: true,
			},
			shortDescription: 
			{ 
				required: true,
			},
			description: 
			{ 
				required: true,
			}
			
		},
		messages:
		{
		}
	});// eof validation
	
	/*/////////////////////////////////////
	//Validate add method for Branch 
	/////////////////////////////////////
	$.validator.addMethod('CheckGategory', function(val, element)
	{
		cate_name=$("#name").val();
		id=$("#id").val();
		$.ajax({
				 url:"subcategory_curd.php",
				 type: "POST",
				 data: {type:"validate",cate_name:cate_name,id:id},
				 async:false,
				 success:function(data){
					// alert(data);
					 isSuccess=(data==1)?false:true;
					 }
		});//eof ajax
		return isSuccess ;				
	}, 'sub-category is already exists.');
	*/
	
	
	
	//////////////////////////////////
	// on click of submit button
	//////////////////////////////////
	$('#submit').click(function(){
     
		flag=$("#clientFrm").valid();
		
		if (flag==true)
		{	
		
			$('#submit').hide();
		 	$('#loading').show();			
		
			var formdata = new FormData();
			formdata.append('type', "addClient");
			formdata.append('name', $("#name").val());
			formdata.append('location', $("#location").val());
			formdata.append('project', $("#project").val());
			formdata.append('shortDescription', $("#shortDescription").val());
			formdata.append('description', $("#description").val());
			formdata.append('website', $("#website").val());
			
			$.ajax({
			   type: "POST",
			   url: "client_curd.php",
			   data:formdata,
			   success: function(data){ //alert(data); console.log(data);
				   
			   		if(data==1)
					{	
						$('#loading').hide();		
						$( "#dialog1" ).dialog({
								dialogClass: "alert",
								buttons: {
								 'Ok': function() {
									window.location.replace("list.php");
									}
								}
							  });
					}
					else
					{
					 $('#loading').hide();		
						$( "#dialog2" ).dialog({
								dialogClass: "alert",
								buttons: {
								 'Ok': function() {
									window.location.replace("index.php");
									}
								}
							  });
						
					}

			   },
			   cache: false,
			   contentType: false,
			   processData: false
			});//eof ajax		
			
		}// eof if condition
		
	});
	
    /////////////////////////////////
	// on click of edit button
	/////////////////////////////////		
	$('#update').click(function(){
		flag=$("#clientFrm").valid();
		
		if (flag==true)
		{	
			
			$('#update').hide();
		    $('#loading').show();			
			var formdata = new FormData();
			formdata.append('type', "editClient");
			formdata.append('id', $("#id").val());
			formdata.append('name', $("#name").val());
			formdata.append('location', $("#location").val());
			formdata.append('project', $("#project").val());
			formdata.append('shortDescription', $("#shortDescription").val());
			formdata.append('description', $("#description").val());
			formdata.append('website', $("#website").val());
			
			var x;
			$.ajax({
			   type: "POST",
			   url: "client_curd.php",
			   data:formdata,
			   async: false,
			   success: function(data){//alert(data);
				   if(data==1)
					{ 
						window.location.replace("list.php");						
					}
			   },
			   cache: false,
			   contentType: false,
			   processData: false
			});//eof ajax
		
			
		}// eof if condition
		
	});
	
	
	
	
	//////////////////////////////////
	// on click of delete button
	//////////////////////////////////
	
	$(document).on('click', '.delete', function() {
		
		var didConfirm = confirm("Are you sure?");
	   	if (didConfirm == true) {
			var id=$(this).attr("id");
			
			$.ajax({
				url:"client_curd.php",
				type: "POST",
				data: {type:"delete",id:id},
				async:false,
				success: function(data){//alert(data);

					if(data==1)
					{
						 $('#loading').hide();	
						$( "#deletemsg" ).dialog({
								dialogClass: "alert",
								buttons: {
								 'Ok': function() {
									window.location.replace("list.php");
									}
								}
							  });
					}
					location.reload();
				}
			});
			
	    }
	});
	
	
});

//Search Filter Write HEre
$(document).on('click','#search',function()
{
	
		var x;
		$.ajax({
			url:"filter_report.php",
			type: "POST",
			data: {type:"searchList",name:$('#name').val()},
			async:false,
			success: function(data){ 
			$('#add').html(data);
			//alert(data);
			}
		});
			

});
//Onclick Active And Unactive
$(document).on('click','.checkStatus',function()
	{
		
			var id=$(this).attr('value');
			var x;
			$.ajax({
				url:"testimonial_curd.php",
				type: "POST",
				data: {type:"CheckStatus",id:id},
				async:false,
				success: function(data){ //alert(data);
					location.reload();
				}
			});
			
	
	})


$(document).ready(function() {
    $(".number").keydown(function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
             // Allow: Ctrl+A, Command+A
            (e.keyCode == 65 && ( e.ctrlKey === true || e.metaKey === true ) ) || 
             // Allow: home, end, left, right, down, up
            (e.keyCode >= 35 && e.keyCode <= 40)) {
                 // let it happen, don't do anything
                 return;
        }
        // Ensure that it is a number and stop the keypress
        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
            e.preventDefault();
        }
    });
});

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

Linux vps.suncrosonline.com 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 x86_64
Apache
162.241.69.42