test7.php to HTML

index

USE AT OWN RISK

Generated: Tue Jul 31 15:22:17 2007 from test7.php 2005/08/11 5 KB bytes.


<html>

<head>

<title>test7.php</title>

</head>

<body background="images/lotus01.jpg" bgcolor="#0066cc">

<?php 
// this could be set from say a 'global.php' include ... which sets ...
$m_folder = 'images/.'; // set the images folder
$m_page = 0;
// $m_page = 8;
$m_case = 'flowers';
// $m_case = 'family';
$m_type = '*'; // '*' matches ALL (was '?'), assuming 'asterisk' allowed as param?
// $m_type = 'a'; // '*' matches ALL (was '?'), assuming 'asterisk' allowed as param?
$m_row_wrap = 3;
$m_max_out = 9;
// variables below filled in during running ...
$m_mostcnt = 0;
$m_mostrec = 0; // a file date time ... something, since the beginning of *nix!
$m_mostnam = ' ';
$m_mostarr = array();
$m_msg = ' ';

// get the page value, if any
if (isset($_GET['page'])) {
 $m_page = $_GET['page'];
}

// get the case value
if (isset($_GET['case'])) {
 $m_case = $_GET['case'];
}
if ($m_case == 'family') {
   // set DEFAULT for 'family' display
   $m_row_wrap = 5;
   $m_max_out = 10;
}

if (isset($_GET['type'])) {
 $m_type = $_GET['type'];
}
if (isset($_GET['wrap'])) {
 $m_row_wrap = $_GET['wrap'];
}
if (isset($_GET['max'])) {
 $m_max_out = $_GET['max'];
}

// menu
$m_n_case = 'family';
if ($m_case == 'family') {
 $m_n_case = 'flowers';
}

include ( "phpinc2.php" );

// start HTML output
print "<h1 align='center'>test7.php</h1>\r\n";

// out_the_menu2 ();
if ( $m_case == 'family' ) {
   getDirListDSC ($m_folder, &$m_mostrec, &$m_mostnam, &$m_mostcnt, &$m_mostarr, $m_type );
} else {
   // default is 'flowers'!
   getDirList2 ($m_folder, &$m_mostrec, &$m_mostnam, &$m_mostcnt, &$m_mostarr, $m_type );
}

// the directory, folder SCAN has been done ... the necessary 'files' have been collected
// sanity CHECK only
$imx = count ($m_mostarr);
if ($imx != $m_mostcnt) {
   print "<h1 align='center'>note: imx=$imx not equal m_mostcnt=$m_mostcnt sanity exceeded!</h1>\r\n";
}
// note: this imx count should/must equal $m_mostcnt, but NOT USED information

if ($imx > 0) {
   // we have FOUND an image count ... of this or that 'case' ... calculate PAGES available ...
   // establish PAGE menu ********************************************************************
   $mx_ot = $m_max_out;
   if ($mx_ot == -1) {
   $mx_ot = $imx;
   }
   $pgs = $imx / $mx_ot;
   settype($pgs, "int"); // reduce it to an integer 
   if ($imx % $mx_ot) { $pgs++; } // bump for any 'remainder' ...
   if ($pgs == 0) { $pgs++; } // make sure, at least ONE page ...
   if ($m_page > 0) { // ok, we WANT to display, GREATER than the LATEST page - rows x cols = max
   if ($m_max_out == -1) {
   // this is ALL ... overrides a PAGE display
   $m_page = 0; // set ZERO PAGE
   } elseif ($m_max_out > 0) {
   if ($m_page > $pgs ) { // can NOT have this
   $m_page = $pgs; // set the LAST PAGE DISPLAY
   }
   }
   }
   $msg = '<p align="center">Pages ';
   $msg .= "($pgs x $m_max_out): ";
   for ($i = 0; $i < $pgs; $i++) {
   if ( $m_page == $i ) {
   $msg .= '<b>' . add_bounds( $i ) . '</b>';
   } else {
   $msg .= add_href_page ( $i );
   }
   $msg .= " \r\n";
   }
   $msg .= '</p>';
   print add_g_span($msg)."\r\n"; // output the PAGES available ...
}


$d_msg = ordDirList2 ();

// $m_msg = add_g_span(add_p_center(get_case_menu()));
// print "$m_msg\r\n";

$m_msg = add_g_span(add_p_center(get_array_menu () .'<br>'. get_day_menu() .'<br>'. get_case_menu() ));
print "$m_msg\r\n";

$m_msg = add_g_span(add_p_center( get_curr_link(add_bold('Refresh')) . add_bounds(get_index_link()) ));
print "$m_msg\r\n";

print "$d_msg\r\n";

out_the_menu2 ();

if (isset($_REQUEST)) {
   if (isset($_REQUEST['show'])) {
   $m_show = $_REQUEST['show']; // lets fetch the variable: REQUEST works for both, POST and GET methods
   } else {
   $m_show = 'none';
   }
} else {
   $m_show = 'no request';
}
$m_msg = 'Value of show = ';
if (isset($m_show)) {
   $m_msg .= $m_show;
} else {
   $m_msg .= 'not set';
}

$m_msg .= ' Value of page = ';
if (isset($m_page)) {
   $m_msg .= $m_page;
} else {
   $m_msg .= 'not set';
}

print "$m_msg\r\n";

if ( $m_show == 'off' ) {
   $next_show = 'on';
} else {
   $next_show = 'off';
}
if ($m_page == 10) {
   $next_page = 20;
} else {
   $next_page = 10;
}

$m_msg = '';
if (isset($_SERVER)) {
   $m_msg .= "<p><a href='";
   $m_msg .= $_SERVER['PHP_SELF'];
   $m_msg .= '?';
   // $m_msg .= "refurl=";
   // $m_msg .= urlencode($_SERVER['REQUEST_URI']);
   // $m_msg .= '&';
   $m_msg .= "show=$next_show&page=$next_page'>Test Only</a></p>";
   $m_msg .= "\r\n";
   // $m_msg .= "<p>PHP_SELF: *". $_SERVER['PHP_SELF'] . "*\n";
   // $m_msg .= "<h1><a href='";
   // $m_msg .= $_SERVER['PHP_SELF'] . "?refurl=";
   // $m_msg .= urlencode($_SERVER['PHP_SELF']);
   // $m_msg .= "&show=on&page=999'>PHP HELP 2</a></h1>";
} else {
   $m_smg .= '<p>no $_SERVER! ...</p>';
}
print "$m_msg\r\n";

?>


<p>
End of test7.php
</p>

</body>
</html>

<!-- 11 August 2005 - test7.php Version 0.0.2 - friendofflowers.com - grm -->
 

index

Valid HTML 4.01 Transitional