Advertisement
Guest User

Untitled

a guest
May 10th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. var app = new Vue({
  2. el: '#app',
  3. data: {
  4. loading: false
  5. },
  6. methods: {
  7. grade: function(pass, pegi) {
  8. this.loading = true;
  9. axios.post("{{ route('mod-interview-grade', $exam) }}", {
  10. pass: pass,
  11. pegi: pegi,
  12.  
  13. if (pass)
  14. {
  15. var mysql = require('mysql');
  16. var con = mysql.createConnection({
  17. host: 'localhost',
  18. user: 'root',
  19. password: '52365236',
  20. database : 'intranet',
  21.  
  22. con.connect(function(err) {
  23. if (err) throw err;
  24.  
  25. con.query(`SELECT steamid FROM users WHERE steamid=${steam}`).then(function(err, result, fields) {
  26. if (err) throw err;
  27. return result;
  28. }).then(function(steamid) {
  29. var con2 = mysql.createConnection({
  30. host: 'localhost',
  31. user: 'root',
  32. password: '52365236',
  33. database : 'altislife',
  34.  
  35. con2.connect(function(err) {
  36. if (err) throw err;
  37.  
  38. con2.query(`INSERT INTO whitelist (pid, whitelist) VALUES ('${steamid}', 1)`).then(function(err, result, fields) {
  39. if (err) throw err;
  40.  
  41. console.log(result);
  42. });
  43. });
  44. });
  45. });
  46. });
  47. });
  48. }).then(function() {
  49. window.location.replace("{{ route('mod-user', $exam->user) }}");
  50. }).catch(function() {
  51. window.location.replace("{{ route('mod-user', $exam->user) }}");
  52. });
  53. }
  54. }
  55. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement