ok
Direktori : /proc/thread-self/root/home2/selectio/public_html/caliberembedded.com/new/admin/ |
Current File : //proc/thread-self/root/home2/selectio/public_html/caliberembedded.com/new/admin/dashboard.php |
<?php include "header.php"; $media_sql="SELECT * FROM `tbl_gallery`"; $media_statement = $pdo->prepare($media_sql); $media_statement->execute(); $media_result = $media_statement->fetchAll(PDO::FETCH_ASSOC); ?> <div class="content-wrapper" style="background-color: white;"> <center class="h1">Upload <span style="color:#00a65a;">Facilities Images</span><br></center> <div hidden> <form action="addphoto.php" id="photoUpload" method="post" enctype="multipart/form-data" style="display:none;"> <div id="drag1_1"> <div class="px-input-button1"> <input type="file" name="gallery" id="browse" class="fileUpload" accept="image/jpeg" style="visibility:hidden; width:150px; height:150px;"> <input type="hidden" name="type" value="add_gallery"> </div> </div> </form> </div> <div class="row"> <?php foreach($media_result as $media){ $img=0; ?> <div class="col-md-2" style="margin:10px;"> <img src="<?=$media['image']?>" style="2px solid #7a7a7a;width:200px; height:225px;" border="0" alt=""><br> <center style="padding:2px;"> <button class="btn btn-danger btn-sm" style="padding:3px;" id="delete" value="<?=$media['id']?>" onclick=custom_delete(<?=$media['id']?>,'delete',<?="'".$media['image']."'"?>,<?=$img?>,<?=$id?>)> <i class="fa fa-trash-o"></i> Delete</button><br> </div> <?php } ?> <?php if(count($media_result)<500){ ?> <div class="col-md-2" style="margin:10px;"> <a href="javascript:;" style="2px solid #7a7a7a; width:200px; height:225px; background-color:#ffffff; display:inline-block; padding:75px 0px; text-decoration:none; text-align:center;" onclick="phtobrws()"> <img src="http://lingayatmarriage.in/images/add-photo-icon.png" width="41" height="40" border="0" alt=""> <span style="display:block; color:#777777;" class="paddt8">Add Facilities Image</span> </a> </div><?php } ?> <div class="col-md-12 progress" id="progress" style="display:none;"> <div class="bar"></div> <div class="percent">0%</div> </div> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.3.0/jquery.form.min.js" integrity="sha384-qlmct0AOBiA2VPZkMY3+2WqkHtIQ9lSdAsAn5RUJD/3vA5MKDgSGcdmIv4ycVxyn" crossorigin="anonymous"></script> <script type="text/javascript"> function phtobrws(){ document.getElementById('browse').click(); } function horoscope_image(){ document.getElementById('horo_browse').click(); } function custom_delete(id,type,image,status,cus_id){ console.log("id :"+image+" type : "+type); $.ajax({ type: 'POST', url: 'addphoto.php', data: {id:id,image: image,type:type,cust_id:cus_id,status:status}, dataType: 'json', complete: function(response) { window.location.reload(); } }); } $(document).ready(function() { var percent = $('.percent'); var bar = $('.bar'); $("#browse").on("change", function() { var fsize = $('#browse')[0].files[0].size; var ext = $('#browse').val().split('.').pop().toLowerCase(); if($.inArray(ext, ['jpg','jpeg,png']) == -1) { alert('Photo Should be .jpg,.jpeg,.png Format'); } else if(fsize>1048576) { alert("Maximum Size 1MB"); } else { document.getElementById("progress").style.display = "block"; $('#photoUpload').ajaxForm({ beforeSend: function() { bar.width('0%'); percent.html('0%'); }, uploadProgress: function(event, position, total, percentComplete) { var pVel = percentComplete + '%'; bar.width(pVel); percent.html(pVel); }, complete: function(data) { window.location.reload(); } }).submit(); } }); }); </script> <style> td{ padding:5px; } .labelb{ font-family: 'Source Sans Pro'; font-weight:900; } .pl10px{ font-family: 'Source Sans Pro'; } .h1{ font-size: 20px; font-weight: 800; display: block; color: #f60; margin-left: 15px; font-family: "Trebuchet MS"; margin: 5px 10px; } </style> <?php include "footer.php";?>