Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using ClassLibrarySeminarski.Model;
- @using Microsoft.EntityFrameworkCore;
- @{
- int brojac = 0;
- Layout = "~/Views/Shared/AdminLayout.cshtml";
- }
- @model OnlineFitnessShop.ViewModels.AdministratorVMs.OdjecaPrikazVM
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Prikaz odjece</title>
- </head>
- <body>
- <hr />
- <div class="container" id="cont1">
- <p class="pClass">
- Filter za spol:
- </p>
- <label class="radio-inline">
- <input id="rd1" type="radio" name="optradio" onclick="filterMuški()">Muškarci
- </label>
- <label class="radio-inline">
- <input id="rd2" type="radio" name="optradio" onclick="filterŽenski()">Žene
- </label>
- <label class="radio-inline">
- <input id="rd1" type="radio" name="optradio" onclick="filterSvi()" checked>Svi proizvodi
- </label>
- </div>
- <hr />
- <div class="tabela">
- <table class="table table-hover table-bordered">
- <thead class="thead-dark">
- <tr>
- <th>Slika</th>
- <th>Naziv</th>
- <th>Cijena</th>
- <th>Spol</th>
- <th>Brend</th>
- <th>Akcija</th>
- </tr>
- </thead>
- <tbody id="b-id">
- @foreach (var x in @Model.podaciOdjece)
- {
- <tr id="red-@brojac">
- <td>
- <img src="/images/@x.ImageUrl" width="50px" height="50px" />
- </td>
- <td>
- @x.Naziv
- </td>
- <td>
- @x.Cijena
- <td class="spol">
- @x.Spol
- </td>
- <td>
- @x.Brend
- </td>
- @*<td><a href="/Administrator/Uredi?dobavljacid=@x.DobavljacID"><input type="button" class="btn btn-warning" value="Uredi" /></a></td>*@
- <td>
- <a href="/AdministratorProizvod/UrediOdjecu?OdjecaID=@x.OdjecaID" class="btn btn-info btn-sm "><span class="glyphicon glyphicon-pencil"></span>Uredi</a>
- <a href="/AdministratorProizvod/ObrisiOdjecu?OdjecaID=@x.OdjecaID" class="btn btn-danger btn-sm "><span class="glyphicon glyphicon-remove-circle"></span>Obrisi</a>
- <a href="/AdministratorProizvod/PrikazVelicine?OdjecaID=@x.OdjecaID" class="btn btn-info btn-sm "><span class="glyphicon glyphicon-list-alt"></span>Upravljanje veličinama</a>
- </td>
- </tr>
- brojac = brojac + 1;
- }
- </tbody>
- </table>
- <a href="/AdministratorProizvod/DodajOdjecu" class="btn btn-success">Dodaj novu odjeću</a>
- </div>
- <script>
- function filterMuški() {
- var c, item, a, i,txtValue;
- c = document.getElementById("b-id");
- item = c.getElementsByTagName("tr");
- for (i = 0; i < item.length; i++) {
- a = item[i].getElementsByClassName("spol")[0];
- txtValue = a.innerText.trim();
- var p = item[i].id;
- if (txtValue == "Muški") {
- document.getElementById(p).style.display = "";
- } else {
- document.getElementById(p).style.display = "none";
- }
- }
- }
- function filterŽenski() {
- var c, item, a, i,txtValue;
- c = document.getElementById("b-id");
- item = c.getElementsByTagName("tr");
- for (i = 0; i < item.length; i++) {
- a = item[i].getElementsByClassName("spol")[0];
- txtValue = a.innerText.trim();
- console.log(txtValue);
- var p = item[i].id;
- if (txtValue == "Ženski") {
- console.log("radi");
- document.getElementById(p).style.display = "";
- } else {
- document.getElementById(p).style.display = "none";
- }
- }
- }
- function filterSvi() {
- var c, item;
- c = document.getElementById("b-id");
- item = c.getElementsByTagName("tr");
- for (i = 0; i < item.length; i++) {
- var p = item[i].id;
- if (document.getElementById(p).style.display = "none") {
- document.getElementById(p).style.display = ""
- }
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement