 <!-- Main content -->
<section class="content">
  <div class="container-fluid">
    <div class="row">
      <div class="col-12">
        <div class="card">
          <div class="card-header">
            <div class="row">
              <div class="col-sm-6">
                <h3 class="card-title">Agen Voucher Pascabayar</h3>
              </div>
              <div class="col-sm-6">
                <ol class="float-sm-right mb-0">
                  <a type="button" class="btn btn-danger btn-sm m-1" data-toggle="modal" data-target="#staticBackdrop">Tambah</a>
                </ol>
              </div>
              <!-- Modal Tambah -->
              <div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
                <div class="modal-dialog modal-xl">
                  <div class="modal-content">
                    <form method="post" enctype="multipart/form-data">
                      <div class="modal-header bg-primary">
                        <h5 class="modal-title" id="staticBackdropLabel">Tambah Agen</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                        </button>
                      </div>
                      <div class="modal-body">
                        <div class="row">
                          <div class="card-body pb-0">
                            <div class="row">
                              <div class="col-md-6">
                                <div class="form-group">
                                  <label>Server</label>
                                  <select class="form-control" name="ids" required="required">
                                    <option value="">Pilih</option>
                                    <?php 
                                    $List = new Listdata();
                                    $List->set_list("data_server",$SqlDataWH);
                                    foreach ($List->get_list() as $key => $value): ?>
                                    <option value="<?php echo $value['id']; ?>" ><?php echo $value['nama_server']; ?></option>
                                    <?php endforeach ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <label>Mikrotik</label>
                                  <select class="form-control" name="idm" required="required">
                                    <option value="">Pilih</option>
                                    <?php 
                                    $List = new Listdata();
                                    $List->set_list("setting_mikrotik",$SqlDataWHId);
                                    foreach ($List->get_list() as $key => $value): ?>
                                    <option value="<?php echo $value['id']; ?>" ><?php echo $value['nama']; ?></option>
                                    <?php endforeach ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <label>Nama Agen</label>
                                  <input type="text" class="form-control" name="nama" required="required">
                                </div>
                                <div class="form-group">
                                  <label>Nomor Whatsapp</label>
                                  <input type="text" class="form-control" name="nomor" required="required">
                                </div>
                              </div>
                              <div class="col-md-6">
                                <div class="form-group">
                                  <label>Email Agen</label>
                                  <input type="email" class="form-control" name="email" required="required">
                                </div>
                                <div class="form-group">
                                  <label>Kode Agen</label>
                                  <input type="text" class="form-control" name="kode" required="required">
                                </div>
                                <div class="form-group">
                                  <label>Alamat</label>
                                  <textarea class="form-control" rows="4" name="alamat" required="required"></textarea>
                                </div>
                              </div>
                            </div>
                            <a class="btn btn-link" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
                                Option Form Tambahan
                            </a>
                            <div class="collapse" id="collapseExample">
                                <div class="card-body">
                                  <label>Pilih Voucher Agen</label>
                                  <div class="row">
                                    <?php 
                                    $List->set_list("profile_paket", $SqlDataWHId. "AND status = '1'");
                                      foreach ($List->get_list() as $key => $value): 
                                        //Kumpulkan semua ID
                                        $ids_menu[] = $value['id'];
                                        ?>
                                      <div class="col-md-4">
                                        <div class="form-check mb-2">
                                          <input class="form-check-input" type="checkbox" value="<?php echo $value['id']; ?>" name="menu_ids[]" id="flexCheckDefault" checked>
                                          <label class="form-check-label" for="flexCheckDefault">
                                              <?php echo $value['nama'] . " ( Rp. ".number_format($value['harga_paket'])." )"; ?>
                                          </label>
                                        </div>
                                      </div>
                                    <?php endforeach ?>
                                  </div>
                                </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        <input type="submit" name="tambah" class="btn btn-primary" value="Tambah">
                      </div>
                    </form>
<?php
if (isset($_POST['tambah'])) {

  $difference = array_diff($ids_menu, $_POST['menu_ids']);

  if (empty($difference)) {
    $paket_list = NULL;
  } else {
    $paket_list = implode(', ', $_POST['menu_ids']);
  }

    // Format nomor WhatsApp
    if (substr($_POST['nomor'], 0, 2) == '62') {
        $handphone = $_POST['nomor'];
    } else {
        $handphone = '62' . substr($_POST['nomor'], 1);
    }

    // Cek apakah nomor WhatsApp sudah terdaftar
    $stmt = $pdo->prepare("SELECT nomor_whatsapp FROM agen_voucher WHERE nomor_whatsapp = :NoWhatsApp");
    $stmt->execute([':NoWhatsApp' => $handphone]);
    $ceknomor = $stmt->fetch(PDO::FETCH_ASSOC);

    if (empty($ceknomor)) {
        try {
            // Generate password dan hash
            $password = $_POST['kode'] . date('is');
            $hashedPassword = password_hash($password, PASSWORD_DEFAULT);

            // Insert data agen baru
            $stmt = $pdo->prepare("INSERT INTO agen_voucher (id_data_server, id_setting_mikrotik, email, nama, alamat, nomor_whatsapp, kode_agen, status, profile, password, jenis_agen,list_paket) VALUES (:id_data_server, :id_setting_mikrotik, :email, :nama, :alamat, :nomor_whatsapp, :kode_agen, 'Aktif', 'member.png', :password, 'Pascabayar', :list_paket)");

            $stmt->execute([
                ':id_data_server' => $_POST['ids'],
                ':id_setting_mikrotik' => $_POST['idm'],
                ':email' => $_POST['email'],
                ':nama' => $_POST['nama'],
                ':alamat' => $_POST['alamat'],
                ':nomor_whatsapp' => $handphone,
                ':kode_agen' => $_POST['kode'],
                ':password' => $hashedPassword,
                ':list_paket' => $paket_list
            ]);
//Kirim Pesan Registrasi Agen
$Pesan = "*Registrasi Agen Voucher*

Nama      : ".$_POST['nama']."
Alamat    : ".$_POST['alamat']."
Kode Agen : ".$_POST['kode']."
Password  : ".$password."

_Registrasi Berhasil..!!_

_==> Pesan Otomatis Sistem <==_";
$Nomor = array($handphone);
$APIwa = new PesanWA();
$APIwa->Send_Pesan($_POST['ids'],'sendMessage',$Nomor,$Pesan);

            sweetAlert("Agen telah ditambahkan", "success");
        } catch (PDOException $e) {
            sweetAlert("Terjadi kesalahan: " . $e->getMessage(), "error");
        }
    } else {
        sweetAlert("Registrasi Gagal.!, Nomor WhatsApp sudah terdaftar", "error");
    }
}
?>

                  </div>
                </div>
              </div>
              <!-- END Modal Tambah -->
            </div>
          </div>
          <!-- /.card-header -->
          <div class="card-body">
            <div class="row">
              <div class="col-md-6">
                <div class="row">
                  <div class="col-md-3 mb-2">
                    <form method="post">
                        <select id="pilihBulan" onchange="fetchDataAgen()" class="form-control form-control-sm">
                            <?php
                            $idArray = explode(',', $SvId);
                            $query = "SELECT generate_time FROM v_detail_agen_pascabayar WHERE id_data_server IN (" . implode(',', array_fill(0, count($idArray), '?')) . ") GROUP BY generate_time ORDER BY generate_time DESC";
                            $stmt = $pdo->prepare($query);
                            foreach ($idArray as $index => $id) {
                                $stmt->bindValue($index + 1, $id, PDO::PARAM_INT); // Bind setiap ID ke parameter
                            }
                            $stmt->execute();
                            $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
                            foreach ($options as $row) {
                                $generate_time = $row['generate_time'];
                                ?>
                                <option value="<?php echo $generate_time; ?>"><?php echo substr(formatIndo($generate_time), 3); ?></option>
                            <?php } ?>
                        </select>
                    </form>
                  </div>
                  <div class="col-md-6">
                    <center>
                      <p>Akumulasi Keuangan Voucher</p>
                    </center>
                  </div>
                </div>
                <div class="row">
                  <div class="col-lg-4 col-6">
                      <!-- small box -->
                      <div class="small-box bg-info" id="penjualanBox">
                          <div class="inner">
                              <h4 id="penjualanValue">0</h4>
                              <p>Total Penjualan</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-card"></i>
                          </div>
                      </div>
                  </div>
                  <div class="col-lg-4 col-6">
                      <!-- small box -->
                      <div class="small-box bg-success" id="lunasBox">
                          <div class="inner">
                              <h4 id="lunasValue">0</h4>
                              <p>Total Lunas</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-card"></i>
                          </div>
                      </div>
                  </div>
                  <div class="col-lg-4 col-6">
                      <!-- small box -->
                      <div class="small-box bg-warning" id="pendingBox">
                          <div class="inner">
                              <h4 id="pendingValue">0</h4>
                              <p>Total Pending</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-card"></i>
                          </div>
                      </div>
                  </div>
                </div>
              </div>
              <div class="col-md-6">
                <div class="row">
                  <div class="col-md-3 mb-2">
                  </div>
                  <div class="col-md-6">
                    <center>
                      <p>Akumulasi Voucher</p>
                    </center>
                  </div>
                </div>
                <div class="row">
                  <div class="col-lg-3 col-6">
                      <!-- small box -->
                      <div class="small-box bg-info" id="pendingBox">
                          <div class="inner">
                              <h4 id="jumtotalValue">0</h4>
                              <p>Total Voucher</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-android-wifi"></i>
                          </div>
                      </div>
                  </div>
                  <div class="col-lg-3 col-6">
                      <!-- small box -->
                      <div class="small-box bg-warning" id="pendingBox">
                          <div class="inner">
                              <h4 id="jumbelumValue">0</h4>
                              <p>Belum Aktif</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-wifi"></i>
                          </div>
                      </div>
                  </div>
                  <div class="col-lg-3 col-6">
                      <!-- small box -->
                      <div class="small-box bg-success" id="pendingBox">
                          <div class="inner">
                              <h4 id="jumsedangValue">0</h4>
                              <p>Sedang Aktif</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-android-wifi"></i>
                          </div>
                      </div>
                  </div>
                  <div class="col-lg-3 col-6">
                      <!-- small box -->
                      <div class="small-box bg-danger" id="pendingBox">
                          <div class="inner">
                              <h4 id="jumsudahValue">0</h4>
                              <p>Sudah Kedaluarsa</p>
                          </div>
                          <div class="icon">
                              <i class="ion ion-wifi"></i>
                          </div>
                      </div>
                  </div>
                </div>
              </div>
            </div>
            <table id="example3" class="table table-bordered table-striped">
              <thead>
              <tr>
                <th>No</th>
                <th>Nama Server</th>
                <th>Mikrotik</th>
                <th>Nama Agen</th>
                <th>Nomor WhatsApp</th>
                <th>Jumlah Transaksi</th>
                <th>Status</th>
                <th>Action</th>
              </tr>
              </thead>
              <tbody>
              <?php
                $no = 1;
                $aserver = mysqli_query($con,"SELECT * FROM v_detail_agen_voucher $SqlDataWHId AND jenis_agen = 'Pascabayar'");
                while ($server = mysqli_fetch_assoc($aserver)) 
                {
              ?>
              <tr>
                <td style="max-width: 30px;"><?php echo $no; ?></td>
                <td><?php echo $server['nama_server']; ?></td>
                <td><?php echo $server['nama_mikrotik']; ?></td>
                <td><?php echo $server['nama'] . ' ('.$server['kode_agen'].')'; ?><br>
                  <?php 
                    if($server['status'] == 'Aktif') {
                      echo '<div class="badge badge-success">Aktif</div>';
                    } else {
                      echo '<div class="badge badge-danger">Tidak Aktif</div>';
                    }
                  ?>
                </td>
                <td><?php echo $server['nomor_whatsapp']; ?></td>
                <td style="max-width: 100px;">Rp. <?php echo substr(number_format($server['saldo']),1); ?></td>
                <td>
                  <?php 
                  // Ambil bulan dan tahun saat ini dalam format Y-m
                  $now = date('Y-m');

                  // Persiapkan query untuk mengecek saldo yang tidak sama dengan 0
                  $stmt = $pdo->prepare("SELECT 1 FROM v_detail_agen_pascabayar WHERE id_agen_voucher = :id_agen_voucher AND generate_time < :now AND saldo != 0 LIMIT 1");
                  $stmt->bindValue(':id_agen_voucher', $server['id'], PDO::PARAM_INT);
                  $stmt->bindValue(':now', $now, PDO::PARAM_STR); // Pastikan menggunakan PDO::PARAM_STR untuk tanggal
                  $stmt->execute();

                  // Cek apakah ada data yang ditemukan
                  if ($stmt->fetch()) {
                      echo '<span class="badge badge-danger">Ada Tunggakan</span>';
                  } else {
                      echo '<span class="badge badge-success">Lancar</span>';
                  }
                  ?>
                </td>
                <td>
                  <form method="post">
                    <a href="?<?php echo encrypt_url('agen_pascabayar_detail|'.$server['id']); ?>" class="btn btn-info btn-sm m-1">Detail</a>
                    <a type="button" class="btn btn-secondary btn-sm m-1" data-toggle="modal" data-target="#modal-edit<?php echo $server['id'];?>">Edit</a>
                    <input type="submit" name="hapus<?php echo $server['id'];?>" value="Hapus" class="btn btn-danger btn-sm m-1" />
                  </form>
                </td>
              </tr>
              <!-- Modal Edit -->
              <div class="modal fade" id="modal-edit<?php echo $server['id'];?>" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
                <div class="modal-dialog modal-xl">
                  <div class="modal-content">
                    <form method="post" enctype="multipart/form-data">
                      <div class="modal-header bg-secondary">
                        <h5 class="modal-title" id="staticBackdropLabel">Edit Agen Voucher</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                        </button>
                      </div>
                      <div class="modal-body">
                        <div class="row">
                          <div class="card-body pb-0">
                            <div class="row">
                              <div class="col-md-6">
                                <div class="form-group">
                                  <label>Server</label>
                                  <select class="form-control" name="ids" required="required">
                                    <option value="">Pilih</option>
                                    <?php 
                                    $List = new Listdata();
                                    $List->set_list("data_server",$SqlDataWH);
                                    foreach ($List->get_list() as $key => $value): ?>
                                    <option value="<?php echo $value['id']; ?>" <?php if($value['id'] == $server['id_data_server']) { echo "selected";} ?> ><?php echo $value['nama_server']; ?></option>
                                    <?php endforeach ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <label>Mikrotik</label>
                                  <select class="form-control" name="idm" required="required">
                                    <option value="">Pilih</option>
                                    <?php 
                                    $List = new Listdata();
                                    $List->set_list("setting_mikrotik",$SqlDataWHId);
                                    foreach ($List->get_list() as $key => $value): ?>
                                    <option value="<?php echo $value['id']; ?>" <?php if($value['id'] == $server['id_setting_mikrotik']) { echo "selected";} ?> ><?php echo $value['nama']; ?></option>
                                    <?php endforeach ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <label>Nama Agen</label>
                                  <input type="text" class="form-control" name="nama" required="required" value="<?php echo $server['nama']; ?>">
                                </div>
                                <div class="form-group">
                                  <label>Nomor Whatsapp</label>
                                  <input type="text" class="form-control" name="nomor" required="required" value="<?php echo $server['nomor_whatsapp']; ?>">
                                </div>
                              </div>
                              <div class="col-md-6">
                                <div class="form-group">
                                  <label>Email Agen</label>
                                  <input type="email" class="form-control" name="email" required="required" value="<?php echo $server['email']; ?>">
                                </div>
                                <div class="form-group">
                                  <label>Kode Agen</label>
                                  <input type="text" class="form-control" name="kode" required="required" value="<?php echo $server['kode_agen']; ?>">
                                </div>
                                <div class="form-group">
                                  <label>Alamat</label>
                                  <textarea class="form-control" rows="4" name="alamat" required="required"><?php echo $server['alamat']; ?></textarea>
                                </div>
                              </div>
                            </div>
                            <a class="btn btn-link" data-toggle="collapse" data-target="#collapseExample<?php echo $server['id'];?>" aria-expanded="false" aria-controls="collapseExample<?php echo $server['id'];?>">
                                Option Form Tambahan
                            </a>
                            <div class="collapse" id="collapseExample<?php echo $server['id'];?>">
                                <div class="card-body">
                                  <label>Pilih Voucher Agen</label>
                                  <div class="row">
                                    <?php 
                                    $data_paket = explode(",", $server['list_paket']);
                                    $List->set_list("profile_paket", $SqlDataWHId . " AND status = '1'");
                                    $ids_menu = [];

                                    foreach ($List->get_list() as $key => $value): 
                                        // Kumpulkan semua ID
                                        $ids_menu[] = $value['id'];
                                        if (empty($data_paket[0])) {
                                          $checked = 'checked';
                                        } else {
                                        // Cek apakah ID ada dalam array data_paket
                                          $checked = in_array($value['id'], $data_paket) ? 'checked' : ''; // Memperbaiki typo 'cekcked' menjadi 'checked'
                                        }
                                        ?>
                                        <div class="col-md-4">
                                            <div class="form-check mb-2">
                                                <input class="form-check-input" type="checkbox" value="<?php echo $value['id']; ?>" name="menu_ids[]" id="flexCheck<?php echo $value['id']; ?>" <?php echo $checked; ?>>
                                                <label class="form-check-label" for="flexCheck<?php echo $value['id']; ?>">
                                                    <?php echo $value['nama'] . " ( Rp. " . number_format($value['harga_paket']) . " )"; ?>
                                                </label>
                                            </div>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        <input type="submit" name="edit<?php echo $server['id']; ?>" class="btn btn-warning" value="Edit">
                      </div>
                    </form>
                    <?php
                    if (isset($_POST['edit'.$server['id']])) 
                    {
                      $difference = array_diff($ids_menu, $_POST['menu_ids']);

                        if (empty($difference)) {
                          $paket_list = NULL;
                        } else {
                          $paket_list = implode(', ', $_POST['menu_ids']);
                        }

                      $update = mysqli_query($con,"UPDATE agen_voucher SET 
                        id_data_server      ='$_POST[ids]',
                        id_setting_mikrotik ='$_POST[idm]',
                        email               ='$_POST[email]',
                        nama                ='$_POST[nama]',
                        alamat              ='$_POST[alamat]',
                        nomor_whatsapp      ='$_POST[nomor]',
                        kode_agen           ='$_POST[kode]',
                        list_paket          ='$paket_list'
                        WHERE id            = '$server[id]' ");
                      if ($update) 
                      {
                        sweetAlert("Data agen telah di ubah", "success");
                      }
                    }
                    if (isset($_POST['hapus'.$server['id']]))
                    {
                      $iddata = $server['id'];
                      deleteAlert("agen_voucher",$iddata );
                    }
                    ?>
                </div>
              </div></div>
              <!-- END Modal Edit -->
            <?php $no++; } ?>
              </tbody>
            </table>
          </div>
          <!-- /.card-body -->
        </div>
        <!-- /.card -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
  </div>
  <!-- /.container-fluid -->
</section>
<!-- /.content -->

<script>
  // Fungsi untuk menetapkan bulan saat ini sebagai nilai default di dropdown
  function setDefaultMonth() {
    // Dapatkan bulan dan tahun saat ini
    var now = new Date();
    var currentMonth = now.getMonth() + 1; // getMonth() menghasilkan bulan 0-11, jadi kita tambahkan 1
    var currentYear = now.getFullYear();

    // Format bulan dalam format YYYY-MM
    var currentMonthString = currentYear + '-' + (currentMonth < 10 ? '0' + currentMonth : currentMonth);

    // Atur nilai default pada dropdown
    document.getElementById('pilihBulan').value = currentMonthString;

    // Panggil fungsi untuk mengambil data berdasarkan bulan saat ini
    fetchDataAgen();
  }

  // Fungsi untuk mengambil data agen berdasarkan bulan yang dipilih
  function fetchDataAgen() {
    // Ambil nilai bulan dari dropdown
    var bulan = document.getElementById('pilihBulan').value;


    // Ambil nilai ID dan generate_time dari server-side (misalnya dari halaman PHP sebelumnya)
    var idDataServer = <?php echo $SvId; ?>; // Ganti dengan ID yang sesuai atau ambil dari variabel PHP
    var generateTime = bulan; // bulan dalam format YYYY-MM
    
    // Buat request dengan menggunakan XMLHttpRequest
    var xhr = new XMLHttpRequest();
    xhr.open("GET", "list_data/data_akumulasi_agen_pascabayar.php?id=" + idDataServer + "&tgl=" + generateTime, true);

    // Ketika request selesai diproses
    xhr.onreadystatechange = function() {
        if (xhr.readyState === 4) { // 4 berarti request telah selesai
            if (xhr.status === 200) { // Jika status sukses (200)
                // Parse data JSON dari PHP
                var response = JSON.parse(xhr.responseText);
                
                // Pastikan data tersedia sebelum mengaksesnya
                if (response && response.length > 0) {
                    // Ambil data dari response (jika ada)
                    var data = response[0];

                    // Ambil nilai atau set ke 0 jika tidak ada
                    var kredit = parseFloat(data.total_kredit) || 0;  
                    var debet = parseFloat(data.total_debet) || 0;    
                    var saldo = parseFloat(data.total_saldo) || 0;    
                    var jumlah_voucher = parseInt(data.total_voucher) || 0;
                    var jumlah_voucher_belum_aktif = parseInt(data.total_voucher_belum_aktif) || 0;
                    var jumlah_voucher_aktif = parseInt(data.total_voucher_aktif) || 0;
                    var jumlah_voucher_expaired = parseInt(data.total_voucher_expaired) || 0;

                    // Format angka dengan pemisah ribuan
                    kredit = kredit.toLocaleString(); 
                    debet = debet.toLocaleString();   
                    saldo = saldo.toLocaleString();   

                    // Masukkan data ke dalam elemen HTML yang sesuai
                    document.getElementById('penjualanValue').innerText = "Rp. "+kredit;
                    document.getElementById('lunasValue').innerText = "Rp. "+debet;
                    document.getElementById('pendingValue').innerText = "Rp. "+saldo;
                    document.getElementById('jumtotalValue').innerText = jumlah_voucher.toLocaleString();
                    document.getElementById('jumbelumValue').innerText = jumlah_voucher_belum_aktif.toLocaleString();
                    document.getElementById('jumsedangValue').innerText = jumlah_voucher_aktif.toLocaleString();
                    document.getElementById('jumsudahValue').innerText = jumlah_voucher_expaired.toLocaleString();
                } else {
                    // Jika data tidak ditemukan atau kosong
                    document.getElementById('result').innerHTML = "Tidak ada data untuk bulan yang dipilih.";
                }
            } else {
                // Jika ada masalah dengan request
                document.getElementById('result').innerHTML = "Error: Tidak dapat mengambil data.";
            }
        }
    };

    // Kirimkan request
    xhr.send();
  }

  // Panggil fungsi setDefaultMonth saat halaman dimuat
  window.onload = setDefaultMonth;
</script>
