Hi catacausticActually I installed this plugin called profi search filter..and I want to edit some functionalities to it…The provider gave me an addon for the datepicker…
Here is the addon…
addon.php
add_action( ‘wp_enqueue_scripts’, ‘psf_addon_scripts’ );
function psf_addon_scripts(){
wp_enqueue_script( ‘jquery-touch’, ‘//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js’, array( ‘jquery-ui-slider’ ) );
wp_enqueue_script( ‘sf-date’, plugins_url( ‘/script.js’, __FILE__ ), array( ‘sf-script’, ‘jquery-ui-datepicker’ ) );
wp_enqueue_style( ‘sf-ui-datepicker’, ‘//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css’ );
}
script.php
jQuery( document ).ready( function(){
var data_id = 2;
var data_id_2 = 3;
var format = ‘mm-dd-yy’;
jQuery( ‘fieldset[data-id=”‘ + data_id + ‘”] input’ ).datepicker({ dateFormat: format });
jQuery( ‘fieldset[data-id=”‘ + data_id_2 + ‘”] input’ ).datepicker({ dateFormat: format });
});
and I want this code to be integrated on my code..
<script type=”text/javascript” language=”javascript”>
jQuery(function() {
jQuery( “#from” ).datepicker({
defaultDate: “+1w”,
changeMonth: true,
numberOfMonths: 1,
dateFormat: “yy-mm-dd”,
onClose: function( selectedDate ) {
$( “#to” ).datepicker( “option”, “minDate”, selectedDate );
}
});
jQuery( “#to” ).datepicker({
defaultDate: “+1w”,
changeMonth: true,
numberOfMonths: 1,
dateFormat: “yy-mm-dd”,
onClose: function( selectedDate ) {
jQuery( “#from” ).datepicker( “option”, “maxDate”, selectedDate );
}
});
});
</script>
with my own datatable: I don’t know how to call them on wordpress…
$sql = “SELECT * FROM log WHERE call_date >= DATE_FORMAT(‘” . $from . “‘, ‘%Y/%m/%d’) AND call_date <= DATE_FORMAT(‘” . $to . “‘, ‘%Y/%m/%d’)”;
//$sql = “SELECT * FROM log WHERE call_date >= ‘”.date(“Y-m-d”, strtotime($from)).”‘ AND call_date <= ‘”.date(“Y-m-d”, strtotime($to)).”‘”;
//$sql = “SELECT * FROM log WHERE call_date >= ‘$from’ AND call_date <= ‘$to'”;
$result = mysqli_query($link, $sql, MYSQLI_STORE_RESULT);
while($row = $result->fetch_assoc()){
$name= $row[‘name’];
$disposition = $row[‘did_id’];
$date = $row[‘call_date’];
}