zagorisback

Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Оригинальный код без изменений code 1 Код: <p class="bioheading">Tags: Studio/Distributor</p><p class="biodata"> <!-- TESTO DEL COMMENTO<div style="float:left;"> --> <div id="iddistr"> <?php require_once("connetti.php"); $actor_id = $_GET['id']; $query = "SELECT studio, distributor FROM film_actor INNER JOIN film ON film_actor.film_id = film.film_id INNER JOIN actor ON film_actor.actor_id = actor.actor_id WHERE film_actor.actor_id = $actor_id "; $arr = array(); $result = mysql_query( $query ); if (!$result) die("mySQL error: ". mysql_error()); while( $row = mysql_fetch_object( $result ) ) : ?> <?php $risultato = explode(" , ", $row->distributor); foreach ($risultato as $res) { array_push($arr, $res); } $risultato = explode(" , ", $row->studio); foreach ($risultato as $res) { array_push($arr, $res); } ?> <? endwhile; ?> <?php natcasesort($arr); $ok2 = array_count_values($arr); foreach (array_unique($arr) as $ok){ ?> <div class="pretty p-default p-round"> <input type="checkbox" name="distr" value="<?php echo $ok;?>"> <div class="state p-success-o"> <label> <?php echo ' ' . '<a style="color:blue">' . $ok . '</a>' . " (" . $ok2[$ok] . ")" . ' ';?> </label> </div> </div> <?php } ?> | code 2 Код: <td><?php echo $row->film_year; ?><br><?php echo $row->release_data; ?></td> <td> <?php echo $row->studio; ?> <br> <?php echo $row->distributor; ?> </td> | code 3 (datatables) Код: <script> $(document).ready( function () { ..... // start filter checkbox 2 di 2 $('input:checkbox').on('change', function () { //build a regex filter string with an or(|) condition //build a filter string with an or(|) condition var distributor = $('input:checkbox[name="distr"]:checked').map(function() { return this.value; }).get().join('|'); //now filter in column 2, with no regex, no smart filtering, not case sensitive table.column(2).search(distributor, true, false, false).draw(false); | |