Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. <link rel="stylesheet" type="text/css" href="main.css">
  2.  
  3. <h1>Coursetro Instructor</h1>
  4.  
  5. <h2 id="instructor"></h2>
  6.  
  7. <label for="name" class="col-lg-2 control-label">Instructor Name</label>
  8. <input id="name" type="text">
  9.  
  10. <label for="name" class="col-lg-2 control-label">Instructor Age</label>
  11. <input id="age" type="text">
  12.  
  13. <button id="button">Update Instructor</button>
  14.  
  15.  
  16. </div>
  17.  
  18. <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
  19.  
  20. <script>
  21. if (typeof web3 !== 'undefined') {
  22. web3 = new Web3(web3.currentProvider);
  23. } else {
  24. // set the provider you want from Web3.providers
  25. web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
  26. }
  27. web3.eth.defaultAccount = web3.eth.accounts[0];
  28. var CoursetroContract = web3.eth.contract([
  29. {
  30. "constant": false,
  31. "inputs": [
  32. {
  33. "name": "_fName",
  34. "type": "string"
  35. },
  36. {
  37. "name": "_age",
  38. "type": "uint256"
  39. }
  40. ],
  41. "name": "setInstructor",
  42. "outputs": [],
  43. "payable": false,
  44. "stateMutability": "nonpayable",
  45. "type": "function"
  46. },
  47. {
  48. "constant": true,
  49. "inputs": [],
  50. "name": "getInstructor",
  51. "outputs": [
  52. {
  53. "name": "",
  54. "type": "string"
  55. },
  56. {
  57. "name": "",
  58. "type": "uint256"
  59. }
  60. ],
  61. "payable": false,
  62. "stateMutability": "view",
  63. "type": "function"
  64. }
  65.  
  66. </script>
Add Comment
Please, Sign In to add comment