-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproto-raport.html
150 lines (140 loc) · 6.38 KB
/
proto-raport.html
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styles/evo-calendar.css"/>
<link rel="stylesheet" href="styles/materialize.css">
<link href="styles/nouislider.css" rel="stylesheet">
<script src="scripts/nouislider.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300&display=swap" rel="stylesheet">
<script src="scripts/wNumb.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<nav>
<div class="nav-wrapper">
<a href="?page=logout" class="right" style="padding-right: 10px;">Logout</a>
<ul id="nav-mobile" class="left">
<li><a href="#" data-target="slide-out" class="sidenav-trigger show-on-small hide-on-med-and-up"><i class="material-icons large">menu</i></a></li>
<li><a class="hide-on-small-only linkDashboard" href="#">Dashboard</a></li>
<li><a class="hide-on-small-only linkCalendar" href="#">Calendar</a></li>
<?php if ($account->permissions['timesheet']): ?>
<li><a class="hide-on-small-only linkPontaj" href="#">Ponteaza</a></li>
<?php endif; ?>
<?php if ($account->permissions['raport']): ?>
<li><a class="hide-on-small-only linkRaport" href="#">Raportari</a></li>
<?php endif; ?>
<?php if ($account->permissions['holiday']): ?>
<li><a class="hide-on-small-only linkConcediu" href="#">Concediu</a></li>
<?php endif; ?>
<?php if ($account->permissions['admin']): ?>
<li><a class="hide-on-small-only linkAdmin" href="/?page=admin">Admin</a></li>
<?php endif; ?>
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
<div class="row">
<h5 style="padding: 10px;">Buna <?php echo $account->getFirstName(); ?><a href="#" class="right" onclick="$('.sidenav').sidenav('close');"><i class="material-icons">close</i></a></h5>
<br>
<li><a href="#" class="linkDashboard">Dashboard</a></li>
<li><a href="#" class="linkCalendar">Calendar</a></li>
<?php if ($account->permissions['timesheet']): ?>
<li><a href="#" class="linkPontaj">Ponteaza</a></li>
<?php endif; ?>
<?php if ($account->permissions['raport']): ?>
<li><a href="#" class="linkRaport" href="#">Raportari</a></li>
<?php endif; ?>
<?php if ($account->permissions['holiday']): ?>
<li><a href="#" class="linkConcediu">Concediu</a></li>
<?php endif; ?>
<?php if ($account->permissions['admin']): ?>
<li><a href="/?page=admin" class="linkAdmin">Admin</a></li>
<?php endif; ?>
<br>
<li><a href="?page=logout">Logout</a></li>
</div>
</ul>
<div class="container">
<div class="row"></div>
<div class="row hide" id="reportRow">
<ul id="projProgress" class="collapsible expandable">
</ul>
</div>
<!-- <div class="row">
<a class='dropdown-trigger btn' href='#' data-target='addProjDD'>Adauga Proiect</a>
<ul id='addProjDD' class='dropdown-content'>
</ul>
</div> -->
<div class="row">
<div class="input-field col s12 l4">
<select id="addProjDD" class="browser-default" onchange="selectProject(value);">
<option value="" disabled selected>Alege proiectul</option>
</select>
</div>
<div class="input-field col s12 l4" id="select1">
</div>
<div class="input-field col s12 l4" id="select2">
</div>
</div>
<div class="row">
<a id="raporteazateazaBtn" class="waves-effect waves-light btn" onclick="raporteaza();">Raporteaza</a>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
<script>
function raporteaza() {
let curDate = new Date();
const formData = {
'action' : 'addReport',
'date' : `${curDate.getFullYear()}-${curDate.getMonth()+1}-${curDate.getDate()}`,
'report' : reportObject
};
$.ajax({
type : 'POST', // define the type of HTTP verb we want to use (POST for our form)
url : 'handler.php', // the url where we want to POST
data : formData, // our data object
//dataType : 'json', // what type of data do we expect back from the server
encode : true,
success : function(data) {
if (data.substring(0,8)=="Failure:") {
M.toast({html: data.substring(8)});
}
if (data.substring(0,8)=="Success:") {
//e corecta ma
M.toast({html: 'Raportare salvata cu succes!'})
}
},
error: function(){
//
}
});
}
$(document).ready(function(){
addLinks();
$('.sidenav').sidenav();
let reportDate = new Date();
let elem = document.querySelector('.collapsible.expandable');
let instance = M.Collapsible.init(elem, {
accordion: false
});
$.get("handler.php?r=init", function(data, status) {
//console.log("Data: " + data + "\nStatus: " + status);
initData = JSON.parse(data);
collabsObject = initData.collabs;
projectsObject = initData.projects;
activitiesObject = initData.activities;
phasesObject = initData.phases;
milestonesObject = initData.milestones;
//initializare categorii proiect
//populateActiveProjects();
populateActiveDropdown();
$('select').formSelect();
});
});
</script>
</body>
</html>