Skip to content

Commit

Permalink
added new changes for api connect
Browse files Browse the repository at this point in the history
  • Loading branch information
arulcancan committed Mar 15, 2020
1 parent 97435e4 commit 227ee6b
Show file tree
Hide file tree
Showing 11 changed files with 581 additions and 39 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ APP_KEY=base64:sBNbJThk+cKYWyRAisG8KYkFAkv527csvLTIMlRcP8I=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
NOMINETION_API=https://jsonplaceholder.typicode.com/users

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
Expand Down
35 changes: 35 additions & 0 deletions app/Http/Controllers/FormController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use GuzzleHttp\Client;

class FormController extends Controller
{
public function viewPE9()
{
$client = new Client();
$response = $client->request('GET', env('NOMINETION_API'));
$statusCode = $response->getStatusCode();
// $body = $response->getBody();
$body = $response->getBody()->getContents();
$obj = json_decode($body);
//dd($body);
return view('pe9')->with('Fdata',$obj);

}

public function viewPE30()
{
$client = new Client();
$response = $client->request('GET', env('NOMINETION_API'));
$statusCode = $response->getStatusCode();
// $body = $response->getBody();
$body = $response->getBody()->getContents();
$obj = json_decode($body);
//dd($body);
return view('pe30x1x2')->with('Fdata',$obj);

}
}
47 changes: 16 additions & 31 deletions resources/views/pe30x1x2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
<div class="row justify-content-md-center">
<div class="col col-lg-3">
<form> <center>
<select class="custom-select custom-select-lg mb-3" id="election" name="election" >
<option value="pe">Choose The Election </option>
<option value="pre">PRE</option>
<option value="mc">MC</option>
<option value="r">R</option>
<select class="custom-select custom-select-lg mb-3" id="election" name="election"onChange >
@foreach($Fdata as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
</div>
<div class="col col-lg-3">
Expand Down Expand Up @@ -55,34 +54,20 @@
<th align="right"> Party Name</th>
<th align="left"> Symbol</th>
<th align="left"> No</th>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
<td align="left"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
<td align="left"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
<td align="left"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
<td align="left"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
<td align="left"></td>
</tr>
</tr>

@foreach($Fdata as $data)
<tr>
<td>{{$data->id}}</td>
<td>{{$data->name}}</td>
<td>{{$data->username}}</td>

</tr>
@endforeach

</table >


<table align="center" border="1" cellpadding="5" width="80%">
<tr>
<td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td>
Expand Down
19 changes: 11 additions & 8 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
return view('index');
});

Route::get('pe9', function () {
return view('pe9');
});
// Route::get('pe9', function () {

// return view('pe9');
// });


Route::get('pe10', function () {
return view('pe10');
});
Route::get('pe30x1x2', function () {
return view('pe30x1x2');
});
// Route::get('pe30x1x2', function () {
// return view('pe30x1x2');
// });

Route::get('pe11', function () {
return view('pe11');
Expand All @@ -45,6 +47,7 @@
return view('pe9a');
});


#routes/web.php
// ----------------------------------------------------
Route::get('/pe9', 'FormController@viewPE9');
Route::get('/pe30x1x2', 'FormController@viewPE30');

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:3:{s:6:"_token";s:40:"fE8w05ChkJnQ18hjzcwIBS8uJ04GUjqdZqDBVeEZ";s:9:"_previous";a:1:{s:3:"url";s:30:"http://localhost:8000/pe30x1x2";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
122 changes: 122 additions & 0 deletions storage/framework/views/76c9ac13a3855ad77a6817120173af38af0ee0b2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Nomination Outputs</title>

<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom fonts for this template -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lora:400,400i,700,700i" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="css/business-casual.min.css" rel="stylesheet">

</head>

<body>

<h1 class="site-heading text-center text-white d-none d-lg-block">
<span class="site-heading-lower ">Nomination Outputs</span><br><br>
<span class="site-heading-upper text-primary mb-4">Election Commission of Sri lanka</span>

</h1>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark py-lg-2" id="mainNav">
<div class="container">
<a class="navbar-brand text-uppercase text-expanded font-weight-bold d-lg-none" href="#">Start Bootstrap</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav mx-auto">

<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href="index">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href='pe9'>PE09
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href='pe10'>PE10
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href='pe10x1'>PE10 (1)
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href="pe11">PE11
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item active px-lg-4">
<a class="nav-link text-uppercase text-expanded" href="pe30x1x2">PE30(1)(2)
<span class="sr-only">(current)</span>
</a>
</li>


</ul>
</div>
</div>
</nav>
<br>






<!-- Nain Content -->

<?php echo $__env->yieldContent('content'); ?>


<!-- Main Content -->







<footer class="footer text-faded text-center py-5">
<div class="container">
<p class="m-0 small">Copyright &copy; Eletion Commission of Sri Lanka 2020</p>
</div>
</footer>

<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script>
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;

document.body.innerHTML = printContents;

window.print();

document.body.innerHTML = originalContents;
}
</script>
</body>

</html>
Loading

0 comments on commit 227ee6b

Please sign in to comment.