php-windows Digest 17 Jun 2004 15:56:23 -0000 Issue 2288

Topics (messages 23997 through 24004):

Re: Where is mysqli in PHP5rc3?
        23997 by: memoimyself.yahoo.com.br

Re: ASP to PHP converter?
        23998 by: Sudeep Zamudra
        23999 by: Svensson, B.A.T. (HKG)
        24001 by: Gryffyn, Trevor

Re: Multiple file Delete
        24000 by: Svensson, B.A.T. (HKG)
        24002 by: Gryffyn, Trevor

Self-calling script problem.
        24003 by: Garry Grierson
        24004 by: Gryffyn, Trevor

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
That sort of explains it, but I find it curious (to put it mildly) that there should 
not be any 
kind of warning or notice regarding the absence of the mysqli extension in the 
package. 
Granted, PHP doesn't cost any money, so I suppose I'm in no position to complain.


On 11 Jun 2004 at 13:44, Jason Barnett wrote:

> The new releases of MySQL are licensed under the GPL.  I read over on 
> Zend's site that MySQL is trying to make an exception for PHP and a few 
> other open source projects, but a lot of the people at Zend don't want 
> to restrict their PHP users.  And, a few others thought that they 
> shouldn't show preferences to any database.
> 
> I was also unpleasantly surprised by this, but since I don't have a 
> pressing time concern this was no deal for me.  Instead, I've learned 
> how to migrate my databases to another system :)

--- End Message ---
--- Begin Message ---
Hi Erik,
 
Check this out. http://asp2php.naken.cc/
 
I don't know whether it is reliable or not. But i guess it's free.
 
...SuDeEp...

[EMAIL PROTECTED] wrote:
Does anyone know of reasonably good and reliable (and preferably free) ASP to PHP 
converter?

Erik

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---
--- Begin Message ---
> Does anyone know of reasonably good and reliable (and preferably
> free) ASP to PHP  converter?

Well, I have this colleague of mine, however, I don't know if he is for
free. :)

--- End Message ---
--- Begin Message ---
Yeah, I was going to say that there are a ton of ASP -> PHP converters
on http://www.guru.com and probably http://www.codelance.com too, but
they're not free.

The problem with converters is:

If it's a small project
Upside to conversion - you have some idea if it converted it reliably
Downside to conversion - it's small enough to probably convert it
yourself manually

If it's a large project:
Upside - It saves you a lot of time manually converting
Downside - The chance of something being misconverted increases with
each line of code.  I wouldn't trust a universal converter with a large
project.  Then again, there's probably solutions out there that cost
$500-$1000+ that might do it reliably, free ones are hit or miss

And there are some things that just aren't going to convert over
directly, you might need to get some addons for PHP to simulate the same
functionality as you had on ASP.


For me, I think it's just better to do it by hand.  Either convert or
figure out what the ASP does and just re-write it in PHP.

Or maybe slowly  migrate components of the ASP into PHP...   Maybe run
PHP on IIS and have PHP pages calling ASP page and vice version and
slowly phase out the ASP by replacing pieces of it a little at a time.


Just some thoughts.

-TG

> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 17, 2004 7:15 AM
> To: '[EMAIL PROTECTED] '
> Subject: RE: [PHP-WIN] ASP to PHP converter?
> 
> 
> > Does anyone know of reasonably good and reliable (and preferably
> > free) ASP to PHP  converter?
> 
> Well, I have this colleague of mine, however, I don't know if 
> he is for
> free. :)
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
That error message is oki, but use @ to silent error messag, like

      if (@unlink($delFile))



-----Original Message-----
From: Lenny Davila
To: [EMAIL PROTECTED]
Sent: 16-6-2004 22:07
Subject: [PHP-WIN] Multiple file Delete

I need to be able to delete multiple files from my web server by
choosing
one file.  I have a directory of thumbs named "images" and a directory
called "big" with text files and Full images.  If I was to delete the
file
"image1.jpg" I want it to delete "image1.jpg" in the images, the big
folder
and "image1.jpg.txt" in the big folder.  I have now in my code.
($file = file to be deleted)

   if($action=="dele" && $confirm==1) {
   $match=array(); 
// Create an array of files
  $match[]=$file; 
// Put filename in the array
   
  $dirHandle = dir('../'); 
// get recursive directory listing from the directory above
  while($fileHandle = $dirHandle->read()) { 
// while reading the directory
    $delFile = strrchr($fileHandle, "/"); 
// get the filename after the last "/"
    if (in_array(substr($delFile,0,5), $match)) { 
// this line compares the 5 first chars in the filename 
// with the names in the $match array 
// Next line is line 36
    unlink($delFile); $action="";} 
// delete all files that match the filename
      if (unlink($delFile)) { 
          echo "Removed the file $fileHandle<br> \n"; 
      } 
    } 
  }

The first error I get:
Warning: unlink(): No such file or directory in
/home/www/mathiu1i/php/gallerie/edit2.php on line 36


TIA
------------------------------------
Eleno Davila
[EMAIL PROTECTED]
(877)933-6750 Ext�163 (direct line)
http://plasticsurgery.com�

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I'm not understanding the logic in all the loops and such here. And why comparing the 
first 5 characters?  That seems kind of dangerous.

Why don't you pass the name of the main file ($file = "image1.jpg" for example) then:

1. unlink $file in images
2. unlink $file in big
3. unlink $file . ".txt" in big

I don't follow the logic of looping through the files in a folder unless you might 
have other files associated with the image+thumbnail+descriptionfile that you can't 
anticipate.  In which case, I wouldn't check the first 5 characters, I'd check:

If (Mid($FileInDir,0,strlen($FileToDelete)) = $FileToDelete) unlink($FileInDir);


Then you're checking the full "image1.jpg" and not "image" (first 5 characters... What 
happens if you have an "image2.jpg", does it and it's associated thumbnail and 
description files get deleted too?)


I only gave this script a cursory look-over, so forgive me if I missed something, but 
by the comments and the quick glance of the code, I'm assuming that I understand 
what's going on.

-TG


> -----Original Message-----
> From: Lenny Davila [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 16, 2004 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Multiple file Delete
> 
> 
> I need to be able to delete multiple files from my web server 
> by choosing one file.  I have a directory of thumbs named
> "images" and a directory called "big" with text files and
> Full images.  If I was to delete the file "image1.jpg" I
> want it to delete "image1.jpg" in the images, the big folder
> and "image1.jpg.txt" in the big folder.  I have now in my code.
> ($file = file to be deleted)
> 
>    if($action=="dele" && $confirm==1) {
>    $match=array(); 
> // Create an array of files
>   $match[]=$file; 
> // Put filename in the array
>    
>   $dirHandle = dir('../'); 
> // get recursive directory listing from the directory above
>   while($fileHandle = $dirHandle->read()) { 
> // while reading the directory
>     $delFile = strrchr($fileHandle, "/"); 
> // get the filename after the last "/"
>     if (in_array(substr($delFile,0,5), $match)) { 
> // this line compares the 5 first chars in the filename 
> // with the names in the $match array 
> // Next line is line 36
>     unlink($delFile); $action="";} 
> // delete all files that match the filename
>       if (unlink($delFile)) { 
>           echo "Removed the file $fileHandle<br> \n"; 
>       } 
>     } 
>   }
> 
> The first error I get:
> Warning: unlink(): No such file or directory in
> /home/www/mathiu1i/php/gallerie/edit2.php on line 36
> 
> 
> TIA
> ------------------------------------
> Eleno Davila
> [EMAIL PROTECTED]
> (877)933-6750 Ext�163 (direct line)
> http://plasticsurgery.com�

--- End Message ---
--- Begin Message ---
I have a script that asks a user to login using an ID and password, it then
displays a login menu based on the users access type.



This script works on another machine, but I have attempted to set up PHP on
two new machines and keep getting the same problem.



The script runs but when the user types in their data and clicks the
continue button the parameters being input into the script do change but it
looks like it is being ignored.

 e.g

            Calling the page for the first time works:

                        http://160.221.21.129/timelog/index.php



            Self-calling with the additional user_id parameter set results
in the login screen being shown again!

                        http://160.221.21.129/timelog/?user_id=99999

This should now show the users menu options. (As on the other system!)



If I don't put in a user Id and password the screen is updated to reflect
this, I don't understand this as again this is calling itself to perform
this change.



My script is included below, any help would be much appreciated:



<?php

// (Re-)Start the session handler

session_start();



include ( $to_root.'scripts_php/common.php' );



if ( isset ($_GET['LOGOUT']) ) {

            $_SESSION = array();

            header ('Location: http://'.$thiswebsite);

}



// Get the task_id, if supplied

$task_id = trim ($_REQUEST['task_id']);



$errormsg = '';

// Login requested?

if ( $_POST['login'] == 'Click To Login' ) {

            $username = trim ($_POST['username']);

            $f_username = fixquotes ($username); // fixed for SQL statements

            $passwd = trim ($_POST['passwd']);

//            $f_passwd = fixquotes (md5 ($passwd)); // fixed for SQL
statements

            $f_passwd = fixquotes ($passwd); // fixed for SQL statements



            // Error check the form data

            if ( strlen ($username) == 0 ) {

                        $errormsg .= 'You must supply a username in the form
<em>Lastname Firstname</em>.<br />';

            }

            if ( strlen ($passwd) == 0 ) {

                        $errormsg .= 'You must supply a password.<br />';

            }



            $allok = ( strlen ($errormsg) > 0 ) ? false : true;

            if ( $allok ) {

                        // Check that supplied data is valid

                        $sql = "

                        SELECT UserID,UserName,UserType,LastLogin FROM
userlog

                        WHERE UserName='$f_username' AND
UserPassword='$f_passwd'

                        ";

                        $rs = @mysql_query ($sql);

                        if ( !$rs ) {

                                    $errormsg .= 'There was a problem
accessing the database.<br />';

                        }

                        elseif ( mysql_num_rows ($rs) != 1 ) {

                                    // Details not OK - error

                                    $errormsg .= 'Username and/or password
supplied was incorrect.<br />';

                        } else {

                                    // Details OK - process login

                                    $_SESSION['LoggedIn'] = true;

                                    $row = mysql_fetch_object ($rs);

                                    $_SESSION['User_ID'] = $row->UserID;

                                    $_SESSION['User_NAME'] = $row->UserName;

                                    $_SESSION['User_TYPE'] = $row->UserType;

                                    $_SESSION['LastLogin'] =
$row->LastLogin;

                                    header ('Location:
http://'.$thiswebsite.'?user_id='.$row->UserID);

                        }

            }

}

// End of Login requested?

?>

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml";>

<head>

<title>Time Reporting Website</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />



<!-- Honeywell Intranet Template Header Files -->

<link rel=stylesheet type='text/css'
href="http://my.honeywell.com/inc/styleurl.css";>

<script language="JavaScript"
src="http://my.honeywell.com/inc/properties.js";></script>

<script language='JavaScript'
src='http://my.honeywell.com/inc/framed.js'></script>

<script language='JavaScript'
src='http://my.honeywell.com/inc/left_framed.js'></script>

<!-- End of Honeywell Intranet Template Header Files -->



<? include ( 'metas.php' ); ?>



<script language="JavaScript" type="text/JavaScript">

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();

}

MM_reloadPage(true);

//-->

</script>

</head>



<body>



<div id="logo">Time<br />Reporting<br />System</div>



<!-- Honeywell Intranet Template Top Row -->

<script language="JavaScript"
src="http://my.honeywell.com/inc/globalnav.js";></script>

<!-- End of Honeywell Intranet Template Top Row -->



<!-- Honeywell Intranet Template Left Navigation List -->

<script language="JavaScript"
src="http://my.honeywell.com/inc/menuload_url.js";></script>

<script language="JavaScript">

// Change this value to highlight required link in menu

if ( LoggedIn == "1" ) {

            honeywell.list.selItem=0;

} else {

            honeywell.list.selItem=0;

}

</script>

<script language="JavaScript"
src="http://my.honeywell.com/inc/leftmenu_div.js";></script>

<!-- End of Honeywell Intranet Template Left Navigation List -->



<div id="container">



<?php

// Check for Login parameter

if ( $_SESSION['LoggedIn'] ) {

?>



  <h3>Utilities available to <?php echo $_SESSION['User_NAME'] ?>.</h3>

  <p><hr>

  <table bgcolor="gray" width="70%" border="0" cellspacing="4"
cellpadding="4"><tr><td>

  <p><font color="blue"><h4>OPTIONS:</h4></font><p>

<?php





            switch ( $_SESSION['User_TYPE'] ) {

                        case 'viewer':

                                    echo '

                                    <a href="#" onclick="openwin
(\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15,20)">Enter
time against projects.</a>';

                                    echo ( is_numeric ($user_id) ) ? '
(user_'.$user_id.' pre-selected)' : '';

                                    echo '

                                    </p>

                                    <p>

                                    <a href="#" onclick="openwin
(\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,15,20)">View
Status reports.</a>';

                                    echo ( is_numeric ($user_id) ) ? '
(user_'.$user_id.' pre-selected)' : '';

            echo '

                                    </p><hr><p>

                                    ';

                                    echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',true,700,525,15
,20)">Change Password.</a></p>

                                    ';

            echo '

                                    </p></table>

                                    ';

                                    break;



                        case 'inputer':

                                    echo '

                                    <a href="#" onclick="openwin
(\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15,20)">Enter
time against projects.</a>';

            echo ( is_numeric ($user_id) ) ? ' (user_'.$user_id.'
pre-selected)' : '';

            echo '

                                    </p>

                                    <p>

                                    <a href="#" onclick="openwin
(\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,15,20)">View
Status reports.</a>';

                                    echo ( is_numeric ($user_id) ) ? '
(user_'.$user_id.' pre-selected)' : '';

            echo '

                                    </p><hr><p>

                                    ';

                                    echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',true,700,525,15
,20)">Change Password.</a></p>

                                    ';

            echo '

                                    </p></table>

                                    <p>

                                    ';

                                    break;



                        case 'admin':

                                    echo '

                                    <a href="#" onclick="openwin
(\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15,20)">Enter
time against projects.</a>';

            echo '

                                    </p>

                                    <p>

                                    <a href="#" onclick="openwin
(\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,15,20)">View
Status reports.</a>';

            echo '

                                    </p><p></table><hr><p>

                                    ';

            echo '<p><font color="blue"><h3>Administrative
Tasks:</h3></font><p>';

            echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=list\',\'list\',true,700,525,15
,20)">Search for an IDWeb User ID.</a></p></table>

                                    ';

                                    echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',true,700,525,15
,20)">Change Local User Password.</a></p>

                                    ';

            echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=type\',\'type\',true,700,525,15
,20)">Change Local User Type.</a></p>

                                    ';

            echo '

                                    <a href="#" onclick="openwin
(\'admin.php?user_id='.$user_id.'&admin_type=new\',\'new\',true,700,525,15,2
0)">Add a New Local User.</a></p></table>

                                    ';



                                    break;



                        default:

                                    echo '

                                    <p class="errormsg">You have an
unrecognised user type. There are no utilities available to you.</p>

                                    ';

            }

?>

  <hr>

  <h4>Last Logged in on: <?php echo $_SESSION['LastLogin'] ?>.</h4>

<?PHP

//Save Login-Time to the User-Log table

  $now = date ('Y-m-d H:i:s');

  $sql = "UPDATE UserLog SET LastLogin = '$now' WHERE UserID=$user_id";

  $rs = @mysql_query ($sql);



} else {

?>



  <h3>Please login to access the Time Logging system.</h3>



  <form name="loginform" action="<?php echo $PHP_SELF ?>" method="post">

    <input type="hidden" name="task_id" value="<?php echo $task_id ?>" />

    <table width="550" border="0" cellspacing="0" cellpadding="4">

            <caption><?php echo '<span
class="errormsg">'.$row->UserID.$row->UserPassword.$errormsg.'</span>'
?></caption>

      <tr>

        <td>Username: </td>

        <td><input type="text" name="username" tabindex="1" value="<?php
echo $username ?>" /></td>

      </tr>

      <tr>

        <td>Password: </td>

        <td><input type="password" name="passwd" tabindex="2" /></td>

      </tr>

      <tr>

        <td colspan="2"><div align="center">

            <input type="submit" name="login" value="Click To Login"
tabindex="3" />

          </div></td>

      </tr>

    </table>

  </form>



<?php



}

// End of Check for Login parameter

?>



<!-- Footer section - do not touch -->

  <p>

    <script language="JavaScript"
src="http://my.honeywell.com/inc/footer_url.js";></script>

    <script language="JavaScript" src="<? echo $to_root
?>content_owner.js"></script>

  </p>

<!-- End of Footer section - do not touch -->

</div>

</body>

</html>

--- End Message ---
--- Begin Message ---
I don't see any $_GET['User_ID'] statements anywhere.  When you pass a
value via the URL like "scriptname.php?userid=9999", you either need to
use $_GET[] or $_REQUEST[] to retrieve the data.  That could be why it's
being 'ignored'

-TG

> -----Original Message-----
> From: Garry Grierson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 17, 2004 7:25 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Self-calling script problem.
> 
> 
> 
> I have a script that asks a user to login using an ID and 
> password, it then
> displays a login menu based on the users access type.
> 
> 
> 
> This script works on another machine, but I have attempted to 
> set up PHP on
> two new machines and keep getting the same problem.
> 
> 
> 
> The script runs but when the user types in their data and clicks the
> continue button the parameters being input into the script do 
> change but it
> looks like it is being ignored.
> 
>  e.g
> 
>             Calling the page for the first time works:
> 
>                         http://160.221.21.129/timelog/index.php
> 
> 
> 
>             Self-calling with the additional user_id 
> parameter set results
> in the login screen being shown again!
> 
>                         http://160.221.21.129/timelog/?user_id=99999
> 
> This should now show the users menu options. (As on the other system!)
> 
> 
> 
> If I don't put in a user Id and password the screen is 
> updated to reflect
> this, I don't understand this as again this is calling itself 
> to perform
> this change.
> 
> 
> 
> My script is included below, any help would be much appreciated:
> 
> 
> 
> <?php
> 
> // (Re-)Start the session handler
> 
> session_start();
> 
> 
> 
> include ( $to_root.'scripts_php/common.php' );
> 
> 
> 
> if ( isset ($_GET['LOGOUT']) ) {
> 
>             $_SESSION = array();
> 
>             header ('Location: http://'.$thiswebsite);
> 
> }
> 
> 
> 
> // Get the task_id, if supplied
> 
> $task_id = trim ($_REQUEST['task_id']);
> 
> 
> 
> $errormsg = '';
> 
> // Login requested?
> 
> if ( $_POST['login'] == 'Click To Login' ) {
> 
>             $username = trim ($_POST['username']);
> 
>             $f_username = fixquotes ($username); // fixed for 
> SQL statements
> 
>             $passwd = trim ($_POST['passwd']);
> 
> //            $f_passwd = fixquotes (md5 ($passwd)); // fixed for SQL
> statements
> 
>             $f_passwd = fixquotes ($passwd); // fixed for SQL 
> statements
> 
> 
> 
>             // Error check the form data
> 
>             if ( strlen ($username) == 0 ) {
> 
>                         $errormsg .= 'You must supply a 
> username in the form
> <em>Lastname Firstname</em>.<br />';
> 
>             }
> 
>             if ( strlen ($passwd) == 0 ) {
> 
>                         $errormsg .= 'You must supply a 
> password.<br />';
> 
>             }
> 
> 
> 
>             $allok = ( strlen ($errormsg) > 0 ) ? false : true;
> 
>             if ( $allok ) {
> 
>                         // Check that supplied data is valid
> 
>                         $sql = "
> 
>                         SELECT UserID,UserName,UserType,LastLogin FROM
> userlog
> 
>                         WHERE UserName='$f_username' AND
> UserPassword='$f_passwd'
> 
>                         ";
> 
>                         $rs = @mysql_query ($sql);
> 
>                         if ( !$rs ) {
> 
>                                     $errormsg .= 'There was a problem
> accessing the database.<br />';
> 
>                         }
> 
>                         elseif ( mysql_num_rows ($rs) != 1 ) {
> 
>                                     // Details not OK - error
> 
>                                     $errormsg .= 'Username 
> and/or password
> supplied was incorrect.<br />';
> 
>                         } else {
> 
>                                     // Details OK - process login
> 
>                                     $_SESSION['LoggedIn'] = true;
> 
>                                     $row = mysql_fetch_object ($rs);
> 
>                                     $_SESSION['User_ID'] = 
> $row->UserID;
> 
>                                     $_SESSION['User_NAME'] = 
> $row->UserName;
> 
>                                     $_SESSION['User_TYPE'] = 
> $row->UserType;
> 
>                                     $_SESSION['LastLogin'] =
> $row->LastLogin;
> 
>                                     header ('Location:
> http://'.$thiswebsite.'?user_id='.$row->UserID);
> 
>                         }
> 
>             }
> 
> }
> 
> // End of Login requested?
> 
> ?>
> 
> <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> 
> <html xmlns="http://www.w3.org/1999/xhtml";>
> 
> <head>
> 
> <title>Time Reporting Website</title>
> 
> <meta http-equiv="Content-Type" content="text/html; 
> charset=iso-8859-1" />
> 
> 
> 
> <!-- Honeywell Intranet Template Header Files -->
> 
> <link rel=stylesheet type='text/css'
> href="http://my.honeywell.com/inc/styleurl.css";>
> 
> <script language="JavaScript"
> src="http://my.honeywell.com/inc/properties.js";></script>
> 
> <script language='JavaScript'
> src='http://my.honeywell.com/inc/framed.js'></script>
> 
> <script language='JavaScript'
> src='http://my.honeywell.com/inc/left_framed.js'></script>
> 
> <!-- End of Honeywell Intranet Template Header Files -->
> 
> 
> 
> <? include ( 'metas.php' ); ?>
> 
> 
> 
> <script language="JavaScript" type="text/JavaScript">
> 
> <!--
> 
> function MM_reloadPage(init) {  //reloads the window if Nav4 resized
> 
>   if (init==true) with (navigator) {if
> ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
> 
>     document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
> onresize=MM_reloadPage; }}
> 
>   else if (innerWidth!=document.MM_pgW || 
> innerHeight!=document.MM_pgH)
> location.reload();
> 
> }
> 
> MM_reloadPage(true);
> 
> //-->
> 
> </script>
> 
> </head>
> 
> 
> 
> <body>
> 
> 
> 
> <div id="logo">Time<br />Reporting<br />System</div>
> 
> 
> 
> <!-- Honeywell Intranet Template Top Row -->
> 
> <script language="JavaScript"
> src="http://my.honeywell.com/inc/globalnav.js";></script>
> 
> <!-- End of Honeywell Intranet Template Top Row -->
> 
> 
> 
> <!-- Honeywell Intranet Template Left Navigation List -->
> 
> <script language="JavaScript"
> src="http://my.honeywell.com/inc/menuload_url.js";></script>
> 
> <script language="JavaScript">
> 
> // Change this value to highlight required link in menu
> 
> if ( LoggedIn == "1" ) {
> 
>             honeywell.list.selItem=0;
> 
> } else {
> 
>             honeywell.list.selItem=0;
> 
> }
> 
> </script>
> 
> <script language="JavaScript"
> src="http://my.honeywell.com/inc/leftmenu_div.js";></script>
> 
> <!-- End of Honeywell Intranet Template Left Navigation List -->
> 
> 
> 
> <div id="container">
> 
> 
> 
> <?php
> 
> // Check for Login parameter
> 
> if ( $_SESSION['LoggedIn'] ) {
> 
> ?>
> 
> 
> 
>   <h3>Utilities available to <?php echo 
> $_SESSION['User_NAME'] ?>.</h3>
> 
>   <p><hr>
> 
>   <table bgcolor="gray" width="70%" border="0" cellspacing="4"
> cellpadding="4"><tr><td>
> 
>   <p><font color="blue"><h4>OPTIONS:</h4></font><p>
> 
> <?php
> 
> 
> 
> 
> 
>             switch ( $_SESSION['User_TYPE'] ) {
> 
>                         case 'viewer':
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15
> ,20)">Enter
> time against projects.</a>';
> 
>                                     echo ( is_numeric ($user_id) ) ? '
> (user_'.$user_id.' pre-selected)' : '';
> 
>                                     echo '
> 
>                                     </p>
> 
>                                     <p>
> 
>                                     <a href="#" onclick="openwin
> (\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,1
> 5,20)">View
> Status reports.</a>';
> 
>                                     echo ( is_numeric ($user_id) ) ? '
> (user_'.$user_id.' pre-selected)' : '';
> 
>             echo '
> 
>                                     </p><hr><p>
> 
>                                     ';
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',t
rue,700,525,15
> ,20)">Change Password.</a></p>
> 
>                                     ';
> 
>             echo '
> 
>                                     </p></table>
> 
>                                     ';
> 
>                                     break;
> 
> 
> 
>                         case 'inputer':
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15
> ,20)">Enter
> time against projects.</a>';
> 
>             echo ( is_numeric ($user_id) ) ? ' (user_'.$user_id.'
> pre-selected)' : '';
> 
>             echo '
> 
>                                     </p>
> 
>                                     <p>
> 
>                                     <a href="#" onclick="openwin
> (\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,1
> 5,20)">View
> Status reports.</a>';
> 
>                                     echo ( is_numeric ($user_id) ) ? '
> (user_'.$user_id.' pre-selected)' : '';
> 
>             echo '
> 
>                                     </p><hr><p>
> 
>                                     ';
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',t
rue,700,525,15
> ,20)">Change Password.</a></p>
> 
>                                     ';
> 
>             echo '
> 
>                                     </p></table>
> 
>                                     <p>
> 
>                                     ';
> 
>                                     break;
> 
> 
> 
>                         case 'admin':
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'inputer.php?user_id='.$user_id.'\',\'work\',true,700,525,15
> ,20)">Enter
> time against projects.</a>';
> 
>             echo '
> 
>                                     </p>
> 
>                                     <p>
> 
>                                     <a href="#" onclick="openwin
> (\'status.php?user_id='.$user_id.'\',\'status\',true,700,525,1
> 5,20)">View
> Status reports.</a>';
> 
>             echo '
> 
>                                     </p><p></table><hr><p>
> 
>                                     ';
> 
>             echo '<p><font color="blue"><h3>Administrative
> Tasks:</h3></font><p>';
> 
>             echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=list\',\'list\',t
rue,700,525,15
> ,20)">Search for an IDWeb User ID.</a></p></table>
> 
>                                     ';
> 
>                                     echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=pass\',\'pass\',t
rue,700,525,15
> ,20)">Change Local User Password.</a></p>
> 
>                                     ';
> 
>             echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=type\',\'type\',t
rue,700,525,15
> ,20)">Change Local User Type.</a></p>
> 
>                                     ';
> 
>             echo '
> 
>                                     <a href="#" onclick="openwin
> (\'admin.php?user_id='.$user_id.'&admin_type=new\',\'new\',tru
e,700,525,15,2
> 0)">Add a New Local User.</a></p></table>
> 
>                                     ';
> 
> 
> 
>                                     break;
> 
> 
> 
>                         default:
> 
>                                     echo '
> 
>                                     <p class="errormsg">You have an
> unrecognised user type. There are no utilities available to you.</p>
> 
>                                     ';
> 
>             }
> 
> ?>
> 
>   <hr>
> 
>   <h4>Last Logged in on: <?php echo $_SESSION['LastLogin'] ?>.</h4>
> 
> <?PHP
> 
> //Save Login-Time to the User-Log table
> 
>   $now = date ('Y-m-d H:i:s');
> 
>   $sql = "UPDATE UserLog SET LastLogin = '$now' WHERE 
> UserID=$user_id";
> 
>   $rs = @mysql_query ($sql);
> 
> 
> 
> } else {
> 
> ?>
> 
> 
> 
>   <h3>Please login to access the Time Logging system.</h3>
> 
> 
> 
>   <form name="loginform" action="<?php echo $PHP_SELF ?>" 
> method="post">
> 
>     <input type="hidden" name="task_id" value="<?php echo 
> $task_id ?>" />
> 
>     <table width="550" border="0" cellspacing="0" cellpadding="4">
> 
>             <caption><?php echo '<span
> class="errormsg">'.$row->UserID.$row->UserPassword.$errormsg.'</span>'
> ?></caption>
> 
>       <tr>
> 
>         <td>Username: </td>
> 
>         <td><input type="text" name="username" tabindex="1" 
> value="<?php
> echo $username ?>" /></td>
> 
>       </tr>
> 
>       <tr>
> 
>         <td>Password: </td>
> 
>         <td><input type="password" name="passwd" tabindex="2" /></td>
> 
>       </tr>
> 
>       <tr>
> 
>         <td colspan="2"><div align="center">
> 
>             <input type="submit" name="login" value="Click To Login"
> tabindex="3" />
> 
>           </div></td>
> 
>       </tr>
> 
>     </table>
> 
>   </form>
> 
> 
> 
> <?php
> 
> 
> 
> }
> 
> // End of Check for Login parameter
> 
> ?>
> 
> 
> 
> <!-- Footer section - do not touch -->
> 
>   <p>
> 
>     <script language="JavaScript"
> src="http://my.honeywell.com/inc/footer_url.js";></script>
> 
>     <script language="JavaScript" src="<? echo $to_root
> ?>content_owner.js"></script>
> 
>   </p>
> 
> <!-- End of Footer section - do not touch -->
> 
> </div>
> 
> </body>
> 
> </html>
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---

Reply via email to