<?php // User Page
if($page = $row['seo']){
    include(BASE);    
    $getuser = $dbc->query("SELECT * FROM `users` WHERE `users`.`uid`='{$row['uid']}' LIMIT 1");
    $rwpusr = $getuser->fetch_assoc();
    $dbc->close();
    
    include(BASE);
    $getgallery = $dbc->query("SELECT * FROM `galleries` WHERE `uid`='{$row['uid']}' ORDER BY `date` DESC LIMIT 1");
    $rwpgal = $getgallery->fetch_assoc();
    $dbc->close();
    
    include(BASE);
    $getranking = $dbc->query("SELECT * FROM `champions` WHERE `uid`='{$row['uid']}' ORDER BY `champ_pos` ASC LIMIT 5") or die($dbc->error);
    $dbc->close();
    
    include(BASE);
    $getrankingtop = $dbc->query("SELECT * FROM `champions` WHERE `uid`='{$row['uid']}' AND `champ_pos`='1' LIMIT 1") or die($dbc->error);
    $dbc->close();
    
    include(BASE);
    $getrankingbot = $dbc->query("SELECT * FROM `champions` WHERE `uid`='{$row['uid']}' AND `champ_pos`='2' LIMIT 4") or die($dbc->error);
    $dbc->close();
    
    
    include(BASE);
    $getcountchamp = $dbc->query("SELECT COUNT(*) AS countcp FROM `champions` WHERE `uid`='{$row['uid']}'") or die($dbc->error);
    $rwccp = $getcountchamp->fetch_assoc();
    $countchamp = $rwccp['countcp'];
    $dbc->close();
    
    
    include(BASE);
    $getpairs = $dbc->query("SELECT * FROM `pairs` WHERE `uid`='{$row['uid']}' LIMIT 10") or die($dbc->error);
    $dbc->close();
    
    include(BASE);
    $getcountpairs = $dbc->query("SELECT COUNT(*) AS countpr FROM `pairs` WHERE `uid`='{$row['uid']}'") or die($dbc->error);
    $rwcpr = $getcountpairs->fetch_assoc();
    $countmatt = $rwcpr['countpr'];
    $dbc->close();
    
    
    }
    
    

    
     if(($rwpusr['book'] == '1') || ($rwpusr['uid'] == $_SESSION['uid'])){
?>

<div class="w3-row">

<div class="w3-col l12 m12 s12 w3-bluepm w3-border-bottom">


<div class="w3-col l3 m5 s12">
<?php if($_SESSION['uid'] == $row['uid']){ ?>
<div class="flip-card w3-margin_ w3-center" style="width:100%;height:210px;margin:0px;">
<div class="flip-card-inner">
<div class="flip-card-front">
<?php if(!empty($row['pictures'])){?>
<img class="w3-circle_" src="<?=PATH.'images/'.$row['pictures']?>" alt="<?=$row['pictures']?>" style="object-fit:cover;width:100%;height:100%;"/>
<?php }else{ ?>
<img class="w3-circle_" src="<?=PATH.'images/no-user-image.png'?>" alt="no-user-image.png" style="object-fit:cover;width:100%;height:100%;"/>
<?php } ?>
</div>

<div class="flip-card-back">
<h2><?=$lng['hello']?>, <?=$rwpusr['first_name']?></h2> 
<p><?=$lng['content_of_flip_photo_avatar']?></p> 

<p>
<a onclick="document.getElementById('viewphoto').style.display='block'"><?=$lng['view_my_photo']?></a><br/>
<a onclick="document.getElementById('chgphoto').style.display='block'"><?=$lng['change_my_photo']?></a></p>

</div>    
</div>
</div>
<?php }else{ ?>

<div class="flip-card w3-margin_ w3-center" style="width:100%;height:210px;margin:0px;">
<div class="flip-card-inner">
<div class="flip-card-front">
<?php if(!empty($row['pictures'])){?>
<img class="w3-circle_" src="<?=PATH.'images/'.$row['pictures']?>" alt="<?=$row['pictures']?>" style="object-fit:cover;width:100%;height:100%;"/>
<?php }else{ ?>
<img class="w3-circle_" src="<?=PATH.'images/no-user-image.png'?>" alt="no-user-image.png" style="object-fit:cover;width:100%;height:100%;"/>
<?php } ?>
</div>

<div class="flip-card-back">
<h2><?=$lng['hello']?>,</h2> 
<p><?=$lng['this_is_my_page']?></p> 

<p>
<a onclick="document.getElementById('viewphoto').style.display='block'" style="cursor:pointer;">
<i class="fa fa-photo"></i> <?=$lng['view_my_photo']?></a>

</p>
</div>    
</div>
</div>



<?php } ?>
</div>

<div class="w3-col l9 m7 s12">

<div class="w3-margin_ w3-right_">


<a class="w3-text-white w3-center" href="<?=BASE_URL.PATH.$row['seo']?>.html" style="text-decoration:none;">
<h2 class="w3-border-bottom">
<?=$rwpusr['first_name']?>
<?php if(!empty($rwpusr['last_name'])){echo ' '.$rwpusr['last_name'];}?>
</h2></a>

<div class="w3-col w3-container l6 m12 s12">
<?php
echo '<p>';
if(!empty($rwpusr['phone'])){echo '<i class="fa fa-fw fa-phone"></i> '.$rwpusr['phone']."<br/>";}
if(!empty($rwpusr['fax'])){echo '<i class="fa fa-fw fa-fax"></i> '.$rwpusr['fax']."<br/>";}
if(!empty($rwpusr['mobile'])){echo '<i class="fa fa-fw fa-mobile"></i> '.$rwpusr['mobile'].'<br/>';}

if(!empty($rwpusr['email'])){echo '<i class="fa fa-fw fa-at"></i> '.str_replace('@', '[aici este <i class="fa fa-at"></i>]', $rwpusr['email']).'<br/>';}

if(!empty($row['url'])){echo '<a class="w3-border-bottom w3-border-bluepm w3-hover-border-seagreen" href="'.$row['url'].'" target="_blank" style="text-decoration:none;"><i class="fa fa-fw fa-globe"></i> '.str_replace('https://', '', $row['url']).' <i class="fa fa-external-link" title="External Link"></i></a> <br/>';}
echo '</p>';
?>
</div>


<div class="w3-col w3-container l6 m12 s12">
<?php
if(!empty($rwpusr['register_date'])){
    echo '<i class="fa fa-fw fa-sign-in" title="'.$lng['on_this_site_from'].' '.date('d/m/Y', strtotime($rwpusr['register_date'])).'"></i> '.$lng['on_this_site_from'].' '.date('d/m/Y', strtotime($rwpusr['register_date']))."<br/>";
    }
?>

<i class="fa fa-fw fa-trophy"></i> <?=$lng['champions']?>: <?=$countchamp?>/5<br/>
<i class="fa fa-fw fa-heart"></i> <?=$lng['mattress_pairs']?>: <?=$countmatt?>/10




<div class="w3-row">
<?php
if($_SESSION['uid'] == $row['uid']){
//echo '<div class="w3-col l6 m6 s12 w3-hide_">';
echo '<a href="'.PATH.'myaccount.html"class="w3-button w3-bluepm w3-small w3-hover-seagreen w3-right" style="text-decoration:none;">';
echo '<i class="fa fa-fw fa-pencil-square-o"></i><span class="w3-hide-small"> '.$lng['edit_profile'].'</span></a>';
//echo '</div>';
    //}
 
?>

<?php if($rwpusr['book'] == 0){ ?>

<div class="w3-container_" style="margin-bottom: -10px;">
<form action="" method="post">
<button type="submit" class="w3-button w3-seagreen w3-small w3-hover-black w3-right" title="<?=$lng['activate_book_title_btn']?>"><?=$lng['activate_book']?></button>
<input type="hidden" name="uid" value="<?=$_SESSION['uid']?>"/>
<input type="hidden" name="activatebook" value="true"/>
</form>
</div>

<?php }elseif($rwpusr['book'] == 1){ ?>

<div class="w3-container_">
<form action="" method="post">
<button type="submit" class="w3-button w3-red w3-small w3-hover-black w3-right"><?=$lng['disable_book']?></button>
<input type="hidden" name="uid" value="<?=$_SESSION['uid']?>"/>
<input type="hidden" name="dezactivatebook" value="true"/>
</form>

</div>
<?php } ?>
</div>

<?php } ?>
</div>
</div>

</div>

</div>

</div>

<?php if(isset($photouploaded)){?>
<button id="statusLoad" onclick="notifyUserPhoto()" class="w3-hide"></button>
<div id="statusUpload"><?=$photouploaded?></div>
<?php } ?>
<?php if(isset($errortouploading)){?>
<button id="statusLoad" onclick="notifyUserPhoto()" class="w3-hide"></button>
<div id="statusUpload"><?=$errortouploading?></div>
<?php } ?>


<?php
// modal chgphoto

echo '<div id="chgphoto" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<div class="w3-container_">';
echo '<span onclick="document.getElementById(\'chgphoto\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';

echo '<div class="w3-row">';
echo '<div class="w3-container w3-text-white w3-card" style="background-color:#117594;">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['change_my_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block w3-white">';

echo '<div class="w3-col l12">';

if(is_file('images/'.$row['pictures'])){
echo '<img src="images/'.$row['pictures'].'" alt="'.$row['pictures'].'" style="width:500px;height:auto;padding:4px;" loading="lazy"/>';
 }else{
    echo '<img src="images/no-user-image.png" alt="no-user-image.png" style="object-fit:cover;width:1000px;max-width:100%;height:400px;padding:4px;" loading="lazy"/>';
 }
echo '</div>';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="userphoto" id="userphoto" required="">';
echo '<button class="w3-button w3-block w3-red w3-hover-black" type="submit">';
echo $lng['change_my_photo'].'</button>';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="changephotoavatar" value="true">';
echo '</form>';
echo '</div>';

echo '</div></div></div><div class="w3-hide">&nbsp;</div></div></div>';


// end modal chgphoto
// modal viewphoto

echo '<div id="viewphoto" class="w3-modal" style="z-index:1007;margin-top:0px;" onclick="this.style.display=\'none\'">';
echo '<div class="w3-modal-content w3-animate-top" style="width:1000px;max-width:100%;margin:auto;">';
echo '<div class="w3-container_">';
echo '<span onclick="document.getElementById(\'viewphoto\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';

echo '<div class="w3-row">';
echo '<div class="w3-container w3-text-white w3-card" style="background-color:#117594;">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['user_photo_modal_title'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block w3-white">';

echo '<div class="w3-col l12">';
if(is_file('images/'.$row['pictures'])){
echo '<img src="images/'.$row['pictures'].'" alt="'.$row['pictures'].'" style="width:1000px;max-width:100%;height:auto;padding:4px;" loading="lazy"/>';
 }else{
    echo '<img src="images/no-user-image.png" alt="no-user-image.png" style="object-fit:cover;width:1000px;max-width:100%;height:400px;padding:4px;" loading="lazy"/>';
 }
echo '</div>';

echo '</div></div></div><div class="w3-hide">&nbsp;</div></div></div>';


// end modal viewphoto
?>

<div class="w3-col l12 m12 s12">

<div class="w3-container_">

<h3 class="w3-border-bottom w3-center w3-text-bluepm"><i class="fa fa-trophy"></i> <?=strtoupper($lng['champions'])?></h3>
<?php

if(isset($added_champ)){echo '<div class="w3-panel w3-green"><p>'.$added_champ.'</p></div>';}

if(isset($not_added_champ)){echo '<div class="w3-panel w3-red"><p>'.$not_added_champ.'</p></div>';}

if(isset($limitout)){echo '<div class="w3-panel w3-red"><p>'.$limitout.'</p></div>';}


if(isset($photo1uploaded)){echo '<div class="w3-panel w3-green"><p>'.$photo1uploaded.'</p></div>';}
if(isset($errortouploading)){echo '<div class="w3-panel w3-red"><p>'.$errortouploading.'</p></div>';}

if(isset($photodelservok)){echo '<div class="w3-panel w3-green"><p>'.$photodelservok.'</p></div>';}

if(isset($msgresponsedeldb)){echo '<div class="w3-panel w3-green"><p>'.$msgresponsedeldb.'</p></div>';}
if(isset($deletephoto)){echo '<div class="w3-panel w3-green"><p>'.$lng['photos_related_pigeon_deleted'].'</p></div>';}

if(isset($oknewnamechanged)){echo '<div class="w3-panel w3-green"><p>'.$oknewnamechanged.'</p></div>';}
if(isset($newnameNOTchange)){echo '<div class="w3-panel w3-red"><p>'.$newnameNOTchange.'</p></div>';}

?>
<?php if($getranking->num_rows > '0'){ ?>

<?php while($rwchp = $getranking->fetch_assoc()){ 
    
    if($rwchp['champ_pos'] === '1'){

?>


<div class="w3-row w3-card w3-margin-bottom">
<div class="w3-bluepm">
<h3 class="w3-center" style="margin:0px;padding:4px;">
<img src="<?=IMG?>dove.png" alt="<?=$rwchp['champ_name']?>" title="<?=$rwchp['champ_name']?>" style="width:30px;padding:2px;"/> <?=$rwchp['champ_name']?> <?php if($_SESSION['uid'] == $row['uid']){?><a onclick="document.getElementById('<?=$rwchp['champ_id']?>stergere').style.display='block'" style="cursor:pointer;"><i class="fa fa-trash"></i></a> <a onclick="document.getElementById('<?=$rwchp['champ_id']?>modifica').style.display='block'" style="cursor:pointer;"><i class="fa fa-pencil-square-o"></i></a><?php } ?></h3>
</div>
<div class="w3-col l6 m6 s12">
<?php if($rwchp['photo1']){?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL?><?=$rwchp['photo1']?>" style="object-fit:cover;width:99%;margin:0.50%;height:250px;max-height:400px;" onclick="onClick(this)" alt="<?=$rwchp['champ_name']?>" title="<?=$rwchp['champ_name']?>"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp['champ_id']?>1').style.display='block'" style="cursor:pointer;">Actualizează</a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp['champ_id']?>del1').style.display='block'">Șterge</a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwchp['champ_id']?>1').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/>Adaugă foto</i></div></a>
<?php } }?>
</div>
<div class="w3-col l6 m6 s12">
<?php if($rwchp['photo2']){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL?><?=$rwchp['photo2']?>" style="object-fit:cover;width:99%;margin:0.50%;height:250px;max-height:400px;cursor:pointer" onclick="onClick(this)" alt="<?=$rwchp['champ_name']?>" title="<?=$rwchp['champ_name']?>"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp['champ_id']?>2').style.display='block'" style="cursor:pointer;">Actualizează</a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp['champ_id']?>del2').style.display='block'">Șterge</a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwchp['champ_id']?>2').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/>Adaugă foto</i>
</div></a>
<?php } }?>
</div>
</div>
<?php 

if($_SESSION['uid'] == $row['uid']){

// modal chgphoto1
echo '<div id="'.$rwchp['champ_id'].'1" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_change_photos'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo1" id="photo1" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_change_photos'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangephoto1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgphoto2

// modal del1
echo '<div id="'.$rwchp['champ_id'].'del1" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'del1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotog1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del1

// modal chgphoto2
echo '<div id="'.$rwchp['champ_id'].'2" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_change_photos'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo2" id="photo2" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_change_photos'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangephoto2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgphoto2

// modal del2
echo '<div id="'.$rwchp['champ_id'].'del2" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'del2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotog2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del2

// modal stergere
echo '<div id="'.$rwchp['champ_id'].'stergere" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'stergere\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_pigeon'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_pigeon_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="stergereporumbel" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal stergere

// modal modifica
echo '<div id="'.$rwchp['champ_id'].'modifica" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp['champ_id'].'modifica\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['modify_pigeon_name'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<input type="text" class="w3-input" name="newchampname" value="'.$rwchp['champ_name'].'"/>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['change_pigeon_name'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="modificaporumbel" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal modifica

   }

    }
 
 } 
 
 if($getranking->num_rows > '0'){
    include(BASE);
    $getchambott = $dbc->query("SELECT * FROM `champions` WHERE `uid`='{$row['uid']}' ORDER BY `champ_pos` ASC LIMIT 0,5") or die($dbc->error);
    $dbc->close();
    
    while($rwchp3 = $getchambott->fetch_assoc()){
        
        if($rwchp3['champ_pos'] === '2'){
 
//echo $rwchp3['champ_name']."\n";
// echo $rwchp3['photo1']."\n";
// echo $rwchp3['photo2'];
 
 
?>


<div class="w3-col l6 m12 s12 w3-margin-bottom">

<div class="w3-bluepm" style="width:99%;margin:0.50%;">
<h3 class="w3-center" style="margin:0px;">
<img src="<?=IMG?>dove.png" alt="dove.png" title="<?=$rwchp3['champ_name']?>" style="width:30px;padding:2px;"/> <?=$rwchp3['champ_name']?> <?php if($_SESSION['uid'] == $row['uid']){?><a onclick="document.getElementById('<?=$rwchp3['champ_id']?>stergere').style.display='block'" style="cursor:pointer;"><i class="fa fa-trash"></i></a> <a onclick="document.getElementById('<?=$rwchp3['champ_id']?>modifica').style.display='block'" style="cursor:pointer;"><i class="fa fa-pencil-square-o"></i></a><?php } ?></h3>
</div>
<div class="w3-col l6 m6 s6 photo-container">
<?php if(!empty($rwchp3['photo1'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwchp3['photo1']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer;" onclick="onClick(this)"/>

<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp3['champ_id']?>1').style.display='block'" style="cursor:pointer;"><?=$lng['update_photo']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp3['champ_id']?>del1').style.display='block'"><?=$lng['delete_photo']?></a></div>
<?php } ?>

<?php }else{ if($_SESSION['uid'] == $row['uid']){ ?>

<a onclick="document.getElementById('<?=$rwchp3['champ_id']?>1').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo']?></i>
</div></a>
<?php } } ?>
</div>

<div class="w3-col l6 m6 s6 photo-container">
<?php if(!empty($rwchp3['photo2'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwchp3['photo2']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer" onclick="onClick(this)"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp3['champ_id']?>2').style.display='block'" style="cursor:pointer;"><?=$lng['update_photo']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwchp3['champ_id']?>del2').style.display='block'"><?=$lng['delete_photo']?></a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwchp3['champ_id']?>2').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo']?></i>
</div></a>
<?php } }?>
</div>

</div>

<?php if($_SESSION['uid'] == $row['uid']){
// modal chgpcb1
echo '<div id="'.$rwchp3['champ_id'].'1" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_change_photos'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo1" id="photo1" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_change_photos'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepcb1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpcb1

// modal del1
echo '<div id="'.$rwchp3['champ_id'].'del1" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'del1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotog1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del1

// modal chgpcb2
echo '<div id="'.$rwchp3['champ_id'].'2" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_change_photos'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo2" id="photo2" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_change_photos'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepcb2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpcb2

// modal del2
echo '<div id="'.$rwchp3['champ_id'].'del2" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'del2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotog2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del2

// modal stergere
echo '<div id="'.$rwchp3['champ_id'].'stergere" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'stergere\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_pigeon'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">Sunteți sigur de această acțiune?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_pigeon_confirm'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="stergereporumbel" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal stergere

// modal modifica
echo '<div id="'.$rwchp3['champ_id'].'modifica" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwchp3['champ_id'].'modifica\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['modify_pigeon_name'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<input type="text" class="w3-input" name="newchampname" value="'.$rwchp3['champ_name'].'"/>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['modify_pigeon_name'].'</button>';
echo '<input type="hidden" name="chmID" value="'.$rwchp3['champ_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="modificaporumbel" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal modifica
   }

    } 
      }
   }
 
 }else{ ?>

<h4 class="w3-center w3-text-gray"><?=$lng['no_pigeon_added_yet']?></h4>

<?php } ?>


<?php if($getranking->num_rows < 5){ if($rwpusr['uid'] == $_SESSION['uid']){ ?>

<form action="" method="post">
<div class="w3-row w3-margin-bottom">
<div class="w3-col l8 m6 s12">
<input class="w3-input w3-card" type="text" name="pigeon_champ" placeholder="<?=$lng['add_champion']?>" required=""/>
</div>
<div class="w3-col l2 m6 s12">
<select class="w3-select w3-card" name="champ_pos">
<?php if($getrankingtop->num_rows < 1){ ?>
<option value="1"><?=$lng['first_champion']?></option>
<?php } if($getrankingbot->num_rows < 4){?>
<option value="2"><?=$lng['rest_of_champions']?></option>
<?php } ?>
</select>
</div>
<div class="w3-col l2 m6 s12">
<button class="w3-button w3-block w3-bluepm w3-hover-seagreen"><?=$lng['add_champion']?></button>
</div>
</div>
<input type="hidden" name="uid" value="<?=$rwpusr['uid']?>"/>
<input type="hidden" name="add_champ_form" value="true"/>
</form>

<?php } } ?>


<div class="w3-col l12 m12 s12">

<h3 class="w3-border-bottom w3-center w3-text-bluepm">
<i class="fa fa-heart"></i> <?=strtoupper($lng['mattress_pairs'])?></h3>


<?php  
 
 if($getpairs->num_rows > '0'){    
    
    while($rwpr = $getpairs->fetch_assoc()){
  
 
?>
<div class="w3-col l12 m12 s12 w3-margin-bottom">

<div class="w3-bluepm" style="width:99.40%;margin:0.30%;">
<h3 class="w3-center" style="margin:0px;">
<img src="<?=IMG?>dove.png" alt="dove.png" title="<?=$rwpr['pair_name']?>" style="width:30px;padding:2px;"/> <?=$rwpr['pair_name']?> <?php if($_SESSION['uid'] == $row['uid']){?><a onclick="document.getElementById('<?=$rwpr['pair_id']?>stergere').style.display='block'" style="cursor:pointer;"><i class="fa fa-trash"></i></a> <a onclick="document.getElementById('<?=$rwpr['pair_id']?>modifica').style.display='block'" style="cursor:pointer;"><i class="fa fa-pencil-square-o"></i></a><?php } ?></h3>
</div>
<div class="w3-col l3 m6 s6 photo-container">
<?php if(!empty($rwpr['photo1'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwpr['photo1']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer;" onclick="onClick(this)"/>

<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>1').style.display='block'" style="cursor:pointer;"><?=$lng['update_pair']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>del1').style.display='block'"><?=$lng['delete_pair']?></a></div>
<?php } ?>

<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwpr['pair_id']?>1').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo_pair']?></i>
</div></a>
<?php } }?>
</div>

<div class="w3-col l3 m6 s6 photo-container">
<?php if(!empty($rwpr['photo2'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwpr['photo2']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer" onclick="onClick(this)"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>2').style.display='block'" style="cursor:pointer;"><?=$lng['update_pair']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>del2').style.display='block'"><?=$lng['delete_pair']?></a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwpr['pair_id']?>2').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo_pair']?></i>
</div></a>
<?php } }?>
</div>

<div class="w3-col l3 m6 s6 photo-container">
<?php if(!empty($rwpr['photo3'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwpr['photo3']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer" onclick="onClick(this)"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>3').style.display='block'" style="cursor:pointer;"><?=$lng['update_pair']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>del3').style.display='block'"><?=$lng['delete_pair']?></a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){ ?>
<a onclick="document.getElementById('<?=$rwpr['pair_id']?>3').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo_pair']?></i>
</div></a>
<?php } }?>
</div>

<div class="w3-col l3 m6 s6 photo-container">
<?php if(!empty($rwpr['photo4'])){ ?>
<img class="w3-opacity-min w3-hover-opacity-off" src="<?=GAL.$rwpr['photo4']?>" style="object-fit:cover;width:98%;margin:1%;height:250px;max-height:400px;cursor:pointer" onclick="onClick(this)"/>
<?php if($_SESSION['uid'] == $row['uid']){?>
<div class="w3-center"><a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>4').style.display='block'" style="cursor:pointer;"><?=$lng['update_pair']?></a> | <a class="w3-button w3-link" onclick="document.getElementById('<?=$rwpr['pair_id']?>del4').style.display='block'"><?=$lng['delete_pair']?></a></div>
<?php } ?>
<?php }else{ if($_SESSION['uid'] == $row['uid']){?>
<a onclick="document.getElementById('<?=$rwpr['pair_id']?>4').style.display='block'" style="cursor:pointer;">
<div class="w3-center w3-card w3-hover-light-gray" style="width:98%;margin:1%;height:250px;">
<i class="fa fa-camera w3-xxlarge w3-text-gray w3-padding-16" style="margin-top:60px;"><br/><?=$lng['add_photo_pair']?></i>
</div></a>
<?php } }?>
</div>

</div>

<?php if($_SESSION['uid'] == $row['uid']){
// modal chgpr1
echo '<div id="'.$rwpr['pair_id'].'1" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_cahnge_photo_pair'].' 1</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo1" id="photo1" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_cahnge_photo_pair'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepr1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpr1

// modal chgpr2
echo '<div id="'.$rwpr['pair_id'].'2" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_cahnge_photo_pair'].' 2</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo2" id="photo2" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_cahnge_photo_pair'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepr2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpr2

// modal chgpr3
echo '<div id="'.$rwpr['pair_id'].'3" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'3\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_cahnge_photo_pair'].' 3</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo3" id="photo3" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_cahnge_photo_pair'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepr3" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpr3

// modal chgpr4
echo '<div id="'.$rwpr['pair_id'].'4" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'4\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-camera"></i> '.$lng['add_cahnge_photo_pair'].' 4</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST" enctype="multipart/form-data">';
echo '<input class="w3-input w3-button" type="file" name="photo4" id="photo4" required="">';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['add_cahnge_photo_pair'].'</button>';
echo '<input type="hidden" name="picID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="addchangepr4" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal chgpr4

// modal stergere
echo '<div id="'.$rwpr['pair_id'].'stergere" class="w3-modal" style="z-index:1007;margin-top:-50px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'stergere\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_pair_title'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">'.$lng['delete_pair_ask'].'?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_pair_confirm_yes'].'</button>';
echo '<input type="hidden" name="prkID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="stergereperche" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal stergere

// modal modifica
echo '<div id="'.$rwpr['pair_id'].'modifica" class="w3-modal" style="z-index:1007;margin-top:0px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'modifica\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['modify_name_pair_title'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<input type="text" class="w3-input" name="newpairname" value="'.$rwpr['pair_name'].'"/>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['modify_name_pair_btn'].'</button>';
echo '<input type="hidden" name="pairID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="modificapereche" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal modifica

// modal del1
echo '<div id="'.$rwpr['pair_id'].'del1" class="w3-modal" style="z-index:1007;margin-top:-50px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'del1\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">'.$lng['delete_photo_ask'].'?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="prID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotopr1" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del1

// modal del2
echo '<div id="'.$rwpr['pair_id'].'del2" class="w3-modal" style="z-index:1007;margin-top:-50px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'del2\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">'.$lng['delete_photo_ask'].'?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="prID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotopr2" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del2


// modal del3
echo '<div id="'.$rwpr['pair_id'].'del3" class="w3-modal" style="z-index:1007;margin-top:-50px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'del3\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">'.$lng['delete_photo_ask'].'?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="prID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotopr3" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del3

// modal del4
echo '<div id="'.$rwpr['pair_id'].'del4" class="w3-modal" style="z-index:1007;margin-top:-50px;">';
echo '<div class="w3-modal-content w3-animate-top" style="width:500px;max-width:100%;margin:auto;">';
echo '<span onclick="document.getElementById(\''.$rwpr['pair_id'].'del4\').style.display=\'none\'" class="w3-button w3-display-topright w3-red" style="margin-top:5px;"><i class="fa fa-close w3-xlarge"></i></span>';
echo '<div class="w3-row">';
echo '<div class="w3-container w3-bluepm w3-card">';
echo '<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-fw fa-trash"></i> '.$lng['delete_photo'].'</h3>';
echo '</div>';
echo '<div class="w3-bar-block">';
echo '<div class="w3-col l12">';
echo '<form action="" method="POST">';
echo '<h3 class="w3-container w3-center">'.$lng['delete_photo_ask'].'?</h3>';
echo '<button class="w3-button w3-block w3-bluepm w3-hover-seagreen" type="submit">';
echo $lng['delete_photo_confirm'].'</button>';
echo '<input type="hidden" name="prID" value="'.$rwpr['pair_id'].'">';
echo '<input type="hidden" name="usrID" value="'.$_SESSION['uid'].'">';
echo '<input type="hidden" name="delphotopr4" value="true">';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div></div></div>';
// end modal del4
   }   }   
 
  }else{ ?>

<h4 class="w3-center w3-text-gray"><?=$lng['no_pigeon_queen_added_yet']?></h4>

<?php } ?>


<?php if($getpairs->num_rows < 10){ if($rwpusr['uid'] == $_SESSION['uid']){ ?>

<form action="" method="post">
<div class="w3-row w3-margin-bottom">
<div class="w3-col l8 m6 s12">
<input class="w3-input w3-card" type="text" name="pigeon_pair" placeholder="<?=$lng['add_pairs_of_pigeons']?>" required=""/>
</div>

<div class="w3-col l4 m6 s12">
<button class="w3-button w3-block w3-bluepm w3-hover-seagreen"><?=$lng['add_pairs_btn']?></button>
</div>
</div>
<input type="hidden" name="uid" value="<?=$rwpusr['uid']?>"/>
<input type="hidden" name="add_pair_form" value="true"/>
</form>

<?php } } ?>


</div>



<div id="modal01" class="w3-modal" onclick="this.style.display='none'">
  <span class="w3-button w3-hover-red w3-xlarge w3-display-topright w3-hide">&times;</span>
  <div class="w3-modal-content w3-animate-zoom">
    <img id="img01" style="width:100%;max-width:100%;max-height:100%;margin:0;padding:0;"/>
  </div>
</div>

<script>
function onClick(element) {
  document.getElementById("img01").src = element.src;
  document.getElementById("modal01").style.display = "block";
}
</script>
<?php }else{ ?>

<div class="w3-row">

<div class="w3-col l12 m12 s12 w3-bluepm w3-center w3-border-bottom">
<h2 class="w3-padding-32"><i class="fa fa-ban w3-xxxlarge"></i><br/><?=$lng['page_inactive_title']?></h2>
<img src="<?=IMG?>404trs.png" alt="404trs.png" title="<?=$lng['page_inactive_title']?>" style="max-width:90%;"/>
</div>



</div>

<?php } ?>