Advertisement
noam76

update_tenant

Apr 14th, 2022 (edited)
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.46 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1/0;">
  6.     <title>הוספת דייר חדש</title>
  7.     <link rel="stylesheet" type="text/css" href="style.css" />
  8.     <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
  9.     <script type="text/javascript" src="js/jquery.validate.js"></script>
  10.     <script type="text/javascript">
  11.     $(document).ready(function(){  
  12.         $("#formLeft .input-bg").hover(function() {
  13.             $(this).addClass("active");
  14.         }, function() {
  15.             $(this).removeClass("active");
  16.         });
  17.        
  18.         $("#formLeft input").focus(function() {
  19.             $(this).parent().addClass("active");
  20.         });
  21.         $("#formLeft input").blur(function() {
  22.             $("#formLeft .input-bg").removeClass("active");
  23.         });
  24.        
  25.         $("#formRight .input-bg").hover(function() {
  26.             $(this).addClass("active");
  27.         }, function() {
  28.             $(this).removeClass("active");
  29.         });
  30.        
  31.         $("#formRight input").focus(function() {
  32.             $(this).parent().addClass("active");
  33.         });
  34.         $("#formRight input").blur(function() {
  35.             $("#formRight .input-bg").removeClass("active");
  36.         });
  37.        
  38.         $("#formRight .message-bg").hover(function() {
  39.             $(this).addClass("active");
  40.         }, function() {
  41.             $(this).removeClass("active");
  42.         });
  43.        
  44.         $("#formRight textarea").focus(function() {
  45.             $(this).parent().addClass("active");
  46.         });
  47.         $("#formRight textarea").blur(function() {
  48.             $("#formRight .message-bg").removeClass("active");
  49.         });
  50.        
  51.         $("#commentForm").validate();
  52.     });
  53.     </script>
  54. </head>
  55. <body>
  56. <div><h1>עדכון פרטים דייר קיים <button class="learn-more" type="submit" onclick="window.location.href='/vaadbait/ContactForm/index.html';">דף הבית</button></h1></div>
  57.     <div id="page-wrap">
  58.         <form method="post" autocomplete="off" action="updatetenant.php" id="commentForm">
  59.             <fieldset>
  60.             <div id="formRight">
  61.                 <label for="Name">:מספר דירה</label>
  62.                 <?php
  63.                 $servername = "localhost";
  64.                 $username = "root";
  65.                 $password = "";
  66.                 $dbname = "vaadbait";
  67.                 $pdo = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  68.                 $sql = "SELECT appartnmb,firstname,lastname FROM contacts";
  69.                 $stmt = $pdo->prepare($sql);
  70.                 $stmt->execute();
  71.                 $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
  72.                 if ($stmt->rowCount() > 0) { ?>
  73.  
  74.                   <select class="input-bg" name="nbrselect">
  75.                   <option value="" disabled selected>בחר דייר</option>
  76.                       <?php foreach ($results as $row) { $appartnmbr = $row['appartnmb']; ?>
  77.                             <option value="<?php $row['appartnmb']?> <?php echo $row['appartnmb']; ?>"><?php echo $row['appartnmb']; ?>&nbsp;<?php echo $row['firstname']; ?>&nbsp;<?php echo $row['lastname']; ?></option>
  78.                             <?php } ?>     
  79.                   </select>
  80.                   <?php } ?>
  81.                  
  82.                 <label for="Name">:שם משפחה</label>
  83.                 <?php
  84.                 $sql = "SELECT lastname, firstname FROM contacts WHERE appartnmb='$appartnmbr'";
  85.                 $stmt = $pdo->prepare($sql);
  86.                 $stmt->execute();
  87.                 $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
  88.                 if ($stmt->rowCount() > 0) {
  89.                 foreach ($results as $row) { ?>
  90.                 <div class="input-bg">
  91.                     <input type="text" name="lastname" id="lastname" placeholder="שם משפחה" class="required" required="required" />
  92.                     <input type="text" name="lastname" value="<?php echo $row['lastname']?>" required>
  93.                 </div>
  94.                 <?php } ?>
  95.                 <?php } ?>
  96.                 <br>
  97.                 <input type="image" src="images/send-button.jpg" name="submit" value="Submit" class="submit-button" />
  98.             </div>
  99.            
  100.             <div id="formLeft">
  101.                 <label for="Name">:שם פרטי</label>
  102.                 <div class="input-bg">
  103.                     <input type="text" name="firstname" id="firstname" placeholder="שם פרטי" class="required" required="required" />
  104.                 </div>
  105.                
  106.                 <label for="Email">:דואר אלקטרוני</label>
  107.                 <div class="input-bg">
  108.                     <input type="text" name="mail" id="mail" placeholder="דואר אלקטרוני" <!-- class="required email -->" />
  109.                 </div>
  110.             </div>
  111.            
  112.             <div class="clear"></div>
  113.             </fieldset>
  114.         </form>
  115.     </div> 
  116.     <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  117.     </script>
  118.     <script type="text/javascript">
  119.     _uacct = "UA-68528-29";
  120.     urchinTracker();
  121.     </script>
  122. </body>
  123. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement