Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 3.48 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jquery dialog box
  2. <?php
  3.    require_once('../../SfHelper.php');
  4.    $sfHelper = new SfHelper();
  5.    echo $sfHelper->load_css('ui-lightness/login');
  6. ?>
  7.  
  8.  
  9. <div name="form_Login" class="form_Login">
  10. <form id="form1" name="form1" method="post" action="<?php echo
  11.       $sfHelper->base_url().'forms/jobseeker/'; ?>process_Login.php" >
  12. <table width="296" border="0" align="center" cellspacing="5">
  13.     <tr>
  14.        <td colspan="3">LOGIN JOB SEEKER</td>
  15.     </tr>
  16.     <tr>
  17.        <td width="110">Username</td>
  18.        <td width="18">:</td>
  19.        <td width="209"><input type="text" name="txtUsername"
  20.             id="txtUsername" /></td>
  21.     </tr>
  22.     <tr>
  23.        <td>Password</td>
  24.        <td>:</td>
  25.        <td><input type="password" name="txtPassword" id="txtPassword" /></td>
  26.     </tr>
  27.     <tr>
  28.        <td colspan="3">
  29.  
  30.    </td>
  31.     </tr>
  32.     <tr>
  33.        <td colspan="3"><div align="center">
  34.           <input type="submit" name="Login" id="Login" value="Login" />
  35.           </div></td>
  36.     </tr>
  37.  </table>
  38. </form>
  39. </div>
  40.  
  41.  
  42. <?php
  43. if(isset($_GET['err']))
  44. {
  45.    if($_GET['err'] == "Sorry, We Cannot found your Username")
  46.    {
  47.       echo '<script type="text/javascript">
  48.                alert("Sorry, We Cannot found your Username"); </script>';
  49.  
  50.    }
  51.    else if($_GET['err'] == "Invalid Username or Password")
  52.    {
  53.         echo '<script type="text/javascript">
  54.                      alert("Invalid Username or Password");</script>';
  55.    }
  56. }
  57. ?>
  58.        
  59. if(isset($_GET['err']))
  60. {
  61.      if($_GET['err'] == "Sorry, We Cannot found your Username")
  62.      {
  63.         echo '<script type="application/javascript">
  64.            $("#Login").click(function() {
  65.               $( "#dialog-message" ).dialog({
  66.                  modal: true,
  67.                  buttons: {
  68.                     Ok: function() {
  69.                        $( this ).dialog( "close" );
  70.                     }
  71.                  }
  72.               });
  73.            });
  74.        </script>';
  75.      }
  76.      else if($_GET['err'] == "Invalid Username or Password")
  77.      {
  78.          echo '<script type="application/javascript">
  79.             $("#Login").click(function() {
  80.                  "#dialog-message2" ).dialog({
  81.                      modal: true,
  82.                      buttons: {
  83.                         Ok: function() {
  84.                            $( this ).dialog( "close" );
  85.                         }
  86.                      }
  87.                  });
  88.             });
  89.         </script>';
  90.     }
  91. }
  92.        
  93. <div id="dialog-message" style="display:none" >
  94.     <p>
  95.     <span class="ui-icon ui-icon-circle-check"
  96.                 style="float:left; margin:0 7px 50px 0;"></span>
  97.     Sorry, We Cannot found your Username
  98.     </p>
  99.    </div>
  100.  
  101.   <div id="dialog-message2" style="display:none" >
  102.     <p>
  103.     <span class="ui-icon ui-icon-circle-check"
  104.                  style="float:left; margin:0 7px 50px 0;"></span>
  105.     Invalid Username or Password
  106.     </p>
  107.   </div>
  108.        
  109. $(document).ready(function() {
  110.   // Code using $ as usual goes here.
  111.   //The DOM is now loaded and can be manipulated.
  112. });
  113.  
  114.   echo '<script type="application/javascript">
  115.                 $(document).ready(function() {
  116.                      $("#Login").click(function() {
  117.                         $( "#dialog-message" ).dialog({
  118.                               modal: true,
  119.                               buttons: {
  120.                               Ok: function() {
  121.                                $( this ).dialog( "close" );
  122.                               }
  123.                              }
  124.                          });
  125.                        });
  126.                        });
  127.          </script>';