Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
<%@page import="java.sql.ResultSet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
if (session.getAttribute("id") == null)
response.sendRedirect("exit.jsp");
%>
<jsp:include page='ust.jsp'>
<jsp:param name="baslik" value="Ürünler"/>
<jsp:param name="icon" value="cubes"/>
</jsp:include>
<%
DB db = new DB();
ResultSet rs = db.qWMR("select u.id, k.ad, u.ad,u.img,u.fiyat from urunler u , kategoriler k where u.id=k.id");
ResultSet krs = db.qWMR("select * from kategoriler");
%>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jszip-3.1.3/pdfmake-0.1.27/dt-1.10.15/b-1.4.0/b-flash-1.4.0/b-html5-1.4.0/b-print-1.4.0/r-2.1.1/sc-1.4.2/se-1.2.2/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jszip-3.1.3/pdfmake-0.1.27/dt-1.10.15/b-1.4.0/b-flash-1.4.0/b-html5-1.4.0/b-print-1.4.0/r-2.1.1/sc-1.4.2/se-1.2.2/datatables.min.js"></script>
<table id="tbl" class="table table-bordered table-striped table-hover" style="width:100%">
<thead>
<tr>
<th class='text-center'>ID</th>
<th class='text-center'>KATEGORİ AD</th>
<th class='text-center'>AD</th>
<th class='text-center'>IMG</th>
<th class='text-center'>FİYAT</th>
<th class='text-center' style="width:100px">İŞLEM</th>
</tr>
</thead>
<tbody>
<%
int i=0;
while (rs.next())
{
String id = rs.getString(1);
String kad = rs.getString(2);
String ad = rs.getString(3);
String img = rs.getString(4);
String fiyat = rs.getString(5);
out.println("<tr>");
out.println("<td align='center'>"+id+"</td>");
out.println("<td align='center'>"+kad+"</td>");
out.println("<td align='center'>"+ad+"</td>");
out.println("<td style='vertical-align:middle' align='center'><a href='"+img+"' target='_blank'><i class='fa fa-image fa-2x'></i></a></td>");
out.println("<td align='center'>"+fiyat+"</td>");
%>
<td align="center">
<button rec_id="<%=i%>" rec_name="<%=ad%>" class="kat_upd btn btn-primary btn-sm"><i class="fa fa-fw fa-edit"></i></button>
<button rec_id="<%=id%>" class="kat_sil btn btn-danger btn-sm"><i class="fa fa-fw fa-trash-o"></i></button>
</td>
<%
out.println("</tr>");
i++;
}
%>
</tbody>
</table>
<br />
<div class="text-right">
<button type="button" data-toggle="modal" data-target="#addModal" class="btn btn-lg btn-success"><i class="fa fa-fw fa-lg fa-plus"></i> Yeni Kategori Ekle</button>
</div>
<div id="addModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<form id="addForm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-left">Ürün Ekle</h4>
</div>
<div class="modal-body text-left" >
<select class="form-control" id='kateg' name="kateg">
<% while (krs.next()) {
String kad = krs.getString("ad");
String kid = krs.getString("id");
%>
<option value="<%=kid%>"><%=kad%></option>
<%}%>
</select>
<b>Ürün Adı : </b>
<input type="text" name="ad" class="form-control input" required />
<b>Resim yolu : </b>
<input type="text" name="resim" class="form-control input" required />
<b>Fiyat : </b>
<input type="text" name="fiyat" class="form-control input" required />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-lg fa-plus"></i>Ekle</button>
</div>
</div>
</form>
</div>
</div>
<div id="updModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<form id="updForm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-left">Ürün Güncelle</h4>
</div>
<div class="modal-body text-left" >
<input type="hidden" id="uid" name="id" value="" />
<select class="form-control" id="u_kateg" name="kateg">
<% while (krs.next()) {
String kad = krs.getString("ad");
String kid = krs.getString("id");
%>
<option value="<%=kid%>"><%=kad%></option>
<%}%>
</select>
<b>Ürün Adı : </b>
<input type="text" id="u_ad" name="ad" class="form-control input" required />
<b>Resim yolu : </b>
<input type="text" name="resim" class="form-control input" required />
<b>Fiyat : </b>
<input type="text" name="fiyat" class="form-control input" required />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-lg fa-edit"></i>Güncelle</button>
</div>
</div>
</form>
</div>
</div>
<script>
$("#addForm").submit(function(e)
{
e.preventDefault();
var vals = $(this).serialize();
alert(vals);
$.post("api/admin/urun/ekle", vals , function(d,s)
{
location.reload();
});
return false;
});
$("#updForm").submit(function(e)
{
e.preventDefault();
var vals = $(this).serialize();
$.post("api/admin/urun/guncelle", vals , function(d,s)
{
location.reload();
});
return false;
});
var table;
$(".kat_upd").click(function()
{
var kategoriId = $(this).attr('rec_id');
var kategoriAd = $(this).attr('rec_name');
var rows = table.rows( kategoriId ).data();
var a = rows[0].toString().split(",");
var ID = a[0];
var kID = a[1];
alert(ID);
alert(kID);
$("#u_ad").val(kID);
$("#updModal").modal('show');
});
$(".kat_sil").click(function()
{
var kategoriId = $(this).attr('rec_id');
var onay = confirm("Bu Kategoriyi Silmek İstediğinize Emin Misiniz ?");
if (onay == true)
{
$.post("api/admin/urun/sil", { "id" : kategoriId }, function(d,s)
{
location.reload();
});
}
});
$(document).ready(function()
{
table = $('#tbl').DataTable();
});
</script>
<jsp:include page='alt.jsp' />
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team