-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheditJobs.php
149 lines (131 loc) · 4.18 KB
/
editJobs.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
include_once('header.php');
include_once('lang/index.php');
include_once('classes/SteamAuth.php');
$hasError = '';
$updateSuccess = false;
if (!isset($_SESSION['steamUser']))
{
header('Location: login.php');
}
else
{
if (!$_SESSION['steamUser']->permissions->canApproveJobs)
{
?>
<h3 class="fg-red"><?php echo $lang['error']; ?></h3>
<p class="fg-red"><?php echo $lang['permission_denied']; ?></p>
<?php
}
else
{
if(isset($_POST['updateJob']) && isset($_POST['jobID']) && isset($_POST['status']))
{
/*$up_steamID = $_POST['steamID'];
$up_status = $_POST['status'];
$up_submitJobs = 0;
$up_approveJobs = 0;
$up_editUserStatus = 0;
$up_editVTC = 0;
if(isset($_POST['canSubmitJobs']))
$up_submitJobs = 1;
if(isset($_POST['canApproveJobs']))
$up_approveJobs = 1;
if(isset($_POST['canEditUserStatus']))
$up_editUserStatus = 1;
if(isset($_POST['canEditVTCSettings']))
$up_editVTC = 1;
//UpdateUser($steamID,$status,$canSubmit,$canApprove,$canEdit,$canVTC)
if(UpdateUser($up_steamID,$up_status,$up_submitJobs,$up_approveJobs,$up_editUserStatus,$up_editVTC))
{
$updateSuccess = true;
}
else
{
$hasError = 'Failed to update user!';
}
//var_dump($_POST);*/
}
//else
//{
?>
<script src="custom_js/VTCSettings_validate.js" type="text/javascript"></script>
<div class="container">
<table class="table dataTable striped hovered border bordered" id="deliveriesTable" data-role="datatable" data-searching="true">
<thead align="center">
<tr>
<th align="center" style="text-align: center">Job ID</th>
<th align="center" style="text-align: center">Steam ID</th>
<th align="center" stlye="text-align: center">Username</th>
<th align="center" style="text-align: center">Game</th>
<th align="center" style="text-align: center">Source City</th>
<th align="center" style="text-align: center">Destination City</th>
<th align="center" style="text-align: center">Cargo</th>
<th align="center" style="text-align: center">Est. Income</th>
<th align="center" style="text-align: center">Distance Driven</th>
<th align="center" style="text-align: center">Fuel Burned</th>
<th align="center" style="text-align: center">Fuel Purchased</th>
<th align="center" style="text-align: center">Damage</th>
<th align="center" style="text-align: center">Status</th>
</tr>
</thead>
<tbody>
<?php
foreach(GetAllDeliveries() as $tempJob)
{
echo "<tr>";
echo "<td><a href=viewJobDetails.php?id=" . $tempJob->jobID . ">" . $tempJob->jobID . "</a></td>";
echo "<td>" . $tempJob->steamID . "</td>";
echo "<td>" . $tempJob->displayName . "</td>";
echo "<td>" . strtoupper($tempJob->gameAbbreviation) . "</td>";
echo "<td>" . $tempJob->sourceCity . "</td>";
echo "<td>" . $tempJob->destinationCity . "</td>";
echo "<td>" . $tempJob->cargo . "</td>";
echo "<td>";
if(strcmp($tempJob->gameAbbreviation,"ats")===0)
echo "$";
else
echo "€";
echo number_format(round($tempJob->income,2),2) . "</td>";
echo "<td>" ;
if(strcmp($tempJob->gameAbbreviation,"ats")===0)
echo number_format(round($tempJob->distanceDriven*0.621371,2),2) . " MI";
else
echo number_format(round($tempJob->distanceDriven,2),2) . " KM";
echo "</td>";
if(strcmp($tempJob->gameAbbreviation,"ats")===0)
{
echo "<td>" . number_format(round($tempJob->fuelBurned*0.264172,2),2) ;
echo " GL";
}
else
{
echo "<td>" . number_format(round($tempJob->fuelBurned,2),2) ;
echo " L";
}
echo "</td>";
if(strcmp($tempJob->gameAbbreviation,"ats")===0)
{
echo "<td>" . number_format(round($tempJob->fuelPurchased*0.264172,2),2) ;
echo " GL";
}
else
{
echo "<td>" . number_format(round($tempJob->fuelPurchased,2),2) ;
echo " L";
}
echo "</td>";
echo "<td>" . number_format(round($tempJob->damage*100,2),2) . "%</td>";
echo "<td>" . $jobStatuses[$tempJob->status] . "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<?php
//}
}
}
include_once('footer.php');
?>