Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" />
- <script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
- <script src="js/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="style.css" />
- <script type="text/javascript">
- $(document).ready(function() {
- //start combo select
- (function( $ ) {
- $.widget( "ui.combobox", {
- _create: function() {
- var self = this,
- select = this.element.hide(),
- selected = select.children( ":selected" ),
- value = selected.val() ? selected.text() : "";
- var input = this.input = $( "<input>" )
- .insertAfter( select )
- .val( value )
- .autocomplete({
- delay: 0,
- minLength: 0,
- source: function( request, response ) {
- var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
- response( select.children( "option" ).map(function() {
- var text = $( this ).text();
- if ( this.value && ( !request.term || matcher.test(text) ) )
- return {
- label: text.replace(
- new RegExp(
- "(?![^&;]+;)(?!<[^<>]*)(" +
- $.ui.autocomplete.escapeRegex(request.term) +
- ")(?![^<>]*>)(?![^&;]+;)", "gi"
- ), "<strong>$1</strong>" ),
- value: text,
- option: this
- };
- }) );
- },
- select: function( event, ui ) {
- ui.item.option.selected = true;
- self._trigger( "selected", event, {
- item: ui.item.option
- });
- },
- change: function( event, ui ) {
- if ( !ui.item ) {
- var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
- valid = false;
- select.children( "option" ).each(function() {
- if ( $( this ).text().match( matcher ) ) {
- this.selected = valid = true;
- return false;
- }
- });
- if ( !valid ) {
- // remove invalid value, as it didn't match anything
- $( this ).val( "" );
- select.val( "" );
- input.data( "autocomplete" ).term = "";
- return false;
- }
- }
- }
- })
- .addClass( "ui-widget ui-widget-content ui-corner-left ui-corner-right inputCustom" )
- input.data( "autocomplete" )._renderItem = function( ul, item ) {
- return $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( "<a>" + item.label + "</a>" )
- .appendTo( ul );
- };
- },
- destroy: function() {
- this.input.remove();
- this.button.remove();
- this.element.show();
- $.Widget.prototype.destroy.call( this );
- }
- });
- })( jQuery );
- $(function() {
- $( ".combobox" ).combobox();
- });
- //end combo select
- $(".datePicker").datepicker({dateFormat: 'yy-mm-dd'});
- $(".statusC").change(function () {
- var id=$(this).attr('id');
- var status = $(".statusC#"+id+" option:selected").val();
- $.ajax({
- type: "POST",
- url: "checkStatus.php",
- data: "routeid="+id+"&status="+status,
- success: function(html){
- //alert("Status successfully changed!");
- javascript:location.reload(true);
- }
- });
- });
- $(".statusWheel").change(function () {
- var status = $(".statusWheel option:selected").val();
- window.location = "index2.php?statusQ="+status;
- });
- $(".typeQ").change(function () {
- var typeQ = $(".typeQ option:selected").val();
- //alert(typeQ);
- $.ajax({
- type: "POST",
- url: "searchAuto.php",
- data: "typeQ="+typeQ,
- success: function(resultSearch){
- $('.search').html(resultSearch);
- }
- });
- });
- $('.closeAlertL').click(function() {
- $('#alertBar').hide('slow');
- });
- var genNumber = 0;
- $('.addSchoolGen').click(function() {
- genNumber = document.getElementById("genNum").value;
- $.ajax({
- type: "GET",
- url: "addRouteGen.php",
- data: "type=school&num="+genNumber,
- success: function(result){
- $('.schoolStudentIn').append(result);
- $(".combobox").combobox();
- }
- });
- genNumber++;
- });
- $('.addStudentGen').click(function() {
- genNumber = document.getElementById("genNum").value;
- $.ajax({
- type: "GET",
- url: "addRouteGen.php",
- data: "type=student&num="+genNumber,
- success: function(result){
- $('.schoolStudentIn').append(result);
- $(".combobox").combobox();
- }
- });
- genNumber++;
- });
- $('.removeStop').click(function(e) {
- e.preventDefault();
- $(this).closest('tr').fadeOut(400, function () {
- $(this).remove();
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement