From 23121588b43ba7098465e73b26e4dd942d38fd52 Mon Sep 17 00:00:00 2001 From: Rod Roark Date: Sat, 5 Nov 2011 17:04:35 -0700 Subject: [PATCH] Sort pages to match the original order in a displayed document. --- interface/fax/fax_dispatch.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/interface/fax/fax_dispatch.php b/interface/fax/fax_dispatch.php index 7edad809e..822cb3d95 100644 --- a/interface/fax/fax_dispatch.php +++ b/interface/fax/fax_dispatch.php @@ -723,23 +723,29 @@ while ($urow = sqlFetchArray($ures)) { \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
$page\n"; - echo " \n"; - echo " \n"; + $jpgarray[$matches[1]] = $jfname; } } closedir($dh); +// readdir does not read in any particular order, we must therefore sort +// by filename so the display order matches the original document. +ksort($jpgarray); +$page = 0; +foreach ($jpgarray as $jfnamebase => $jfname) { + ++$page; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
$page\n"; + echo " \n"; + echo " \n"; +} ?> -- 2.11.4.GIT