Wednesday, April 10, 2019

modal dialog sample code

 <!-- Modal -->    <div id="myModal" class="modal fade" role="dialog">
        <div class="modal-dialog">

            <!-- Modal content-->            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">xyz</h4>
                </div>
                <div class="modal-body">
                    xyz:
                    <select name="xyz" class="form-control xyz">
                        <option value="" disabled selected>xyz</option>
                        

                    </select>
                           </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default abc" >CTA1</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>

        </div>
    </div>

to show modal
$('#myModal').modal('show'); 
to close
$('#my_modal').modal('hide');

Thursday, April 4, 2019

Mysql new learning .. Use of keyword "having"

You can use Having with group by

SELECT COUNT( x ) AS cnt
GROUP BY o.x
HAVING cnt >1

Python using relative paths in files

Use below syntax to run python script from anywhere

import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),"../Config/")))