/
0Art
/
Baev_course
Обзор
Документация
Войти
/
0Art
/
Baev_course
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
mop.php
333 строки
9 KB
0Art
upload files
18 дек 2024, 18:49
18 дек 2024, 18:49
150210e
Код
Авторство
О чём код?
<?php // Админка ini_set('display_errors','On'); require_once("header.php"); $potok = 4; if(isset($_GET['potok'])) { $potok = (int) $_GET['potok']; } $token = ""; if(isset($_GET['token'])) $token = $_GET['token']; if($token != "0baf4d1b106") { header("location:index.php"); } $course7 = []; $sql0="SELECT email FROM course7"; $result0 = mysqli_query($db,$sql0); while( $myrow0 = mysqli_fetch_array($result0) ) { $course7[] = $myrow0['email']; } $sql = "SELECT orders.id,orders.email,users.name,users.number2,orders.cost,orders.datetime,orders.comment,orders.mop FROM orders, users WHERE orders.`email` = `users`.`email` AND orders.course_id = 7 AND orders.potok_number=4 AND orders.email = users.email ORDER BY orders.datetime DESC"; $result = mysqli_query($db, $sql); ?> <!DOCTYPE html> <html style="margin-top:0 !important;"> <head> <title>Adminka | Максим Баев</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="font/stylesheet.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css"> <link href="./css/slick.css" rel="stylesheet" type="text/css"> <link href="style.css?v=2.3" rel="stylesheet" type="text/css"> <script src="https://widget.cloudpayments.ru/bundles/cloudpayments"></script> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet"> <style> .container { margin: 30px auto; min-width: 600px; max-width: 1284px; height: auto; display: block; position: relative; padding: 40px; } .container .flex { display: flex; justify-content: space-between; padding-top: 50px; } .container .flex > div { word-break: break-all; overflow-wrap: break-word; width: 49%; font-size: 16px; } h4.text-background { display: inline-block; } .iframe { width: 100%; height: auto; overflow: visible; } .users + .users { background-color: white; margin-top: 40px; padding: 20px; color: #000; } table { min-width: 100%; } table tr td, table tr th { width: 140px; } table tr th { display: none; font-size: 13px; } table tr td { display: none; font-size: 13px; padding: 3px 0px; } table tr td.active, table tr th.active { display: table-cell; text-align: left; word-break: break-all; overflow-wrap: break-word; padding-right: 5.5px; } table tr td[data=email], table tr th[data=email] { width: 230px; } table tr td[data=card], table tr th[data=card] { width: 100px; } table tr td[data=payed], table tr th[data=payed] { width: 80px; } table#student2 tr:hover td { background-color: rgba(0,0,0,.2); } table tr.active td { background-color: rgba(0,0,0,.14); } .small-costs { font-size: 12px; display: flex; margin: 5px 0 0 0; flex-wrap: wrap; word-break: break-word; } .small-costs > div { width: 100%; } .small-costs > div + div { margin-top: 2px; } .form-element:not(.type) label{ width: 160px; display: inline-block; } .form-element { padding: 3px 0px; } .small-costs strong { display: block; margin-bottom: 3px; margin-top: 10px; } .small-costs p { padding: 0; margin: 2px 0; text-align: left; } input[type=radio] { display: inline-flex; padding: 6px; margin-right: 6px; margin-bottom: -2px; height: auto; } label + input[type=radio] { margin-left: 30px; } input[type=radio]:checked { background-color: green; } @media (max-width: 600px) { .container { min-width: 200px; padding: 15px; } .container .flex { flex-wrap: wrap; padding-top: 20px; } .container .flex > div { width: 100%; } .container .flex > div + div { padding-top: 20px; } table tr > td:nth-child(4), table tr > td:nth-child(5), table tr > td:nth-child(6), table tr > td:nth-child(7), table tr > td:nth-child(8), table tr > td:nth-child(9), table tr > td:nth-child(10), table tr > th:nth-child(4), table tr > th:nth-child(5), table tr > th:nth-child(6), table tr > th:nth-child(7), table tr > th:nth-child(8), table tr > th:nth-child(9), table tr > th:nth-child(10) { display: none; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>Свет по Баеву <?=$potok;?>.0</h1> <br/><br/><br/> <h3>Оплаты:</h3> <div class="users"> <div class="iframe"> <table cellspacing="0" cellpadding="0" id="student" data-order='[[ 4, "desc" ]]'> <thead> <tr> <th data="email" class="active">Email:</th> <th data="name" class="active">Имя:</th> <th data="number" class="active">Телефон:</th> <th data="payed" class="active">Сумма:</th> <th data="date" data-class-name="priority" class="active">Дата:</th> <th data="comment" class="active">коммент:</th> <th data="mop" class="active">моп:</th> </tr> </thead> <tbody> <?php while( $row = mysqli_fetch_array($result) ) { $trclass=""; if($row['mop']==1) $trclass = "active"; ?> <tr class="<?=$trclass;?>" data-id="<?php echo $row['id'];?>"> <td data="email" class="active"><?php echo $row['email'];?></td> <td data="name" class="active"><?php echo $row['name'];?></td> <td data="number" class="active"><?php echo $row['number2'];?></td> <td data="payed" class="active"><?php echo $row['cost'];?></td> <td data="date" class="active"><?php echo $row['datetime'];?></td> <td data="comment" class="active"><textarea data-id="<?php echo $row['id'];?>"><?php echo $row['comment'];?></textarea></td> <td data="mop" class="active" data-id="<?php echo $row['id'];?>"><?php if($row['mop']==1) echo "mop";?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <br/><br/><br/> </div> </div> <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> <script type="text/javascript" src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script> <script> $(document).ready(function() { $('#student').DataTable({ "paging": false, "info": false, "search": false }); $('table#student tbody td[data=mop]').on("click", function() { if($(this).parent('tr').hasClass('active')) { data=0; $(this).html(""); } else { data = 1; $(this).html("mop"); } $(this).parent('tr').toggleClass('active'); $.ajax({ url: 'update_user_mop.php', method: 'post', dataType: 'html', data: { "data":data, "id":$(this).attr('data-id') }, success: function(data){ console.log(data); } }); }); $('table#student tbody textarea').on("input", function() { data = $(this).val(); $.ajax({ url: 'update_user_mop_textarea.php', method: 'post', dataType: 'html', data: { "data":data, "id":$(this).attr('data-id') }, success: function(data){ console.log(data); } }); }); }); </script> </body> </html>