aboutsummaryrefslogtreecommitdiff
path: root/include/assignments-view.php
blob: a155ef772ef6cd5f09ec9e92dce1d3eab857405f (plain) (blame)
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
<?php
/**
 * BusinessAdmin: administrative software for small companies
 * Copyright (C) 2015 Camil Staps (ViviSoft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

require_once(__DIR__ . '/../login.php');

$_assignment = new Assignment($_pdo, $_id);
?>
<div class="col-lg-6">
	<div class="panel panel-default">
		<div class="panel-heading">Details</div>
		<div class="panel-body table-responsive">
			<table class="table table-bordered" id="overview-assignments">
				<thead>
					<tr>
						<th>#</th>
						<th>Offer</th>
						<th>Time</th>
						<th>Price</th>
					</tr>
				</thead>
				<tbody>
					<?php
						echo "<tr class='mix'
								data-mixer-order-id='{$_assignment->id}'
								data-mixer-order-offer='{$_assignment->getOffer()->id}'
								data-mixer-order-time='{$_assignment->hours}'
								data-mixer-order-price='{$_assignment->price_per_hour}'>
							<td class='col-min-width'>{$_assignment->id}</td>
							<td class='col-min-width'>
								<a href='".Constants::url_internal."/offers?id={$_assignment->getOffer()->id}'>#{$_assignment->getOffer()->id}</a> to
								<a href='".Constants::url_internal."/contacts?id={$_assignment->getOffer()->getContact()->id}'>{$_assignment->getOffer()->getContact()->name}</a>
								(<a href='".Constants::url_internal."/clients?id={$_assignment->getOffer()->getContact()->getClient()->id}'>{$_assignment->getOffer()->getContact()->getClient()->name}</a>)
							</td>
							<td class='col-min-width'><a href='#' class='editable' id='editable-_assignment-{$_assignment->id}-hours' data-type='text' data-pk='{$_assignment->id}' data-url='".Constants::url_external."_assignments/edit'>{$_assignment->hours}</a>h</td>
							<td class='col-min-width'>
							   ".Constants::invoice_valuta."<a href='#' class='editable' id='editable-_assignment-{$_assignment->id}-price_per_hour' data-type='text' data-pk='{$_assignment->id}' data-url='".Constants::url_external."_assignments/edit'>{$_assignment->price_per_hour}</a> / hr<br/>
								<a href='#' class='editable' id='editable-_assignment-{$_assignment->id}-vat' data-type='text' data-pk='{$_assignment->id}' data-url='".Constants::url_external."_assignments/edit'>{$_assignment->VAT_percentage}</a>% VAT
							</td>
						</tr>";
					?>
				</tbody>
			</table>
		</div>
	</div>
</div>
<div class="col-lg-6">
	<div class="panel panel-default">
		<div class="panel-heading">Description</div>
		<div class="panel-body">
			<?=$_assignment->getHTMLDescription()?>
		</div>
	</div>
</div>