<?php
include 'includ/header.php';
?>
        <div class="container grid px-6 mx-auto ">


            <a style="font-size: 20px"
               class="text-xs font-semibold tracking-wide text-left text-gray-500 0 dark:text-gray-400 inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
            >
                <svg xmlns="http://www.w3.org/2000/svg" id="Outline" viewBox="0 0 24 24" fill="gray" width="21"
                     height="21">
                    <path d="M22.485,10.975,12,17.267,1.515,10.975A1,1,0,1,0,.486,12.69l11,6.6a1,1,0,0,0,1.03,0l11-6.6a1,1,0,1,0-1.029-1.715Z"/>
                    <path d="M22.485,15.543,12,21.834,1.515,15.543A1,1,0,1,0,.486,17.258l11,6.6a1,1,0,0,0,1.03,0l11-6.6a1,1,0,1,0-1.029-1.715Z"/>
                    <path d="M12,14.773a2.976,2.976,0,0,1-1.531-.425L.485,8.357a1,1,0,0,1,0-1.714L10.469.652a2.973,2.973,0,0,1,3.062,0l9.984,5.991a1,1,0,0,1,0,1.714l-9.984,5.991A2.976,2.976,0,0,1,12,14.773ZM2.944,7.5,11.5,12.633a.974.974,0,0,0,1,0L21.056,7.5,12.5,2.367a.974.974,0,0,0-1,0h0Z"/>
                </svg>

                <span class="ml-4"><?php echo $_LANG['Volumetitle']?></span>
                <?php session_notif_wizwiz() ?>
            </a>


            <?php
            volumes_delete($conn);
            ?>
            <?php
            $sql1 = "SELECT * FROM increase_order";
			$stmt = $conn->prepare($sql1);
			$stmt->execute();
			$result1 = $stmt->get_result();
			$stmt->close();
            echo '
                            <div style="margin-top:40px" class="shadow-lg min-w-0 p-4 bg-white rounded-lg dark:bg-gray-800 text-xs font-semibold tracking-wide text-left text-gray-500 border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800">

                            <div class="w-full overflow-x-auto">
                                <table class="w-full whitespace-no-wrap" >
                            <thead>
                            <tr class="text-center text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-700">
                                <th class="px-4 py-3"></th>
                                <th class="px-4 py-3">' . $_LANG['REMARK'] . '</th>
                                <th class="px-4 py-3">' . $_LANG['SERVER'] . '</th>
                                <th class="px-4 py-3">' . $_LANG['PRICE'] . '</th>
                                <th class="px-4 py-3">' . $_LANG['DATE'] . '</th>
                                <th class="px-4 py-3">' . $_LANG['DELETE'] . '</th>
                            </tr>
                            </thead>
                                ';
            echo '<tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800 text-center" >';
            while ($row1 = $result1->fetch_assoc()) {
                $id_server_d = $row1["id"];
                $server_id_d = $row1["server_id"];
                $timestamp = $row1["date"];
                $date = jdate('Y-m-d H:i:s', $timestamp);
                $number_amount = number_format($row1["amount"]);
                $sql_plans = "SELECT * FROM server_info where id=?";
				$stmt = $conn->prepare($sql_plans);
				$stmt->bind_param('i', $server_id_d);
				$stmt->execute();
				$result_plans = $stmt->get_result();
				$stmt->close();
                
                while ($row_plans = $result_plans->fetch_assoc()) {
                    $id_plans = $row_plans["title"];
                }
                echo '<tr class="text-gray-700 dark:text-gray-400">';
                echo '<td class="px-4 py-3">';
                echo '<div class="flex items-center text-sm ">';
                echo '<div class="relative hidden w-8 h-8 mr-3 mt-2 rounded-full md:block" >';
                echo '<svg xmlns="http://www.w3.org/2000/svg" id="Outline" viewBox="0 0 24 24" fill="gray" width="21" height="21"><path d="M22.485,10.975,12,17.267,1.515,10.975A1,1,0,1,0,.486,12.69l11,6.6a1,1,0,0,0,1.03,0l11-6.6a1,1,0,1,0-1.029-1.715Z"/><path d="M22.485,15.543,12,21.834,1.515,15.543A1,1,0,1,0,.486,17.258l11,6.6a1,1,0,0,0,1.03,0l11-6.6a1,1,0,1,0-1.029-1.715Z"/><path d="M12,14.773a2.976,2.976,0,0,1-1.531-.425L.485,8.357a1,1,0,0,1,0-1.714L10.469.652a2.973,2.973,0,0,1,3.062,0l9.984,5.991a1,1,0,0,1,0,1.714l-9.984,5.991A2.976,2.976,0,0,1,12,14.773ZM2.944,7.5,11.5,12.633a.974.974,0,0,0,1,0L21.056,7.5,12.5,2.367a.974.974,0,0,0-1,0h0Z"/></svg>';
                echo '</div>';
                echo '<div>';
                echo '<p class="text-xs text-gray-600 dark:text-gray-400">' . $row1["userid"] . '</p>';
                echo '</div>';
                echo '</div>';
                echo '</td>';
                echo '<td class="px-4 py-3 text-sm" style="font-size: 13px !important;">' . $row1["remark"] . '</td>';
                if (isset($id_plans)) {
                    echo '<td class="px-4 py-3 text-sm" style="font-size: 13px !important;">' . $id_plans . '</td>';
                } else {
                    echo '<td class="px-4 py-3 text-sm" style="font-size: 13px !important;">' . $_LANG['notserver'] . '</td>';
                }
                echo '<td class="px-4 py-3 text-sm" style="font-size: 13px !important;">' . $number_amount . '</td>';
                echo '<td class="px-4 py-3 text-sm" style="font-size: 13px !important;">' . $date . '</td>';
                echo '<td class="px-4 py-3">';
                echo '<div class="flex items-center justify-center space-x-4 text-sm ">';
                echo '<button id="ts-error" class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-purple-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray" aria-label="Delete">';
                echo '<a id="ts-error" href="volume.php?delete=' . $row1["id"] . '" ><svg class="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path>' . $row1["id"] . '</svg></a>';
                echo '</button>';
                echo '</div>';
                echo '</td>';
                echo '</tr>';
            }
            echo '</tbody>';
            echo '</table>';
            echo '</div>';
            echo '</div>';
            ?>
<?php
include 'includ/footer.php';
?>
