ok
Direktori : /home2/globaltriumphfou/public_html/admin_panel/ |
Current File : /home2/globaltriumphfou/public_html/admin_panel/partner_member.php |
<?php include "dbconn.php"; include "checklogin.php"; include "function.php"; include "ps_pagination.php"; $limit=100; if(isset($_POST['searchbut'])) { $search=$_POST['search']; $sqlt="select * from partner_images where B_Name like '%$search%' order by B_Position desc"; }else $sqlt="select * from partner_images order by B_Position desc"; $query=mysqli_query($connection,$sqlt); $num=mysqli_num_rows($query); if($num>0) { $pager = new PS_Pagination($connection, $sqlt,$limit, 5,''); $pager->setDebug(true); $dquery = $pager->paginate(); } $catlist=get_awcat($connection); ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="description" content="Admin"> <!-- Twitter meta--> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:site" content="@pankaj"> <meta property="twitter:creator" content="@pankaj"> <!-- Open Graph Meta--> <meta property="og:type" content="website"> <meta property="og:site_name" content="GTF"> <meta property="og:title" content="GTF"> <meta property="og:description" content="GTF Admin"> <title>Partner Member</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Main CSS--> <link rel="stylesheet" type="text/css" href="css/main.css"> <!-- Font-icon css--> <link rel="stylesheet" type="text/css" href="fontawesome/font-awesome.min.css"> <script type="text/javascript" src="js/sortable.js"></script> <style> .table th, .table td { padding: 3px; vertical-align: top; } .sortable th a{ color:#000; } a.btn{ color:white; } </style> </head> <body class="app sidebar-mini rtl"> <!-- Navbar--> <?php include "header.php"; ?> <!-- Sidebar menu--> <div class="app-sidebar__overlay" data-toggle="sidebar"></div> <?php $currentPage="partner_member"; include "aside.php"; ?> <!--Popup Start--> <div class="modal fade" id="modallogin" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <form id="formt" name="formt" role="form"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title">Add Partner Member</h4> </div> <div class="modal-body"> <div class="form-body"> <div class="col-md-12"> <div class="form-group row"> <div class="col-sm-6"> <label for="username">Name<span class="required">*</span></label> <input type="text" class="form-control" name="B_Name" value=""> </div> <div class="col-sm-6"> <label for="username">Position<span class="required">*</span></label> <input type="text" class="form-control" name="B_Position" value=""> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <label for="username">Web Url<span class="required">*</span></label> <textarea name="B_Url" class="form-control"></textarea> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <label for="username">Image(150*150)Pixel</label> <input type="file" class="form-control" name="B_Images" accept="image/*"> </div> </div> </div> </div> </div> <div class="modal-footer"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <input name="submit" type="submit" class="btn btn-info" value="Save"> <input type="hidden" class="form-control" name="operation" value="Addpartner"> <div id="errormsgboxt" align="center"></div> </div> </div> </div> </div> </form> </div> </div> </div> <!--Popup End--> <main class="app-content"> <div class="app-title"> <div> <h1><i class="fa fa-user"></i> Partner Member List</h1> </div> <ul class="app-breadcrumb breadcrumb"> <li class="breadcrumb-item"><button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#modallogin"><span class="fa fa-plus"></span>Add Partner Member</button> </li> </ul> </div> <div class="row"> <div class="col-md-12"> <div class="tile"> <div class="tile-body table-responsive"> <!----> <?php if($num<=0) { echo "<h5> Sorry !!! No Data Exist</h5>"; } else { ?> <table class="table"> <thead> <tr> <th> <form id="fm1" name="fm1" method="post"> <table class="table"> <tr> <td align="left" valign="middle"><input value="<?php echo $search; ?>" name="search" type="text" placeholder="Search by Name" class="form-control"></td> <td><input type="submit" name="searchbut" value="Search" class="btn btn-primary"></td> <td align="center" valign="middle"> <table class="table table-bordered"> <tr> <td align="center" valign="middle">Total = <?php echo $num; ?></td> <td align="center" valign="middle" class="first"><?php echo $pager->renderFirst(); ?></td> <td align="center" valign="middle" class="next"><?php echo $pager->renderPrev(); ?></td> <td align="center" valign="middle" class="next"><?php echo $pager->renderNext(); ?></td> <td align="center" valign="middle" class="first"><?php echo $pager->renderLast(); ?></td> </tr> </table> </td> </tr> </table> </form> </th> </tr> </thead> <tbody> <tr> <td align="left" valign="top"> <table class="table table-bordered table-striped sortable" id="anyid"> <tr> <th align="center" valign="middle" class="unsortable">S.No</th> <th align="left" valign="middle">Name</th> <th align="left" valign="middle">Web Url</th> <th align="left" valign="middle">Position</th> <th align="left" valign="middle">Image</th> <th align="center" valign="middle" class="unsortable" ></th> </tr> <?php $j=1; while($rows=mysqli_fetch_assoc($dquery)) { ?> <tr id="<?php echo $rows['B_Id']; ?>"> <td align="center" valign="middle"><?php echo $j++; ?></td> <td align="left" valign="middle"><a href="#myModaleditpr<?php echo $rows['B_Id']; ?>" data-toggle="modal" class="button button-small"><?php echo $rows['B_Name']; ?></a></td> <td align="left" valign="middle"><?php echo $rows['B_Url']; ?></td> <td align="left" valign="middle"><?php echo $rows['B_Position']; ?></td> <td align="left" valign="middle"><img src="../client-image/<?php echo $rows['B_Images']; ?>" width="50px" height="50px"></img></td> <td align="center" valign="middle"><button type="button" class="remove btn-danger"><span class="fa fa-trash-o"></span></button></td> </tr> <!--Popup Start--> <div class="modal fade" id="myModaleditpr<?php echo $rows['B_Id']; ?>" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <form id="formt<?php echo $rows['B_Id']; ?>" name="formt<?php echo $rows['B_Id']; ?>" role="form"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title">Edit <?php echo $rows['B_Name']; ?></h4> </div> <div class="modal-body"> <div class="form-body"> <div class="col-md-12"> <div class="form-group row"> <div class="col-sm-6"> <label for="username">Name<span class="required">*</span></label> <input type="text" class="form-control" name="B_Name" value="<?php echo $rows['B_Name']; ?>"> </div> <div class="col-sm-6"> <label for="username">Position<span class="required">*</span></label> <input type="text" class="form-control" name="B_Position" value="<?php echo $rows['B_Position']; ?>"> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <label for="username">Web Url<span class="required">*</span></label> <textarea class="form-control" name="B_Url"><?php echo $rows['B_Url']; ?></textarea> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <label for="username">Image(150*150)Pixel</label> <input type="file" class="form-control" name="B_Images" accept="image/*"> </div> </div> </div> </div> </div> <div class="modal-footer"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <input name="submit" type="button" class="btn btn-info" id="adduser" value="Save" onclick="update_user('<?php echo $rows['B_Id']; ?>');"> <input type="hidden" class="form-control" name="operation" value="Updatepartner"> <input type="hidden" class="form-control" name="editid" value="<?php echo $rows['B_Id']; ?>"> <input type="hidden" class="form-control" name="p_filename" value="<?php echo $rows['B_Images']; ?>"> <div id="errormsgboxt<?php echo $rows['B_Id']; ?>" align="center"></div> </div> </div> </div> </div> </form> </div> </div> </div> <!--Popup End--> <?php } ?> </table> </td> </tr> </tbody> </table> <?php } ?> </div> </div> </div> </div> </main> <?php include "footer.php"; ?> <!-- Essential javascripts for application to work--> <script src="js/jquery-3.2.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/main.js"></script> <!-- The javascript plugin to display page loading on top--> <script src="js/plugins/pace.min.js"></script> <script> $(document).ready(function(){ $(".remove").click(function(){ var id = $(this).parents("tr").attr("id"); if(confirm('Are you sure to remove ?')) { $.ajax({ url: 'operation.php', type: 'POST', data: 'editid='+id+'&operation=Deletepartner', success: function(data) { $("#"+id).remove(); alert("removed successfully"); } }); } }); }); function update_user(str){ $("#errormsgboxt"+str).html('<div class="alert-danger">Please Wait..</div>'); var form = $('#formt'+str)[0]; var formData = new FormData(form); $.ajax({ url: "operation.php", type: "POST", data: formData,contentType: false,cache: false,processData:false,success: function(response) { if(response=='1') location.reload(); else $('#errormsgboxt'+str).html('<div class="alert-danger">'+response+'</div>'); } }); return false; } $("#formt").submit(function() { $("#errormsgboxt").html('<div class="alert-danger">Please Wait..</div>'); var form = $('#formt')[0]; var formData = new FormData(form); $.ajax({ url: "operation.php", type: "POST", data: formData,contentType: false,cache: false,processData:false,success: function(response) { if(response=='1') location.reload(); else $('#errormsgboxt').html('<div class="alert-danger">'+response+'</div>'); } }); return false; }); </script> </body> </html>