<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<%
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
Response.Codepage = 65001

degisken = Request.QueryString
gelenlink_bol = split(degisken, "/")
kategoriid = replace(gelenlink_bol(4),".html","")

%>
<!--#include file ="header.asp"-->

<div class="all-elements">
    
	<!--#include file ="menu.asp"-->
    
<%
Set baglanti = server.CreateObject("adodb.connection")
baglanti.open "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & server.Mappath("kb45t49fehrgi5.mdb")

	Set giris = Server.CreateObject("ADODB.Recordset")
    sqlm = "SELECT * from notes where (code='"&session("code")&"' and id="&kategoriid&") order by id desc"
    giris.open sqlm, baglanti, 1, 3
			
			if not giris.eof then
			
			Set categ = Server.CreateObject("ADODB.Recordset")
    		sqlca = "SELECT * from category where (code='"&session("code")&"' and id="&giris("cat")&") order by id desc"
    		categ.open sqlca, baglanti, 1, 3
			kategorisi=categ("id")
			categ.close
			set categ=nothing
			%>
    <div id="content" class="snap-content">
        <div class="full-bottom"></div>
        	<div class="content">
            <div style="margin-top:10px;">&nbsp;</div>
                <h4>Not düzenle</h4>
                <div class="container no-bottom">
                    <div class="contact-form no-bottom">
							<div class="formSuccessMessageWrap" id="formSuccessMessageWrap" style="margin-bottom:-10px;">
                        		<div class="static-notification-green tap-dismiss-notification">
                        			<p class="center-text uppercase">Not başarıyla düzenlendi.</p>
                   				 </div>
                                 <a href="#" onclick="history.go(-3);" class="button button-orange"><i class="fa fa-arrow-circle-left"></i>Geri dön</a>
                        	</div>
                        		<div class="formValidationError" id="contactNameFieldError" style="margin-bottom:-10px;">
                                    <div class="static-notification-red tap-dismiss-notification">
                                        <p class="center-text uppercase">Başlık kısmı boş!</p>
                                    </div>
                                </div>
                                <div class="formValidationError" id="contactMessageTextareaError" style="margin-bottom:-10px;">
                                    <div class="static-notification-red tap-dismiss-notification">
                                        <p class="center-text uppercase">Not kısmı boş!</p>
                                    </div>
                                </div> 
                        <form action="/cmd.asp?page=edit&note=<%=giris("id")%>" method="post" class="contactForm" id="contactForm" style="margin-top:10px;">
                            <fieldset>
                                <div class="formFieldWrap">
                                    <label class="field-title contactNameField" for="contactNameField">Başlık:<span>(zorunlu)</span></label>
                                    <input type="text" name="name" value="<%=giris("name")%>" placeholder="not başlığı" class="contactField requiredField" id="contactNameField"/>
                                </div>
                                <div class="formEmailWrap">
                                    <label class="field-title contactEmailField" for="contactEmailField">Kategori:</label>
                                    <select name="cat" class="contactField requiredField">
<%
	Set kategori = Server.CreateObject("ADODB.Recordset")
    sqlcat = "SELECT * from category where code='"&session("code")&"' order by id desc"
    kategori.open sqlcat, baglanti, 1, 3
	
			if not kategori.eof then
           	Do while not kategori.eof
			%>  
            		<option value="<%=kategori("id")%>" <% if cint(kategorisi)=cint(kategori("id")) then %>selected<% end if %>><%=kategori("name")%></option>
            <%
			kategori.movenext
			loop
			end if
			
    kategori.close
	set kategori=nothing
%>   
                                    </select>
                                </div>
                                <div class="formTextareaWrap">
                                    <label class="field-title contactMessageTextarea" for="contactMessageTextarea">Not: <span>(zorunlu)</span></label>
                                    <textarea name="note" class="contactTextarea requiredField" placeholder="Notunuz.." id="contactMessageTextarea"><%=giris("note")%></textarea>
                                </div>
                                <div class="formSubmitButtonErrorsWrap" style="margin-top:10px;">
                                    <input type="submit" class="buttonWrap button button-blue contactSubmitButton" id="contactSubmitButton" value="Düzenle" data-formId="contactForm"/>
                                </div>
                            </fieldset>
                        </form>  
            <div style="margin-top:10px;">&nbsp;</div>     
                    </div>
                </div>
            <div class="decoration"></div>
        </div>
        
            <%
			else
			%>
            
            <div class="content">
            			<div style="margin-top:10px;">&nbsp;</div>
                <div class="container no-bottom">
                    <div class="no-bottom">
            		<div class="static-notification-yellow tap-dismiss-notification">
                        <p class="center-text uppercase">Aradığınız not bulunamadı.</p>
                    </div>
            <div style="margin-top:10px;">&nbsp;</div> 
            <div class="decoration"></div>
            		</div>
                </div>
            </div>
        <%
			end if
			%>
            
	<%
    giris.close
	set giris=nothing

baglanti.close
Set baglanti = nothing
%>
      
        <!-- Page Footer-->
        <div class="footer">
            <div class="footer-socials half-bottom">
                <a href="#" class="footer-up"><i class="fa-menu fa-angle-up"></i></a>
            </div>
        </div>
                
    </div>   
</div>

</body>