Files
eng.vidok.com/templates_user/articles/password-view.php
2025-03-07 12:38:32 +01:00

44 lines
1.4 KiB
PHP

<div class="article-password" id="article-password-<?= $this -> article['id'];?>">
<div class="row">
<div class="col-12">
<p><?= \S::lang( 'ten-artykul-jest-chroniony-podaj-haslo-aby-odblokowac-zawartosc-artykulu' );?></p>
<form metho="POST" id="form-<?= $this -> article['id'];?>">
<!-- <input type="password" name="password" id="password-<?= $this -> article['id'];?>" required="required"> -->
<input type="email" name="email" id="email-<?= $this -> article['id'];?>" required="required">
<input type="submit" class="btn btn-success" id="submit-<?= $this -> article['id'];?>" value="<?= \S::lang( 'odblokuj' );?>">
</form>
</div>
</div>
</div>
<script class="footer" type="text/javascript">
$( function()
{
$( 'body' ).on( click_event, '#submit-<?= $this -> article['id'];?>', function(e)
{
if ( $.trim( $( "#email-<?= $this -> article['id'];?>" ).val() ) !== '' )
{
e.preventDefault();
var email = $( '#email-<?= $this -> article['id'];?>' ).val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/ajax.php',
data:
{
a: 'article_unlock',
email: email,
article_id: <?= $this -> article['id'];?>
},
success: function( data )
{
location.reload();
}
});
return false;
}
});
});
</script>