Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function logout_user()
- {
- $conn = ConnectionManager::getConnection();
- $datetime = date("Y-m-d H:i:s");
- $sql = "update bl_login_log set logouttime = '$datetime' where fk_user = '".$_SESSION['BuserID']."' and session_id = '".$_SESSION['Bsession_id']."' ";
- $result = $conn->query($sql);
- unset($_SESSION['BuserID']);
- unset($_SESSION['BuserType']);
- unset($_SESSION['BuserName']);
- unset($_SESSION['BuserEmail']);
- unset($_SESSION['BuserUID']);
- unset($_SESSION['Bsession_id']);
- unset($_SESSION['company_anum']);
- unset($_SESSION['financialyear']);
- $conn->close();
- }
- function tadafetch()
- {
- var name = $("#designation").val();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=tadafetch&state='+name,
- success: function (data) {
- $("#taddda").html(data);
- }
- });
- }
- function fetchmandaly(i)
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=fetchmandaly&state='+i,
- success: function (data) {
- $("#mandal").html(data);
- }
- });
- }
- function fetchmandal(i)
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=fetchmandal&state='+i,
- success: function (data) {
- $("#mandal").html(data);
- }
- });
- }
- function fetchmandall(i,j)
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=fetchmandall&state='+i+'&j='+j,
- success: function (data) {
- $("#mandall").html(data);
- }
- });
- }
- function fetchtown(i)
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=fetchtown&state='+i,
- success: function (data) {
- $("#town").html(data);
- }
- });
- }
- function fetchtowny(i)
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=fetchtowny&state='+i,
- success: function (data) {
- $("#town").html(data);
- }
- });
- }
- function statuschange(i)
- {
- var name = $("#sstatus").val();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=statusschange&statuss='+name+'&id='+i,
- success: function (data) {
- $("#example1").load("orderlist.php #example1");
- }
- });
- }
- function calculate2()
- {
- var sum = 0;
- $('.price').each(function() {
- sum += Number($(this).val());
- var vess=$("#atotalpp").val(sum);
- });
- }
- function calculater()
- {
- var sum = 0;
- $('.price').each(function() {
- sum += Number($(this).val());
- var vess=$("#atotalpp").val(sum);
- });
- }
- function calculaterr(i)
- {
- var qty = parseInt($("#qty"+i).val());
- var price = parseInt($("#price"+i).val());
- var tprice=price*qty ;
- var tamount = $("#tamount"+i).val(tprice);
- }
- function calculate22()
- {
- var sum = 0;
- $('.price').each(function() {
- sum += Number($(this).val());
- var vess=$("#atotalpp").val(sum);
- });
- }
- function calculate(i)
- {
- var qty = parseInt($("#qty"+i).val());
- var price = parseInt($("#price"+i).val());
- var tprice=price*qty ;
- var tamount = $("#tamount"+i).val(tprice);
- }
- function calculateee(i)
- {
- var qty = parseInt($("#qty"+i).val());
- var price = parseInt($("#price"+i).val());
- var tprice=price*qty ;
- var tamount = $("#tamount"+i).val(tprice);
- }
- function calculate3()
- {
- var sum = 0;
- $('.price').each(function() {
- sum += Number($(this).val());
- var vess=$("#atotalpp").val(sum);
- });
- }
- function calculatee(i)
- {
- var qty = parseInt($("#qty"+i).val());
- var price = parseInt($("#price"+i).val());
- var tprice=price*qty ;
- var tamount = $("#tamount"+i).val(tprice);
- }
- function fetchproduct()
- {
- var name = $("#name").val();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=gethtml&name='+name,
- success: function (data) {
- $("#product").html(data);
- $("#check").show();
- }
- });
- }
- function deletestaff(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletestaff&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletepro(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletepro&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deleteemp(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleteemp&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletedealer(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletedealer&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deleteorder(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleteorder&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deleteproduct(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleteproduct&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletenotes(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletenotes&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletereceipt(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletereceipt&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletelocation(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletelocation&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deleteshift(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleteshift&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deleterole(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleterole&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletejobwork(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletejobwork&wo_no='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletestock(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletestock&id='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletesalesinvoice(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletesalesinvoice&sales_invoice_no='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function deletecashinvoice(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletecashinvoice&cashinvoice_no='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- /*function deletecashinvoice12(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletecashinvoice12&cashinvoice_no='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- */
- function deletebatchcreation(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletebatchcreation&batch_no='+i,
- success: function () {
- // $("#loading_"+i).hide();
- $('body').fadeOut(400, function(){
- location.reload();
- });
- }
- });
- }
- }
- function addsequirty ()
- {
- var after = $("#after").val();
- var ip = $("#ip").val();
- var valid;
- valid = addsequirtys();
- if(valid) {
- var UrlToPass = 'action=addsequirty&after='+after+'&ip='+ip;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='security.php';
- });
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addsequirtys() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#after").val()) {
- $("#after-info").html("This field is required");
- $("#after").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#ip").val()) {
- $("#ip-info").html("This field is required");
- $("#ip").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function termsdefault (i)
- {
- if(i!='') {
- var UrlToPass = 'action=termsdefault&i='+i;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("payment-terms.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function methoddefault (i)
- {
- if(i!='') {
- var UrlToPass = 'action=methoddefault&i='+i;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("payment-method.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function adddmethod ()
- {
- var name = $("#name").val();
- var valid;
- valid = adddmethods();
- if(valid) {
- var UrlToPass = 'action=adddmethod&name='+name;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='payment-method.php';
- });
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function adddmethods() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#name").val()) {
- $("#name-info").html("This field is required");
- $("#name").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function adddterms ()
- {
- var terms = $("#terms").val();
- var days = $("#days").val();
- var valid;
- valid = addterm();
- if(valid) {
- var UrlToPass = 'action=addterms&terms='+terms+'&days='+days;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='payment-terms.php';
- });
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addterm() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#terms").val()) {
- $("#terms-info").html("This field is required");
- $("#terms").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#days").val()) {
- $("#days-info").html("This field is required");
- $("#days").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function addpacking ()
- {
- var editor1 = $("#editor1").val();
- //alert(editor1);
- var enable =$('input[name="status4"]:checked').val();
- var location =$('input[name="status5"]:checked').val();
- var valid;
- valid = addpackings();
- if(valid) {
- var UrlToPass = 'action=addpacking&editor1='+editor1+'&enable='+enable+'&location='+location;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addpackings() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#editor1").val()) {
- $("#editor1-info").html("This field is required");
- $("#editor1").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function addtax ()
- {
- var tname = $('#tname').val();
- var registration = $('#registration').val();
- var rate = $('#rate').val();
- var valid;
- valid = custompaymentmethod222();
- if(valid) {
- var UrlToPass = 'action=addtax&tname='+tname+'®istration='+registration+'&rate='+rate;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='taxs.php';
- });
- //gethtml();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function custompaymentmethod222() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#tname").val()) {
- $("#tname-info").html("This field is required");
- $("#tname").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#registration").val()) {
- $("#registration-info").html("This field is required");
- $("#registration").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#rate").val()) {
- $("#rate-info").html("This field is required");
- $("#rate").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function updateaddtax (i)
- {
- //alert(i);
- var tname = $('#utname'+i).val();
- var registration = $('#uregistration'+i).val();
- var rate = $('#urate'+i).val();
- var valid;
- valid = custompaymentmethod2222(i);
- if(valid) {
- var UrlToPass = 'action=updateaddtax&tname='+tname+'®istration='+registration+'&rate='+rate+'&id='+i;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("taxs.php #asdd");
- $("#AllError").html('Tax Updated Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv"+i).click();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#utname').val('');
- $('#uregistration').val('');
- $('#urate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function custompaymentmethod2222(i) {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#utname"+i).val()) {
- $("#utname-info"+i).html("This field is required");
- $("#utname"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#uregistration"+i).val()) {
- $("#uregistration-info"+i).html("This field is required");
- $("#uregistration"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#urate"+i).val()) {
- $("#urate-info"+i).html("This field is required");
- $("#urate"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function deletetax(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $("#delete").text('Deleting..');
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletetax&id='+i,
- success: function(status){
- var status=$.trim(status);
- if(status=='1')
- {
- $("#asdd").load("taxs.php #asdd");
- }
- }
- });
- }
- }
- function adddept()
- {
- var dept = $('#dept').val();
- var parents = $('#parent').val();
- var valid;
- valid = adddepts();
- if(valid) {
- $('#depts').val(dept);
- $('#parentss').val(parents);
- $(".closediv").click();
- }
- }
- function adddepts() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#dept").val()) {
- $("#dept-info").html("This field is required");
- $("#dept").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#parent").val()) {
- $("#parent-info").html("This field is required");
- $("#parent").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function addsupplier ()
- {
- var sname = $('#sname').val();
- var valid;
- valid = addsuppliers();
- if(valid) {
- var UrlToPass = 'action=addsupplier&sname='+sname;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#suppliers").load("product-form.php #suppliers");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('#sname').val('');
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addsuppliers() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#sname").val()) {
- $("#sname-info").html("This field is required");
- $("#sname").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function addbrand ()
- {
- var sname = $('#brands').val();
- var valid;
- valid = addbrands();
- if(valid) {
- var UrlToPass = 'action=addbrand&sname='+sname;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("product-form.php #asdd");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddivv").click();
- $('#brands').val('');
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addbrands() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#brands").val()) {
- $("#brands-info").html("This field is required");
- $("#brands").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function addtype ()
- {
- var sname = $('#types').val();
- var valid;
- valid = addtypes();
- if(valid) {
- var UrlToPass = 'action=addtype&sname='+sname;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#type").load("product-form.php #type");
- $("#AllError").html('Tax Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddivvv").click();
- $('#types').val('');
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function addtypes() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#types").val()) {
- $("#types-info").html("This field is required");
- $("#types").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function autogenrate()
- {
- //alert(123)
- var i = '1';
- if((i!=''))
- {
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=autogenrate',
- success: function (data) {
- var vess=$("#sku").val(data);
- //alert(data);
- }
- });
- }
- }
- function updatemeasure (i)
- {
- //alert(i);
- var tname = $('#utname'+i).val();
- var registration = $('#uregistration'+i).val();
- var valid;
- valid = updatemeasures(i);
- if(valid) {
- var UrlToPass = 'action=updatemeasure&tname='+tname+'®istration='+registration+'&id='+i;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("measure.php #asdd");
- $("#AllError").html('Measure Updated Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv"+i).click();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#utname').val('');
- $('#uregistration').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function updatepacking (i)
- {
- var editor1 = $('#editor1'+i).val();
- var enable=$("input:checkbox[name='usunstatusss" + i + "']:checked").val();
- var include=$("input:checkbox[name='usunstatussss" + i + "']:checked").val();
- if(enable !='') {
- var UrlToPass = 'action=updatepacking&editor1='+editor1+'&enable='+enable+'&id='+i+'&include='+include;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#asdd").load("packing.php #asdd");
- $("#AllError").html('Packing Updated Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv"+i).click();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#utname').val('');
- $('#uregistration').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function updatemeasures(i) {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#utname"+i).val()) {
- $("#utname-info"+i).html("This field is required");
- $("#utname"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#uregistration"+i).val()) {
- $("#uregistration-info"+i).html("This field is required");
- $("#uregistration"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function deletemeasure(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $("#delete").text('Deleting..');
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletemeasure&id='+i,
- success: function(status){
- var status=$.trim(status);
- if(status=='1')
- {
- $("#asdd").load("measure.php #asdd");
- }
- }
- });
- }
- }
- function deletepacking(i)
- {
- //alert(1);
- if (confirm('Are you sure you want to delete this ?')) {
- //$("#loading_"+i).show();
- $("#delete").text('Deleting..');
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deletepacking&id='+i,
- success: function(status){
- var status=$.trim(status);
- if(status=='1')
- {
- $('body').fadeOut(400, function(){
- document.location.href = "packing.php";
- });
- }
- }
- });
- }
- }
- function adduser ()
- {
- var name = $('#name').val();
- var email = $('#email').val();
- var role = $('#role').val();
- var valid;
- valid = users();
- if(valid) {
- var UrlToPass = 'action=adduser&name='+name+'&email='+email+'&role='+role;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#AllError").html('User Added Successfully!');
- $(".alart_meneg").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='list-user.php';
- });
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function users() {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- $("#email-info").show();
- if(!$("#name").val()) {
- $("#name-info").html("This field is required");
- $("#name").css('background-color','#FFFFDF');
- valid = false;
- }
- if($('#role').val() == "0") {
- $("#role-info").html("please select role");
- $("#role").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#email").val()) {
- $("#email-info").html("required");
- $("#email").css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#email").val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
- $("#email-info").html("Please Enter valid email");
- $("#email").css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function updateuser (i)
- {
- var name = $('#uname'+i).val();
- var email = $('#uemail'+i).val();
- var role = $('#urole'+i).val();
- var valid;
- valid = userss(i);
- if(valid) {
- var UrlToPass = 'action=updateuser&name='+name+'&email='+email+'&role='+role+'&id='+i;
- $.ajax({
- type : 'POST',
- data : UrlToPass,
- url : 'process/process.php',
- success: function(data){
- $("#AllErroru").html('User Added Successfully!');
- $(".alart_menegu").show();
- $(".closeddiv").click();
- $('body').fadeOut(800, function(){
- document.location.href ='list-user.php';
- });
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- $('#tname').val('');
- $('#registration').val('');
- $('#rate').val('');
- }
- });
- }
- else
- {
- $("#loading").hide();
- //$("#AllError").html('Please fill all field!');
- //$(".alart_meneg").show();
- setTimeout(function(){
- $("#AllError").fadeOut("slow", function () {
- $("#AllError").remove();
- });
- }, 1500);
- return false;
- }
- }
- function userss(i) {
- var valid = true;
- $(".demoInputBox").css('background-color','');
- $(".info").html('');
- if(!$("#uname"+i).val()) {
- $("#uname-info"+i).html("This field is required");
- $("#uname"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if($('#urole'+i).val() == "0") {
- $("#urole-info"+i).html("please select role");
- $("#urole"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#uemail"+i).val()) {
- $("#uemail-info"+i).html("required");
- $("#uemail"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- if(!$("#uemail"+i).val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
- $("#uemail-info"+i).html("Please Enter valid email");
- $("#uemail"+i).css('background-color','#FFFFDF');
- valid = false;
- }
- return valid;
- }
- function check_email(x)
- {
- if(x!='')
- {
- $.ajax({
- type: "POST",
- url:'process/process.php?email='+x+'&action=check_mail',
- beforeSend: function (data) {
- $('#fadediv').show();
- },
- success: function (data) {
- $('#fadediv').hide();
- var temp = $.trim(data);
- if(temp=='1')
- {
- $('#email_error').html("Email already exist!");
- document.getElementById("email").value = "";
- $("#email-info").hide();
- $("#email-info").hide();
- }
- else
- {
- $('#email_error').html("");
- }
- }
- });
- }
- }
- function deleteuser(i)
- {
- if (confirm('Are you sure you want to delete this ?')) {
- $("#delete").text('Deleting..');
- $.ajax({
- type: "POST",
- url : 'process/process.php?action=deleteuser&id='+i,
- success: function(status){
- var status=$.trim(status);
- if(status=='1')
- {
- $('body').fadeOut(800, function(){
- document.location.href ='list-user.php?success=deleted';
- });
- }
- }
- });
- }
- }
- $res = $db->listorder();
- $row=mysql_num_rows($res);
- echo $row;
- if(isset($_SESSION['adminuserid']))
- {
- echo "<script>window.location = 'dashboard.php'</script>";
- }
Add Comment
Please, Sign In to add comment