Posts

Showing posts from July, 2016

UniversePay Payment Gateway Integration

/**** Just Create call.php  and put following code ****/ <script   src="https://code.jquery.com/jquery-1.11.0.min.js"   integrity="sha256-spTpc4lvj4dOkKjrGokIrHkJgNA0xMS98Pw9N7ir9oI="   crossorigin="anonymous"></script> <script src="https://api.universepay.eu/static_common/v1/checkout/oplata.js"></script> <script>     var button = $ipsp.get('button');        button.setMerchantId(1396339);        button.setAmount('100', 'USD');     button.setHost('api.universepay.eu');     button.setResponseUrl("http://localhost/universepay/universe_return.php");            location.href=button.getUrl() </script>     <button onclick="location.href=button.getUrl()">Pay</button> /**** **************************************** ****/ /**** Just Create universe_return.php  and put following code ****/   <?php      echo 'Success Part';     ec

How to set start and End date to bootstrap datepicker?

<script>        /*** For the start date***/     var FromStartDate = new Date();     $('#datepicker').datepicker({         startDate: FromStartDate,         autoclose: true     });     /*** For the end date***/     var FromEndDate = new Date();         $('#datepicker').datepicker({         endDate: FromEndDate,         autoclose: true     });     </script>

How to do set order in bootstrap data-table?

/*** Just put this code line where your data are loading ***/     "aaSorting": [[ 0, "desc" ]],

How to get current protocol of current site?

    $isSecure = false;     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {         $isSecure = true;     }elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVE['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {         $isSecure = true;     }     $protocol = $isSecure ? 'https://' : 'http://';     echo $protocol;     /*** Mostly its used setting base url. Like codeigniter's config file for base url         For Ex.: $config['base_url']= $protocol.$_SERVER['HTTP_HOST'].'/site_directory/';     ***/

How to get current protocol of current site?

    $isSecure = false;     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {         $isSecure = true;     }elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVE['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {         $isSecure = true;     }     $protocol = $isSecure ? 'https://' : 'http://';     echo $protocol;     /*** Mostly its used setting base url. Like codeigniter's config file for base url         For Ex.: $config['base_url']= $protocol.$_SERVER['HTTP_HOST'].'/site_directory/';     ***/

Replace morethan one characters or string to given string

/*** IT WILL REPLACE WITH SPACE WHERE GETTING NUMBERS FROM STRING ***/ $patterns = array ('/[0-9]+/'); $replace = array (' '); echo preg_replace($patterns, $replace, '374ethendoe@hotmail.com123');

Reload page when using JSON with success part in special case

/*****  This will reload with current page and tab ****/     window.location.href=window.location.href; /****  This will reload current page only *****/     window.location.reoload();

Set Hyperlink Using Jquery

Just set any default link here: <a href="http://www.google.com" target="_blank">Click Here</a> Now write jquery for setting the dynamic link: $(document).ready(function() { $("a").prop("href", "http://stcodewriter.blogspot.in/"); });