<?php



include("../asl.php");
ini_set('display_errors', '0');


?>



<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html ; charset=utf-8" />
    <meta http-equiv="content-type" content="text/html" />
    <meta name="author" content="persian" />

    <title>طراحی ربات ahp</title>


    <link rel="Stylesheet" type="text/css" href="style.css" />


    <style>
        @font-face {
            font-family: 'amir';
            src: url('font/BKoodakBold.ttf')format('truetype'),
                url('font/BKoodakBold.eot')format('eot'),
                url('font/BKoodakBold.woff')format('woff');

        }
        
  @font-face
{
font-family: 'amir' ;
src:url('font/BKoodakBold.ttf')format('truetype'),
url('font/BKoodakBold.eot')format('eot'),
url('font/BKoodakBold.woff')format('woff');

}
.font{
    font-family:amir;
}

.input{
    font-family:amir;
    width:300px;
    height:50px;
    font-size:12pt;
    padding-right:10px;
}


.input-blue{

    font-family:amir;
    width:320px;
    height:50px;
    font-size:12pt;
    padding-right:10px;
    background-color:#0078ff;
    color:white;border-radius: 5px;
}
.button-blue{
        color: #ffffff;
background-color: #0064cd;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);

    font-family:amir;
    font-size:10pt;
    width:px;
    height:30px;
    padding-right:10px;
    color:white;
    border-radius: 5px;
    border:0px;
    
    
    
    
    border: 1px solid #ccc;
border-bottom-color: #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
-ms-transition: 0.1s linear all;
-o-transition: 0.1s linear all;

}
.button-green{
    color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #faa732;
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
background-image: -o-linear-gradient(top, #fbb450, #f89406);
background-image: linear-gradient(to bottom, #fbb450, #f89406);
background-repeat: repeat-x;


    font-family:amir;
    font-size:10pt;
    width:150px;
    height:30px;
    padding-right:10px;
    color:white;
    border-radius: 5px;
    border:0px;
}
.button-orange{



background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));
background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
background-image: linear-gradient(top, #5bc0de, #339bb9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #339bb9 #339bb9 #22697d;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);

    font-family:amir;
    font-size:10pt;
    width:120px;
    height:30px;
    padding-right:10px;
    color:white;
    border-radius: 5px;
    border:0px;
    
    
    
    border: 1px solid #ccc;
border-bottom-color: #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
-ms-transition: 0.1s linear all;
-o-transition: 0.1s linear all;
}
.button-red-gradiant{
    background-color: #c43c35;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #c43c35 #c43c35 #882a25;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);


    font-family:amir;
    font-size:10pt;
    width:120px;
    height:30px;
    padding-right:10px;
    color:white;
    border-radius: 5px;
    border:0px;


border: 1px solid #ccc;
border-bottom-color: #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
-ms-transition: 0.1s linear all;
-o-transition: 0.1s linear all;
}



.button-gray-gradiant{
cursor: pointer;
display: inline-block;
background-color: #e6e6e6;
background-repeat: no-repeat;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);


    font-family:amir;
    font-size:10pt;
    width:200px;
    height:30px;
    padding-right:10px;
    color:gray;
    border-radius: 5px;
    border:0px;

border: 1px solid #ccc;
border-bottom-color: #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
-ms-transition: 0.1s linear all;
-o-transition: 0.1s linear all;

}



.button-red{


background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));
background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
background-image: linear-gradient(top, #5bc0de, #339bb9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #339bb9 #339bb9 #22697d;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);

    font-family:amir;
    font-size:10pt;
    width:120px;
    height:30px;
    padding-right:10px;
    color:white;
    border-radius: 5px;
    border:0px;
    

}

body{
    font-family:amir;
   
             background-image: url('/vichy/images/3.jpg');
     background-size:100% 100%;
-moz-background-size:100% 100%; /* Firefox 3.6 */
background-repeat:no-repeat;
    background-repeat: no-repeat;
    background-attachment: fixed;
     

}
    #content{
        width:800px;
  
        background-color:#ffffff;
        border-radius:5px;
        box-shadow: 0px 5px 5px gray;

    }
    .radius{
        border-radius:1000px;
        width:100px;
        margin-top:30px;
    }
    .radiuslogo{
        
        width:440px;
        margin-top:200px;
    }
    .gray{
     background-color:#aef6ff;
        color:#555;
        font-weight:bold ;
              
    }
    #content-content{
        margin-right:30px;
    }
    #callus{
        display:none;
    }
    .blue{
        color:#0066ff;
            font-weight:bold ;
    }
        .white{
        color:#ffffff;
            font-weight:bold ;
    }
    .th{
    
font-size:10pt;
        width:233px;
        height:30px;
        color:white;
        border: 1px #767676 solid;
        
background: #767676;
background: -moz-linear-gradient(top, #767676 0%, #686868 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #767676), color-stop(100%, #686868));
background: -webkit-linear-gradient(top, #767676 0%, #686868 100%);
    }
        .th2{
font-size:10pt;

        height:30px;
        color:white;
        border: 1px #767676 solid;
background: #767676;
background: -moz-linear-gradient(top, #767676 0%, #686868 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #767676), color-stop(100%, #686868));
background: -webkit-linear-gradient(top, #767676 0%, #686868 100%);
    }
        .td{
          font-size:10pt;
border: 1px #CCC solid;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5));
background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 );
height: 30px;
border-radius: 5px;
        width:233px;
                height:30px;
        color:black;

    }
            .td2{
          font-size:10pt;
border: 1px #CCC solid;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5));
background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 );
height: 30px;
border-radius: 5px;

                height:30px;
        color:black;

    }

    .green{
        color:green;
         font-weight:bold ;
         background-color:#ffffff;
    }
    #messages{
        display:none;
    }
    #changepass{
        display:none;
    }
    .page{
        text-decoration:none;
        border:1px;
        border-style: solid;
        border-color:gray;
        color:gray;
        width:20px;
        height:20px;
    }
    #editinfo{
        display:none;
    }
    .green{
        color:green;
    }
 
    </style>


</head>

<body dir="rtl" align="center">
    <div align="center">
        <?php

        //   import_request_variables("p" , "a_");


        //old import
        function checkarray($summerarray, $mainkey, $mainarray)
        {
            if (in_array($mainkey, $summerarray)) {
                unset($mainarray["$mainkey"]);
                return $mainarray;
            } else {
                return "ok";
            }
        }

        $summerarray = array();
        $artest = $_POST;
        foreach ($artest as $postinfo) {

            $ar_mainkey = array_search($postinfo, $artest);
            if (checkarray($summerarray, $ar_mainkey, $artest) != "ok") {
                $artest = checkarray($summerarray, $ar_mainkey, $artest);
                $ar_mainkey = array_search($postinfo, $artest);
            }
            ${'a_' . $ar_mainkey} = $postinfo;
            $summerarray[] = $ar_mainkey;
        }
        //old import


        try {
            $conn = new PDO("mysql:host=$servername;dbname=$mydb", $username, $password,  array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
            // set the PDO error mode to exception

            $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $e) {
            echo "Connection failed: " . $e->getMessage();
        }




        $sql = "select * from admin";
        $stmt =   $conn->prepare($sql);
        $stmt->execute();

        $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
        $show = $stmt->fetch();

        $user = $show["user"];
        $pass = $show["pass"];


        $getpass = hash_hmac('md5', $a_pass, 'salt');


        if ($user == $a_user && $pass == $getpass) {
        } else {





            echo "<p style='color:green' >یوزرنیم و پسورد اشتباه
</p>";




            function redirect($url)
            {
                if (!headers_sent()) {
                    header('Location: ' . $url);
                    exit;
                } else {
                    echo '<script type="text/javascript">';
                    echo 'window.location.href="' . $url . '";';
                    echo '</script>';
                    echo '<noscript>';
                    echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
                    echo '</noscript>';
                    exit;
                }
            }

            redirect("enter.php");
        }




        function sendmessage($text, $chatid, $keys)
    {
        $ch = curl_init("https://api.telegram.org/bot7305082680:AAFueBDE7l1iTJPHsmZ0ERsf_2FBZfwQwzc/sendmessage?chat_id=$chatid&text=$text&parse_mode=HTML&reply_markup=$keys");
        curl_exec($ch);
    }


        function generateTelegramInviteLink($chatId) {

            $exTime = time() + 4800;

            // Endpoint for creating chat invite link
            $url = "https://api.telegram.org/bot7305082680:AAFueBDE7l1iTJPHsmZ0ERsf_2FBZfwQwzc/createChatInviteLink";
        
            // Initialize cURL session
            $ch = curl_init();
        
            // Set cURL options
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
                'chat_id' => $chatId, 
                'expire_date' => $exTime
            ]));
        
            // Execute cURL session
            $response = curl_exec($ch);
        
            // Close cURL session
            curl_close($ch);
        
            // Decode the JSON response
            $response = json_decode($response, true);
        
            // Check if the request was successful
            if (!$response['ok']) {
                throw new Exception("Failed to generate invite link: " . $response['description']);
            }
        
            // Return the invite link
            return $response['result'];
        }
        
       
        







        ?>

        <br /><br />
        <h4 class="white">پنل مدیریتی ربات</h4>
        <div id="content" align="right">
            <div id="content-content">
                <table>
                    <tr>
                        <td><img class="radius" src="images/user.png" /></td>
                        <td class="gray" valign="bottom">خوش آمدید <?php print $userse; ?></td>

                        <td>
                            <form target="_blank" method='post' action='authCheck.php'>


                                <input type='submit' style='width:100%' class='font' value='احراز هویت' />
                                <input type='hidden' name='user' value="<?php echo $a_user  ?>" />
                                <input type='hidden' name='pass' value="<?php echo $a_pass  ?>" class='font' />
                            </form>
                        </td>

                        




                    </tr>
                    </tr>

                </table>



                <br />
                <br />
                <a href="https://telegram.me/" target="_blank">
                    <input class='button-blue' style="width:725px;" type="button" value="رفتن به داخل ربات" />
                </a>

                <br />
                <div id="fish">




                    <h5 class='gray'>◄ نمایش احراز هویت</h5>


                    <table>
                        <tr>
                            <th class='th'>فرم</th>
                            <th class='th'>اسکرین شات</th>
                            <th class='th'>نام تلگرام</th>
                            <th class='th'>یوزرنیم</th>
                            <th class='th'>وضعیت</th>
                            <th class='th'>ویرایش</th>
                     

                        </tr>
                        <tr>





                            <?php

                            if (isset($_POST['check'])) {

                                $id = $_POST['id'];
                                $status = $_POST['status'];
                                $sql = "update basket set `status`='$status' where id='$id' ";
                                $conn->exec($sql);
                                    
                                // sendmessage(urlencode($text), intval($_POST['chatid']), '');
                                
                            }


                            $stmt = $conn->prepare("SELECT * FROM basket ");

                            $stmt->execute();

                            // set the resulting array to associative
                            $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);

                            $k = $stmt->fetchAll();
                            $num = $stmt->rowCount();


                            foreach ($k as $v) {
                                print "
                                <tr>
                                    <td align='center' class='td'>" . $v["message"] . "</td>
                                    <td align='center' class='td'>
                                        <a href='../upload/" . $v['picture'] . "'>
                                            <img style='width:100%' src='../upload/" . $v['picture'] . "' />
                                        </a>
                                    </td>
                                    <td align='center' class='td'>" . $v["telname"] . "</td>
                                    <td align='center' class='td'>" . $v["username"] . "</td>
                                    <form method='post' action='screens.php'>
                                        <td align='center' class='td'>
                                            <select name='status'>
                                                <option value='در انتظار پرداخت'" . ($v["status"] == 'در انتظار پرداخت' ? ' selected' : '') . ">در انتظار پرداخت</option>
                                                <option value='در حال بررسی'" . ($v["status"] == 'در حال بررسی' ? ' selected' : '') . ">در حال بررسی</option>
                                                <option value='در صف چاپ'" . ($v["status"] == 'در صف چاپ' ? ' selected' : '') . ">در صف چاپ</option>
                                                <option value='ارسال شده'" . ($v["status"] == 'ارسال شده' ? ' selected' : '') . ">ارسال شده</option>
                                            </select>
                                        </td>
                                        <td align='center' class='td'>
                                            <button name='check' value='no' style='width:100%'>ویرایش</button>
                                        </td>
                                        <input type='hidden' name='id' value='" . $v["id"] . "' />
                                        <input type='hidden' name='chatid' value='" . $v["chatid"] . "' />
                                        <input type='hidden' name='path' value='" . $v["path"] . "' />
                                        <input type='hidden' name='user' value='$a_user' />
                                        <input type='hidden' name='pass' value='$a_pass' />
                                    </form>
                                </tr>";
                            }
                            




                            ?>










                        </tr>



                    </table>

















                    <hr />
                    
                    <br />
                    






                </div>



















                <br />
                <br />
            </div>
        </div>




        <a style="text-decoration:none ;" href="http://ahpbot.ir" target="_blank" class="gray">طراحی شده توسط ahpbot</a>
    </div>

    <?php
    $conn = null;
    ?>
</body>

</html>