Jump to content

coppens

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by coppens

  1. I am using the coding wizards.  I want to pull the ChildcareId of the session user.  The session is followed by the users 'username'.  The table has UserId, UserName, ChildcareID, and UserLevel.  I need the filter to look at the ChildcareID of the current user and filter all users with the same ID as well as only choosing those users with a userlevel of 1.

     

    Please help.

     

    Thank you

  2. I am using Dreamweaver and would like the results of a page to display records that have the same variable as the user that has logged in.  For instance, if User A works at 'Daycare A' and 'Daycare A' is coded as workplace '5'.  How do I word the statement that all persons who work at workplace '5' appear on the page.  The pages are already filtered to follow the user through by username.  However I need the new filter to look at the users record, choose the column 'ChildcareID' and display all others from that Childcare.  I currently have this statement.

     

    SELECT *
    FROM users
    WHERE ChildcareID = colname
    ORDER BY LastName ASC
     
    Name: colname
    Type: Integer
    Default value: -1
    Run-time value: $_SESSION['MM_Username']
     
    Thank you
  3. I am having trouble with the coding to return the user to the previous page after submitting a form.  I understand that it is usually better to create a direct link to the previous page, however there are four entrances to this page and I would like the user to return to their previous page upon submitting.  I have listed the code below and I think my problem lies in line 112 or there about.  Thank you so much.

     

    <?php session_start(); ?>
    <?php require_once('../Connections/Connect.php'); ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    }
    $MM_authorizedUsers = "1,2";
    $MM_donotCheckaccess = "false";
    
    
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
      // For security, start by assuming the visitor is NOT authorized. 
      $isValid = False; 
    
    
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
      // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
      if (!empty($UserName)) { 
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
        // Parse the strings into arrays. 
        $arrUsers = Explode(",", $strUsers); 
        $arrGroups = Explode(",", $strGroups); 
        if (in_array($UserName, $arrUsers)) { 
          $isValid = true; 
        } 
        // Or, you may restrict access to only certain users based on their username. 
        if (in_array($UserGroup, $arrGroups)) { 
          $isValid = true; 
        } 
        if (($strUsers == "") && false) { 
          $isValid = true; 
        } 
      } 
      return $isValid; 
    }
    
    
    $MM_restrictGoTo = "AnitasAnimalArk/AnimalArk.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo); 
      exit;
    }
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO postshift (UserID, ShiftDay, ShiftDate, ShiftMonth, ShiftYear, ShiftStartHour, ShiftStartMin, ShiftStartTime, ShiftEndHour, ShiftEndMin, ShiftEndTime, ChildcareCentre, Address, City, Telephone, EmployeeFirstName, EmployeeLastName, `Position`, EmailEmployee, EmailCentre, Comments) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['UserID'], "int"),
                           GetSQLValueString($_POST['ShiftDay'], "text"),
                           GetSQLValueString($_POST['ShiftDate'], "text"),
                           GetSQLValueString($_POST['ShiftMonth'], "text"),
                           GetSQLValueString($_POST['ShiftYear'], "int"),
                           GetSQLValueString($_POST['ShiftStartHour'], "int"),
                           GetSQLValueString($_POST['ShiftStartMin'], "int"),
                           GetSQLValueString($_POST['ShiftStartTime'], "text"),
                           GetSQLValueString($_POST['ShiftEndHour'], "int"),
                           GetSQLValueString($_POST['ShiftEndMin'], "int"),
                           GetSQLValueString($_POST['ShiftEndTime'], "text"),
                           GetSQLValueString($_POST['ChildcareName'], "text"),
                           GetSQLValueString($_POST['ChildcareAddress'], "text"),
                           GetSQLValueString($_POST['ChildcareCity'], "text"),
                           GetSQLValueString($_POST['ChildcareTelephone'], "int"),
                           GetSQLValueString($_POST['EmployeeFirstName'], "text"),
                           GetSQLValueString($_POST['EmployeeLastName'], "text"),
                           GetSQLValueString($_POST['Position2'], "text"),
                           GetSQLValueString($_POST['EmployeeUserEmail'], "text"),
                           GetSQLValueString($_POST['ChildcareEmail'], "text"),
                           GetSQLValueString($_POST['Comments'], "text"));
    
    
      mysql_select_db($database_Connect, $Connect);
      $Result1 = mysql_query($insertSQL, $Connect) or die(mysql_error());
    
    
      $insertGoTo = "HTTP_REFERER";
       if (isset($_SERVER["HTTP_REFERER"])) {
            header("Location: " . $_SERVER["HTTP_REFERER"]);
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    
    mysql_select_db($database_Connect, $Connect);
    $query_PostShift = "SELECT * FROM postshift";
    $PostShift = mysql_query($query_PostShift, $Connect) or die(mysql_error());
    $row_PostShift = mysql_fetch_assoc($PostShift);
    $totalRows_PostShift = mysql_num_rows($PostShift);
    $query_PostShift = "SELECT * FROM postshift";
    $PostShift = mysql_query($query_PostShift, $Connect) or die(mysql_error());
    $row_PostShift = mysql_fetch_assoc($PostShift);
    $totalRows_PostShift = mysql_num_rows($PostShift);
    $query_PostShift = "SELECT * FROM postshift";
    $PostShift = mysql_query($query_PostShift, $Connect) or die(mysql_error());
    $row_PostShift = mysql_fetch_assoc($PostShift);
    $totalRows_PostShift = mysql_num_rows($PostShift);
    $query_PostShift = "SELECT * FROM postshift";
    $PostShift = mysql_query($query_PostShift, $Connect) or die(mysql_error());
    $row_PostShift = mysql_fetch_assoc($PostShift);
    $totalRows_PostShift = mysql_num_rows($PostShift);
    
    
    $colname_Users = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_Users = $_SESSION['MM_Username'];
    }
    mysql_select_db($database_Connect, $Connect);
    $query_Users = sprintf("SELECT * FROM users WHERE UserName = %s", GetSQLValueString($colname_Users, "text"));
    $Users = mysql_query($query_Users, $Connect) or die(mysql_error());
    $row_Users = mysql_fetch_assoc($Users);
    $totalRows_Users = mysql_num_rows($Users);
    
    
    $colname_Childcare = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_Childcare = $_SESSION['MM_Username'];
    }
    mysql_select_db($database_Connect, $Connect);
    $query_Childcare = sprintf("SELECT * FROM users INNER JOIN childcareinfo  ON users.ChildcareID = childcareinfo.ChildcareID WHERE users.UserName = %s", GetSQLValueString($colname_Childcare, "text"));
    $Childcare = mysql_query($query_Childcare, $Connect) or die(mysql_error());
    $row_Childcare = mysql_fetch_assoc($Childcare);
    $totalRows_Childcare = mysql_num_rows($Childcare);
    ?> 
  4. I checked and they have no idea what I am talking about.  The tech keeps saying that mysql works fine.  Is this something that I fix on my website coding itself, or is it something that my hosting domain updates and I just tag along?

  5. Good day,

     

    I have a website that I have labored over as I am learning but determined, only to find out that mysql is depreciating.  How do I switch my site to mysqli?  I use a myphpadmin database with the site.  Thank you so much.

  6. Good day,

     

    I seem to be at a loss on the script that I am missing.  I have four levels of users ranging from level 0, 1, 2, 3.  Depending on the users user level, I would like them to be directed to one of 4 pages.  In essence, a different home screen for each user level.  I have attached my php script.  Any help would be wonderful.  Thank you!

     

    <?php require_once('Connections/Connect.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    }
     
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    }
     
    if (isset($_POST['UserName'])) {
      $loginUsername=$_POST['UserName'];
      $password=$_POST['Password'];
      $MM_fldUserAuthorization = "UserLevel";
      $MM_redirectLoginSuccess = "ConnectHome.php";
      $MM_redirectLoginFailed = "Login.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_Connect, $Connect);
     
      $LoginRS__query=sprintf("SELECT UserName, Password, UserLevel FROM users WHERE UserName=%s AND Password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
       
      $LoginRS = mysql_query($LoginRS__query, $Connect) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        
        $loginStrGroup  = mysql_result($LoginRS,0,'UserLevel');
        
    if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;      
     
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        }
        header("Location: " . $MM_redirectLoginSuccess );
      }
      else {
        header("Location: ". $MM_redirectLoginFailed );
      }
    }
    ?>
  7. ChildcareID is the primary key.  When the information in page 1 is entered, it populates the childcareinfo table in the database.  I would like page 2 to retrieve the ChildcareID (primary key) from the childcareinfo table and enter this information into the hidden field on Page 2.  Thank you for your help.

  8. I have a form that asks the user to input the business name and address.  A hidden field assigns the user a ChildcareID for the childcare table.  This is the relational key in the 'user' table.  I have been trying for days to have the childcareID transfer to the next form whereby the user enters their personal information.  I can not see where I am going wrong.  I apologize now, I am learning how to code and will post both pages here.  Thank you so much for your help.  I am very grateful.

     

    Page 1

     

    <?php session_start(); ?>
    <?php require_once('../Connections/Connect.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
     
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO childcareinfo (ChildcareName, ChildcareAddress, ChildcareCity, ChildcareProvince, ChildcarePostalCode, ChildcareTelephone, Fax, ChildcareEmail) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['BusinessName'], "text"),
                           GetSQLValueString($_POST['Address'], "text"),
                           GetSQLValueString($_POST['City'], "text"),
                           GetSQLValueString($_POST['Province'], "text"),
                           GetSQLValueString($_POST['PostalCode'], "text"),
                           GetSQLValueString($_POST['Telephone'], "text"),
                           GetSQLValueString($_POST['CellPhone'], "int"),
                           GetSQLValueString($_POST['Email'], "text"));
     
      mysql_select_db($database_Connect, $Connect);
      $Result1 = mysql_query($insertSQL, $Connect) or die(mysql_error());
     
      $insertGoTo = "AdminRegistration.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
     
    mysql_select_db($database_Connect, $Connect);
    $query_Childcare = "SELECT * FROM childcareinfo";
    $Childcare = mysql_query($query_Childcare, $Connect) or die(mysql_error());
    $row_Childcare = mysql_fetch_assoc($Childcare);
    $totalRows_Childcare = mysql_num_rows($Childcare);
     
    ?>
    <!DOCTYPE html>
     
    <html>
    <head>
    <meta charset="UTF-8" />
    <title>Registration - Childcare Connect</title>
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="css/ie6.css" />
    <![endif]-->
    <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    </script>
    </head>
    <body>
    <div id="header">
    <div>
    <a href="../index.php"><img src="../images/logo.gif" alt="Logo" width="199" height="82" /></a>
    <ul>
    <li><a href="../ConnectHome.php">Home</a></li>
    <li class="current"><a href="AnitasAnimalArk/AnimalAdminConsole.php">Back</a></li>
    <li><a href="../LogOut.php">Log Out</a></li>
    <li><a href="../contact.html">Contact us</a></li>
    </ul>
    </div>
    </div>
    <div class="content">
    <div>
    <div>
     <table width="960" height="463" border="0" background="../images/UserRegistration.gif">
       <tr>
         <td width="747" height="30"> </td>
         <td width="203"> </td>
           </tr>
       <tr>
         <td height="427"> </td>
         <td> </td>
           </tr>
         </table>
    </div>
     <div>
       <table>
         <tr>
           <td rowspan="2" align="center" valign="top"><div id="sidebar">
             <h3>Instructions</h3>
             <ul>
               <li id="vision"> <span><a href="../LogoUpload.php">Profile Logo Upload</a></span>
                 <p>Click the above 'Profile Logo Upload' link to upload a Profile Logo for the Childcare, School, Club, or Camp.</p>
                   </li>
               <li id="mission"> <span>Our Mission</span>
                 <p> </p>
                   </li>
               <li id="wecare"> <span>We care</span>
                 <p> </p>
                   </li>
                 </ul>
               </div></td>
           <td align="left" valign="top"><table width="100%" border="0" align="right">
             <tr align="left">
               <td align="center"><h3><u>Business  Registration</u></h3></td>
                 </tr>
               </table></td>
             </tr>
         <tr>
           <td width="630" align="right" valign="top"><table width="100%" border="4" align="right" bordercolor="#FFB33B">
                 <tr>
                 <td align="right">
                          
         <form action="<?php echo $editFormAction; ?>" name="form1" method="POST" input type="submit">
                   <table border="0" align="center">
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2" align="center">Business Name:<br>
                         <span id="sprytextfield3">
                         <label for="BusinessName"></label>
                         <input type="text" name="BusinessName" id="BusinessName">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><span id="sprytextfield1">
                         <label for="Address">Address:<br>
                         </label>
                         <input name="Address" type="text" id="Address">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield2">
                         <label for="City">City:</label>
                         <br>
    <input name="City" type="text" id="City">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td><span id="sprytextfield8">
                         <label for="Province">Province:</label>
                         <input name="Province" type="text" id="Province">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield9">
                         <label for="PostalCode7">PostalCode</label>
                         :<br>
    <input type="text" name="PostalCode" id="PostalCode7">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td> </td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield10">
                                <label for="Telephone">Telephone:</label>
                                <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span><span id="sprytextfield12">
                                <label for="Telephone"></label>
                                <input type="text" name="Telephone" id="Telephone">
                                <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td><span id="sprytextfield11"><span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span><span id="sprytextfield13">
                            <label for="CellPhone"></label>
                            Fax:<br>
                            <input type="text" name="CellPhone" id="CellPhone">
    <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><span id="sprytextfield5">
                                <label for="Email3">Email:</label>
                                <br>
                                <input name="Email" type="text" id="Email">
                                <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><input type="submit" name="RegisterUser" id="RegisterUser" value="Register User"></td>
                         </tr>
                       </table>
                   <input type="hidden" name="MM_insert" value="form1">
                 </form></td>
                      </tr>
                    </table></td>
             </tr>
           </table>
     </div>
    </div>
    </div>
    <div id="footer">
    <div>
    <div>
    <span>Follow us</span>
    <a href="http://facebook.com/childcareconnect" target="_blank" class="facebook">Facebook</a>
    <a href="#" class="subscribe">Subscribe</a></div>
    <ul>
    <li>
    <a href="#"><img src="../images/playing-in-grass.gif" alt="Image" /></a>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna.</p>
    <a href="#" class="readmore">Read more</a>
    </li>
    <li>
    <a href="#"><img src="../images/baby-smiling.gif" alt="Image" /></a>
    <p>Sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud.</p>
    <a href="#" class="readmore">Read more</a>
    </li>
    </ul>
    </div>
    <p class="footnote">© Childcare Connect. All Rights Reserved.</p>
    </div>
    <script type="text/javascript">
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8");
    var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "phone_number", {format:"phone_custom", pattern:"123-456-7890", hint:"123-456-7890"});
    var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11", "phone_number", {format:"phone_custom", pattern:"123-456-7890", hint:"123-456-7890"});
    var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12");
    var sprytextfield13 = new Spry.Widget.ValidationTextField("sprytextfield13");
    var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($Childcare);
     
    mysql_free_result($ChildcareRegistration);
     
    mysql_free_result($Users);
     
    mysql_free_result($ChildcareID);
    ?>
     
     
    Page 2
     

    <?php session_start(); ?>
    <?php require_once('../Connections/Connect.php'); ?>
     
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
     
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
     
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
     
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO users (ChildcareID, FirstName, LastName, UserAddress, City, Province, PostalCode, Telephone, CellPhone, Email, UserName, Password, UserLevel) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['ChildcareID'], "int"),
                           GetSQLValueString($_POST['FirstName'], "text"),
                           GetSQLValueString($_POST['LastName'], "text"),
                           GetSQLValueString($_POST['Address'], "text"),
                           GetSQLValueString($_POST['City'], "text"),
                           GetSQLValueString($_POST['Province'], "text"),
                           GetSQLValueString($_POST['PostalCode'], "text"),
                           GetSQLValueString($_POST['Telephone'], "text"),
                           GetSQLValueString($_POST['CellPhone'], "text"),
                           GetSQLValueString($_POST['Email'], "text"),
                           GetSQLValueString($_POST['UserName'], "text"),
                           GetSQLValueString($_POST['Password'], "text"),
                           GetSQLValueString($_POST['UserLevel'], "text"));
     
      mysql_select_db($database_Connect, $Connect);
      $Result1 = mysql_query($insertSQL, $Connect) or die(mysql_error());
     
      $insertGoTo = "../ConnectHome.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
     
    $colname_Childcare = "-1";
    if (isset($_GET['ChildcareID'])) {
      $colname_Childcare = $_GET['ChildcareID'];
    }
    mysql_select_db($database_Connect, $Connect);
    $query_Childcare = sprintf("SELECT * FROM childcareinfo WHERE ChildcareID = %s", GetSQLValueString($colname_Childcare, "int"));
    $Childcare = mysql_query($query_Childcare, $Connect) or die(mysql_error());
    $row_Childcare = mysql_fetch_assoc($Childcare);
    $totalRows_Childcare = mysql_num_rows($Childcare);$colname_Childcare = "-1";
    if (isset($_GET['ChildcareID'])) {
      $colname_Childcare = $_GET['ChildcareID'];
    }
    mysql_select_db($database_Connect, $Connect);
    $query_Childcare = sprintf("SELECT * FROM childcareinfo WHERE ChildcareID = %s", GetSQLValueString($colname_Childcare, "int"));
    $Childcare = mysql_query($query_Childcare, $Connect) or die(mysql_error());
    $row_Childcare = mysql_fetch_assoc($Childcare);
    $totalRows_Childcare = mysql_num_rows($Childcare);
     session_start(); ?>
     
     
    <!DOCTYPE html>
     
    <html>
    <head>
    <meta charset="UTF-8" />
    <title>Registration - Childcare Connect</title>
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="css/ie6.css" />
    <![endif]-->
    <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    </script>
    </head>
    <body>
    <div id="header">
    <div>
    <a href="../index.php"><img src="../images/logo.gif" alt="Logo" width="199" height="82" /></a>
    <ul>
    <li><a href="../ConnectHome.php">Home</a></li>
    <li class="current"><a href="AnitasAnimalArk/AnimalArk.php">Back</a></li>
    <li><a href="../LogOut.php">Log Out</a></li>
    <li><a href="../contact.html">Contact us</a></li>
    </ul>
    </div>
    </div>
    <div class="content">
    <div>
    <div>
     <table width="960" height="463" border="0" background="../images/UserRegistration.gif">
       <tr>
         <td width="747" height="30"> </td>
         <td width="203"> </td>
           </tr>
       <tr>
         <td height="427"> </td>
         <td> </td>
           </tr>
         </table>
    </div>
     <div>
       <table width="100%" border="0">
         <tr>
           <td width="320" rowspan="2" align="center" valign="top"><div id="sidebar">
             <h3>Our Education</h3>
             <ul>
               <li id="vision"> <span>Our Vision</span>
                 <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim venia.</p>
                   </li>
               <li id="mission"> <span>Our Mission</span>
                 <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim venia.</p>
                   </li>
               <li id="wecare"> <span>We care</span>
                 <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim venia.</p>
                   </li>
                 </ul>
               </div></td>
           <td align="right" valign="top"><table width="100%" height="66" border="0" align="right">
             <tr>
               <td height="62" align="center">User Registration</td>
                 </tr>
               </table></td>
             </tr>
         <tr>
           <td width="630" align="right" valign="top"><table width="100%" border="4" align="right" bordercolor="#FFB33B">
                 <tr>
                 <td align="right"><form action="<?php echo $editFormAction; ?>" name="form1" method="POST">
                   <table width="600" border="0" align="center">
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2" align="center"><span id="sprytextfield3">
                         <label for="FirstName">First Name:<br>
                         </label>
                         <input name="FirstName" type="text" id="FirstName">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><span id="sprytextfield4">
                         <label for="LastName4">Last Name:</label>
                         <br>
    <input name="LastName" type="text" id="LastName">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><span id="sprytextfield1">
                         <label for="Address">Address:</label>
                         <br>
    <input name="Address" type="text" id="Address">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td width="245"><span id="sprytextfield2">
                         <label for="City">City:<br>
                         </label>
                         <input name="City" type="text" id="City">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td width="245"><span id="sprytextfield8">
                         <label for="Province">Province:</label>
                         <input name="Province" type="text" id="Province">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield9">
                         <label for="PostalCode">Postal Code:</label>
                         <input name="PostalCode" type="text" id="PostalCode">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td> </td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield10">
                                <label for="Telephone">Telephone:</label>
                                <input name="Telephone" type="text" id="Telephone">
                                <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td><span id="sprytextfield11">
                         <label for="CellPhone">Cell Phone:</label>
                         <input name="CellPhone" type="text" id="CellPhone">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td colspan="2"><span id="sprytextfield5">
                                <label for="Email3">Email:</label>
                                <br>
                                <input name="Email" type="text" id="Email">
                                <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                         </tr>
                     <tr>
                       <td colspan="2"> </td>
                         </tr>
                     <tr>
                       <td><span id="sprytextfield6">
                         <label for="UserName3">User Name:</label>
                         <br>
                         <input name="UserName" type="text" id="UserName">
                           <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                       <td><span id="sprytextfield7">
                         <label for="Password">Password:</label>
                         <input name="Password" type="text" id="Password">
                         <span class="textfieldRequiredMsg">A value is required.</span></span><br>
                                <span class="textfieldRequiredMsg">A value is required.</span></td>
                         </tr>
                     <tr>
                       <td height="34" colspan="2"><input name="UserLevel" type="hidden" id="UserLevel" value="2">
                           <input name="ChildcareID" type="hidden" id="ChildcareID" value="<?php echo $row_Childcare['ChildcareID']; ?>"></td>
                         </tr>
                     <tr>
                       <td height="62" colspan="2"><input type="submit" name="RegisterUser" id="RegisterUser" value="Register User"></td>
                         </tr>
                       </table>
                   <input type="hidden" name="MM_insert" value="form1">
                 </form></td>
                      </tr>
                    </table></td>
             </tr>
           </table>
     </div>
    </div>
    </div>
    <div id="footer">
    <div>
    <div>
    <span>Follow us</span>
    <a href="http://facebook.com/childcareconnect" target="_blank" class="facebook">Facebook</a>
    <a href="#" class="subscribe">Subscribe</a></div>
    <ul>
    <li>
    <a href="#"><img src="../images/playing-in-grass.gif" alt="Image" /></a>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna.</p>
    <a href="#" class="readmore">Read more</a>
    </li>
    <li>
    <a href="#"><img src="../images/baby-smiling.gif" alt="Image" /></a>
    <p>Sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud.</p>
    <a href="#" class="readmore">Read more</a>
    </li>
    </ul>
    </div>
    <p class="footnote">© Childcare Connect. All Rights Reserved.</p>
    </div>
    <script type="text/javascript">
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8");
    var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
    var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "none");
    var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11");
    var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($Users);
     
    mysql_free_result($Childcare);
    ?>
     
     
    Thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.