-
Notifications
You must be signed in to change notification settings - Fork 0
/
models-manager.php
130 lines (121 loc) · 4.8 KB
/
models-manager.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
session_start();
require 'controls/check-session.php';
if(login_check()) {
?>
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="css/logo.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<?php
include 'navbar.php';
?>
<div class="container">
<div class="row">
<h2 class="center">Add new model</h2>
</div>
<div class="row">
<div class="col s12">
<div class="card-panel">
<div class="row">
<form class="col s12" role="form" id="model-form" method="post" action="write-model.php">
<div class="row">
<!-- Model's title -->
<div class="input-field col s6">
<input placeholder="Title" name="modelstitle" id="modelstitle" type="text" class="validate">
<label required="required" aria-required="true" for="modelstitle">Model's title</label>
</div>
<!-- Text area -->
<div class="row">
<div class="input-field col s12">
<textarea id="description" name="description" class="materialize-textarea validate"></textarea>
<label for="description" required="required" aria-required="true">Model's description</label>
</div>
</div>
<!-- File input -->
<div class="file-field input-field">
<div class="btn blue">
<span>File</span>
<input type="file" name="photo-model" id="photo-model" class="validate">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload model's image">
</div>
</div>
<!-- File input -->
<div class="file-field input-field">
<div class="btn blue">
<span>File</span>
<input type="file">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Model's STL">
</div>
</div>
<div class="input-field col s6">
<input id="modeltags" type="text" class="validate">
<label for="modeltags">Model's TAGS</label>
</div>
<br>
<!-- Load anythings -->
</div>
<div class="right row">
<button type="submit" class="waves-effect waves-light btn blue">Load module</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
include 'footer.php';
?>
<!--JavaScript at end of body for optimized loading-->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript" src="js/navbar.js"></script>
<script type="text/javascript" src="js/jquery-validate.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script>
$( document ).ready( function () {
$("#model-form").validate( {
errorClass: 'invalid',
errorPlacement: function(error, element) {
$(element).closest("form").find("label[for='" + element.attr("id") + "']").attr('data-error', error.text());
},
rules: {
modelstitle: {
required: true
},
description: {
required: true
}
},
messages: {
modelstitle:{
required: "Enter a name",
},
description:{
required: "Enter a description",
}
}
} );
} );
</script>
</body>
</html>
<?php
}else{
header("location:admin.php");
}
?>
<!-- vim: set filetype=eruby.html : -->