Posts

Apache enable MOD_REWRITE for PHP Rest API

Image
Hi Im woarking with follwing expample which illustrate how to create REST Api form genic PHP http://www.tutorialsface.com/2016/02/simple-php-mysql-rest-api-sample-example-tutorial/ However I  need to set MOD_REWRITE for the API folder in Wamp and Follwing steps need to follow to achive it . 1.Go to apache  http.conf in WAMP apache folder ,and open it 2. Make a backup of http.conf   3.  Find the line #LoadModule rewrite_module modules/mod_rewrite.so and uncomment it by removing hash. 4.ADD the rule as below for the APi folder . in my case its MI_API (there will be block like below mapped to WAP ,www folder ,you can edit it as nesosary) <directory C:/wamp/www> Options All   AllowOverride All </directory> Thanks  for : https://webdevdoor.com/php/mod_rewrite-windows-apache-url-rewriting

Oracle Varchar2 DateTime Experassions - yyyy-mm-dd HH24:MI:SS

There is a verchar2 Date Time Filed  in the table which now need to get Results with the given rnage eg : up to 3 days of the past from today. Eg Field DONE_TIME SELECT  * substr(DONE_TIME,0,19) FROM EG_TABLE Convert to date : SELECT  *  TO_DATE(substr(DONE_TIME,0,19),'yyyy-mm-dd HH24:MI:SS') FROM EG_TABLE Reduce From the System Time : SELECT  *  (systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS')) FROM EG_TABLE RANGE Comparison  : WHERE trunc(to_number(substr((systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS')),1,instr(systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS'),' '))))>3

jQuery Ajaz to check if returned data object is empty

Image
In one of my jQuery Ajax Request ,I need to check wehter quary  return  empty results. $ . post ( "php/socialbookmark-post.php" , { bookmarkID : $ ( this ). val ()}, function ( data ) { if ( data != "" ) alert ( data ); });   data !== 'undefined' && data !== '' not worked Properly and Stack OverFlow also not given good answer. I observed, If empty data set  returned , the full block will not executed. http://stackoverflow.com/questions/2589558/jquery-to-check-if-returned-data-object-is-empty But refffering to jQuery I able to come up with solid answer. http://api.jquery.com/jQuery.ajax/ By defult we inherit the sucess method (done ) and if empty data set returned it will go (fail).     $.post("./testURL" function (o) {                                 ...

Preview Saved HTML in Bootstrap Model Dialog

Image
I had to create a Bootstap model Dialog using HTML Content Saved in the Oracle Database LONG column, Its easy . I will keep the HTML in the a div which is hidden and take the contnet to the model HTML when user prometed. HTML- Dynamic Table Rows <div style="display: none" id="preview_<?php echo $row['TB_ID'] ?>" > <?php echo $row['TB_HTML'] ?> </div>  Model Dialog HTML - End of the Page <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</ button> <h4 class="modal-title">Detail</h4> </div> <div class="modal-bo...

Great Menu Wokrs fine to me

Image
A horizontal slide out menu with a grid-like thumbnail layout for the submenu. With media query examples for smaller devices. https://tympanus.net/codrops/2013/05/17/horizontal-slide-out-menu/ however you have to remember to load the jqvqcript after HTML renadred ,,in the End of the File. ................ </div> < script > var menu = new cbpHorizontalSlideOutMenu ( document . getElementById ( 'cbp-hsmenu-wrapper' ) ); </ script >

Oracle Updagte if Exhist else Insert

merge into A outl   using (select 1 id, 'A' ran,3 beat from dual) s   on (outl.ID = s.id and outl.RANG=s.ran )   when matched then update set BEAT = s.beat   when not matched then insert (ID, RANG,BEAT)    values ( s.id , s.ran,s.beat);

Bootstrap DatTimePicker set Current Date

Image
Hi I had to set the current date for BootStrap Date Time Picker in YYYY-MM-DD formet Given code assist me to do it . JS          $('#date').datetimepicker({             pickDate: true,             pickTime: false,                   });       //After create control         var dNow = new Date();         var localdate = dNow.getFullYear()+'-'+ (dNow.getMonth() + 1) + '-' + dNow.getDate() ;          $('#datet').val(localdate); HTML     <div class='input-group date' id='date' value="" data-date-format="YYYY-MM-DD">                                 <input type='text'  id="datet" name="datet" />                 ...