<?php
require 'admin/processing/db.php';
$count = 6 + $count;
$addvideo = R::findAll( 'videos', "WHERE id > $count LIMIT 9" );
foreach( $addvideo as $addvideo )
{ ?>
<div class="col-md-4 col-sm-12 sz-video">
<a class="popup-youtube" href="<?php echo $addvideo->link; ?>">
<div class="vidos embed-responsive">
<span class="overlay"><ion-icon name="play-circle" class="icon-play"></ion-icon></span>
<div class="img-vid" style="background-image: url(<?php echo $addvideo->image; ?>)"></div>
</div>
<h3><?php echo $addvideo->title; ?></h3>
</a>
<?php if( $verify_admin = true ){ ?>
<form action="success.php" method="POST">
<div class="text-center admin_element">
<!--<button class="btn btn-sm btn-warning text-white" name="edit_video">Изменить</button>-->
<button class="btn btn-sm btn-danger text-white" name="delete_video">Удалить</button>
<input type="hidden" name="id_video" value="<?php echo $addvideo->id; ?>">
</div>
</form>
<?php } ?>
</div>
<?php } $count = 9; ?>
function delete_video()
{
$data = $_POST;
if( isset($data['delete_video']) )
{
$video_id = $data['id_video']; // id_video - это скрытое поле input. Значение берётся в цикле из $videos->id;
R::getAssoc("DELETE FROM videos WHERE id = '$video_id'");
}
}