-
Notifications
You must be signed in to change notification settings - Fork 0
/
company.php
executable file
·63 lines (50 loc) · 2.12 KB
/
company.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
<?php require('core/init.php'); ?>
<?php
if(isset($_SESSION['user_name'])){
if (isset($_POST['companySerach'])) {
// Sanitize POST data
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
//Get Vars
$companySerch = trim($_POST['searchCompany']);
// Create Company Object
$company = new Company;
if ($company->fatchCompany($companySerch)) {
//Get Template & Assing Vars
$template = new Template('templates/company.php');
$companyId = $_SESSION['company_id'];
//Assign Values
$template->traUrls = $company->getUrlDataTra($companyId);
$template->erpUrls = $company->getUrlDataErp($companyId);
$template->centralUsers = $company->getCentralUsers($companyId);
$template->retailUsers = $company->getRetailUsers($companyId);
$template->erpUsers = $company->getErpUsers($companyId);
$template->ipAddress = $company->getIpAdr($companyId);
$template->transponder = $company->getTrans($companyId);
$template->tnsNames = $company->getTNS($companyId);
$template->additionalDataErp = $company->getAdditionalDataErp($companyId);
$template->additionalDataMlp = $company->getAdditionalDataMlp($companyId);
} else {
redirect('index.php', 'Kompanija nije nađena', 'error');
}
} else {
// Create Company Object
$company = new Company;
$template = new Template('templates/company.php');
$companyId = $_SESSION['company_id'];
//Assign Values
$template->traUrls = $company->getUrlDataTra($companyId);
$template->erpUrls = $company->getUrlDataErp($companyId);
$template->centralUsers = $company->getCentralUsers($companyId);
$template->retailUsers = $company->getRetailUsers($companyId);
$template->erpUsers = $company->getErpUsers($companyId);
$template->ipAddress = $company->getIpAdr($companyId);
$template->transponder = $company->getTrans($companyId);
$template->tnsNames = $company->getTNS($companyId);
$template->additionalDataErp = $company->getAdditionalDataErp($companyId);
$template->additionalDataMlp = $company->getAdditionalDataMlp($companyId);
}
// Display template
echo $template;
} else {
redirect('index.php', 'Niste prijavljeni na sistem', 'error');
}