-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofilemaker.html
More file actions
54 lines (45 loc) · 1.84 KB
/
profilemaker.html
File metadata and controls
54 lines (45 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.14.min.js"></script>
</head>
<body>
<script type="text/javascript">
Parse.initialize("bmobCoB17mgSf7S9J6ZntiQGq5NEm2eIyHroyP9t", "Wut80Nd7rKFVvHEvT7K9jQMCV2HIO67OEH0pWaBe");
Parse.serverURL = 'https://rayfoodapp.herokuapp.com/parse'
window.onload = saveprofile();
function saveprofile()
{
var SupplierProfile = Parse.Object.extend("SupplierProfile");
var supplierprofile = new SupplierProfile();
supplierprofile.set("name", "US Food Service");
supplierprofile.set("address", "15 some Road");
supplierprofile.set("city", "Albany");
supplierprofile.set("State", "NY");
supplierprofile.set("zip", "12186");
supplierprofile.set("phone", "5555555");
supplierprofile.set("salesreps", "paul@usfoodservice.com");
supplierprofile.set("DoesServicecharge", false)
supplierprofile.set("servicechargeprice", 0)
supplierprofile.set("minpricefororder", 50)
supplierprofile.set("percentageoff", 0)
supplierprofile.save(null, {
success: function(profile) {
// Execute any logic that should take place after the object is saved.
console.log('New object created with objectId: ' + profile.id);
alert("you have successfully added a Supplier Profile ")
localStorage.removeItem("selectedsupplier");
},
error: function(profile, error) {
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
}
})
}
</script>
</body>
</head>
</html>