Skip to content

Commit

Permalink
Merge pull request #275 from DasunThathsara/sohani
Browse files Browse the repository at this point in the history
Sohani
  • Loading branch information
DasunThathsara authored Feb 28, 2024
2 parents d9ec50d + 18d8ef0 commit e630acc
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 25 deletions.
27 changes: 16 additions & 11 deletions app/controllers/ParkingOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ public function parkingCapacity($parking_ID = null, $parking_name = null){
}

// -------------------------------------- Report ---------------------------------------
public function viewReport(){
public function viewReport($land_ID = null){
$data = [
'title' => 'Home page',
'landID' => $land_ID,
'lands' => $this->landModel->viewLands()
];

Expand All @@ -118,22 +119,26 @@ public function viewReport(){
if ($other_data['notification_count'] < 10)
$other_data['notification_count'] = '0'.$other_data['notification_count'];

// echo "<pre>";
// die(print_r($data));
// echo "</pre>";

$this->view('parkingOwner/report', $data, $other_data);
}

// -------------------------------------- generate Report ---------------------------------------
public function viewGenerateReport(){
$data = [
'title' => 'Home page'
];
// public function viewGenerateReport(){
// $data = [
// 'title' => 'Home page'
// ];

$other_data['notification_count'] = 0;
// $other_data['notification_count'] = 0;

if ($other_data['notification_count'] < 10)
$other_data['notification_count'] = '0'.$other_data['notification_count'];
// if ($other_data['notification_count'] < 10)
// $other_data['notification_count'] = '0'.$other_data['notification_count'];

$this->view('parkingOwner/generatereport', $data, $other_data);
}
// $this->view('parkingOwner/generatereport', $data, $other_data);
// }

// ------------------------------------ Securities -------------------------------------
// View assign security to parking owner
Expand Down Expand Up @@ -181,7 +186,7 @@ public function securityRemove(){
redirect('parkingOwner/securities/'.$land_ID);
}
}

public function landAccessControl($sec_id = null){
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
Expand Down
19 changes: 14 additions & 5 deletions app/controllers/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ public function __construct(){
// Only parkingOwner are allowed to access driver pages
$this->middleware->checkAccess(['parkingOwner']);
$this->parkingOwnerModel = $this->model('parkingOwnerModel');
// $this->landModel = $this->model('LandModel');
}

public function viewReport(){
$data = [
'title' => 'Home page'
];
$this->view('parkingOwner/report', $data);
public function viewReport($land_ID = null){

$landId = $_POST['landID'];

$arr['landid'] = $landId;

$data = $this->parkingOwnerModel->viewReport($arr);

echo json_encode($data);

// die(print_r($data));
// $this->view('parkingOwner/report', $data);
}

}
11 changes: 11 additions & 0 deletions app/models/ParkingOwnerModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ public function updatePrice($data): bool
}
}

// ------------------------- Report Functionalities -------------------------
// View report
public function viewReport($data){
$this->db->query('SELECT * FROM driver_land WHERE landID = :landid');
$this->db->bind(':landid', $data['landid']);

$row = $this->db->resultSet();

return $row;
}


// ------------------------- Assigned Security Functionalities -------------------------
public function landAccessControl($sec_id): bool{
Expand Down
Loading

0 comments on commit e630acc

Please sign in to comment.