Index of /demo/uploads/SYS_CONFIG/riotsymlinkphp/alda_txt9240

 NameLast modifiedSizeDescription

 Parent Directory   -  
 alda.txt 2021-02-12 07:49 15K 

<?php include('config.php');
	
	if(!isset($_SESSION['id']))
	{
		echo "<script>window.location.href='index.php'</script>";
	}

?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Admin</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="assets/css/bootstrap.min.css">
  <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="assets/css/ionicons.min.css">
  <link rel="stylesheet" href="assets/css/AdminLTE.min.css">
  <link rel="stylesheet" href="assets/css/dataTables.bootstrap.min.css">
  <link rel="stylesheet" href="assets/css/skins/_all-skins.min.css">
  <link rel="stylesheet" href="assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  <link rel="stylesheet" type="text/css" href="assets/css/bootstrap-fileinput.css">
  <link rel="stylesheet" type="text/css" href="assets/css/bootstrap-theme.css">
  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini page-content-white">
<div class="wrapper">
  <?php include('header.php');?>

  <?php include('sidebar.php');?>

<div class="content-wrapper " style="background-color: white;">
    <section class="row page-breadcrumb" style="padding: 8px 20px;">
      <ol class="breadcrumb" >
        <li ><a href="#" ><i class="fa fa-home" ></i> Home</a></li>
        <li class="active">Gativdhiyaan</li>
      </ol>
    </section>
    <section class="content-header">
      <h1 class="fa fa-home">
     Gativdhiyaan
      </h1>
      <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addMediaModal" id="add_button" style="float: right;"><span class="glyphicon glyphicon-plus"></span>&nbsp;Add Gativdhiyaan
    </button>
    </section>
   <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <!--<div class="box-header">
              <h3 class="box-title"></h3>
            </div>-->
            <!-- /.box-header -->
            <div class="box-body">
              <div class="table-responsive">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th style="width: 70px;">Sl.No.</th>
                  <th style="width: 120px;">Image</th>
                  <th>Title</th>
                  <th>Description</th>
                  <th>Date</th>
                  <th>Edit</th>
                  <th>Delete</th>
                </tr>
                </thead>
             <?php 
                  $sql = mysqli_query($mysqli,"select * from tbl_gatividhiyaan where page_id ='6' order by id asc");
               ?>
                <tbody>
               
                 <?php 
                $i=1;
                while ($row = mysqli_fetch_array($sql))
               {
               ?>
                <tr>
                  <td><?php echo $i;?></td>
                  <td><img src="uploads/<?php echo $row['img'];?>" width="100px" height="100px"></td>
                  <td><?php echo $row['title'];?></td>
                  <td><?php echo $row['description'];?></td>
                  <td><?php echo $row['date'];?></td>
                  <td><button type="button" class="btn btn-success" id="editBtnId" data-editBtnId="<?php echo $row['id'];?>">Edit</button></td>
                  <td><button type="button" class="btn btn-danger" id="delteBtnId"  data-deleteImg="<?php echo $row['img'];?>" data-delteBtnId="<?php echo $row['id'];?>">Delete</button></td>
                </tr>
                <?php $i++;}?>
           
                </tbody>
                <tfoot>
                <tr>
                  <th style="width: 70px;">Sl.No.</th>
                  <th style="width: 120px;">Image</th>
                  <th>Title</th>
                  <th>Description</th>
                  <th>Date</th>
                  <th>Edit</th>
                  <th>Delete</th>
                </tr>
                </tfoot>
              </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
    <!--Modal-->
  <div class="modal fade" id="addMediaModal" tabindex="-1" role="dialog" aria-labellegatividhiyaa_dby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <form action="" method="post" method="POST" class="form-horizontal" enctype="multipart/form-data" id="myform">
      <div class="modal-header">
        <h3 class="modal-title" id="myModalLabel">Add Gatividhiyaan</h3>
      </div>

      <div class="modal-body">
      <div class="form-group">
        <label class="control-label col-md-3">Title
          <span class="required text-danger"> * </span>
        </label>
          <div class="col-md-9">
            <div class="input-group">
              <span class="input-group-addon"><i class="fa fa-bookmark"></i></span>
          <input class="form-control" type="text" name="gatividhi_name" id="gatividhi_name" placeholder="Enter Title">
        </div>
        </div>
        </div>

        <div class="form-group">
        <label class="control-label col-md-3">Description
          <span class="required text-danger"> * </span>
        </label>
          <div class="col-md-9">
             <div class="input-group">
              <span class="input-group-addon"><i class="fa fa-bookmark"></i></span>
          <textarea class="form-control" type="text" name="gatividhi_desc" id="gatividhi_desc" placeholder="Enter Description"></textarea>
        </div>
        </div>
        </div>

        <div class="form-group">
        <label class="control-label col-md-3">Date
          <span class="required text-danger"> * </span>
        </label>
          <div class="col-md-9">
             <div class="input-group">
              <span class="input-group-addon"><i class="fa fa-bookmark"></i></span>
          <input class="form-control" type="text" name="gatividhi_date" id="gatividhi_date" placeholder="Enter Date">
        </div>
        </div>
        </div>


        <div class="form-group">
        <label class="control-label col-md-3">Category
          <span class="required text-danger"> * </span>
        </label>
          <div class="col-md-9">
             <div class="input-group">
              <span class="input-group-addon"><i class="fa fa-bookmark"></i></span>
          <select class="form-control" name="type" id="type">
            <option>--------Select--------</option>
            <option value="gatividhiyaan">गतिविधियाँ</option>
            <option value="aagami_karya">आगामी कार्यक्रम</option>
          </select>
        </div>
        </div>
        </div>

        <div class="form-group" >
        <div class="col-md-12" >
                      <div class="form-group last">
                        <label class="control-label col-md-3">Image</label>
                        <div class="col-md-9 ">
                          <div class="addsz">
                          <div class="col-md-5">
                          <div class="fileinput fileinput-new" data-provides="fileinput">
                            <div class="fileinput-new thumbnail" >
                               <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt="" /> </div>

                            <div class="fileinput-preview fileinput-exists thumbnail" > </div>
                            <br/>
                              <span class="btn btn-default btn-file">
                                <span class="fileinput-new"> Select image </span>
                               <span class="fileinput-exists"> Change</span>
                               <input type="file" class="form-control" name="gatividhi_image" id="gatividhi_image" style="width: 250px; height: 200px;" onchange="validateimg()"> </span>
                              <a href="javascript:;" class="btn btn-danger fileinput-exists" data-dismiss="fileinput"> Remove</a>
                               <span id="uploaded_hidden_image"></span>
                           </div>
                          </div>
                          </div>
                        </div>
                      </div>
                      </div>
                    </div>
      </div>
<div class="row">
<div class="col-md-offset-3 col-md-9">
<div class="pmd-modal-action">
<input type="hidden" id="updateId" name="updateId">
<input type="hidden" id="uploaded_image" name="uploaded_image">
<input type="hidden"  name="action" id="action" value="Save">
<input type="submit"  name="submit" id="submit" class="btn btn-success" value="Save">
&nbsp;&nbsp;&nbsp;
<button data-dismiss="modal" class="btn btn-warning">Cancel</button>
<br><br>
<div class="modal-footer">
  </div>  
</div>
</div>
</div>
      </form>
    </div>
  </div>
</div>   <!--Modal-->
</div>
<?php include('footer.php');?>
 
  <div class="control-sidebar-bg"></div>
</div> <!--wrapper-->

    
<script src="assets/dist/jquery-3.3.1.min.js"></script>
<script src="assets/dist/bootstrap.min.js"></script>
<script src="assets/dist/fastclick.js"></script>
<script src="assets/dist/adminlte.min.js"></script>
<script src="assets/dist/demo.js"></script>
<script src="assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="assets/dist/bootstrap-fileinput.js"></script>
<script src="assets/lib/propeller.min.js"></script>
<script type="text/javascript" src="assets/lib/sweetalert.min.js"></script>
<script src="assets/dist/js/jquery.dataTables.min.js"></script>
<script src="assets/dist/js/dataTables.bootstrap.min.js"></script>
<script>
function validateimg() {
    var formData = new FormData();
    var file = document.getElementById("gatividhi_image").files[0];
    formData.append("Filedata", file);
    var t = file.type.split('/').pop().toLowerCase();
    if (t != "jpeg" && t != "jpg" && t != "png" && t != "pdf") {
        swal({
            title:"Please Select GIF, PNG, JPG, JPEG, PDF Type FILES",
            icon:"warning"
          });
        document.getElementById("gatividhi_image").value = '';
        document.getElementById("submit").disabled = true;
        return false;
    }
    document.getElementById("submit").disabled = false;
    return true;
}
</script>
<script>
  $(document).ready(function() {
    $('#example1').DataTable()
    $('#example2').DataTable({
      'paging'      : true,
      'lengthChange': false,
      'searching'   : false,
      'ordering'    : true,
      'info'        : true,
      'autoWidth'   : false
    });
  });
</script>
<script> 
      $(window).on('load',function(){
        function readURL(input) {
          if (input.files && input.files[0]) {
            var reader = new FileReader();

            reader.onload = function (e) {
            $('#image_upload_preview').attr('src', e.target.result);
            }

            reader.readAsDataURL(input.files[0]);
          }
        }

        $("#uploadFile").change(function () {
        readURL(this);
        });
      });//]]> 
      $("#uploadTrigger").click(function(){
         $("#uploadFile").click();
      });
</script> 

<script type="text/javascript">
  $(document).ready(function(){

$(document).on("click","#editBtnId",function(e){
      e.preventDefault();
      var editBtnId = $(this).attr('data-editBtnId');
      var action = 'fetchSingleRow';
      $.ajax({
        url:"gatividhiyaa_db.php",
        method:"POST",
        data:{editBtnId:editBtnId,action:action},
        dataType:"json",
        success:function(data){
        $("#addMediaModal").modal('show');
        $("#gatividhi_name").val(data.gatividhi_name);
        $("#gatividhi_desc").val(data.gatividhi_desc);
        $("#gatividhi_date").val(data.gatividhi_date);
        $("#type").val(data.type);
        $("#uploaded_image").val(data.gatividhi_image);
        $("#uploaded_hidden_image").html(data.uploaded_hidden_image);
        $("#myModalLabel").text('Update Gativdhiyaan');
        $("#action").val('Update');
        $("#submit").val('Update');
        $("#updateId").val(editBtnId);
        }
      });
    });

  $(document).on("click","#delteBtnId",function(e){
      e.preventDefault();
      swal({
        title:"Are you sure Delete?",
        icon:"warning",
        buttons:true,
        dangerMode:true,
      }).then((ifWillDelete)=>{
        if (ifWillDelete) {
          var deleteImg = $(this).attr('data-deleteImg');
      var  delteBtnId = $(this).attr('data-delteBtnId');
      var action ='delete';
      $.ajax({
        url:"gatividhiyaa_db.php",
        method:"POST",
        data:{deleteImg:deleteImg,delteBtnId:delteBtnId,action:action},
        success:function(data){
          if (data.trim()=='deleted') {
            swal({
              title:"Data Delete Successfully",
              icon:"success"
            });
           location.reload();
          }
        }
      });
        }else{
          return false;
        }
      })
      
    });

     $(document).on("click","#add_button",function(e){
      e.preventDefault();
      $("#myform")[0].reset();
      $("#uploaded_hidden_image").html('');
        $("#myModalLabel").text('Add Gativdhiyaan');
        $("#action").val('Save');
        $("#submit").val('Save');
    });

     $(document).on("submit","#myform",function(e){
      e.preventDefault();
      var gatividhi_name = $("#gatividhi_name").val();
      var gatividhi_desc = $("#gatividhi_desc").val();
      var gatividhi_date = $("#gatividhi_date").val();
      var type = $("#type").val();
      var gatividhi_image = $("#gatividhi_image").val();
      var imageExtention = $("#gatividhi_image").val().split('.').pop().toLowerCase();
      if (imageExtention != '') {
        if (jQuery.inArray(imageExtention,['gif','png','jpg','jpeg','pdf']) == -1) {
          swal({
            title:"Please Select GIF, PNG, JPG, JPEG, PDF Type FILES",
            icon:"warning"
          });
          $("#gatividhi_image").val('');
          return false;
        }
      }
        $.ajax({
          url:"gatividhiyaa_db.php",
          method:"POST",
          data: new FormData(this),
          contentType:false,
          processData:false,
          success:function(data){
            if (data.trim()=='created') {
              $("#addMediaModal").modal('hide');
              $("#myform")[0].reset();
            }
              if (data.trim()=='Update') {
              $("#addMediaModal").modal('hide');
              $("#myform")[0].reset();
            }
               location.reload();
         }
        });

    });

  });
</script>
</body>
</html>