• Hi Michael,

    I have this in the filter filter=”Available-From~~/.*$_POST(avail).*/i”]
    works great for an exact date match but is it possible to amend it so that any Available-From date greater than or equal to the input POST date is displayed please?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Try this:
    filter="strtotime(Available-From)>=strtotime($_POST(avail))"

    https://cfdbplugin.com/?page_id=1195

    Thread Starter MikeKJ

    (@mikekj)

    Hi Michael,
    Tried that with no result returned also tried

    [cfdb-table form=”Initial Application” filter=”strtotime(Available-From)>=strtotime(/.*$_POST(avail).*/i)”]

    <form action=”.” method=”POST”>
    Date: <input type=”text” name=”avail” />(yyyy-mm-dd)
    <input type=”submit” />
    </form>

    with again no return, the date entries in the database are in yyyy-mm-dd format and when entering a date in POST of 2017-04-01 I expect the data from an entry in the database with an Available-From date of 2017-04-03 to be returned. FYI this shortcode and form is in a page of a WP site.

    Sorry to be a pain

    Plugin Author Michael Simpson

    (@msimpson)

    Set the filter to exactly how I wrote it. Yours is different.

    Thread Starter MikeKJ

    (@mikekj)

    Sorry Michael, exactly as you wrote it

    [cfdb-table form=”Initial Application” filter=”strtotime(Available-From)>=strtotime($_POST(avail))”]

    no result returned from a POST date of 2017-04-01

    Thread Starter MikeKJ

    (@mikekj)

    Yaay got it to work like this

    [insert_php]
    if (isset($_POST[‘avail’])){
    echo do_shortcode(‘[cfdb-table form=”Initial Application” filter=”strtotime(Available-From) >= strtotime($_POST(avail))”]’);
    }
    [/insert_php]

    Thread Starter MikeKJ

    (@mikekj)

    Great plugin and some great flexibility Michael, I do have a question though, why did you decide to use an array of arrays for cfdb instead of sql rows? Just curious.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘date in data >= POST date input’ is closed to new replies.