<?php
    require_once('config.php');
    
    ?>
        <style>
            :root {
                --button-color: <?php echo THEME_COLOR; ?>;
            }
        </style>
    <?php
    
    $user_id=@$_GET['username'];
    
    $data = [
        "username" => $user_id,
        "other_user_id" => "0"
    ];
    
    $url = $baseurl . 'showUserDetail';
    $json_data = @curl_request($data, $url);
    

?>

<?php
    if(is_array($json_data) || is_object($json_data)) 
    {
        if($json_data['code']=="200")
        {
            $json_data=$json_data['msg'];
            ?>
                
                <head>
                    <title>🔴 <?php echo $json_data['User']['username']; ?> is LIVE on <?php echo APP_NAME; ?> now.</title>
                    <meta data-n-head="ssr" charset="utf-8" />
                    <meta data-n-head="ssr" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
                    <link data-n-head="ssr" rel="icon" type="image/x-icon" href="/favicon.ico" />
                    <base href="<?php echo BASE_URL;?>">
                    <link rel="preload" href="assets/css/aa07e69.css?token=<?php echo time(); ?>" as="style" />
                    <link rel="preload" href="assets/css/3757fc0.css?token=<?php echo time(); ?>" as="style" />
                    <link rel="preload" href="assets/css/64e9952.css?token=<?php echo time(); ?>" as="style" />
                    <link rel="stylesheet" href="assets/css/aa07e69.css?token=<?php echo time(); ?>" />
                    <link rel="stylesheet" href="assets/css/3757fc0.css?token=<?php echo time(); ?>" />
                    <link rel="stylesheet" href="assets/css/64e9952.css?token=<?php echo time(); ?>" />
                    
                    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
                    <script>
                    $(document).ready(function(){
                        $("a , .video").click(function(event){
                            event.preventDefault(); // Prevent default action
                            $('.download-dialog').removeAttr("style");
                        });
                        
                        $(".close").click(function(event){
                            event.preventDefault(); // Prevent default action
                            $('.download-dialog').css({
                                "display": "none"
                            });
                        });
                        
                        
                    });
                    </script>
                
                    
                </head>
                
    
                <body>
                    <div id="__nuxt">
                        <!---->
                        <div id="__layout">
                            <div>
                                <div>
                                    <div>
                                        <div data-fetch-key="InstallBar:0" class="app-banner">
                                            <a href="profile/<?php echo $json_data['User']['username']; ?>" class="app-logo-link">
                                                <div class="app-info">
                                                    <img src="<?php echo checkImageUrl($json_data['User']['profile_gif']); ?>" class="app-logo bg-cus-g1" />
                                                    <div>
                                                        <div class="app-title">@<?php echo $json_data['User']['username']; ?></div>
                                                        <div class="app-slogan">is using <?php echo APP_NAME; ?>. Join us now!</div>
                                                    </div>
                                                </div>
                                            </a>
                                            <a
                                                href="profile/<?php echo $json_data['User']['username']; ?>"
                                                class="app-link"
                                            >
                                                View More
                                            </a>
                                            <!---->
                                        </div>
                                        <input id="opid" type="hidden" value="VJr9kXvwPW" />
                                        <div class="container">
                                            
                                            <div class="portrait live">
                                                
                                                <?php
                                                    if(isset($_GET['live']))
                                                    {
                                                        ?>
                                                            <div class="live-lot">
                                                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 275 275" width="275" height="275" style="width: 100%; height: 100%; transform: translate3d(0, 0, 0); content-visibility: visible;" preserveAspectRatio="xMidYMid meet">
                                                                    <defs>
                                                                        <clipPath id="__lottie_element_3"><rect width="275" height="275" x="0" y="0"></rect></clipPath>
                                                                        <linearGradient id="__lottie_element_7" spreadMethod="pad" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="100" y2="0">
                                                                            <stop offset="0%" stop-color="rgb(255,255,255)"></stop>
                                                                            <stop offset="100%" stop-color="rgb(0,0,0)"></stop>
                                                                        </linearGradient>
                                                                        <linearGradient id="__lottie_element_11" spreadMethod="pad" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="100" y2="0">
                                                                            <stop offset="0%" stop-color="rgb(255,255,255)"></stop>
                                                                            <stop offset="100%" stop-color="rgb(0,0,0)"></stop>
                                                                        </linearGradient>
                                                                    </defs>
                                                                    <g clip-path="url(#__lottie_element_3)">
                                                                        <g style="display: block;" transform="matrix(1,0,0,1,150.625,187.5)" opacity="1">
                                                                            <g opacity="1" transform="matrix(1,0,0,1,-13.125,-121.125)">
                                                                                <path
                                                                                    fill="url(#__lottie_element_11)"
                                                                                    fill-opacity="0"
                                                                                    d=" M0,-49 C66.22799682617188,-49 120,4.771999835968018 120,71 C120,137.22799682617188 66.22799682617188,191 0,191 C-66.22799682617188,191 -120,137.22799682617188 -120,71 C-120,4.771999835968018 -66.22799682617188,-49 0,-49z"
                                                                                ></path>
                                                                                <path
                                                                                    stroke-linecap="butt"
                                                                                    stroke-linejoin="miter"
                                                                                    fill-opacity="0"
                                                                                    stroke-miterlimit="4"
                                                                                    stroke="rgb(255,101,0)"
                                                                                    stroke-opacity="1"
                                                                                    stroke-width="6"
                                                                                    d=" M0,-49 C66.22799682617188,-49 120,4.771999835968018 120,71 C120,137.22799682617188 66.22799682617188,191 0,191 C-66.22799682617188,191 -120,137.22799682617188 -120,71 C-120,4.771999835968018 -66.22799682617188,-49 0,-49z"
                                                                                ></path>
                                                                            </g>
                                                                        </g>
                                                                        
                                                                    </g>
                                                                </svg>
                                                            </div>
    
                                                        <?php
                                                    }
                                                ?>
                                                
                                                <a
                                                    href="#"
                                                >
                                                    <img src="<?php echo checkImageUrl($json_data['User']['profile_gif']); ?>" />
                                                </a>
                                                
                                                <?php
                                                    if(isset($_GET['live']))
                                                    {
                                                        ?>
                                                            <div class="live-icon"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="18" viewBox="0 0 15 18"><g fill="none" fill-rule="evenodd"><g fill="#FFF"><g><g><path d="M10.248 4.647l6.046 10.882c.536.965.188 2.183-.777 2.72-.297.164-.632.251-.972.251H2.455c-1.105 0-2-.895-2-2 0-.34.086-.674.251-.971L6.752 4.647c.536-.966 1.754-1.313 2.72-.777.326.181.595.45.776.777z" transform="translate(-182 -203) translate(128 100) translate(54 102) rotate(90 8.5 10)"></path></g></g></g></g></svg></div>
                                                        <?php
                                                    }
                                                ?>
                                                
                                                <!---->
                                                <!---->
                                            </div>
                                            <div class="username">
                                                @<?php echo $json_data['User']['username']; ?>
                                                <!---->
                                            </div>
                                            
                                            <?php
                                                if(isset($_GET['live']))
                                                {
                                                    ?>
                                                        <div style="margin: 5px 0px; font-size: 13px;color:var(--button-color);font-weight: bold;">Host is Live now</div>
                                                    <?php
                                                }
                                            ?>
                                            
                                            
                                            
                                            <!---->
                                            <!---->
                                            <!---->
                                            <!--<div class="rounded-full bg-cus-ec mt-4 py-2 px-4 font-medium cursor-pointer">-->
                                            <!--    Join my Group: My group-->
                                            <!--</div>-->
                                            <div class="user-stats">
                                                <a
                                                    href="#"
                                                    class="user-stat-group"
                                                >
                                                    <strong><?php echo $json_data['User']['following_count']; ?></strong> <label>Following</label>
                                                </a>
                                                <a
                                                    href="#"
                                                    class="user-stat-group"
                                                >
                                                    <strong><?php echo $json_data['User']['followers_count']; ?></strong> <label>Followers</label>
                                                </a>
                                                <a
                                                    href="#"
                                                    class="user-stat-group"
                                                >
                                                    <strong><?php echo $json_data['User']['likes_count']; ?></strong> <label>Likes</label>
                                                </a>
                                            </div>
                                            <div class="user-follow container-max">
                                                <a
                                                    href="#"
                                                    class="support-btn btn"
                                                >
                                                    <span>
                                                        <?php
                                                            if(isset($_GET['live']))
                                                            {
                                                                echo "Join My Live";
                                                            }
                                                            else
                                                            {
                                                                echo "Message";
                                                            }
                                                        ?>
                                                    </span>
                                                </a>
                                                <a
                                                    href="#"
                                                    class="follow-btn btn"
                                                >
                                                    Follow
                                                </a>
                                            </div>
                                            
                                            <?php
                                                $data = [
                                                    "other_user_id" => $json_data['User']['id'],
                                                    "starting_point" => "0"
                                                ];
                                                
                                                $url = $baseurl . 'showVideosAgainstUserID';
                                                $json_data_videos = @curl_request($data, $url);
                                                
                                            ?>
                                            
                                            <div class="tabs container-max">
                                                
                                            </div>
                                            <div class="videos" style="">
                                                
                                                <?php
                                                    
                                                    if(is_array($json_data_videos) || is_object($json_data_videos))
                                                    {
                                                        foreach ($json_data_videos['msg']['public'] as $singleRow)
                                                        {
                                                            ?>
                                                                <div class="video">
                                                                    <div class="cursor-pointer"><img src="<?php echo checkImageUrl($singleRow['Video']['thum']); ?>" /></div>
                                                                    <div class="op-video-info">
                                                                        <div class="op-video-views">
                                                                            <svg xmlns="http://www.w3.org/2000/svg" width="12" height="14" viewBox="0 0 12 14">
                                                                                <path
                                                                                    fill="none"
                                                                                    fill-rule="evenodd"
                                                                                    stroke="#FFF"
                                                                                    d="M10.87 7.67c.185-.37.202-.78.08-1.144-.12-.365-.38-.682-.751-.868L2.67 1.894c-.208-.104-.438-.158-.671-.158-.414 0-.79.168-1.06.44-.272.27-.44.646-.44 1.06v7.528c0 .233.054.462.158.67.186.371.503.632.868.753.364.121.774.104 1.145-.081l7.528-3.764c.29-.146.525-.38.67-.671z"
                                                                                ></path>
                                                                            </svg>
                                                                            <span class="op-video-info-count"><?php echo $singleRow['Video']['view']; ?></span>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            <?php
                                                        }
                                                    }
                                                ?>
                                                
                                                
                                                
                                                
                                                <div class="bottom-download">
                                                    <a
                                                        href=""
                                                        class="download-btn btn px-4"
                                                    >
                                                        <span>
                                                            
                                                            <?php
                                                                if(isset($_GET['live']))
                                                                {
                                                                    echo "Download App to Join My Live";
                                                                }
                                                                else
                                                                {
                                                                    echo "Download App of your ❤ videos now";
                                                                }
                                                            ?>
                                                        </span>
                                                    </a>
                                                </div>
                                            </div>
                                            <div class="comments" style="display: none;">
                                                <div class="empty-content">No comments.</div>
                                                <a href="#" class="download-btn btn">More Comments</a>
                                            </div>
                                            <div class="loading" style="display: none;">
                                                <svg
                                                    xmlns="http://www.w3.org/2000/svg"
                                                    viewBox="0 0 500 300"
                                                    width="500"
                                                    height="300"
                                                    style="width: 100%; height: 100%; transform: translate3d(0px, 0px, 0px); content-visibility: visible;"
                                                    preserveAspectRatio="xMidYMid meet"
                                                >
                                                    <defs>
                                                        <clipPath id="__lottie_element_2"><rect width="500" height="300" x="0" y="0"></rect></clipPath>
                                                    </defs>
                                                    <g clip-path="url(#__lottie_element_2)">
                                                        <g style="display: block;" transform="matrix(0.9800000190734863,0,0,0.9800000190734863,150,208.19635009765625)" opacity="1">
                                                            <g opacity="1" transform="matrix(1,0,0,1,1,0)">
                                                                <path
                                                                    fill="rgb(255,101,0)"
                                                                    fill-opacity="1"
                                                                    d=" M0,-22.8439998626709 C12.607603073120117,-22.8439998626709 22.8439998626709,-12.607603073120117 22.8439998626709,0 C22.8439998626709,12.607603073120117 12.607603073120117,22.8439998626709 0,22.8439998626709 C-12.607603073120117,22.8439998626709 -22.8439998626709,12.607603073120117 -22.8439998626709,0 C-22.8439998626709,-12.607603073120117 -12.607603073120117,-22.8439998626709 0,-22.8439998626709z"
                                                                ></path>
                                                            </g>
                                                        </g>
                                                        <g style="display: block;" transform="matrix(0.9800000190734863,0,0,0.9800000190734863,250,218.99423217773438)" opacity="1">
                                                            <g opacity="1" transform="matrix(1,0,0,1,1,0)">
                                                                <path
                                                                    fill="rgb(255,154,0)"
                                                                    fill-opacity="1"
                                                                    d=" M0,-22.8439998626709 C12.607603073120117,-22.8439998626709 22.8439998626709,-12.607603073120117 22.8439998626709,0 C22.8439998626709,12.607603073120117 12.607603073120117,22.8439998626709 0,22.8439998626709 C-12.607603073120117,22.8439998626709 -22.8439998626709,12.607603073120117 -22.8439998626709,0 C-22.8439998626709,-12.607603073120117 -12.607603073120117,-22.8439998626709 0,-22.8439998626709z"
                                                                ></path>
                                                            </g>
                                                        </g>
                                                        <g style="display: block;" transform="matrix(0.9800000190734863,0,0,0.9800000190734863,350,220)" opacity="1">
                                                            <g opacity="1" transform="matrix(1,0,0,1,1,0)">
                                                                <path
                                                                    fill="rgb(255,193,0)"
                                                                    fill-opacity="1"
                                                                    d=" M0,-22.8439998626709 C12.607603073120117,-22.8439998626709 22.8439998626709,-12.607603073120117 22.8439998626709,0 C22.8439998626709,12.607603073120117 12.607603073120117,22.8439998626709 0,22.8439998626709 C-12.607603073120117,22.8439998626709 -22.8439998626709,12.607603073120117 -22.8439998626709,0 C-22.8439998626709,-12.607603073120117 -12.607603073120117,-22.8439998626709 0,-22.8439998626709z"
                                                                ></path>
                                                            </g>
                                                        </g>
                                                    </g>
                                                </svg>
                                            </div>
                                        </div>
                                        
                                        <div class="download-dialog" style="display: none;">
                                            <div class="dialog-body">
                                                <div class="portrait">
                                                    <a href="profile/<?php echo $json_data['User']['username']; ?>"><img src="<?php echo checkImageUrl($json_data['User']['profile_gif']); ?>" /></a>
                                                </div>
                                                <div class="username break-all">@<?php echo $json_data['User']['username']; ?></div>
                                                <div class="welcome">
                                                   <?php echo $json_data['User']['bio']; ?>
                                                </div>
                                                <a
                                                    href="<?php echo APP_URL; ?>"
                                                    class="download-btn btn"
                                                >
                                                    Download the App
                                                </a>
                                                <i class="close cursor-pointer"></i>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                
                    <link href="assets/css/64e9952.css" rel="stylesheet" type="text/css" />
                </body>
            <?php
        }
        else
        {
            ?>
                <base href="<?php echo BASE_URL;?>">
                <link rel="preload" href="assets/css/aa07e69.css?token=<?php echo time(); ?>" as="style" />
                <link rel="preload" href="assets/css/3757fc0.css?token=<?php echo time(); ?>" as="style" />
                <link rel="preload" href="assets/css/64e9952.css?token=<?php echo time(); ?>" as="style" />
                <link rel="stylesheet" href="assets/css/aa07e69.css?token=<?php echo time(); ?>" />
                <link rel="stylesheet" href="assets/css/3757fc0.css?token=<?php echo time(); ?>" />
                <link rel="stylesheet" href="assets/css/64e9952.css?token=<?php echo time(); ?>" />
                
                <div class="error-container">
                    <!---->
                    <div>
                        <div>
                            <svg xmlns="http://www.w3.org/2000/svg" width="78" height="78" viewBox="0 0 78 78">
                                <g fill="none" fill-rule="evenodd" stroke="#999" stroke-width="3">
                                    <circle cx="39" cy="28.5" r="23.833"></circle>
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M72.37 73.64C65.922 61.838 53.396 53.833 39 53.833c-14.201 0-26.583 7.79-33.105 19.33"></path>
                                </g>
                            </svg>
                        </div>
                        <h2>Couldn’t find this account</h2>
                        <h4>
                            Find more interest people, videos and hashtags<br />
                            on <?php echo APP_NAME; ?>.
                        </h4>
                        <a href="#" class="download" style="background-color: var(--button-color);">
                            Download the <?php echo APP_NAME; ?>
                        </a>
                    </div>
                </div>
    
            <?php
        }
        
    }
    
?>



