Guest User

Untitled

a guest
Jan 24th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.62 KB | None | 0 0
  1. function logout_user()
  2. {
  3. $conn = ConnectionManager::getConnection();
  4. $datetime = date("Y-m-d H:i:s");
  5. $sql = "update bl_login_log set logouttime = '$datetime' where fk_user = '".$_SESSION['BuserID']."' and session_id = '".$_SESSION['Bsession_id']."' ";
  6.  
  7.  
  8. $result = $conn->query($sql);
  9.  
  10. unset($_SESSION['BuserID']);
  11. unset($_SESSION['BuserType']);
  12. unset($_SESSION['BuserName']);
  13. unset($_SESSION['BuserEmail']);
  14. unset($_SESSION['BuserUID']);
  15. unset($_SESSION['Bsession_id']);
  16. unset($_SESSION['company_anum']);
  17. unset($_SESSION['financialyear']);
  18. $conn->close();
  19.  
  20.  
  21.  
  22. }
  23.  
  24. function tadafetch()
  25. {
  26.  
  27. var name = $("#designation").val();
  28. $.ajax({
  29. type: "POST",
  30. url : 'process/process.php?action=tadafetch&state='+name,
  31. success: function (data) {
  32. $("#taddda").html(data);
  33.  
  34. }
  35. });
  36. }
  37.  
  38. function fetchmandaly(i)
  39. {
  40.  
  41.  
  42. $.ajax({
  43. type: "POST",
  44. url : 'process/process.php?action=fetchmandaly&state='+i,
  45. success: function (data) {
  46. $("#mandal").html(data);
  47.  
  48. }
  49. });
  50. }
  51. function fetchmandal(i)
  52. {
  53.  
  54.  
  55. $.ajax({
  56. type: "POST",
  57. url : 'process/process.php?action=fetchmandal&state='+i,
  58. success: function (data) {
  59. $("#mandal").html(data);
  60.  
  61. }
  62. });
  63. }
  64. function fetchmandall(i,j)
  65. {
  66.  
  67.  
  68. $.ajax({
  69. type: "POST",
  70. url : 'process/process.php?action=fetchmandall&state='+i+'&j='+j,
  71. success: function (data) {
  72. $("#mandall").html(data);
  73.  
  74. }
  75. });
  76. }
  77. function fetchtown(i)
  78. {
  79.  
  80.  
  81. $.ajax({
  82. type: "POST",
  83. url : 'process/process.php?action=fetchtown&state='+i,
  84. success: function (data) {
  85. $("#town").html(data);
  86.  
  87. }
  88. });
  89. }
  90. function fetchtowny(i)
  91. {
  92.  
  93.  
  94. $.ajax({
  95. type: "POST",
  96. url : 'process/process.php?action=fetchtowny&state='+i,
  97. success: function (data) {
  98. $("#town").html(data);
  99.  
  100. }
  101. });
  102. }
  103. function statuschange(i)
  104. {
  105.  
  106. var name = $("#sstatus").val();
  107. $.ajax({
  108. type: "POST",
  109. url : 'process/process.php?action=statusschange&statuss='+name+'&id='+i,
  110. success: function (data) {
  111. $("#example1").load("orderlist.php #example1");
  112.  
  113. }
  114. });
  115. }
  116.  
  117.  
  118. function calculate2()
  119. {
  120. var sum = 0;
  121. $('.price').each(function() {
  122. sum += Number($(this).val());
  123. var vess=$("#atotalpp").val(sum);
  124. });
  125.  
  126. }
  127. function calculater()
  128. {
  129.  
  130. var sum = 0;
  131. $('.price').each(function() {
  132. sum += Number($(this).val());
  133. var vess=$("#atotalpp").val(sum);
  134. });
  135.  
  136. }
  137.  
  138. function calculaterr(i)
  139. {
  140. var qty = parseInt($("#qty"+i).val());
  141. var price = parseInt($("#price"+i).val());
  142. var tprice=price*qty ;
  143. var tamount = $("#tamount"+i).val(tprice);
  144.  
  145. }
  146.  
  147. function calculate22()
  148. {
  149.  
  150. var sum = 0;
  151. $('.price').each(function() {
  152. sum += Number($(this).val());
  153. var vess=$("#atotalpp").val(sum);
  154. });
  155.  
  156. }
  157.  
  158. function calculate(i)
  159. {
  160. var qty = parseInt($("#qty"+i).val());
  161. var price = parseInt($("#price"+i).val());
  162. var tprice=price*qty ;
  163. var tamount = $("#tamount"+i).val(tprice);
  164.  
  165. }
  166. function calculateee(i)
  167. {
  168.  
  169. var qty = parseInt($("#qty"+i).val());
  170. var price = parseInt($("#price"+i).val());
  171. var tprice=price*qty ;
  172. var tamount = $("#tamount"+i).val(tprice);
  173.  
  174. }
  175.  
  176. function calculate3()
  177. {
  178. var sum = 0;
  179. $('.price').each(function() {
  180. sum += Number($(this).val());
  181. var vess=$("#atotalpp").val(sum);
  182. });
  183.  
  184. }
  185.  
  186.  
  187. function calculatee(i)
  188. {
  189. var qty = parseInt($("#qty"+i).val());
  190. var price = parseInt($("#price"+i).val());
  191. var tprice=price*qty ;
  192. var tamount = $("#tamount"+i).val(tprice);
  193.  
  194. }
  195.  
  196.  
  197. function fetchproduct()
  198. {
  199.  
  200. var name = $("#name").val();
  201. $.ajax({
  202. type: "POST",
  203. url : 'process/process.php?action=gethtml&name='+name,
  204. success: function (data) {
  205. $("#product").html(data);
  206. $("#check").show();
  207.  
  208. }
  209. });
  210. }
  211.  
  212. function deletestaff(i)
  213. {
  214.  
  215. if (confirm('Are you sure you want to delete this ?')) {
  216. //$("#loading_"+i).show();
  217.  
  218. $.ajax({
  219. type: "POST",
  220. url : 'process/process.php?action=deletestaff&id='+i,
  221. success: function () {
  222. // $("#loading_"+i).hide();
  223. $('body').fadeOut(400, function(){
  224. location.reload();
  225.  
  226. });
  227. }
  228. });
  229.  
  230. }
  231. }
  232.  
  233.  
  234. function deletepro(i)
  235. {
  236.  
  237. if (confirm('Are you sure you want to delete this ?')) {
  238. //$("#loading_"+i).show();
  239.  
  240. $.ajax({
  241. type: "POST",
  242. url : 'process/process.php?action=deletepro&id='+i,
  243. success: function () {
  244. // $("#loading_"+i).hide();
  245. $('body').fadeOut(400, function(){
  246. location.reload();
  247.  
  248. });
  249. }
  250. });
  251.  
  252. }
  253. }
  254.  
  255. function deleteemp(i)
  256. {
  257.  
  258. if (confirm('Are you sure you want to delete this ?')) {
  259. //$("#loading_"+i).show();
  260.  
  261. $.ajax({
  262. type: "POST",
  263. url : 'process/process.php?action=deleteemp&id='+i,
  264. success: function () {
  265. // $("#loading_"+i).hide();
  266. $('body').fadeOut(400, function(){
  267. location.reload();
  268.  
  269. });
  270. }
  271. });
  272.  
  273. }
  274. }
  275.  
  276. function deletedealer(i)
  277. {
  278.  
  279. if (confirm('Are you sure you want to delete this ?')) {
  280. //$("#loading_"+i).show();
  281.  
  282. $.ajax({
  283. type: "POST",
  284. url : 'process/process.php?action=deletedealer&id='+i,
  285. success: function () {
  286. // $("#loading_"+i).hide();
  287. $('body').fadeOut(400, function(){
  288. location.reload();
  289.  
  290. });
  291. }
  292. });
  293.  
  294. }
  295. }
  296.  
  297. function deleteorder(i)
  298. {
  299.  
  300. if (confirm('Are you sure you want to delete this ?')) {
  301. //$("#loading_"+i).show();
  302.  
  303. $.ajax({
  304. type: "POST",
  305. url : 'process/process.php?action=deleteorder&id='+i,
  306. success: function () {
  307. // $("#loading_"+i).hide();
  308. $('body').fadeOut(400, function(){
  309. location.reload();
  310.  
  311. });
  312. }
  313. });
  314.  
  315. }
  316. }
  317.  
  318. function deleteproduct(i)
  319. {
  320.  
  321. if (confirm('Are you sure you want to delete this ?')) {
  322. //$("#loading_"+i).show();
  323.  
  324. $.ajax({
  325. type: "POST",
  326. url : 'process/process.php?action=deleteproduct&id='+i,
  327. success: function () {
  328. // $("#loading_"+i).hide();
  329. $('body').fadeOut(400, function(){
  330. location.reload();
  331.  
  332. });
  333. }
  334. });
  335.  
  336. }
  337. }
  338.  
  339. function deletenotes(i)
  340. {
  341.  
  342. if (confirm('Are you sure you want to delete this ?')) {
  343. //$("#loading_"+i).show();
  344.  
  345. $.ajax({
  346. type: "POST",
  347. url : 'process/process.php?action=deletenotes&id='+i,
  348. success: function () {
  349. // $("#loading_"+i).hide();
  350. $('body').fadeOut(400, function(){
  351. location.reload();
  352.  
  353. });
  354. }
  355. });
  356.  
  357. }
  358. }
  359.  
  360.  
  361. function deletereceipt(i)
  362. {
  363.  
  364. if (confirm('Are you sure you want to delete this ?')) {
  365. //$("#loading_"+i).show();
  366.  
  367. $.ajax({
  368. type: "POST",
  369. url : 'process/process.php?action=deletereceipt&id='+i,
  370. success: function () {
  371. // $("#loading_"+i).hide();
  372. $('body').fadeOut(400, function(){
  373. location.reload();
  374.  
  375. });
  376. }
  377. });
  378.  
  379. }
  380. }
  381.  
  382. function deletelocation(i)
  383. {
  384.  
  385. if (confirm('Are you sure you want to delete this ?')) {
  386. //$("#loading_"+i).show();
  387.  
  388. $.ajax({
  389. type: "POST",
  390. url : 'process/process.php?action=deletelocation&id='+i,
  391. success: function () {
  392. // $("#loading_"+i).hide();
  393. $('body').fadeOut(400, function(){
  394. location.reload();
  395.  
  396. });
  397. }
  398. });
  399.  
  400. }
  401. }
  402.  
  403. function deleteshift(i)
  404. {
  405.  
  406. if (confirm('Are you sure you want to delete this ?')) {
  407. //$("#loading_"+i).show();
  408.  
  409. $.ajax({
  410. type: "POST",
  411. url : 'process/process.php?action=deleteshift&id='+i,
  412. success: function () {
  413. // $("#loading_"+i).hide();
  414. $('body').fadeOut(400, function(){
  415. location.reload();
  416.  
  417. });
  418. }
  419. });
  420.  
  421. }
  422. }
  423. function deleterole(i)
  424. {
  425.  
  426. if (confirm('Are you sure you want to delete this ?')) {
  427. //$("#loading_"+i).show();
  428.  
  429. $.ajax({
  430. type: "POST",
  431. url : 'process/process.php?action=deleterole&id='+i,
  432. success: function () {
  433. // $("#loading_"+i).hide();
  434. $('body').fadeOut(400, function(){
  435. location.reload();
  436.  
  437. });
  438. }
  439. });
  440.  
  441. }
  442. }
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. function deletejobwork(i)
  451. {
  452.  
  453. if (confirm('Are you sure you want to delete this ?')) {
  454. //$("#loading_"+i).show();
  455.  
  456. $.ajax({
  457. type: "POST",
  458. url : 'process/process.php?action=deletejobwork&wo_no='+i,
  459. success: function () {
  460. // $("#loading_"+i).hide();
  461. $('body').fadeOut(400, function(){
  462. location.reload();
  463.  
  464. });
  465. }
  466. });
  467.  
  468. }
  469. }
  470. function deletestock(i)
  471. {
  472.  
  473. if (confirm('Are you sure you want to delete this ?')) {
  474. //$("#loading_"+i).show();
  475.  
  476. $.ajax({
  477. type: "POST",
  478. url : 'process/process.php?action=deletestock&id='+i,
  479. success: function () {
  480. // $("#loading_"+i).hide();
  481. $('body').fadeOut(400, function(){
  482. location.reload();
  483.  
  484. });
  485. }
  486. });
  487.  
  488. }
  489. }
  490.  
  491. function deletesalesinvoice(i)
  492. {
  493.  
  494. if (confirm('Are you sure you want to delete this ?')) {
  495. //$("#loading_"+i).show();
  496.  
  497. $.ajax({
  498. type: "POST",
  499. url : 'process/process.php?action=deletesalesinvoice&sales_invoice_no='+i,
  500. success: function () {
  501. // $("#loading_"+i).hide();
  502. $('body').fadeOut(400, function(){
  503. location.reload();
  504.  
  505. });
  506. }
  507. });
  508.  
  509. }
  510. }
  511.  
  512. function deletecashinvoice(i)
  513. {
  514.  
  515. if (confirm('Are you sure you want to delete this ?')) {
  516. //$("#loading_"+i).show();
  517.  
  518. $.ajax({
  519. type: "POST",
  520. url : 'process/process.php?action=deletecashinvoice&cashinvoice_no='+i,
  521. success: function () {
  522. // $("#loading_"+i).hide();
  523. $('body').fadeOut(400, function(){
  524. location.reload();
  525.  
  526. });
  527. }
  528. });
  529.  
  530. }
  531. }
  532. /*function deletecashinvoice12(i)
  533. {
  534.  
  535. if (confirm('Are you sure you want to delete this ?')) {
  536. //$("#loading_"+i).show();
  537.  
  538. $.ajax({
  539. type: "POST",
  540. url : 'process/process.php?action=deletecashinvoice12&cashinvoice_no='+i,
  541. success: function () {
  542. // $("#loading_"+i).hide();
  543. $('body').fadeOut(400, function(){
  544. location.reload();
  545.  
  546. });
  547. }
  548. });
  549.  
  550. }
  551. }
  552. */
  553. function deletebatchcreation(i)
  554. {
  555.  
  556. if (confirm('Are you sure you want to delete this ?')) {
  557. //$("#loading_"+i).show();
  558.  
  559. $.ajax({
  560. type: "POST",
  561. url : 'process/process.php?action=deletebatchcreation&batch_no='+i,
  562. success: function () {
  563. // $("#loading_"+i).hide();
  564. $('body').fadeOut(400, function(){
  565. location.reload();
  566.  
  567. });
  568. }
  569. });
  570.  
  571. }
  572. }
  573. function addsequirty ()
  574. {
  575. var after = $("#after").val();
  576. var ip = $("#ip").val();
  577. var valid;
  578. valid = addsequirtys();
  579. if(valid) {
  580. var UrlToPass = 'action=addsequirty&after='+after+'&ip='+ip;
  581. $.ajax({
  582. type : 'POST',
  583. data : UrlToPass,
  584. url : 'process/process.php',
  585. success: function(data){
  586. $("#asdd").load("taxs.php #asdd");
  587. $("#AllError").html('Tax Added Successfully!');
  588. $(".alart_meneg").show();
  589. $(".closeddiv").click();
  590. $('body').fadeOut(800, function(){
  591. document.location.href ='security.php';
  592.  
  593. });
  594. setTimeout(function(){
  595. $("#AllError").fadeOut("slow", function () {
  596. $("#AllError").remove();
  597. });
  598. }, 1500);
  599. $('#tname').val('');
  600. $('#registration').val('');
  601. $('#rate').val('');
  602. }
  603. });
  604. }
  605. else
  606. {
  607. $("#loading").hide();
  608. //$("#AllError").html('Please fill all field!');
  609. //$(".alart_meneg").show();
  610. setTimeout(function(){
  611. $("#AllError").fadeOut("slow", function () {
  612. $("#AllError").remove();
  613. });
  614. }, 1500);
  615. return false;
  616.  
  617. }
  618. }
  619.  
  620. function addsequirtys() {
  621. var valid = true;
  622. $(".demoInputBox").css('background-color','');
  623. $(".info").html('');
  624. if(!$("#after").val()) {
  625.  
  626. $("#after-info").html("This field is required");
  627. $("#after").css('background-color','#FFFFDF');
  628. valid = false;
  629. }
  630. if(!$("#ip").val()) {
  631.  
  632. $("#ip-info").html("This field is required");
  633. $("#ip").css('background-color','#FFFFDF');
  634. valid = false;
  635. }
  636.  
  637.  
  638. return valid;
  639. }
  640.  
  641.  
  642. function termsdefault (i)
  643. {
  644.  
  645. if(i!='') {
  646. var UrlToPass = 'action=termsdefault&i='+i;
  647. $.ajax({
  648. type : 'POST',
  649. data : UrlToPass,
  650. url : 'process/process.php',
  651. success: function(data){
  652. $("#asdd").load("payment-terms.php #asdd");
  653. $("#AllError").html('Tax Added Successfully!');
  654. $(".alart_meneg").show();
  655. setTimeout(function(){
  656. $("#AllError").fadeOut("slow", function () {
  657. $("#AllError").remove();
  658. });
  659. }, 1500);
  660. $('#tname').val('');
  661. $('#registration').val('');
  662. $('#rate').val('');
  663. }
  664. });
  665. }
  666. else
  667. {
  668. $("#loading").hide();
  669. //$("#AllError").html('Please fill all field!');
  670. //$(".alart_meneg").show();
  671. setTimeout(function(){
  672. $("#AllError").fadeOut("slow", function () {
  673. $("#AllError").remove();
  674. });
  675. }, 1500);
  676. return false;
  677.  
  678. }
  679. }
  680.  
  681. function methoddefault (i)
  682. {
  683.  
  684. if(i!='') {
  685. var UrlToPass = 'action=methoddefault&i='+i;
  686. $.ajax({
  687. type : 'POST',
  688. data : UrlToPass,
  689. url : 'process/process.php',
  690. success: function(data){
  691. $("#asdd").load("payment-method.php #asdd");
  692. $("#AllError").html('Tax Added Successfully!');
  693. $(".alart_meneg").show();
  694. setTimeout(function(){
  695. $("#AllError").fadeOut("slow", function () {
  696. $("#AllError").remove();
  697. });
  698. }, 1500);
  699. $('#tname').val('');
  700. $('#registration').val('');
  701. $('#rate').val('');
  702. }
  703. });
  704. }
  705. else
  706. {
  707. $("#loading").hide();
  708. //$("#AllError").html('Please fill all field!');
  709. //$(".alart_meneg").show();
  710. setTimeout(function(){
  711. $("#AllError").fadeOut("slow", function () {
  712. $("#AllError").remove();
  713. });
  714. }, 1500);
  715. return false;
  716.  
  717. }
  718. }
  719.  
  720.  
  721.  
  722. function adddmethod ()
  723. {
  724. var name = $("#name").val();
  725. var valid;
  726. valid = adddmethods();
  727. if(valid) {
  728. var UrlToPass = 'action=adddmethod&name='+name;
  729. $.ajax({
  730. type : 'POST',
  731. data : UrlToPass,
  732. url : 'process/process.php',
  733. success: function(data){
  734. $("#asdd").load("taxs.php #asdd");
  735. $("#AllError").html('Tax Added Successfully!');
  736. $(".alart_meneg").show();
  737. $(".closeddiv").click();
  738. $('body').fadeOut(800, function(){
  739. document.location.href ='payment-method.php';
  740.  
  741. });
  742. setTimeout(function(){
  743. $("#AllError").fadeOut("slow", function () {
  744. $("#AllError").remove();
  745. });
  746. }, 1500);
  747. $('#tname').val('');
  748. $('#registration').val('');
  749. $('#rate').val('');
  750. }
  751. });
  752. }
  753. else
  754. {
  755. $("#loading").hide();
  756. //$("#AllError").html('Please fill all field!');
  757. //$(".alart_meneg").show();
  758. setTimeout(function(){
  759. $("#AllError").fadeOut("slow", function () {
  760. $("#AllError").remove();
  761. });
  762. }, 1500);
  763. return false;
  764.  
  765. }
  766. }
  767.  
  768. function adddmethods() {
  769. var valid = true;
  770. $(".demoInputBox").css('background-color','');
  771. $(".info").html('');
  772. if(!$("#name").val()) {
  773.  
  774. $("#name-info").html("This field is required");
  775. $("#name").css('background-color','#FFFFDF');
  776. valid = false;
  777. }
  778.  
  779.  
  780.  
  781. return valid;
  782. }
  783.  
  784. function adddterms ()
  785. {
  786. var terms = $("#terms").val();
  787. var days = $("#days").val();
  788. var valid;
  789. valid = addterm();
  790. if(valid) {
  791. var UrlToPass = 'action=addterms&terms='+terms+'&days='+days;
  792. $.ajax({
  793. type : 'POST',
  794. data : UrlToPass,
  795. url : 'process/process.php',
  796. success: function(data){
  797. $("#asdd").load("taxs.php #asdd");
  798. $("#AllError").html('Tax Added Successfully!');
  799. $(".alart_meneg").show();
  800. $(".closeddiv").click();
  801. $('body').fadeOut(800, function(){
  802. document.location.href ='payment-terms.php';
  803.  
  804. });
  805. setTimeout(function(){
  806. $("#AllError").fadeOut("slow", function () {
  807. $("#AllError").remove();
  808. });
  809. }, 1500);
  810. $('#tname').val('');
  811. $('#registration').val('');
  812. $('#rate').val('');
  813. }
  814. });
  815. }
  816. else
  817. {
  818. $("#loading").hide();
  819. //$("#AllError").html('Please fill all field!');
  820. //$(".alart_meneg").show();
  821. setTimeout(function(){
  822. $("#AllError").fadeOut("slow", function () {
  823. $("#AllError").remove();
  824. });
  825. }, 1500);
  826. return false;
  827.  
  828. }
  829. }
  830.  
  831. function addterm() {
  832. var valid = true;
  833. $(".demoInputBox").css('background-color','');
  834. $(".info").html('');
  835. if(!$("#terms").val()) {
  836.  
  837. $("#terms-info").html("This field is required");
  838. $("#terms").css('background-color','#FFFFDF');
  839. valid = false;
  840. }
  841.  
  842. if(!$("#days").val()) {
  843.  
  844. $("#days-info").html("This field is required");
  845. $("#days").css('background-color','#FFFFDF');
  846. valid = false;
  847. }
  848.  
  849. return valid;
  850. }
  851.  
  852. function addpacking ()
  853. {
  854. var editor1 = $("#editor1").val();
  855. //alert(editor1);
  856. var enable =$('input[name="status4"]:checked').val();
  857. var location =$('input[name="status5"]:checked').val();
  858. var valid;
  859. valid = addpackings();
  860. if(valid) {
  861. var UrlToPass = 'action=addpacking&editor1='+editor1+'&enable='+enable+'&location='+location;
  862. $.ajax({
  863. type : 'POST',
  864. data : UrlToPass,
  865. url : 'process/process.php',
  866. success: function(data){
  867. $("#asdd").load("taxs.php #asdd");
  868. $("#AllError").html('Tax Added Successfully!');
  869. $(".alart_meneg").show();
  870. $(".closeddiv").click();
  871. setTimeout(function(){
  872. $("#AllError").fadeOut("slow", function () {
  873. $("#AllError").remove();
  874. });
  875. }, 1500);
  876. $('#tname').val('');
  877. $('#registration').val('');
  878. $('#rate').val('');
  879. }
  880. });
  881. }
  882. else
  883. {
  884. $("#loading").hide();
  885. //$("#AllError").html('Please fill all field!');
  886. //$(".alart_meneg").show();
  887. setTimeout(function(){
  888. $("#AllError").fadeOut("slow", function () {
  889. $("#AllError").remove();
  890. });
  891. }, 1500);
  892. return false;
  893.  
  894. }
  895. }
  896.  
  897. function addpackings() {
  898. var valid = true;
  899. $(".demoInputBox").css('background-color','');
  900. $(".info").html('');
  901. if(!$("#editor1").val()) {
  902.  
  903. $("#editor1-info").html("This field is required");
  904. $("#editor1").css('background-color','#FFFFDF');
  905. valid = false;
  906. }
  907.  
  908.  
  909.  
  910. return valid;
  911. }
  912.  
  913.  
  914. function addtax ()
  915. {
  916. var tname = $('#tname').val();
  917. var registration = $('#registration').val();
  918. var rate = $('#rate').val();
  919. var valid;
  920. valid = custompaymentmethod222();
  921. if(valid) {
  922. var UrlToPass = 'action=addtax&tname='+tname+'&registration='+registration+'&rate='+rate;
  923. $.ajax({
  924. type : 'POST',
  925. data : UrlToPass,
  926. url : 'process/process.php',
  927. success: function(data){
  928. $("#asdd").load("taxs.php #asdd");
  929. $("#AllError").html('Tax Added Successfully!');
  930. $(".alart_meneg").show();
  931. $(".closeddiv").click();
  932. $('body').fadeOut(800, function(){
  933. document.location.href ='taxs.php';
  934.  
  935. });
  936. //gethtml();
  937. setTimeout(function(){
  938. $("#AllError").fadeOut("slow", function () {
  939. $("#AllError").remove();
  940.  
  941. });
  942. }, 1500);
  943. $('#tname').val('');
  944. $('#registration').val('');
  945. $('#rate').val('');
  946. }
  947. });
  948. }
  949. else
  950. {
  951. $("#loading").hide();
  952. //$("#AllError").html('Please fill all field!');
  953. //$(".alart_meneg").show();
  954. setTimeout(function(){
  955. $("#AllError").fadeOut("slow", function () {
  956. $("#AllError").remove();
  957. });
  958. }, 1500);
  959. return false;
  960.  
  961. }
  962. }
  963.  
  964. function custompaymentmethod222() {
  965. var valid = true;
  966. $(".demoInputBox").css('background-color','');
  967. $(".info").html('');
  968. if(!$("#tname").val()) {
  969. $("#tname-info").html("This field is required");
  970. $("#tname").css('background-color','#FFFFDF');
  971. valid = false;
  972. }
  973.  
  974. if(!$("#registration").val()) {
  975. $("#registration-info").html("This field is required");
  976. $("#registration").css('background-color','#FFFFDF');
  977. valid = false;
  978. }
  979. if(!$("#rate").val()) {
  980. $("#rate-info").html("This field is required");
  981. $("#rate").css('background-color','#FFFFDF');
  982. valid = false;
  983. }
  984.  
  985. return valid;
  986. }
  987.  
  988.  
  989.  
  990.  
  991. function updateaddtax (i)
  992. {
  993. //alert(i);
  994. var tname = $('#utname'+i).val();
  995. var registration = $('#uregistration'+i).val();
  996. var rate = $('#urate'+i).val();
  997. var valid;
  998. valid = custompaymentmethod2222(i);
  999. if(valid) {
  1000. var UrlToPass = 'action=updateaddtax&tname='+tname+'&registration='+registration+'&rate='+rate+'&id='+i;
  1001. $.ajax({
  1002. type : 'POST',
  1003. data : UrlToPass,
  1004. url : 'process/process.php',
  1005. success: function(data){
  1006. $("#asdd").load("taxs.php #asdd");
  1007. $("#AllError").html('Tax Updated Successfully!');
  1008. $(".alart_meneg").show();
  1009. $(".closeddiv"+i).click();
  1010. setTimeout(function(){
  1011. $("#AllError").fadeOut("slow", function () {
  1012. $("#AllError").remove();
  1013. });
  1014. }, 1500);
  1015. $('#utname').val('');
  1016. $('#uregistration').val('');
  1017. $('#urate').val('');
  1018. }
  1019. });
  1020. }
  1021. else
  1022. {
  1023. $("#loading").hide();
  1024. //$("#AllError").html('Please fill all field!');
  1025. //$(".alart_meneg").show();
  1026. setTimeout(function(){
  1027. $("#AllError").fadeOut("slow", function () {
  1028. $("#AllError").remove();
  1029. });
  1030. }, 1500);
  1031. return false;
  1032.  
  1033. }
  1034. }
  1035.  
  1036.  
  1037.  
  1038.  
  1039. function custompaymentmethod2222(i) {
  1040. var valid = true;
  1041. $(".demoInputBox").css('background-color','');
  1042. $(".info").html('');
  1043. if(!$("#utname"+i).val()) {
  1044. $("#utname-info"+i).html("This field is required");
  1045. $("#utname"+i).css('background-color','#FFFFDF');
  1046. valid = false;
  1047. }
  1048.  
  1049. if(!$("#uregistration"+i).val()) {
  1050. $("#uregistration-info"+i).html("This field is required");
  1051. $("#uregistration"+i).css('background-color','#FFFFDF');
  1052. valid = false;
  1053. }
  1054. if(!$("#urate"+i).val()) {
  1055. $("#urate-info"+i).html("This field is required");
  1056. $("#urate"+i).css('background-color','#FFFFDF');
  1057. valid = false;
  1058. }
  1059.  
  1060. return valid;
  1061. }
  1062.  
  1063. function deletetax(i)
  1064. {
  1065. if (confirm('Are you sure you want to delete this ?')) {
  1066. //$("#loading_"+i).show();
  1067. $("#delete").text('Deleting..');
  1068. $.ajax({
  1069. type: "POST",
  1070. url : 'process/process.php?action=deletetax&id='+i,
  1071. success: function(status){
  1072.  
  1073. var status=$.trim(status);
  1074. if(status=='1')
  1075. {
  1076. $("#asdd").load("taxs.php #asdd");
  1077.  
  1078. }
  1079. }
  1080. });
  1081.  
  1082.  
  1083. }
  1084. }
  1085.  
  1086.  
  1087. function adddept()
  1088. {
  1089.  
  1090. var dept = $('#dept').val();
  1091. var parents = $('#parent').val();
  1092. var valid;
  1093. valid = adddepts();
  1094. if(valid) {
  1095.  
  1096. $('#depts').val(dept);
  1097. $('#parentss').val(parents);
  1098. $(".closediv").click();
  1099.  
  1100. }
  1101. }
  1102.  
  1103.  
  1104.  
  1105. function adddepts() {
  1106. var valid = true;
  1107. $(".demoInputBox").css('background-color','');
  1108. $(".info").html('');
  1109. if(!$("#dept").val()) {
  1110. $("#dept-info").html("This field is required");
  1111. $("#dept").css('background-color','#FFFFDF');
  1112. valid = false;
  1113. }
  1114.  
  1115. if(!$("#parent").val()) {
  1116. $("#parent-info").html("This field is required");
  1117. $("#parent").css('background-color','#FFFFDF');
  1118. valid = false;
  1119. }
  1120.  
  1121. return valid;
  1122. }
  1123.  
  1124.  
  1125. function addsupplier ()
  1126. {
  1127. var sname = $('#sname').val();
  1128. var valid;
  1129. valid = addsuppliers();
  1130. if(valid) {
  1131. var UrlToPass = 'action=addsupplier&sname='+sname;
  1132. $.ajax({
  1133. type : 'POST',
  1134. data : UrlToPass,
  1135. url : 'process/process.php',
  1136. success: function(data){
  1137. $("#suppliers").load("product-form.php #suppliers");
  1138. $("#AllError").html('Tax Added Successfully!');
  1139. $(".alart_meneg").show();
  1140. $(".closeddiv").click();
  1141. $('#sname').val('');
  1142. setTimeout(function(){
  1143. $("#AllError").fadeOut("slow", function () {
  1144. $("#AllError").remove();
  1145. });
  1146. }, 1500);
  1147. }
  1148. });
  1149. }
  1150. else
  1151. {
  1152. $("#loading").hide();
  1153. //$("#AllError").html('Please fill all field!');
  1154. //$(".alart_meneg").show();
  1155. setTimeout(function(){
  1156. $("#AllError").fadeOut("slow", function () {
  1157. $("#AllError").remove();
  1158. });
  1159. }, 1500);
  1160. return false;
  1161.  
  1162. }
  1163. }
  1164.  
  1165. function addsuppliers() {
  1166. var valid = true;
  1167. $(".demoInputBox").css('background-color','');
  1168. $(".info").html('');
  1169. if(!$("#sname").val()) {
  1170. $("#sname-info").html("This field is required");
  1171. $("#sname").css('background-color','#FFFFDF');
  1172. valid = false;
  1173. }
  1174.  
  1175.  
  1176. return valid;
  1177. }
  1178.  
  1179.  
  1180.  
  1181. function addbrand ()
  1182. {
  1183. var sname = $('#brands').val();
  1184. var valid;
  1185. valid = addbrands();
  1186. if(valid) {
  1187. var UrlToPass = 'action=addbrand&sname='+sname;
  1188. $.ajax({
  1189. type : 'POST',
  1190. data : UrlToPass,
  1191. url : 'process/process.php',
  1192. success: function(data){
  1193. $("#asdd").load("product-form.php #asdd");
  1194. $("#AllError").html('Tax Added Successfully!');
  1195. $(".alart_meneg").show();
  1196. $(".closeddivv").click();
  1197. $('#brands').val('');
  1198. setTimeout(function(){
  1199. $("#AllError").fadeOut("slow", function () {
  1200. $("#AllError").remove();
  1201. });
  1202. }, 1500);
  1203. }
  1204. });
  1205. }
  1206. else
  1207. {
  1208. $("#loading").hide();
  1209. //$("#AllError").html('Please fill all field!');
  1210. //$(".alart_meneg").show();
  1211. setTimeout(function(){
  1212. $("#AllError").fadeOut("slow", function () {
  1213. $("#AllError").remove();
  1214. });
  1215. }, 1500);
  1216. return false;
  1217.  
  1218. }
  1219. }
  1220.  
  1221. function addbrands() {
  1222. var valid = true;
  1223. $(".demoInputBox").css('background-color','');
  1224. $(".info").html('');
  1225. if(!$("#brands").val()) {
  1226. $("#brands-info").html("This field is required");
  1227. $("#brands").css('background-color','#FFFFDF');
  1228. valid = false;
  1229. }
  1230.  
  1231.  
  1232. return valid;
  1233. }
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239. function addtype ()
  1240. {
  1241. var sname = $('#types').val();
  1242. var valid;
  1243. valid = addtypes();
  1244. if(valid) {
  1245. var UrlToPass = 'action=addtype&sname='+sname;
  1246. $.ajax({
  1247. type : 'POST',
  1248. data : UrlToPass,
  1249. url : 'process/process.php',
  1250. success: function(data){
  1251. $("#type").load("product-form.php #type");
  1252. $("#AllError").html('Tax Added Successfully!');
  1253. $(".alart_meneg").show();
  1254. $(".closeddivvv").click();
  1255. $('#types').val('');
  1256. setTimeout(function(){
  1257. $("#AllError").fadeOut("slow", function () {
  1258. $("#AllError").remove();
  1259. });
  1260. }, 1500);
  1261. }
  1262. });
  1263. }
  1264. else
  1265. {
  1266. $("#loading").hide();
  1267. //$("#AllError").html('Please fill all field!');
  1268. //$(".alart_meneg").show();
  1269. setTimeout(function(){
  1270. $("#AllError").fadeOut("slow", function () {
  1271. $("#AllError").remove();
  1272. });
  1273. }, 1500);
  1274. return false;
  1275.  
  1276. }
  1277. }
  1278.  
  1279. function addtypes() {
  1280. var valid = true;
  1281. $(".demoInputBox").css('background-color','');
  1282. $(".info").html('');
  1283. if(!$("#types").val()) {
  1284. $("#types-info").html("This field is required");
  1285. $("#types").css('background-color','#FFFFDF');
  1286. valid = false;
  1287. }
  1288.  
  1289.  
  1290. return valid;
  1291. }
  1292.  
  1293.  
  1294.  
  1295. function autogenrate()
  1296. {
  1297. //alert(123)
  1298. var i = '1';
  1299. if((i!=''))
  1300. {
  1301. $.ajax({
  1302. type: "POST",
  1303. url : 'process/process.php?action=autogenrate',
  1304. success: function (data) {
  1305. var vess=$("#sku").val(data);
  1306. //alert(data);
  1307. }
  1308. });
  1309.  
  1310. }
  1311. }
  1312.  
  1313.  
  1314.  
  1315. function updatemeasure (i)
  1316. {
  1317. //alert(i);
  1318. var tname = $('#utname'+i).val();
  1319. var registration = $('#uregistration'+i).val();
  1320. var valid;
  1321. valid = updatemeasures(i);
  1322. if(valid) {
  1323. var UrlToPass = 'action=updatemeasure&tname='+tname+'&registration='+registration+'&id='+i;
  1324. $.ajax({
  1325. type : 'POST',
  1326. data : UrlToPass,
  1327. url : 'process/process.php',
  1328. success: function(data){
  1329. $("#asdd").load("measure.php #asdd");
  1330. $("#AllError").html('Measure Updated Successfully!');
  1331. $(".alart_meneg").show();
  1332. $(".closeddiv"+i).click();
  1333. setTimeout(function(){
  1334. $("#AllError").fadeOut("slow", function () {
  1335. $("#AllError").remove();
  1336. });
  1337. }, 1500);
  1338. $('#utname').val('');
  1339. $('#uregistration').val('');
  1340. }
  1341. });
  1342. }
  1343. else
  1344. {
  1345. $("#loading").hide();
  1346. //$("#AllError").html('Please fill all field!');
  1347. //$(".alart_meneg").show();
  1348. setTimeout(function(){
  1349. $("#AllError").fadeOut("slow", function () {
  1350. $("#AllError").remove();
  1351. });
  1352. }, 1500);
  1353. return false;
  1354.  
  1355. }
  1356. }
  1357.  
  1358.  
  1359. function updatepacking (i)
  1360. {
  1361.  
  1362. var editor1 = $('#editor1'+i).val();
  1363. var enable=$("input:checkbox[name='usunstatusss" + i + "']:checked").val();
  1364. var include=$("input:checkbox[name='usunstatussss" + i + "']:checked").val();
  1365.  
  1366. if(enable !='') {
  1367. var UrlToPass = 'action=updatepacking&editor1='+editor1+'&enable='+enable+'&id='+i+'&include='+include;
  1368. $.ajax({
  1369. type : 'POST',
  1370. data : UrlToPass,
  1371. url : 'process/process.php',
  1372. success: function(data){
  1373. $("#asdd").load("packing.php #asdd");
  1374. $("#AllError").html('Packing Updated Successfully!');
  1375. $(".alart_meneg").show();
  1376. $(".closeddiv"+i).click();
  1377. setTimeout(function(){
  1378. $("#AllError").fadeOut("slow", function () {
  1379. $("#AllError").remove();
  1380. });
  1381. }, 1500);
  1382. $('#utname').val('');
  1383. $('#uregistration').val('');
  1384. }
  1385. });
  1386. }
  1387. else
  1388. {
  1389. $("#loading").hide();
  1390. //$("#AllError").html('Please fill all field!');
  1391. //$(".alart_meneg").show();
  1392. setTimeout(function(){
  1393. $("#AllError").fadeOut("slow", function () {
  1394. $("#AllError").remove();
  1395. });
  1396. }, 1500);
  1397. return false;
  1398.  
  1399. }
  1400. }
  1401.  
  1402.  
  1403. function updatemeasures(i) {
  1404. var valid = true;
  1405. $(".demoInputBox").css('background-color','');
  1406. $(".info").html('');
  1407. if(!$("#utname"+i).val()) {
  1408. $("#utname-info"+i).html("This field is required");
  1409. $("#utname"+i).css('background-color','#FFFFDF');
  1410. valid = false;
  1411. }
  1412.  
  1413. if(!$("#uregistration"+i).val()) {
  1414. $("#uregistration-info"+i).html("This field is required");
  1415. $("#uregistration"+i).css('background-color','#FFFFDF');
  1416. valid = false;
  1417. }
  1418.  
  1419.  
  1420. return valid;
  1421. }
  1422.  
  1423.  
  1424.  
  1425. function deletemeasure(i)
  1426. {
  1427. if (confirm('Are you sure you want to delete this ?')) {
  1428. //$("#loading_"+i).show();
  1429. $("#delete").text('Deleting..');
  1430. $.ajax({
  1431. type: "POST",
  1432. url : 'process/process.php?action=deletemeasure&id='+i,
  1433. success: function(status){
  1434.  
  1435. var status=$.trim(status);
  1436. if(status=='1')
  1437. {
  1438. $("#asdd").load("measure.php #asdd");
  1439.  
  1440. }
  1441. }
  1442. });
  1443.  
  1444.  
  1445. }
  1446. }
  1447.  
  1448. function deletepacking(i)
  1449. {
  1450. //alert(1);
  1451.  
  1452. if (confirm('Are you sure you want to delete this ?')) {
  1453. //$("#loading_"+i).show();
  1454. $("#delete").text('Deleting..');
  1455. $.ajax({
  1456. type: "POST",
  1457. url : 'process/process.php?action=deletepacking&id='+i,
  1458. success: function(status){
  1459.  
  1460. var status=$.trim(status);
  1461. if(status=='1')
  1462. {
  1463. $('body').fadeOut(400, function(){
  1464.  
  1465. document.location.href = "packing.php";
  1466. });
  1467. }
  1468. }
  1469. });
  1470.  
  1471.  
  1472. }
  1473. }
  1474.  
  1475. function adduser ()
  1476. {
  1477. var name = $('#name').val();
  1478. var email = $('#email').val();
  1479. var role = $('#role').val();
  1480. var valid;
  1481. valid = users();
  1482. if(valid) {
  1483. var UrlToPass = 'action=adduser&name='+name+'&email='+email+'&role='+role;
  1484. $.ajax({
  1485. type : 'POST',
  1486. data : UrlToPass,
  1487. url : 'process/process.php',
  1488. success: function(data){
  1489. $("#AllError").html('User Added Successfully!');
  1490. $(".alart_meneg").show();
  1491. $(".closeddiv").click();
  1492. $('body').fadeOut(800, function(){
  1493. document.location.href ='list-user.php';
  1494.  
  1495. });
  1496. setTimeout(function(){
  1497. $("#AllError").fadeOut("slow", function () {
  1498. $("#AllError").remove();
  1499. });
  1500. }, 1500);
  1501. $('#tname').val('');
  1502. $('#registration').val('');
  1503. $('#rate').val('');
  1504. }
  1505. });
  1506. }
  1507. else
  1508. {
  1509. $("#loading").hide();
  1510. //$("#AllError").html('Please fill all field!');
  1511. //$(".alart_meneg").show();
  1512. setTimeout(function(){
  1513. $("#AllError").fadeOut("slow", function () {
  1514. $("#AllError").remove();
  1515. });
  1516. }, 1500);
  1517. return false;
  1518.  
  1519. }
  1520. }
  1521.  
  1522. function users() {
  1523. var valid = true;
  1524. $(".demoInputBox").css('background-color','');
  1525. $(".info").html('');
  1526. $("#email-info").show();
  1527. if(!$("#name").val()) {
  1528. $("#name-info").html("This field is required");
  1529. $("#name").css('background-color','#FFFFDF');
  1530. valid = false;
  1531. }
  1532.  
  1533.  
  1534. if($('#role').val() == "0") {
  1535. $("#role-info").html("please select role");
  1536. $("#role").css('background-color','#FFFFDF');
  1537. valid = false;
  1538. }
  1539. if(!$("#email").val()) {
  1540. $("#email-info").html("required");
  1541. $("#email").css('background-color','#FFFFDF');
  1542. valid = false;
  1543. }
  1544. if(!$("#email").val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
  1545. $("#email-info").html("Please Enter valid email");
  1546. $("#email").css('background-color','#FFFFDF');
  1547. valid = false;
  1548. }
  1549. return valid;
  1550. }
  1551.  
  1552.  
  1553.  
  1554. function updateuser (i)
  1555. {
  1556. var name = $('#uname'+i).val();
  1557. var email = $('#uemail'+i).val();
  1558. var role = $('#urole'+i).val();
  1559. var valid;
  1560. valid = userss(i);
  1561. if(valid) {
  1562. var UrlToPass = 'action=updateuser&name='+name+'&email='+email+'&role='+role+'&id='+i;
  1563. $.ajax({
  1564. type : 'POST',
  1565. data : UrlToPass,
  1566. url : 'process/process.php',
  1567. success: function(data){
  1568. $("#AllErroru").html('User Added Successfully!');
  1569. $(".alart_menegu").show();
  1570. $(".closeddiv").click();
  1571. $('body').fadeOut(800, function(){
  1572. document.location.href ='list-user.php';
  1573.  
  1574. });
  1575. setTimeout(function(){
  1576. $("#AllError").fadeOut("slow", function () {
  1577. $("#AllError").remove();
  1578. });
  1579. }, 1500);
  1580. $('#tname').val('');
  1581. $('#registration').val('');
  1582. $('#rate').val('');
  1583. }
  1584. });
  1585. }
  1586. else
  1587. {
  1588. $("#loading").hide();
  1589. //$("#AllError").html('Please fill all field!');
  1590. //$(".alart_meneg").show();
  1591. setTimeout(function(){
  1592. $("#AllError").fadeOut("slow", function () {
  1593. $("#AllError").remove();
  1594. });
  1595. }, 1500);
  1596. return false;
  1597.  
  1598. }
  1599. }
  1600.  
  1601. function userss(i) {
  1602. var valid = true;
  1603. $(".demoInputBox").css('background-color','');
  1604. $(".info").html('');
  1605. if(!$("#uname"+i).val()) {
  1606. $("#uname-info"+i).html("This field is required");
  1607. $("#uname"+i).css('background-color','#FFFFDF');
  1608. valid = false;
  1609. }
  1610.  
  1611.  
  1612. if($('#urole'+i).val() == "0") {
  1613. $("#urole-info"+i).html("please select role");
  1614. $("#urole"+i).css('background-color','#FFFFDF');
  1615. valid = false;
  1616. }
  1617. if(!$("#uemail"+i).val()) {
  1618. $("#uemail-info"+i).html("required");
  1619. $("#uemail"+i).css('background-color','#FFFFDF');
  1620. valid = false;
  1621. }
  1622. if(!$("#uemail"+i).val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
  1623. $("#uemail-info"+i).html("Please Enter valid email");
  1624. $("#uemail"+i).css('background-color','#FFFFDF');
  1625. valid = false;
  1626. }
  1627. return valid;
  1628. }
  1629.  
  1630.  
  1631. function check_email(x)
  1632. {
  1633.  
  1634. if(x!='')
  1635. {
  1636.  
  1637. $.ajax({
  1638. type: "POST",
  1639. url:'process/process.php?email='+x+'&action=check_mail',
  1640. beforeSend: function (data) {
  1641. $('#fadediv').show();
  1642. },
  1643. success: function (data) {
  1644. $('#fadediv').hide();
  1645. var temp = $.trim(data);
  1646. if(temp=='1')
  1647. {
  1648. $('#email_error').html("Email already exist!");
  1649. document.getElementById("email").value = "";
  1650. $("#email-info").hide();
  1651. $("#email-info").hide();
  1652. }
  1653. else
  1654. {
  1655. $('#email_error').html("");
  1656.  
  1657. }
  1658. }
  1659. });
  1660. }
  1661. }
  1662.  
  1663.  
  1664.  
  1665. function deleteuser(i)
  1666. {
  1667. if (confirm('Are you sure you want to delete this ?')) {
  1668. $("#delete").text('Deleting..');
  1669. $.ajax({
  1670. type: "POST",
  1671. url : 'process/process.php?action=deleteuser&id='+i,
  1672. success: function(status){
  1673.  
  1674. var status=$.trim(status);
  1675. if(status=='1')
  1676. {
  1677. $('body').fadeOut(800, function(){
  1678. document.location.href ='list-user.php?success=deleted';
  1679.  
  1680. });
  1681.  
  1682. }
  1683. }
  1684. });
  1685.  
  1686.  
  1687. }
  1688. }
  1689.  
  1690. $res = $db->listorder();
  1691. $row=mysql_num_rows($res);
  1692. echo $row;
  1693.  
  1694. if(isset($_SESSION['adminuserid']))
  1695. {
  1696. echo "<script>window.location = 'dashboard.php'</script>";
  1697. }
Add Comment
Please, Sign In to add comment