ok

Mini Shell

Direktori : /home/ngwcolle/public_html/admin/
Upload File :
Current File : /home/ngwcolle/public_html/admin/manage-pmt-link.php

<?php session_start();
//DB conncetion
error_reporting(1);
include_once('includes/config.php');
//validating Session
if (strlen($_SESSION['aid'] == 0)) {
  header('location:logout.php');
} else {


  if (isset($_POST['update'])) {
    $teamid = $_GET['teamid'];
    $tname = $_POST['teamname'];
    $tlname = $_POST['teamleadname'];
    $mobno = $_POST['mobilenumber'];
    // echo $tmember = $_POST['pswitch'];
    // $status = '0';
    $status = isset($_POST['pswitch']) ? 1 : 0;
    // if (isset($_POST['pswitch']) && $_POST['pswitch'] == '1') {
    //   echo  $status = $_POST['pswitch'];
    // }
    $query = mysqli_query($con, "UPDATE  tbl_pmtlink set pmturl='$tname',startdate='$tlname',enddate='$mobno',pmtlinkenabled='$status' WHERE id='1'");
    if ($query) {
      echo '<script>alert("Setting details updated.")</script>';
      echo "<script>window.location.href ='manage-pmt-link.php'</script>";
    } else {
      echo '<script>alert("Something Went Wrong. Please try again.")</script>';
    }
  }
?>

  <!DOCTYPE html>
  <html lang="en">

  <head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Update Team Details</title>

    <!-- Custom fonts for this template-->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
    <style type="text/css">
      label {
        font-size: 16px;
        font-weight: bold;
        color: #000;
      }


      /* The switch - the box around the slider */
      .switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 34px;
        float: right;
      }

      /* Hide default HTML checkbox */
      .switch input {
        display: none;
      }

      /* The slider */
      .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        -webkit-transition: .4s;
        transition: .4s;
      }

      .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        -webkit-transition: .4s;
        transition: .4s;
      }

      input.default:checked+.slider {
        background-color: #444;
      }

      input.primary:checked+.slider {
        background-color: #2196F3;
      }

      input.success:checked+.slider {
        background-color: #8bc34a;
      }

      input.info:checked+.slider {
        background-color: #3de0f5;
      }

      input.warning:checked+.slider {
        background-color: #FFC107;
      }

      input.danger:checked+.slider {
        background-color: #f44336;
      }

      input:focus+.slider {
        box-shadow: 0 0 1px #2196F3;
      }

      input:checked+.slider:before {
        -webkit-transform: translateX(26px);
        -ms-transform: translateX(26px);
        transform: translateX(26px);
      }

      /* Rounded sliders */
      .slider.round {
        border-radius: 34px;
      }

      .slider.round:before {
        border-radius: 50%;
      }
    </style>

  </head>

  <body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">

      <?php include_once('includes/sidebar.php'); ?>

      <!-- Content Wrapper -->
      <div id="content-wrapper" class="d-flex flex-column">

        <!-- Main Content -->
        <div id="content">

          <!-- Topbar -->
          <?php include_once('includes/topbar.php'); ?>
          <!-- End of Topbar -->

          <!-- Begin Page Content -->
          <div class="container-fluid">

            <!-- Page Heading -->
            <h1 class="h3 mb-4 text-gray-800">Edit Payment Link StatusPage</h1>
            <form method="post" name="adminprofile">
              <?php
              // $teamid=$_GET['teamid'];
              $query = mysqli_query($con, "SELECT * from tbl_pmtlink where id='1'");
              while ($row = mysqli_fetch_array($query)) {
              ?>
                <div class="row">

                  <div class="col-lg-8">

                    <!-- Basic Card Example -->
                    <div class="card shadow mb-4">


                      <div class="card-body">
                        <div class="form-group">
                          <label>Payment URL Page</label>
                          <input type="text" class="form-control" name="teamname" value="saleApi.php" required='true'>
                        </div>

                        <div class="form-group">
                          <label>Payment Link Start Date</label>
                          <input type="date" class="form-control" name="teamleadname" value="<?php echo date('Y-m-d', strtotime($row['startdate'])); ?>" required='true'>
                        </div>



                        <div class="form-group">
                          <label>Payment Date End Date</label>
                          <input type="date" class="form-control" name="mobilenumber" value="<?php echo date('Y-m-d', strtotime($row['enddate'])); ?>" required='true' maxlength='10'>
                        </div>

                        <div class="form-group">
                          <label>Enable/Disable Link</label>
                          <!-- <input type="checkbox"> -->
                          <ul class="list-group list-group-flush">
                            <li class="list-group-item">
                              <?php
                              if ($row['pmtlinkenabled'] == 1) {

                                echo '<span class="badge badge-danger p-2">Link Enabled->Switch to Disable the Link</span>';
                              } else {

                                echo '<span class="badge badge-success p-2">Link Disabled->Switch to Enable the Link</span>';
                              }
                              ?>
                              <label class="switch ">
                                <input type="checkbox" class="default" name="pswitch" value="<?php echo $row['pmtlinkenabled']; ?>" <?php echo ($row['pmtlinkenabled'] == 1 ? 'checked' : ''); ?>>
                                <span class="slider"></span>
                              </label>
                            </li>
                          </ul>
                          <!-- <input type="text" class="form-control" name="teammember" value="echo $row['teamMembers']; ?>" required='true'> -->
                        </div>

                      <?php } ?>


                      <div class="form-group">
                        <input type="submit" class="btn btn-primary btn-user btn-block" name="update" id="update" value="Update">
                      </div>

                      </div>
                    </div>

                  </div>



                </div>
            </form>

          </div>
          <!-- /.container-fluid -->

        </div>
        <!-- End of Main Content -->

        <?php include_once('includes/footer.php'); ?>

      </div>
      <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->

    <?php include_once('includes/footer2.php'); ?>


    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin-2.min.js"></script>

  </body>

  </html>
<?php } ?>

Zerion Mini Shell 1.0