forked from loadmybowl/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contracts_history.php
102 lines (76 loc) · 5.09 KB
/
contracts_history.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
<?php
session_start();
ob_start();
require_once('check-login.php');
include_once 'header-logged-in.php';
?>
<script type="text/javascript" src="js/contract.js"></script>
<div class="container theme-showcase" role="main">
<header class="page-header">
<h2>PrimeContract</h2>
</header>
<div class="row">
<div class="col-md-12">
<section class="panel panel-primary">
<header class="panel-heading">
<h2 class="panel-title">Contracts History</h2>
</header>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<?php
include_once 'dbhelper.php';
include_once 'resources.php';
$dbHelper = new DBHelper(session_id(), $_SERVER);
$createdContractsDetails = $dbHelper->getContractsCreatedByUser($_SESSION['user_name']);
$signedContractsDetails = $dbHelper->getContractsSignedByUser($_SESSION['user_name']);
if (count($createdContractsDetails)>0)
{
echo "<p><h3 style='color:blue'>Contracts created by you:</h3>";
echo "<div class='table-responsive scrollable has-scrollbar scrollable-content ' data-plugin-scrollable><table class='table table-bordered table-hover table-condensed mb-none'>";
echo "<tr><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['title']."</th><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['dou']."</th><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['desc']."</th><th></th><th></th></tr>";
foreach ($createdContractsDetails as $contractDetails)
{
echo "<tr>";
foreach ($contractDetails as $key => $value)
{
if ($key != Literals::CONTRACT_DETAILS_FIELD_NAMES['FILE_HASH'] && $key != Literals::CONTRACT_DETAILS_FIELD_NAMES['CONTRACT_ID']) {
echo "<td>".$value."</td>";
}
}
echo "<td><a class='mb-xs mt-xs mr-xs btn btn-primary' target='_new' href='contract_upload_details.php?contractid=".$contractDetails[Literals::CONTRACT_DETAILS_FIELD_NAMES['CONTRACT_ID']]."'>View</a></td>";
echo "<td><a class='mb-xs mt-xs mr-xs btn btn-success' target='_new' href='contract_invite.php?contractid=".$contractDetails[Literals::CONTRACT_DETAILS_FIELD_NAMES['CONTRACT_ID']]."'>Invite Signees</a></td>";
echo "</tr>";
}
echo "</table></div></p>";
}
if (count($signedContractsDetails)>0)
{
echo "<p><h3 style='color:green'>Contracts signed by you:</h3>";
echo "<div class='table-responsive scrollable has-scrollbar scrollable-content ' data-plugin-scrollable><table class='table table-bordered table-hover table-condensed mb-none'>";
echo "<tr><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['title']."</th><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['dou']."</th><th>".Literals::CONTRACT_DETAILS_FIELD_DESC['desc']."</th><th></th></tr>";
foreach ($signedContractsDetails as $contractDetails)
{
echo "<tr>";
foreach ($contractDetails as $key => $value)
{
if ($key != Literals::CONTRACT_DETAILS_FIELD_NAMES['FILE_HASH'] && $key != Literals::CONTRACT_DETAILS_FIELD_NAMES['CONTRACT_ID']) {
echo "<td>".$value."</td>";
}
}
echo "<td><a class='mb-xs mt-xs mr-xs btn btn-primary' target='_new' href='contract_upload_details.php?contractid=".$contractDetails[Literals::CONTRACT_DETAILS_FIELD_NAMES['CONTRACT_ID']]."'>View</a></td>";
echo "</tr>";
}
echo "</table></div></p>";
}
?>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<?php
include_once 'footer.php';
?>