Posts

Showing posts from September, 2017

cron job command for run php script

php -f /home/username/public_html/doctor/mytest.php

checkbox check and uncheck using jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('[name="day[1]"]').change(function()       {         if ($(this).is(':checked')) {           $('[name="day_1[1]"]').prop("checked",false);           $('[name="day_2[1]"]').prop("checked",false);           $('[name="day_3[1]"]').prop("checked",false);           $('[name="day_4[1]"]').prop("checked",false);           $('[name="day_5[1]"]').prop("checked",false);           $('[name="day_6[1]"]').prop("checked",false);         }; }); $('[name="day_1[1]"]').change(function()       {     ...

appoinment timing system start time and end time

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style> select{   width: 100px;    display: block;   margin: 10px; } </style> <script> $(document).ready(function(){     $('#one').change(function() {         $('#two').prop('disabled', this.value == '0');         $('#one1').prop('disabled', this.value == '0');         $('#two1').prop('disabled', this.value == '0');         $("#two option").each(function(){           ...

End time dropdown according to start time dropdown using jQuery.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style> select{   width: 100px;    display: block;   margin: 10px; } </style> <script> $(document).ready(function(){   $('#one').change(function() {         $('#two').prop('disabled', this.value == '0');         $("#two option").each(function(){         if($("#one option:selected").index() >= $(this).index())             $(this).attr("disabled", "disabled");  ...

second dropdown value according to first dropdown using jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style> select{   width: 100px;   display: block;   margin: 10px; } </style> <script> $(document).ready(function(){      $('#one').change(function() {     $('#two').prop('disabled', this.value == '0');        $("#two option").each(function(){        if($("#one option:selected").val() >= $(this).val())             $(this).attr("disabled", "disabled");         else          $(this).removeAttr("disabled");        });       }).change(); }); </script> </head> <body> <select name="first" id="one"> <option disabled="disabled" selected="selected" value="0">Please</option> <option ...

remove product-category from url wordpress woocommerce

add_filter('request', 'alter_the_query' ); function alter_the_query( $vars ) {     global $wpdb;     if( ! empty( $vars['category_name'] ) || ! empty( $vars['name'] ) ) {         $slug = ! empty( $vars['pagename'] ) ? $vars['pagename'] : ( ! empty( $vars['name'] ) ? $vars['name'] : ( !empty( $vars['category_name'] ) ? $vars['category_name'] : $vars['attachment'] ) );         $exists = $wpdb->get_var( $wpdb->prepare( "SELECT t.term_id FROM $wpdb->terms t LEFT JOIN $wpdb->term_taxonomy tt ON tt.term_id = t.term_id WHERE tt.taxonomy = 'product_cat' AND t.slug = %s" ,array( $slug )));         if( $exists ){             $old_vars = $vars;             $vars = array('product_cat' => $slug );             if ( !empty( $old_vars['...

multiple files upload in php using single input fileld.

<?php if(isset($_POST['submit'])){     if(count($_FILES['upload']['name']) > 0){         //Loop through each file         for($i=0; $i<count($_FILES['upload']['name']); $i++) {           //Get the temp file path             $tmpFilePath = $_FILES['upload']['tmp_name'][$i];             //Make sure we have a filepath             if($tmpFilePath != ""){                             //save the filename                 $shortname = $_FILES['upload']['name'][$i];      ...

json encode working with spcial char

mb_ convert_encoding($result[' post_description'], 'UTF-8'),