Coder Social home page Coder Social logo

jplist-php-mysql's People

Contributors

1rosehip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jplist-php-mysql's Issues

Is there a way to use Mustache with a local json file?

#Is there a way to use Mustache with a local json file?

At the moment if I use this.

$.getJSON('js/data.json', function(demos) {
console.log(demos);
var template = $('#demo-template').html();
var html = Mustache.to_html(template, demos);
$('#wrapper').html(html);
});

but the filters don't work

Thanks

No results found with supplied examples and my own table

From @sasori7 on April 28, 2015 13:10

My own mysql table wasn't working, even though I changed the fields and query to match.
So, I did an install of your PHP, MySQL and HTML sample package and ran your create.sql.
off the top, I did notice discrepancies with capitalized row names and referrals to the table in the server-html.php file. I ran it anyway and got 'no results found'.
So, I changed the row names to lower-case, which is what the code was using.
still 'no results found'.
Lastly, I saw that your example used .desc. instead of .description. (or .Description.) so I changed the row name to desc.
still 'no results found'.
If I mess up the username in the config.php, the page just sits there with the loading animation.
Now I'm thinking I should just scrap it as maybe there is some server incompatibility (I'm on a shared godaddy account; http://www.englishsensei.com/jplist/), unless you have some other idea. I can't figure out if I have to change any other 'setup' files other than config.php and server-html.php

Copied from original issue: no81no/jplist#84

counter control - php-mysql-data-source

From @Kapottejas on October 17, 2015 13:31

Hello no81no,

First of all JPLIST is great!

I have a question, is the counter-control working with the php-mysql-data-source package? I tried to add the js file and the example code, but I don't get numbers between the ()

If it is not included in the php-mysql-data-source, can u add it in the future (read: this year ๐Ÿ‘ )?

Or is there an easy way to echo columns count, for example: Architecture (5), Architecture got 5 results after filtering.

(php / jquery snippet)

Thanks!

Copied from original issue: no81no/jplist#142

Exact value from textbox query?

Hello,

It is not an issue, rather a question because I cant not find solution and debugging is very tricky :)

Im curious about possibility to change query in textbox field.
I would like to find exact value and to not use LIKE statement:

case ".kupon":{
                    $result->query = " coupon_off like ? ";
                    break;

Is this possible?
Thank you upfront!

Handlebars multiple Checkbox options

I notice for Checkbox Path Filter Control, its possible to use checkbox to return items with multiple keyword1 options i.e Architecture and Christmas, but in Handlebars I can only return items with only one keyword1 i.e only return Architecture

how can I return keyword1 where the item has Architecture and Christmasas an option in the Handlebars version

Radio buttons

From @jamesdelpriore on February 5, 2016 12:59

Hi,

I have radio buttons on a php mysql page that are tied to a field called type. This field is filled with a letter. Each radio button corresponds to the letter. How would I go about checking this field against the databases.

Any help would be great.

Copied from original issue: no81no/jplist#167

Enhancements: Select All Checkboxes, Reset per filter Control & Infinity Scroll

From @Extracreative on June 5, 2015 12:13

Enhancement 1: 'Select All' checkbox for [Checkbox Path Filter Control](https://jplist.com/controls/checkbox-pa th-filters) & Button Path Filter Control
For example here
I was able to add this but it doesn't trigger the call for "server-json.php" any idea???

Enhancement 2: 'Reset Per Filter - currently reset button clears all. Could have a reset button assign to a filter control, which clears all buttons or checkboxes selected.
I was able to add this but it doesn't trigger the call for "server-json.php" any idea??

Enhancement 3: ' Infinity Scrolling as an option instead of pagination

Copied from original issue: no81no/jplist#102

Range slider for php mysql

From @PJanisio on February 24, 2016 22:12

Hello,

I would like to use jquery UI range slider, it works on clean HTML site filtering by html elements. But i have no idea how to set it together with php and mysql.
I have chosen checkboxgroupfilter.php because I can set control-name there.

Created new function:

function rangeslider($status){
named it, and set-up query column.

setted up my index.html controls, but nothing changes. I have doubts if it works with dynamic data or only with static html.

Copied from original issue: no81no/jplist#172

display data from another table

From @putrabangsa on March 28, 2016 2:41

please help me, how do I get the value generated by a checkbox it comes from another database, the value of which can be connected to the table item
thanks.

Copied from original issue: no81no/jplist#178

JPLIST Single box for title and description search

From @shariq619 on March 19, 2016 10:13

I want a single box to search for both title and description in jplist php mysql

                    <div class="text-filter-box">

                        <!--[if lt IE 10]>
                        <div class="jplist-label">Filter by Title:</div>
                        <![endif]-->

                        <input 
                            data-path=".title, .desc" 
                            data-button="#title-search-button"
                            type="text" 
                            value="" 
                            placeholder="Filter by Title" 
                            data-control-type="textbox" 
                            data-control-name="title-filter" 
                            data-control-action="filter"
                        />

                        <button 
                            type="button" 
                            id="title-search-button">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

Something like this

Copied from original issue: no81no/jplist#177

Google crawl issue for dynamic content server type php-html

Hi!

Im wondering how to serve googlebot content which is loaded by ajax. One solution can be generating sitemap with php, but for the other hand i suppose there is already included solution in jplist to render html source code after ajax.

Im using html server right now:

//ajax settings
                        ajax: {
                            url: 'server/server-html.php'
                            , dataType: 'html'
                            , type: 'POST'
                        }

I suppose that xml, or json with handlebars could resolve this issue, or I`m wrong?
Or there is other solution to render html for crawlers?

Thanks upfront for support.

CSS Issues

Hello..I made changes to the jplist.demo-pages.min.css file, such as changing the font color from red to blue. When I view the html page on my local machine, the color changes are successful; however, when I put the files on my server, the original font color (red) is still showing. I'd appreciate any insight you can provide. By the way, great plugin! I plan to donate as soon as I get this portfolio page done. Thanks.

JPLIST MYSQL JOINS MULTIPLE TABLES WITH WHERE CLAUSE

From @shariq619 on March 2, 2016 7:58

I am trying to do this in

server/domain/server.php

protected function getData(){

        $items = null;

$query = "SELECT registration.,login. FROM " . DB_TABLE . " LEFT JOIN login ON registration.company_id = login.company_id where login.approve = 3 ";

Without where clause this query working fine.

Can anyone tell me how to use where clause in JPLIST PHP MYSQL.

Copied from original issue: no81no/jplist#173

Remove initial request

From @hevyweb on October 30, 2014 10:39

If list of records is already loaded after page load and item container has parameter data-count JPlist should not send initial request to the server.

Copied from original issue: no81no/jplist#32

Avoiding double render

From @Android63 on March 5, 2016 8:31

I'm using jplist to add pagination and filtering to a hotel-listing page written in php. You can see an example here.

At the moment, I use a loop in php to create the list div, and the list-item divs within it.

It works OK, except that, initially, the php page loads and displays ALL the hotels (not just the first page) before jplist kicks in and replaces that with a paginated list of (in my case) 50 hotels.

I've looked at the various data-source options, but I'm not sure which, if any to choose and, if I do, if that will solve the problem.

What is the best way to avoid this double render?

Here's my code:

Javascript:

<script>
$('document').ready(function(){

   /**
   * user defined functions
   */
   jQuery.fn.jplist.settings = {

      /**
      * STARS: jquery ui range slider
      */
        starsSlider: function ($slider, $prev, $next){

            $slider.slider({
                min: 0
                , max: 5
                , range: true
                , values: [0, 5]
                , slide: function (event, ui) {
                    $prev.text('Stars: ' + ui.values[0]);
                    $next.text(ui.values[1]);
                }
            });
        }

        /**
        * STARS: jquery ui set values
        */
        ,starsValues: function ($slider, $prev, $next){
            $prev.text('Stars: ' + $slider.slider('values', 0));
            $next.text($slider.slider('values', 1));
        }

      /**
      * RATING: jquery ui range slider
      */
        ,ratingSlider: function ($slider, $prev, $next){

            $slider.slider({
                min: 0
                , max: 10
                , range: true
                , values: [0, 10]
                , slide: function (event, ui) {
                    $prev.text('Rating: ' + ui.values[0]);
                    $next.text(ui.values[1]);
                }
            });
        }

        /**
        * RATING: jquery ui set values
        */
        ,ratingValues: function ($slider, $prev, $next){
            $prev.text('Rating: ' + $slider.slider('values', 0));
            $next.text($slider.slider('values', 1));
        }

   };

   //check all jPList javascript options
   $('#demo').jplist({              
      itemsBox: '.list' 
      ,itemPath: '.list-item' 
      ,panelPath: '.jplist-panel'   
   });

});
</script>

HTML/PHP:

<!-- demo -->
<div id="demo">

    <!-- panel -->
    <div class="jplist-panel" style="display:inline-block;width:100%;">

        <!-- ios button: show/hide panel -->
        <div class="jplist-ios-button">
             <i class="fa fa-sort"></i>
             jPList Actions
        </div>

        <!-- reset button -->
        <button 
             type="button" 
             class="jplist-reset-btn"
             data-control-type="reset" 
             data-control-name="reset" 
             data-control-action="reset">
             Reset <i class="fa fa-share"></i>
        </button>

        <!-- stars range slider -->
        <div
            class="jplist-range-slider"
            data-control-type="range-slider" 
            data-control-name="range-slider-stars" 
            data-control-action="filter"
            data-path=".data_stars"
            data-slider-func="starsSlider" 
            data-setvalues-func="starsValues">

            <div class="value" data-type="prev-value"></div>
            <div class="ui-slider" data-type="ui-slider"></div>
            <div class="value" data-type="next-value"></div>
        </div>       

        <!-- rating range slider -->
        <div
            class="jplist-range-slider"
            data-control-type="range-slider" 
            data-control-name="range-slider-rating" 
            data-control-action="filter"
            data-path=".data_rating"
            data-slider-func="ratingSlider" 
            data-setvalues-func="ratingValues">

            <div class="value" data-type="prev-value"></div>
            <div class="ui-slider" data-type="ui-slider"></div>
            <div class="value" data-type="next-value"></div>
        </div>       

        <!-- Neighbourhood Filter DropDown Control -->
        <div
         class="jplist-drop-down" 
         data-control-type="filter-drop-down" 
         data-control-name="area-filter" 
         data-control-action="filter">
         <ul style="width:20rem;list-style:none;">
           <li><span data-path="default">Neighbourhood</span></li>
            <?php
             // get list of neighbourhoods (for filter)
             while($row_neighbourhoods = $stmt_neighbourhoods->fetch()) {
                 $area_id = $row_neighbourhoods['area'];
                 if (! $area_id==0){
                     $area_name = $row_neighbourhoods['area_name'];
                     echo '<li><span data-path=".data-area_'.$area_id.'">'.$area_name.'</span></li>';
                 }
             }
            ?>
         </ul>
        </div>

        <!-- Chain Filter DropDown Control -->
        <div
            class="jplist-drop-down" 
            data-control-type="filter-drop-down" 
            data-control-name="chain-filter" 
            data-control-action="filter">
            <ul style="width:20rem;list-style:none;">
                <li><span data-path="default">Chain</span></li>
                <?php
                 // get list of chains (for filter)
                 while($row_chains = $stmt_chains->fetch()) {
                     $chain_id = $row_chains['chain'];
                     $chain_name = $row_chains['chain_name'];
                     echo '<li><span data-path=".data-chain_'.$chain_id.'">'.$chain_name.'</span></li>';
                 }
                ?>
            </ul>
        </div>

        <!-- sort select control -->
        <select 
        class="jplist-select" 
        data-control-type="sort-select" 
        data-control-name="sort" 
        data-control-action="sort">

        <option data-path="default">Sort by</option>
        <option data-path=".price" data-order="asc" data-type="number">Price asc</option>
        <option data-path=".price" data-order="desc" data-type="number">Price desc</option>
        </select>       

        <br /><br />
        <!-- items per page dropdown -->
        <div 
            class="jplist-drop-down" 
            data-control-type="items-per-page-drop-down" 
            data-control-name="paging" 
            data-control-action="paging">
            <ul style="list-style:none;">
                <li><span data-number="10"> 10 per page </span></li>
                <li><span data-number="20"> 20 per page </span></li>
                <li><span data-number="50" data-default="true"> 50 per page </span></li>
                <li><span data-number="100"> 100 per page </span></li>
                <li><span data-number="200"> 200 per page </span></li>
                <li><span data-number="500"> 500 per page </span></li>
                <li><span data-number="all"> view all </span></li>
            </ul>
        </div>  

        <!-- pagination results control -->
        <div 
            class="jplist-label" 
            data-type="Page {current} of {pages}" 
            data-control-type="pagination-info" 
            data-control-name="paging" 
            data-control-action="paging">
        </div>  

        <!-- pagination control -->
        <div 
            class="jplist-pagination" 
            data-control-type="pagination" 
            data-control-name="paging" 
            data-control-action="paging">
        </div>  

    </div><!-- panel -->
    <br /><br />
    <div class="list">
    <?php
    // retrieve geo_area from session
    $geo_area=$_SESSION['geo_area'];
    while($row = $stmt->fetch()) {

        // look up hotel's Area, if specified
        if (! is_null($row['area'])){
            $area_name = ' : <strong>'.utf8_encode($row['area_name']).'</strong>';
        }

        // include Chain, when applicable
        if (! is_null($row['chain_name'])){
            $chain_name = ' ('.utf8_encode($row['chain_name']).')';
        }

        $name = utf8_encode($row['name']);
        // display list item with various data-* attributes for filtering
        echo '<div class="list-item" style="display:block;overflow:auto;margin-bottom:10px;background:#F7F7F7;padding:10px;border:1px solid #E2E2E2;" >';

            // metadata for filtering
            echo '<span class="data-area_'.$row['area'].'"></span>';
            echo '<span class="data-chain_'.$row['chain'].'"></span>';
            if ($row['low_rate']>0){
                echo '<span style="display:none;" class="price">'.$row['low_rate'].'</span>';
            }
            echo '<span style="display:none;" class="data_stars">'.$row['star_rating'].'</span>';
            echo '<span style="display:none;" class="data_rating">'.$row['review_rating'].'</span>';
            echo "<div class='flex-item'><a href='http://secure.every-hotel.com/hotels/hotel/?refid=6446&refclickid=ehlist&hotel_id=" . $row['id']." 'title='Check availability of ".utf8_encode($row['name'])."'><img style='margin-right: 10px;' width='90px' height='90px' align='left' src='" . $row['thumbnail'] . "'></a></div><!--flex-item-->";
            echo "<div class='flex-item'>" . utf8_encode($row['name']).$chain_name.$area_name."</div><!--flex-item-->";
            echo "<div class='flex-item'>" . ltrim((utf8_encode($row['address']) . ", "),", ") . $geo_area."</div><!--flex-item-->";
            $stats = "<div class='flex-item'>";
            // stars
            if($row['star_rating']>0) {
                if($row['star_rating']>1) {
                    $stats.= rtrim($row['star_rating'],".0") . " Stars | ";
                }
                else {
                    $stats.= rtrim($row['star_rating'],".0") . " Star | ";
                }
            }
            // rooms
            if($row['rooms']>0) {
                if($row['rooms']>1) {
                    $stats.= $row['rooms'] . " Rooms | ";
                }
                else {
                    $stats.= $row['rooms'] . " Room | ";
                }
            }
            // rating
            if($row['review_rating']>0) {
                if($row['review_count']>1) {
                    $stats.= "Review Rating: " . $row['review_rating'] . " (" . $row['review_count'] . " Reviews) | ";
                }
                else {
                    $stats.= "Review Rating: " . $row['review_rating'] . " (" . $row['review_count'] . " Review) | ";
                }
            }
            // rate
            if($row['low_rate']>0) {
                // currency symbol
                if($row['currency_symbol']==''){
                    $curr=$row['currency_code'];
                }
                else {
                    $curr=$row['currency_symbol'];
                }
                $stats.= "From ".$curr.$row['low_rate'];
            }
            $stats = rtrim($stats," | ")."</div><!--flex-item-->";
            echo $stats;
            // if available, use /country/state/city link format
            if(isset($_SESSION['href'])){
                $href = $_SESSION['href'];
                echo '<div class="flex-item">' .$href . '/' .$city_url. '/' .$row['url']. '" title="View details of ' .utf8_encode($row['name']). '">View Details</a> | <a href="http://secure.every-hotel.com/hotels/hotel/?refid=6446&refclickid=ehlist&hotel_id=' .$row['id']. ' "title="Check availability of ' .utf8_encode($row['name']). '"> Check Availability</a></div><!--flex-item-->';
            }
            // otherwise use /in/city link format
            else {
                echo "<div class='flex-item'><a href='/in/$city_url/" . $row['url'] ."' title='View details of ".utf8_encode($row['name'])."'>View Details</a> | <a href='http://secure.every-hotel.com/hotels/hotel/?refid=6446&refclickid=ehlist&hotel_id=" . $row['id']." 'title='Check availability of ".utf8_encode($row['name'])."'> Check Availability</a></div><!--flex-item-->";
            }

        echo "</div><!--list-item-->";
    }  // end while
    ?>
    </div><!--list-->
    <!-- no results found -->
    <div class="jplist-no-results">
      <p>No results found</p>
    </div>
</div><!--demo-->

Copied from original issue: no81no/jplist#174

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.