Add B2B form email saving

This commit is contained in:
Roman Pyrih
2025-03-07 12:38:32 +01:00
parent f2698d53d0
commit d4690a42af
9 changed files with 1768 additions and 1690 deletions

View File

@@ -0,0 +1,44 @@
<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>