Forums
This topic is locked
Recordset Paging not working!
08 Nov 2002 04:53:17 E C posted:
Hi,I have a Move to Next and Previous Page "recordset paging" to display images where the image path is stored in MySQL and the image is stored in a folder.
MySQL query is based on titleID and directoryID of the table matching the titleID and the directoryID of the selected image...therefore displaying all the other images that are in the same photo album.
SELECT *
FROM Album_Photos
WHERE titleID = varTitleID AND directoryID = varDirectoryID
ORDER BY Album_Photos.imageID
When I click the Next button it doesnt send the information to display the rest of the results.
It is 4AM here so I am finding this a bit hard to explain!
The URL is : www.madpassion.com/admin/image.php?imageID=10 (you will have to click the change button for the thumbnails to come up...they dont show until the record is updated again)
I hope someone can shed some light on this.
Thanks
Replies
Replied 08 Nov 2002 14:50:28
08 Nov 2002 14:50:28 Ned Frankly replied:
It doesn't have anything to do with your query - the page seems to work fairly well, other than the previous and next. This page is not what MM intended (I think) for recordset paging - in other words, the previous and next that they supply is meant for a standard repeater, with a certain number of rows - if you're showing 10 rows, it adds 10 to an offset and shows the next 10.
Your next and previous always show the current record (your ID #'s in the link). You will need to manually code your Next and Previous, I fear. If you post the entire page we can see what portions of it are stock DMX code and what we have to work with on making your paging work.
Ned Frankly
www.nedfrankly.com
You think I ramble on HERE?
Your next and previous always show the current record (your ID #'s in the link). You will need to manually code your Next and Previous, I fear. If you post the entire page we can see what portions of it are stock DMX code and what we have to work with on making your paging work.
Ned Frankly
www.nedfrankly.com
You think I ramble on HERE?
Replied 13 Nov 2002 16:38:02
13 Nov 2002 16:38:02 E C replied:
I tried messing around with it and re did all my MySQL table to make the query simpler but alas I couldnt get it to work.
the page is really long and it is a work in progress (i seem to be creating more bugs than fixing them) so here goes:
<?php require_once('../Connections/localhost.php'); ?>
<?php require_once('../includes/functions.inc.php'); ?>
<?php
//load the tNG classes
require_once('../tNG/KT_tNG.inc.php');
?>
<?php
//start trigger AutoGen_DirectoryNew
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_AutoGen_DirectoryNew(&$tNG) {
$colNames = Array(('directoryDesc'));
$required = Array((true));
$regExp = Array(('(.|\n)*'));
$labels = Array(('Please enter a Directory name.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""
{
$tNG->setError(-1,$err);
}
}
//end trigger AutoGen_DirectoryNew
//start trigger AutoGen_DirectoryNew
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_AutoGen_DirectoryNew(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where directoryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger AutoGen_DirectoryNew
//start trigger AutoGen_TitleNew
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_AutoGen_TitleNew(&$tNG) {
$colNames = Array(('title'),('titleDesc'));
$required = Array((true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'));
$labels = Array(('Please enter a Title.'),('Please enter a Description.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""
{
$tNG->setError(-1,$err);
}
}
//end trigger AutoGen_TitleNew
//start trigger AutoGen_TitleNew
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_AutoGen_TitleNew(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where titleID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger AutoGen_TitleNew
//start trigger UniVal_InsertImage
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_InsertImage(&$tNG) {
$colNames = Array(('imagePath'));
$required = Array((true));
$regExp = Array(('(.|\n)*'));
$labels = Array(('Please select a file to upload.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""
{
$tNG->setError(-1,$err);
}
}
//end trigger UniVal_InsertImage
//start trigger RollBack_InsertImage
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_RollBack_InsertImage(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where galleryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger RollBack_InsertImage
//start trigger UniVal_InsertGallery
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_InsertGallery(&$tNG) {
$colNames = Array(('titleID'),('directoryID'));
$required = Array((true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'));
$labels = Array(('Please select an Album.'),('Please select a Directory.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""
{
$tNG->setError(-1,$err);
}
}
//end trigger UniVal_InsertGallery
//start trigger RollBack_InsertGallery
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_RollBack_InsertGallery(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where galleryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger RollBack_InsertGallery
//start trigger UniVal_ImageUpdate
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_ImageUpdate(&$tNG) {
$colNames = Array(('imagePath'),('imageDescription'),('imageKeywords'),('galleryID'),('imageID'));
$required = Array((false),(false),(false),(true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'));
$labels = Array(('The value of the field \'ImagePath\' is incorrect!'),('The value of the field \'ImageDescription\' is incorrect!'),('The value of the field \'ImageKeywords\' is incorrect!'),('Please select a gallery for your image.'),('Invalid Primary Key!'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""
{
$tNG->setError(-1,$err);
}
}
//end trigger UniVal_ImageUpdate
//start trigger RED_insert_image
//remove this line if you want to edit the code by hand
function KT_TriggerAFTER_RED_insert_image(&$tNG) {
global $HTTP_SERVER_VARS;
$insertGoTo = "../admin/image.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
$insertGoTo = KT_replaceParam($insertGoTo, 'imageID', $tNG->getRecordId());
KT_redir($insertGoTo);
}
//end trigger RED_insert_image
//start trigger SRF_UploadImage
//remove this line if you want to edit the code by hand
function KT_TriggerAFTER_SRF_UploadImage(&$tNG) {
$fileObject = func_get_arg(1);
$fileProcess = new FileUpload($tNG->recordId, 'images', '../' . 'Files/', $fileObject);
$errMsg = $fileProcess->processUploadedFile('1', '1', '1', '', '', '');
if ($errMsg) {
$tNG->setError(-1,$errMsg);
}
}
//end trigger SRF_UploadImage
// make an instance of the transaction object
$tNG_DirectoryNew = new KT_tNG();
// register to a connection
$tNG_DirectoryNew->setConnection($localhost);
// make an instance of the transaction object
$tNG_SelectDirectoryDelete = new KT_tNG();
// register to a connection
$tNG_SelectDirectoryDelete->setConnection($localhost);
// make an instance of the transaction object
$Image_Update = new KT_tNG();
// register to a connection
$Image_Update->setConnection($localhost);
// make an instance of the transaction object
$tNG_TitleNew = new KT_tNG();
// register to a connection
$tNG_TitleNew->setConnection($localhost);
// make an instance of the transaction object
$Insert_Image = new KT_tNG();
// register to a connection
$Insert_Image->setConnection($localhost);
// make an instance of the transaction object
$Insert_Gallery = new KT_tNG();
// register to a connection
$Insert_Gallery->setConnection($localhost);
// register the AutoGen_DirectoryNew trigger
$tNG_DirectoryNew->registerTrigger(BEFORE,'KT_TriggerBEFORE_AutoGen_DirectoryNew',1);
// register the AutoGen_DirectoryNew trigger
$tNG_DirectoryNew->registerTrigger(ERROR,'KT_TriggerERROR_AutoGen_DirectoryNew',0);
// register the AutoGen_TitleNew trigger
$tNG_TitleNew->registerTrigger(BEFORE,'KT_TriggerBEFORE_AutoGen_TitleNew',1);
// register the AutoGen_TitleNew trigger
$tNG_TitleNew->registerTrigger(ERROR,'KT_TriggerERROR_AutoGen_TitleNew',0);
// register the UniVal_InsertImage trigger
$Insert_Image->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_InsertImage',1);
// register the RollBack_InsertImage trigger
$Insert_Image->registerTrigger(ERROR,'KT_TriggerERROR_RollBack_InsertImage',0);
// register the UniVal_InsertGallery trigger
$Insert_Gallery->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_InsertGallery',1);
// register the RollBack_InsertGallery trigger
$Insert_Gallery->registerTrigger(ERROR,'KT_TriggerERROR_RollBack_InsertGallery',0);
// register the UniVal_ImageUpdate trigger
$Image_Update->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_ImageUpdate',1);
// register the RED_insert_image trigger
$Insert_Image->registerTrigger(AFTER,'KT_TriggerAFTER_RED_insert_image',10);
// register the SRF_UploadImage trigger
$Insert_Image->registerTrigger(AFTER,'KT_TriggerAFTER_SRF_UploadImage',1,$HTTP_POST_FILES['imagePath']);
//set the STARTER condition
$tNG_DirectoryNew->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,$HTTP_POST_VARS['MM_insertDirectory']);
$tNG_DirectoryNew->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$tNG_DirectoryNew->setTransactionType(INSERT_TYPE);
$tNG_DirectoryNew->setTable('Album_Directory');
$tNG_DirectoryNew->setColumnsName(Array(('directoryDesc')));
$tNG_DirectoryNew->setColumnsType(Array((STRING_TYPE)));
$tNG_DirectoryNew->setColumnsValue(Array(($HTTP_POST_VARS['directoryDesc'])));
//set the STARTER condition
$tNG_SelectDirectoryDelete->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,$HTTP_POST_VARS['deleteGallery'],(isset($HTTP_POST_VARS['deleteGallery']) ? $HTTP_POST_VARS['deleteGallery'] : null));
// set the autogeneration information
$tNG_SelectDirectoryDelete->setTransactionType(DELETE_TYPE);
$tNG_SelectDirectoryDelete->setTable('Album_Gallery');
$tNG_SelectDirectoryDelete->setUniqueKey('galleryID',$HTTP_POST_VARS['deleteGallery'],NUMERIC_TYPE);
//set the STARTER condition
$Image_Update->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_update']) ? $HTTP_POST_VARS['MM_update'] : null));
$Image_Update->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Image_Update->setTransactionType(UPDATE_TYPE);
$Image_Update->setTable('Album_Photos');
$Image_Update->setColumnsName(Array(('imageDescription'),('imageKeywords'),('galleryID'),('imageID')));
$Image_Update->setColumnsType(Array((STRING_TYPE),(STRING_TYPE),(NUMERIC_TYPE),(NUMERIC_TYPE)));
$Image_Update->setColumnsValue(Array(((isset($HTTP_POST_VARS['imageDescription']) ? $HTTP_POST_VARS['imageDescription'] : null)),((isset($HTTP_POST_VARS['imageKeywords']) ? $HTTP_POST_VARS['imageKeywords'] : null)),((isset($HTTP_POST_VARS['GalleryUpdate']) ? $HTTP_POST_VARS['GalleryUpdate'] : null)),((isset($HTTP_POST_VARS['imageID']) ? $HTTP_POST_VARS['imageID'] : null))));
$Image_Update->setUniqueKey('imageID',$HTTP_POST_VARS['imageID'],NUMERIC_TYPE);
//set the STARTER condition
$tNG_TitleNew->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insertTitle']) ? $HTTP_POST_VARS['MM_insertTitle'] : null));
$tNG_TitleNew->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$tNG_TitleNew->setTransactionType(INSERT_TYPE);
$tNG_TitleNew->setTable('Album_Title');
$tNG_TitleNew->setColumnsName(Array(('title'),('titleDesc')));
$tNG_TitleNew->setColumnsType(Array((STRING_TYPE),(STRING_TYPE)));
$tNG_TitleNew->setColumnsValue(Array(((isset($HTTP_POST_VARS['title']) ? $HTTP_POST_VARS['title'] : null)),((isset($HTTP_POST_VARS['titleDesc']) ? $HTTP_POST_VARS['titleDesc'] : null))));
//set the STARTER condition
$Insert_Image->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insert']) ? $HTTP_POST_VARS['MM_insert'] : null));
$Insert_Image->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Insert_Image->setTransactionType(INSERT_TYPE);
$Insert_Image->setTable('Album_Photos');
$Insert_Image->setColumnsName(Array(('imagePath')));
$Insert_Image->setColumnsType(Array((FILE_TYPE)));
$Insert_Image->setColumnsValue(Array(((isset($HTTP_POST_FILES['imagePath']['name']) ? $HTTP_POST_FILES['imagePath']['name'] : null))));
//set the STARTER condition
$Insert_Gallery->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insert_Gallery']) ? $HTTP_POST_VARS['MM_insert_Gallery'] : null));
$Insert_Gallery->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Insert_Gallery->setTransactionType(INSERT_TYPE);
$Insert_Gallery->setTable('Album_Gallery');
$Insert_Gallery->setColumnsName(Array(('titleID'),('directoryID')));
$Insert_Gallery->setColumnsType(Array((NUMERIC_TYPE),(NUMERIC_TYPE)));
$Insert_Gallery->setColumnsValue(Array(((isset($HTTP_POST_VARS['Gallery_titleID']) ? $HTTP_POST_VARS['Gallery_titleID'] : null)),((isset($HTTP_POST_VARS['Gallery_directoryID']) ? $HTTP_POST_VARS['Gallery_directoryID'] : null))));
// execute the transaction
$tNG_DirectoryNew->executeTransaction();
// execute the transaction
$tNG_SelectDirectoryDelete->executeTransaction();
// execute the transaction
$Image_Update->executeTransaction();
// execute the transaction
$tNG_TitleNew->executeTransaction();
// execute the transaction
$Insert_Image->executeTransaction();
// execute the transaction
$Insert_Gallery->executeTransaction();
if ((isset($HTTP_POST_VARS['selectTitleDelete'])) && ($HTTP_POST_VARS['selectTitleDelete'] != ""
) {
$deleteSQL = sprintf("DELETE FROM Album_Title WHERE titleID=%s",
GetSQLValueString($HTTP_POST_VARS['selectTitleDelete'], "int"
);
$Result1 = $localhost->Execute($deleteSQL) or die($localhost->ErrorMsg());
}
if ((isset($HTTP_POST_VARS['selectDirectoryDelete'])) && ($HTTP_POST_VARS['selectDirectoryDelete'] != ""
) {
$deleteSQL = sprintf("DELETE FROM Album_Directory WHERE directoryID=%s",
GetSQLValueString($HTTP_POST_VARS['selectDirectoryDelete'], "int"
);
$Result1 = $localhost->Execute($deleteSQL) or die($localhost->ErrorMsg());
}
// begin Recordset
$query_rsDirectories = "SELECT * FROM Album_Directory ORDER BY directoryDesc DESC";
$rsDirectories = $localhost->SelectLimit($query_rsDirectories) or die($localhost->ErrorMsg());
$totalRows_rsDirectories = $rsDirectories->RecordCount();
// end Recordset
// begin Recordset
$query_rsTitles = "SELECT * FROM Album_Title ORDER BY title DESC";
$rsTitles = $localhost->SelectLimit($query_rsTitles) or die($localhost->ErrorMsg());
$totalRows_rsTitles = $rsTitles->RecordCount();
// end Recordset
// begin Recordset
$varImageID__rsAlbum_Photos_Image = '0';
if (isset($HTTP_GET_VARS['imageID'])) {
$varImageID__rsAlbum_Photos_Image = $HTTP_GET_VARS['imageID'];
}
$query_rsAlbum_Photos_Image = sprintf("SELECT Album_Photos.imageID, Album_Photos.imagePath, Album_Photos.imageDescription, Album_Photos.imageKeywords, Album_Photos.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Photos, Album_Gallery, Album_Directory, Album_Title WHERE imageID = %s", $varImageID__rsAlbum_Photos_Image);
$rsAlbum_Photos_Image = $localhost->SelectLimit($query_rsAlbum_Photos_Image) or die($localhost->ErrorMsg());
$totalRows_rsAlbum_Photos_Image = $rsAlbum_Photos_Image->RecordCount();
// end Recordset
// default values for transaction tNG_DirectoryNew
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('directoryDesc', ""
;
}
// end default values for transaction tNG_DirectoryNew
// default values for transaction tNG_TitleNew
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('title', ""
;
$KT_fakeRs->PrepareValue('titleDesc', ""
;
}
// end default values for transaction tNG_TitleNew
// default values for transaction Insert_Image
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('imagePath', ""
;
}
// end default values for transaction Insert_Image
// default values for transaction Insert_Gallery
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('titleID', ""
;
$KT_fakeRs->PrepareValue('directoryID', ""
;
}
// end default values for transaction Insert_Gallery
// rebuild the query string by replacing pageNum and totalRows with the new values
$queryString_rsThumbs = KT_removeParam("&" . $HTTP_SERVER_VARS['QUERY_STRING'], "pageNum_rsThumbs"
;
$queryString_rsThumbs = KT_replaceParam($queryString_rsThumbs, "totalRows_rsThumbs", $totalRows_rsThumbs);
//Start Safe Recordset
if (!isset($KT_error)) {
$KT_error = false;
}
if(isset($KT_FormState) && $KT_FormState == "NEW"
$KT_error = true;
if (!$KT_error) {
$query_rsAlbum_Photos = "SELECT Album_Photos.imageID, Album_Photos.imagePath, Album_Photos.imageDescription, Album_Photos.imageKeywords, Album_Photos.galleryID, Album_Title.title, Album_Title.titleDesc, Album_Directory.directoryDesc, Album_Gallery.titleID, Album_Gallery.directoryID FROM Album_Photos, Album_Title, Album_Directory, Album_Gallery";
$rsAlbum_Photos = $localhost->SelectLimit($query_rsAlbum_Photos) or die($localhost->ErrorMsg());
$totalRows_rsAlbum_Photos = $rsAlbum_Photos->RecordCount();
} else {
$rsAlbum_Photos = &$KT_fakeRs;
}
//End Safe Recordset
// begin Recordset
$varGalleryID__rsGalleryDisplay = '0';
if (isset($galleryID)) {
$varGalleryID__rsGalleryDisplay = $galleryID;
}
$query_rsGalleryDisplay = sprintf("SELECT Album_Gallery.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Directory, Album_Title, Album_Gallery WHERE Album_Gallery.galleryID = %s AND Album_Gallery.titleID = Album_Title.titleID AND Album_Gallery.directoryID = Album_Directory.directoryID", $varGalleryID__rsGalleryDisplay);
$rsGalleryDisplay = $localhost->SelectLimit($query_rsGalleryDisplay) or die($localhost->ErrorMsg());
$totalRows_rsGalleryDisplay = $rsGalleryDisplay->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 2.0.73
// begin Recordset
$query_rsDirectories = "SELECT * FROM Album_Directory";
$rsDirectories = $localhost->SelectLimit($query_rsDirectories) or die($localhost->ErrorMsg());
$totalRows_rsDirectories = $rsDirectories->RecordCount();
// end Recordset
// begin Recordset
$query_rsTitles = "SELECT * FROM Album_Title";
$rsTitles = $localhost->SelectLimit($query_rsTitles) or die($localhost->ErrorMsg());
$totalRows_rsTitles = $rsTitles->RecordCount();
// end Recordset
// begin Recordset
$maxRows_rsThumbs = 10;
$pageNum_rsThumbs = 0;
if (isset($HTTP_GET_VARS['pageNum_rsThumbs'])) {
$pageNum_rsThumbs = $HTTP_GET_VARS['pageNum_rsThumbs'];
}
$startRow_rsThumbs = $pageNum_rsThumbs * $maxRows_rsThumbs;
$varGalleryID__rsThumbs = '0';
if (isset($galleryID)) {
$varGalleryID__rsThumbs = $galleryID;
}
$query_rsThumbs = sprintf("SELECT * FROM Album_Photos WHERE galleryID = %s ORDER BY Album_Photos.imageID", $varGalleryID__rsThumbs);
$rsThumbs = $localhost->SelectLimit($query_rsThumbs, $maxRows_rsThumbs, $startRow_rsThumbs) or die($localhost->ErrorMsg());
if (isset($HTTP_GET_VARS['totalRows_rsThumbs'])) {
$totalRows_rsThumbs = $HTTP_GET_VARS['totalRows_rsThumbs'];
} else {
$all_rsThumbs = $localhost->SelectLimit($query_rsThumbs) or die($localhost->ErrorMsg());
$totalRows_rsThumbs = $all_rsThumbs->RecordCount();
}
$totalPages_rsThumbs = (int)(($totalRows_rsThumbs-1)/$maxRows_rsThumbs);
// end Recordset
// begin Recordset
$query_rsGallery = "SELECT Album_Gallery.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Directory, Album_Title, Album_Gallery WHERE Album_Gallery.titleID = Album_Title.titleID AND Album_Gallery.directoryID = Album_Directory.directoryID";
$rsGallery = $localhost->SelectLimit($query_rsGallery) or die($localhost->ErrorMsg());
$totalRows_rsGallery = $rsGallery->RecordCount();
// end Recordset
?>
<html>
<head>
<title>Photography</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/blue1.css" rel="stylesheet" type="text/css">
<script language="JavaScript" 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];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('<?php echo $rsThumbs->Fields('imagePath'); ?>','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images')">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="180" valign="top" class="TableBorder1">Mad Passion</td>
<td width="415" valign="top" class="TableBorder1"><div align="center">Administration</div></td>
<td width="180" valign="top" class="TableBorder1"> </td>
</tr>
<tr>
<td colspan="3" valign="top" class="TableBorder2"><img src="../images/invis.gif" width="1" height="10"></td>
</tr>
<tr>
<td colspan="3" valign="top" class="TableBorder3"><img src="../images/invis.gif" width="1" height="5"></td>
</tr>
<tr>
<td colspan="3" valign="top"> <table cellspacing=0 cellpadding=0 border=0>
<tbody>
<tr>
<td width="180" rowspan="2" valign="TOP" class="NavLeftColumn"> <div align="left"></div>
<table id="Navigation" class="linkbox" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>About</th>
</tr>
</table>
<table width="100%" cellspacing="0" border="0" cellpadding="4">
<tr>
<td class="linkbox"><a href="about.php">Biography</a></td>
</tr>
<tr>
<td class="linkbox"><a href="contact.php">Contact</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th><font color="#FFFFFF">Galleries</font></th>
</tr>
</table>
<table cellspacing="0" border="0" cellpadding="6" width="100%">
<tr>
<td class="linkbox"><a href="image.php">Add Image </a></td>
</tr>
<tr>
<td class="linkbox"><a href="gallery.php">View Galleries</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Images</th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="linkbox"> <form method="post" enctype="multipart/form-data" name="insert_image" id="insert_image">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="baseline">
<td nowrap align="right"><div align="left">
<p>Add an image:</p>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="center">
<input type="file" name="imagePath" size="15">
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>
<input type="submit" name="MM_insert" value="Upload">
</p></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th class="linkbox">Directories</th>
</tr>
</table>
<form action="" method="post" name="formGalleryDelete" id="formGalleryDelete">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Delete Gallery:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="right">
<p align="center">
<select name="selectDeleteGallery" id="selectDeleteGallery">
<?php
while(!$rsGallery->EOF){
?>
<option value="<?php echo $rsGallery->Fields('galleryID')?>"<?php if (!(strcmp($rsGallery->Fields('galleryID'), $rsGallery->Fields('galleryID')))) {echo "SELECTED";} ?>><?php echo $rsGallery->Fields('directoryDesc')?>: <?php echo $rsGallery->Fields('title')?></option>
<?php
$rsGallery->MoveNext();
}
$rsGallery->MoveFirst();
?>
</select>
</p>
</div></td>
</tr>
<tr class="linkbox">
<td> <div align="right">
<p>
<input name="deleteGallery" type="hidden" value="<?php echo $rsGallery->Fields('galleryID'); ?>" id="deleteDirectoryID3">
<input name="DeleteGallery" type="submit" value="Delete" id="DeleteGallery">
</p>
</div></td>
</tr>
</table>
</form>
<form method="post" name="Gallery" id="Gallery" >
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="baseline">
<td nowrap align="right"><p align="left">Create a new
Gallery:</p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p align="left">Choose a Directory:
</p></td>
</tr>
<tr>
<td><div align="center">
<select name="Gallery_directoryID" id="Gallery_directoryID">
<option value=" ">Please Select</option>
<option value=" "></option>
<?php
while(!$rsDirectories->EOF){
?>
<option value="<?php echo $rsDirectories->Fields('directoryID')?>"><?php echo $rsDirectories->Fields('directoryDesc')?></option>
<?php
$rsDirectories->MoveNext();
}
$rsDirectories->MoveFirst();
?>
</select>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="baseline"><div align="left">
<p>Choose an Album: </p>
</div></td>
</tr>
<tr>
<td> <div align="center">
<select name="Gallery_titleID" id="select5">
<option value=" " <?php if (!(strcmp(" ", $rsAlbum_Photos->Fields('title')))) {echo "SELECTED";} ?>>Please
Select</option>
<?php
while(!$rsTitles->EOF){
?>
<option value="<?php echo $rsTitles->Fields('titleID')?>"<?php if (!(strcmp($rsTitles->Fields('titleID'), $rsAlbum_Photos->Fields('title')))) {echo "SELECTED";} ?>><?php echo $rsTitles->Fields('title')?></option>
<?php
$rsTitles->MoveNext();
}
$rsTitles->MoveFirst();
?>
</select>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="baseline"> <div align="right">
<p>
<input name="MM_insert_Gallery" type="submit" value="Create" id="MM_insert_Gallery">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formDirectoryDelete" id="formDirectoryDelete">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Delete a Directory:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="right">
<p align="center">
<select name="selectDirectoryDelete" id="select">
<?php
while(!$rsDirectories->EOF){
?>
<option value="<?php echo $rsDirectories->Fields('directoryID')?>"<?php if (!(strcmp($rsDirectories->Fields('directoryID'), $rsDirectories->Fields('directoryID')))) {echo "SELECTED";} ?>><?php echo $rsDirectories->Fields('directoryDesc')?></option>
<?php
$rsDirectories->MoveNext();
}
$rsDirectories->MoveFirst();
?>
</select>
</p>
</div></td>
</tr>
<tr class="linkbox">
<td> <div align="right">
<p>
<input name="deleteDirectoryID" type="hidden" value="<?php echo $rsDirectories->Fields('directoryID'); ?>" id="deleteDirectoryID">
<input name="DeleteDirectory" type="submit" value="Delete" id="DeleteDirectory">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formDirectoryNew" id="formDirectoryNew">
<table id="tableDirectory" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><div align="left">
<p>Create a Directory:</p>
</div></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="center">
<input name="directoryDesc" type="text" value="<?php echo $KT_fakeRs->Fields('directoryDesc')?>" size="26" id="directoryDesc">
</div></td>
</tr>
<tr class="linkbox">
<td><div align="right">
<p>
<input name="MM_insertDirectory" type="submit" value="Create" id="MM_insertDirectory">
</p>
</div></td>
</tr>
</table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th class="linkbox">Albums</th>
</tr>
</table>
<form action="" method="post" name="formTitleDelete" id="formTitleDelete">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td><p>Delete an Album:</p></td>
</tr>
<tr>
<td><p align="center">
<select name="selectTitleDelete" id="selectTitleDelete">
<?php
while(!$rsTitles->EOF){
?>
<option value="<?php echo $rsTitles->Fields('titleID')?>"<?php if (!(strcmp($rsTitles->Fields('titleID'), $rsTitles->Fields('titleID')))) {echo "SELECTED";} ?>><?php echo $rsTitles->Fields('title')?></option>
<?php
$rsTitles->MoveNext();
}
$rsTitles->MoveFirst();
?>
</select>
</p></td>
</tr>
<tr>
<td><div align="right">
<p>
<input name="deleteTitleID" type="hidden" value="<?php echo $rsTitles->Fields('titleID'); ?>" id="deleteTitleID">
<input name="DeleteAlbum" type="submit" value="Delete" id="DeleteAlbum">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formTitleNew" id="formTitleNew">
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Add a new Album:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="center">
<input name="title" type="text" value="<?php echo $KT_fakeRs->Fields('title')?>" size="24" id="title">
</div></td>
</tr>
<tr class="linkbox">
<td nowrap><p align="left">Album Description:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <p align="center">
<textarea name="titleDesc" cols="25" rows="3" wrap="VIRTUAL" id="textarea"><?php echo $KT_fakeRs->Fields('titleDesc')?></textarea>
</p></td>
</tr>
<tr class="linkbox">
<td nowrap><div align="right">
<p>
<input name="MM_insertTitle" type="submit" value="Create" id="MM_insertTitle">
</p>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<th width="400" height="20" class="TableMainCont"><font color="#FF0000">
<?php
if ($Insert_Image->getErrorNo()) {
?>
<?php
echo $Insert_Image->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($tNG_TitleNew->getErrorNo()) {
?>
<?php
echo $tNG_TitleNew->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($tNG_DirectoryNew->getErrorNo()) {
?>
<?php
echo $tNG_DirectoryNew->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($Insert_Gallery->getErrorNo()) {
?>
<?php
echo $Insert_Gallery->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($Image_Update->getErrorNo()) {
?>
<?php
echo $Image_Update->getErrorMsg();
?>
<?php
} // end Display Error
?>
</font></th>
<td width="180" rowspan="2" valign="TOP" class="NavLeftColumn"><br>
<?php if ($totalRows_rsThumbs > 0) { // Show if recordset not empty ?>
<table align="CENTER" id="TableThumbs" width="155" border="0" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF">
<tr>
<td> <div align="center">
<?php
while (!$rsThumbs->EOF) {
?>
<a href="image.php?imageID=<?php echo $rsThumbs->Fields('imageID'); ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image','','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images',1);MM_swapImage('Image','','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images',1)"><img alt="Click to update: <?php echo $rsThumbs->Fields('imageKeywords'); ?>" src="../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images" height="50" id="Thumbs" name="Thumbs" border="0"></a>
<?php
$rsThumbs->MoveNext();
}
?>
</div></td>
</tr>
</table>
<table align="CENTER" width="110" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <div align="center">
<table align="center" border="0" width="150" cellpadding="0" cellspacing="0">
<tr>
<td width="55" align="center"><?php if ($pageNum_rsThumbs > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsThumbs=%d%s", $HTTP_SERVER_VARS["PHP_SELF"], max(0, $pageNum_rsThumbs - 1), $queryString_rsThumbs); ?>">Previous</a>
<?php } // Show if not first page ?></td>
<td width="55" align="center"><?php if ($pageNum_rsThumbs < $totalPages_rsThumbs) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsThumbs=%d%s", $HTTP_SERVER_VARS["PHP_SELF"], min($totalPages_rsThumbs, $pageNum_rsThumbs + 1), $queryString_rsThumbs); ?>">Next</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
</div></td>
</tr>
</table>
<?php } // Show if recordset not empty ?> <p align="center"> </p></td>
</tr>
<tr>
<td valign="TOP" class="TableMainCont"> <div align="center">
<?php if ($totalRows_rsAlbum_Photos_Image == 0) { // Show if recordset empty ?>
<img src="../images/invis.gif" height="250" id="Image" name="Image">
<?php } // Show if recordset empty ?>
<?php if ($totalRows_rsAlbum_Photos_Image > 0) { // Show if recordset not empty ?>
<form method="POST" name="Image_Update" id="Image_Update" >
<img alt="<?php echo $rsAlbum_Photos_Image->Fields('imageKeywords'); ?>" src="../Files/<?php echo $rsAlbum_Photos_Image->Fields('imageID'); ?>__images" height="250" id="Image" name="Image">
<table align="center">
<tr valign="baseline">
<td nowrap align="right" valign="top"><p>Description:</p></td>
<td> <textarea name="imageDescription" cols="25" rows="5" wrap="VIRTUAL" id="imageDescription"><?php echo $rsAlbum_Photos_Image->Fields('imageDescription'); ?></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>Keywords:</p></td>
<td><input name="imageKeywords" type="text" value="<?php echo htmlentities($rsAlbum_Photos_Image->Fields('imageKeywords')); ?>" size="25" id="imageKeywords"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>Gallery:</p></td>
<td> <select name="GalleryUpdate" id="GalleryUpdate">
<option value="<?php echo $rsAlbum_Photos_Image->Fields('galleryID'); ?>"><?php echo $rsGalleryDisplay->Fields('directoryDesc')?>: <?php echo $rsGalleryDisplay->Fields('title'); ?></option>
<option value=" "></option>
<?php
while(!$rsGallery->EOF){
?>
<option value="<?php echo $rsGallery->Fields('galleryID')?>"><?php echo $rsGallery->Fields('directoryDesc')?>: <?php echo $rsGallery->Fields('title'); ?></option>
<?php
$rsGallery->MoveNext();
}
$rsGallery->MoveFirst();
?>
</select>
<input name="galleryID" type="hidden" value="<?php echo $rsAlbum_Photos_Image->Fields('galleryID'); ?>" id="galleryID">
</td>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" name="MM_update" value="Update Record"></td>
</tr>
</table>
<input name="imageID" type="hidden" value="<?php echo $rsAlbum_Photos_Image->Fields('imageID'); ?>" id="imageID">
<input name="MM_update" type="hidden" value="Image_Update" id="MM_update">
</form>
<?php } // Show if recordset not empty ?>
</div></td>
</tr>
<tr>
<td class="NavLeftColumn" valign=top> </td>
<td align="center" valign="TOP" class="TableMainCont"> </td>
<td class="NavRightColumn" align="center" valign=middle> </td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="3" valign="bottom" class="TableBorder3"><img src="../images/invis.gif" width="1" height="5"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" class="TableBorder2"><img src="../images/invis.gif" width="1" height="10"></td>
</tr>
<tr>
<td width="180" valign="bottom" class="TableBorder1"> </td>
<td width="415" valign="bottom" class="TableBorder1"> </td>
<td width="180" align="right" class="TableBorder1"> </td>
</tr>
</table>
</body>
</html>
<?php
$rsDirectories->Close();
$rsTitles->Close();
$rsAlbum_Photos_Image->Close();
$rsAlbum_Photos->Close();
$rsGalleryDisplay->Close();
$rsDirectories->Close();
$rsTitles->Close();
$rsThumbs->Close();
$rsGallery->Close();
?>
the page is really long and it is a work in progress (i seem to be creating more bugs than fixing them) so here goes:
<?php require_once('../Connections/localhost.php'); ?>
<?php require_once('../includes/functions.inc.php'); ?>
<?php
//load the tNG classes
require_once('../tNG/KT_tNG.inc.php');
?>
<?php
//start trigger AutoGen_DirectoryNew
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_AutoGen_DirectoryNew(&$tNG) {
$colNames = Array(('directoryDesc'));
$required = Array((true));
$regExp = Array(('(.|\n)*'));
$labels = Array(('Please enter a Directory name.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""

$tNG->setError(-1,$err);
}
}
//end trigger AutoGen_DirectoryNew
//start trigger AutoGen_DirectoryNew
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_AutoGen_DirectoryNew(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where directoryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger AutoGen_DirectoryNew
//start trigger AutoGen_TitleNew
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_AutoGen_TitleNew(&$tNG) {
$colNames = Array(('title'),('titleDesc'));
$required = Array((true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'));
$labels = Array(('Please enter a Title.'),('Please enter a Description.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""

$tNG->setError(-1,$err);
}
}
//end trigger AutoGen_TitleNew
//start trigger AutoGen_TitleNew
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_AutoGen_TitleNew(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where titleID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger AutoGen_TitleNew
//start trigger UniVal_InsertImage
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_InsertImage(&$tNG) {
$colNames = Array(('imagePath'));
$required = Array((true));
$regExp = Array(('(.|\n)*'));
$labels = Array(('Please select a file to upload.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""

$tNG->setError(-1,$err);
}
}
//end trigger UniVal_InsertImage
//start trigger RollBack_InsertImage
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_RollBack_InsertImage(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where galleryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger RollBack_InsertImage
//start trigger UniVal_InsertGallery
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_InsertGallery(&$tNG) {
$colNames = Array(('titleID'),('directoryID'));
$required = Array((true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'));
$labels = Array(('Please select an Album.'),('Please select a Directory.'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""

$tNG->setError(-1,$err);
}
}
//end trigger UniVal_InsertGallery
//start trigger RollBack_InsertGallery
//remove this line if you want to edit the code by hand
function KT_TriggerERROR_RollBack_InsertGallery(&$tNG) {
$keyQuote = $tNG->type2quote[NUMERIC_TYPE];
$sql = "delete from " . $tNG->getTable() . " where galleryID = " . $keyQuote . $tNG->getRecordId() . $keyQuote;
$tNG->connection->Execute($sql);
}
//end trigger RollBack_InsertGallery
//start trigger UniVal_ImageUpdate
//remove this line if you want to edit the code by hand
function KT_TriggerBEFORE_UniVal_ImageUpdate(&$tNG) {
$colNames = Array(('imagePath'),('imageDescription'),('imageKeywords'),('galleryID'),('imageID'));
$required = Array((false),(false),(false),(true),(true));
$regExp = Array(('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'));
$labels = Array(('The value of the field \'ImagePath\' is incorrect!'),('The value of the field \'ImageDescription\' is incorrect!'),('The value of the field \'ImageKeywords\' is incorrect!'),('Please select a gallery for your image.'),('Invalid Primary Key!'));
$uniVal = new UniValValidator($labels, $required, $regExp, $tNG->nameToValue, $colNames);
if (($err = $uniVal->validateFields()) != ""

$tNG->setError(-1,$err);
}
}
//end trigger UniVal_ImageUpdate
//start trigger RED_insert_image
//remove this line if you want to edit the code by hand
function KT_TriggerAFTER_RED_insert_image(&$tNG) {
global $HTTP_SERVER_VARS;
$insertGoTo = "../admin/image.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
$insertGoTo = KT_replaceParam($insertGoTo, 'imageID', $tNG->getRecordId());
KT_redir($insertGoTo);
}
//end trigger RED_insert_image
//start trigger SRF_UploadImage
//remove this line if you want to edit the code by hand
function KT_TriggerAFTER_SRF_UploadImage(&$tNG) {
$fileObject = func_get_arg(1);
$fileProcess = new FileUpload($tNG->recordId, 'images', '../' . 'Files/', $fileObject);
$errMsg = $fileProcess->processUploadedFile('1', '1', '1', '', '', '');
if ($errMsg) {
$tNG->setError(-1,$errMsg);
}
}
//end trigger SRF_UploadImage
// make an instance of the transaction object
$tNG_DirectoryNew = new KT_tNG();
// register to a connection
$tNG_DirectoryNew->setConnection($localhost);
// make an instance of the transaction object
$tNG_SelectDirectoryDelete = new KT_tNG();
// register to a connection
$tNG_SelectDirectoryDelete->setConnection($localhost);
// make an instance of the transaction object
$Image_Update = new KT_tNG();
// register to a connection
$Image_Update->setConnection($localhost);
// make an instance of the transaction object
$tNG_TitleNew = new KT_tNG();
// register to a connection
$tNG_TitleNew->setConnection($localhost);
// make an instance of the transaction object
$Insert_Image = new KT_tNG();
// register to a connection
$Insert_Image->setConnection($localhost);
// make an instance of the transaction object
$Insert_Gallery = new KT_tNG();
// register to a connection
$Insert_Gallery->setConnection($localhost);
// register the AutoGen_DirectoryNew trigger
$tNG_DirectoryNew->registerTrigger(BEFORE,'KT_TriggerBEFORE_AutoGen_DirectoryNew',1);
// register the AutoGen_DirectoryNew trigger
$tNG_DirectoryNew->registerTrigger(ERROR,'KT_TriggerERROR_AutoGen_DirectoryNew',0);
// register the AutoGen_TitleNew trigger
$tNG_TitleNew->registerTrigger(BEFORE,'KT_TriggerBEFORE_AutoGen_TitleNew',1);
// register the AutoGen_TitleNew trigger
$tNG_TitleNew->registerTrigger(ERROR,'KT_TriggerERROR_AutoGen_TitleNew',0);
// register the UniVal_InsertImage trigger
$Insert_Image->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_InsertImage',1);
// register the RollBack_InsertImage trigger
$Insert_Image->registerTrigger(ERROR,'KT_TriggerERROR_RollBack_InsertImage',0);
// register the UniVal_InsertGallery trigger
$Insert_Gallery->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_InsertGallery',1);
// register the RollBack_InsertGallery trigger
$Insert_Gallery->registerTrigger(ERROR,'KT_TriggerERROR_RollBack_InsertGallery',0);
// register the UniVal_ImageUpdate trigger
$Image_Update->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal_ImageUpdate',1);
// register the RED_insert_image trigger
$Insert_Image->registerTrigger(AFTER,'KT_TriggerAFTER_RED_insert_image',10);
// register the SRF_UploadImage trigger
$Insert_Image->registerTrigger(AFTER,'KT_TriggerAFTER_SRF_UploadImage',1,$HTTP_POST_FILES['imagePath']);
//set the STARTER condition
$tNG_DirectoryNew->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,$HTTP_POST_VARS['MM_insertDirectory']);
$tNG_DirectoryNew->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$tNG_DirectoryNew->setTransactionType(INSERT_TYPE);
$tNG_DirectoryNew->setTable('Album_Directory');
$tNG_DirectoryNew->setColumnsName(Array(('directoryDesc')));
$tNG_DirectoryNew->setColumnsType(Array((STRING_TYPE)));
$tNG_DirectoryNew->setColumnsValue(Array(($HTTP_POST_VARS['directoryDesc'])));
//set the STARTER condition
$tNG_SelectDirectoryDelete->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,$HTTP_POST_VARS['deleteGallery'],(isset($HTTP_POST_VARS['deleteGallery']) ? $HTTP_POST_VARS['deleteGallery'] : null));
// set the autogeneration information
$tNG_SelectDirectoryDelete->setTransactionType(DELETE_TYPE);
$tNG_SelectDirectoryDelete->setTable('Album_Gallery');
$tNG_SelectDirectoryDelete->setUniqueKey('galleryID',$HTTP_POST_VARS['deleteGallery'],NUMERIC_TYPE);
//set the STARTER condition
$Image_Update->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_update']) ? $HTTP_POST_VARS['MM_update'] : null));
$Image_Update->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Image_Update->setTransactionType(UPDATE_TYPE);
$Image_Update->setTable('Album_Photos');
$Image_Update->setColumnsName(Array(('imageDescription'),('imageKeywords'),('galleryID'),('imageID')));
$Image_Update->setColumnsType(Array((STRING_TYPE),(STRING_TYPE),(NUMERIC_TYPE),(NUMERIC_TYPE)));
$Image_Update->setColumnsValue(Array(((isset($HTTP_POST_VARS['imageDescription']) ? $HTTP_POST_VARS['imageDescription'] : null)),((isset($HTTP_POST_VARS['imageKeywords']) ? $HTTP_POST_VARS['imageKeywords'] : null)),((isset($HTTP_POST_VARS['GalleryUpdate']) ? $HTTP_POST_VARS['GalleryUpdate'] : null)),((isset($HTTP_POST_VARS['imageID']) ? $HTTP_POST_VARS['imageID'] : null))));
$Image_Update->setUniqueKey('imageID',$HTTP_POST_VARS['imageID'],NUMERIC_TYPE);
//set the STARTER condition
$tNG_TitleNew->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insertTitle']) ? $HTTP_POST_VARS['MM_insertTitle'] : null));
$tNG_TitleNew->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$tNG_TitleNew->setTransactionType(INSERT_TYPE);
$tNG_TitleNew->setTable('Album_Title');
$tNG_TitleNew->setColumnsName(Array(('title'),('titleDesc')));
$tNG_TitleNew->setColumnsType(Array((STRING_TYPE),(STRING_TYPE)));
$tNG_TitleNew->setColumnsValue(Array(((isset($HTTP_POST_VARS['title']) ? $HTTP_POST_VARS['title'] : null)),((isset($HTTP_POST_VARS['titleDesc']) ? $HTTP_POST_VARS['titleDesc'] : null))));
//set the STARTER condition
$Insert_Image->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insert']) ? $HTTP_POST_VARS['MM_insert'] : null));
$Insert_Image->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Insert_Image->setTransactionType(INSERT_TYPE);
$Insert_Image->setTable('Album_Photos');
$Insert_Image->setColumnsName(Array(('imagePath')));
$Insert_Image->setColumnsType(Array((FILE_TYPE)));
$Insert_Image->setColumnsValue(Array(((isset($HTTP_POST_FILES['imagePath']['name']) ? $HTTP_POST_FILES['imagePath']['name'] : null))));
//set the STARTER condition
$Insert_Gallery->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insert_Gallery']) ? $HTTP_POST_VARS['MM_insert_Gallery'] : null));
$Insert_Gallery->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$Insert_Gallery->setTransactionType(INSERT_TYPE);
$Insert_Gallery->setTable('Album_Gallery');
$Insert_Gallery->setColumnsName(Array(('titleID'),('directoryID')));
$Insert_Gallery->setColumnsType(Array((NUMERIC_TYPE),(NUMERIC_TYPE)));
$Insert_Gallery->setColumnsValue(Array(((isset($HTTP_POST_VARS['Gallery_titleID']) ? $HTTP_POST_VARS['Gallery_titleID'] : null)),((isset($HTTP_POST_VARS['Gallery_directoryID']) ? $HTTP_POST_VARS['Gallery_directoryID'] : null))));
// execute the transaction
$tNG_DirectoryNew->executeTransaction();
// execute the transaction
$tNG_SelectDirectoryDelete->executeTransaction();
// execute the transaction
$Image_Update->executeTransaction();
// execute the transaction
$tNG_TitleNew->executeTransaction();
// execute the transaction
$Insert_Image->executeTransaction();
// execute the transaction
$Insert_Gallery->executeTransaction();
if ((isset($HTTP_POST_VARS['selectTitleDelete'])) && ($HTTP_POST_VARS['selectTitleDelete'] != ""

$deleteSQL = sprintf("DELETE FROM Album_Title WHERE titleID=%s",
GetSQLValueString($HTTP_POST_VARS['selectTitleDelete'], "int"

$Result1 = $localhost->Execute($deleteSQL) or die($localhost->ErrorMsg());
}
if ((isset($HTTP_POST_VARS['selectDirectoryDelete'])) && ($HTTP_POST_VARS['selectDirectoryDelete'] != ""

$deleteSQL = sprintf("DELETE FROM Album_Directory WHERE directoryID=%s",
GetSQLValueString($HTTP_POST_VARS['selectDirectoryDelete'], "int"

$Result1 = $localhost->Execute($deleteSQL) or die($localhost->ErrorMsg());
}
// begin Recordset
$query_rsDirectories = "SELECT * FROM Album_Directory ORDER BY directoryDesc DESC";
$rsDirectories = $localhost->SelectLimit($query_rsDirectories) or die($localhost->ErrorMsg());
$totalRows_rsDirectories = $rsDirectories->RecordCount();
// end Recordset
// begin Recordset
$query_rsTitles = "SELECT * FROM Album_Title ORDER BY title DESC";
$rsTitles = $localhost->SelectLimit($query_rsTitles) or die($localhost->ErrorMsg());
$totalRows_rsTitles = $rsTitles->RecordCount();
// end Recordset
// begin Recordset
$varImageID__rsAlbum_Photos_Image = '0';
if (isset($HTTP_GET_VARS['imageID'])) {
$varImageID__rsAlbum_Photos_Image = $HTTP_GET_VARS['imageID'];
}
$query_rsAlbum_Photos_Image = sprintf("SELECT Album_Photos.imageID, Album_Photos.imagePath, Album_Photos.imageDescription, Album_Photos.imageKeywords, Album_Photos.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Photos, Album_Gallery, Album_Directory, Album_Title WHERE imageID = %s", $varImageID__rsAlbum_Photos_Image);
$rsAlbum_Photos_Image = $localhost->SelectLimit($query_rsAlbum_Photos_Image) or die($localhost->ErrorMsg());
$totalRows_rsAlbum_Photos_Image = $rsAlbum_Photos_Image->RecordCount();
// end Recordset
// default values for transaction tNG_DirectoryNew
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('directoryDesc', ""

}
// end default values for transaction tNG_DirectoryNew
// default values for transaction tNG_TitleNew
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('title', ""

$KT_fakeRs->PrepareValue('titleDesc', ""

}
// end default values for transaction tNG_TitleNew
// default values for transaction Insert_Image
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('imagePath', ""

}
// end default values for transaction Insert_Image
// default values for transaction Insert_Gallery
if (!isset($KT_fakeRs)) {
$KT_fakeRs = new fakeRecordSet();
$KT_fakeRs->PrepareValue('titleID', ""

$KT_fakeRs->PrepareValue('directoryID', ""

}
// end default values for transaction Insert_Gallery
// rebuild the query string by replacing pageNum and totalRows with the new values
$queryString_rsThumbs = KT_removeParam("&" . $HTTP_SERVER_VARS['QUERY_STRING'], "pageNum_rsThumbs"

$queryString_rsThumbs = KT_replaceParam($queryString_rsThumbs, "totalRows_rsThumbs", $totalRows_rsThumbs);
//Start Safe Recordset
if (!isset($KT_error)) {
$KT_error = false;
}
if(isset($KT_FormState) && $KT_FormState == "NEW"

if (!$KT_error) {
$query_rsAlbum_Photos = "SELECT Album_Photos.imageID, Album_Photos.imagePath, Album_Photos.imageDescription, Album_Photos.imageKeywords, Album_Photos.galleryID, Album_Title.title, Album_Title.titleDesc, Album_Directory.directoryDesc, Album_Gallery.titleID, Album_Gallery.directoryID FROM Album_Photos, Album_Title, Album_Directory, Album_Gallery";
$rsAlbum_Photos = $localhost->SelectLimit($query_rsAlbum_Photos) or die($localhost->ErrorMsg());
$totalRows_rsAlbum_Photos = $rsAlbum_Photos->RecordCount();
} else {
$rsAlbum_Photos = &$KT_fakeRs;
}
//End Safe Recordset
// begin Recordset
$varGalleryID__rsGalleryDisplay = '0';
if (isset($galleryID)) {
$varGalleryID__rsGalleryDisplay = $galleryID;
}
$query_rsGalleryDisplay = sprintf("SELECT Album_Gallery.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Directory, Album_Title, Album_Gallery WHERE Album_Gallery.galleryID = %s AND Album_Gallery.titleID = Album_Title.titleID AND Album_Gallery.directoryID = Album_Directory.directoryID", $varGalleryID__rsGalleryDisplay);
$rsGalleryDisplay = $localhost->SelectLimit($query_rsGalleryDisplay) or die($localhost->ErrorMsg());
$totalRows_rsGalleryDisplay = $rsGalleryDisplay->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 2.0.73
// begin Recordset
$query_rsDirectories = "SELECT * FROM Album_Directory";
$rsDirectories = $localhost->SelectLimit($query_rsDirectories) or die($localhost->ErrorMsg());
$totalRows_rsDirectories = $rsDirectories->RecordCount();
// end Recordset
// begin Recordset
$query_rsTitles = "SELECT * FROM Album_Title";
$rsTitles = $localhost->SelectLimit($query_rsTitles) or die($localhost->ErrorMsg());
$totalRows_rsTitles = $rsTitles->RecordCount();
// end Recordset
// begin Recordset
$maxRows_rsThumbs = 10;
$pageNum_rsThumbs = 0;
if (isset($HTTP_GET_VARS['pageNum_rsThumbs'])) {
$pageNum_rsThumbs = $HTTP_GET_VARS['pageNum_rsThumbs'];
}
$startRow_rsThumbs = $pageNum_rsThumbs * $maxRows_rsThumbs;
$varGalleryID__rsThumbs = '0';
if (isset($galleryID)) {
$varGalleryID__rsThumbs = $galleryID;
}
$query_rsThumbs = sprintf("SELECT * FROM Album_Photos WHERE galleryID = %s ORDER BY Album_Photos.imageID", $varGalleryID__rsThumbs);
$rsThumbs = $localhost->SelectLimit($query_rsThumbs, $maxRows_rsThumbs, $startRow_rsThumbs) or die($localhost->ErrorMsg());
if (isset($HTTP_GET_VARS['totalRows_rsThumbs'])) {
$totalRows_rsThumbs = $HTTP_GET_VARS['totalRows_rsThumbs'];
} else {
$all_rsThumbs = $localhost->SelectLimit($query_rsThumbs) or die($localhost->ErrorMsg());
$totalRows_rsThumbs = $all_rsThumbs->RecordCount();
}
$totalPages_rsThumbs = (int)(($totalRows_rsThumbs-1)/$maxRows_rsThumbs);
// end Recordset
// begin Recordset
$query_rsGallery = "SELECT Album_Gallery.galleryID, Album_Gallery.titleID, Album_Gallery.directoryID, Album_Directory.directoryDesc, Album_Title.title FROM Album_Directory, Album_Title, Album_Gallery WHERE Album_Gallery.titleID = Album_Title.titleID AND Album_Gallery.directoryID = Album_Directory.directoryID";
$rsGallery = $localhost->SelectLimit($query_rsGallery) or die($localhost->ErrorMsg());
$totalRows_rsGallery = $rsGallery->RecordCount();
// end Recordset
?>
<html>
<head>
<title>Photography</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/blue1.css" rel="stylesheet" type="text/css">
<script language="JavaScript" 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("#"

}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('<?php echo $rsThumbs->Fields('imagePath'); ?>','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images')">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="180" valign="top" class="TableBorder1">Mad Passion</td>
<td width="415" valign="top" class="TableBorder1"><div align="center">Administration</div></td>
<td width="180" valign="top" class="TableBorder1"> </td>
</tr>
<tr>
<td colspan="3" valign="top" class="TableBorder2"><img src="../images/invis.gif" width="1" height="10"></td>
</tr>
<tr>
<td colspan="3" valign="top" class="TableBorder3"><img src="../images/invis.gif" width="1" height="5"></td>
</tr>
<tr>
<td colspan="3" valign="top"> <table cellspacing=0 cellpadding=0 border=0>
<tbody>
<tr>
<td width="180" rowspan="2" valign="TOP" class="NavLeftColumn"> <div align="left"></div>
<table id="Navigation" class="linkbox" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>About</th>
</tr>
</table>
<table width="100%" cellspacing="0" border="0" cellpadding="4">
<tr>
<td class="linkbox"><a href="about.php">Biography</a></td>
</tr>
<tr>
<td class="linkbox"><a href="contact.php">Contact</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th><font color="#FFFFFF">Galleries</font></th>
</tr>
</table>
<table cellspacing="0" border="0" cellpadding="6" width="100%">
<tr>
<td class="linkbox"><a href="image.php">Add Image </a></td>
</tr>
<tr>
<td class="linkbox"><a href="gallery.php">View Galleries</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Images</th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="linkbox"> <form method="post" enctype="multipart/form-data" name="insert_image" id="insert_image">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="baseline">
<td nowrap align="right"><div align="left">
<p>Add an image:</p>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="center">
<input type="file" name="imagePath" size="15">
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>
<input type="submit" name="MM_insert" value="Upload">
</p></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th class="linkbox">Directories</th>
</tr>
</table>
<form action="" method="post" name="formGalleryDelete" id="formGalleryDelete">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Delete Gallery:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="right">
<p align="center">
<select name="selectDeleteGallery" id="selectDeleteGallery">
<?php
while(!$rsGallery->EOF){
?>
<option value="<?php echo $rsGallery->Fields('galleryID')?>"<?php if (!(strcmp($rsGallery->Fields('galleryID'), $rsGallery->Fields('galleryID')))) {echo "SELECTED";} ?>><?php echo $rsGallery->Fields('directoryDesc')?>: <?php echo $rsGallery->Fields('title')?></option>
<?php
$rsGallery->MoveNext();
}
$rsGallery->MoveFirst();
?>
</select>
</p>
</div></td>
</tr>
<tr class="linkbox">
<td> <div align="right">
<p>
<input name="deleteGallery" type="hidden" value="<?php echo $rsGallery->Fields('galleryID'); ?>" id="deleteDirectoryID3">
<input name="DeleteGallery" type="submit" value="Delete" id="DeleteGallery">
</p>
</div></td>
</tr>
</table>
</form>
<form method="post" name="Gallery" id="Gallery" >
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="baseline">
<td nowrap align="right"><p align="left">Create a new
Gallery:</p></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p align="left">Choose a Directory:
</p></td>
</tr>
<tr>
<td><div align="center">
<select name="Gallery_directoryID" id="Gallery_directoryID">
<option value=" ">Please Select</option>
<option value=" "></option>
<?php
while(!$rsDirectories->EOF){
?>
<option value="<?php echo $rsDirectories->Fields('directoryID')?>"><?php echo $rsDirectories->Fields('directoryDesc')?></option>
<?php
$rsDirectories->MoveNext();
}
$rsDirectories->MoveFirst();
?>
</select>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="baseline"><div align="left">
<p>Choose an Album: </p>
</div></td>
</tr>
<tr>
<td> <div align="center">
<select name="Gallery_titleID" id="select5">
<option value=" " <?php if (!(strcmp(" ", $rsAlbum_Photos->Fields('title')))) {echo "SELECTED";} ?>>Please
Select</option>
<?php
while(!$rsTitles->EOF){
?>
<option value="<?php echo $rsTitles->Fields('titleID')?>"<?php if (!(strcmp($rsTitles->Fields('titleID'), $rsAlbum_Photos->Fields('title')))) {echo "SELECTED";} ?>><?php echo $rsTitles->Fields('title')?></option>
<?php
$rsTitles->MoveNext();
}
$rsTitles->MoveFirst();
?>
</select>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="baseline"> <div align="right">
<p>
<input name="MM_insert_Gallery" type="submit" value="Create" id="MM_insert_Gallery">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formDirectoryDelete" id="formDirectoryDelete">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Delete a Directory:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="right">
<p align="center">
<select name="selectDirectoryDelete" id="select">
<?php
while(!$rsDirectories->EOF){
?>
<option value="<?php echo $rsDirectories->Fields('directoryID')?>"<?php if (!(strcmp($rsDirectories->Fields('directoryID'), $rsDirectories->Fields('directoryID')))) {echo "SELECTED";} ?>><?php echo $rsDirectories->Fields('directoryDesc')?></option>
<?php
$rsDirectories->MoveNext();
}
$rsDirectories->MoveFirst();
?>
</select>
</p>
</div></td>
</tr>
<tr class="linkbox">
<td> <div align="right">
<p>
<input name="deleteDirectoryID" type="hidden" value="<?php echo $rsDirectories->Fields('directoryID'); ?>" id="deleteDirectoryID">
<input name="DeleteDirectory" type="submit" value="Delete" id="DeleteDirectory">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formDirectoryNew" id="formDirectoryNew">
<table id="tableDirectory" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><div align="left">
<p>Create a Directory:</p>
</div></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="center">
<input name="directoryDesc" type="text" value="<?php echo $KT_fakeRs->Fields('directoryDesc')?>" size="26" id="directoryDesc">
</div></td>
</tr>
<tr class="linkbox">
<td><div align="right">
<p>
<input name="MM_insertDirectory" type="submit" value="Create" id="MM_insertDirectory">
</p>
</div></td>
</tr>
</table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th class="linkbox">Albums</th>
</tr>
</table>
<form action="" method="post" name="formTitleDelete" id="formTitleDelete">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td><p>Delete an Album:</p></td>
</tr>
<tr>
<td><p align="center">
<select name="selectTitleDelete" id="selectTitleDelete">
<?php
while(!$rsTitles->EOF){
?>
<option value="<?php echo $rsTitles->Fields('titleID')?>"<?php if (!(strcmp($rsTitles->Fields('titleID'), $rsTitles->Fields('titleID')))) {echo "SELECTED";} ?>><?php echo $rsTitles->Fields('title')?></option>
<?php
$rsTitles->MoveNext();
}
$rsTitles->MoveFirst();
?>
</select>
</p></td>
</tr>
<tr>
<td><div align="right">
<p>
<input name="deleteTitleID" type="hidden" value="<?php echo $rsTitles->Fields('titleID'); ?>" id="deleteTitleID">
<input name="DeleteAlbum" type="submit" value="Delete" id="DeleteAlbum">
</p>
</div></td>
</tr>
</table>
</form>
<form action="" method="post" name="formTitleNew" id="formTitleNew">
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="linkbox">
<td nowrap><p>Add a new Album:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <div align="center">
<input name="title" type="text" value="<?php echo $KT_fakeRs->Fields('title')?>" size="24" id="title">
</div></td>
</tr>
<tr class="linkbox">
<td nowrap><p align="left">Album Description:</p></td>
</tr>
<tr class="linkbox">
<td nowrap> <p align="center">
<textarea name="titleDesc" cols="25" rows="3" wrap="VIRTUAL" id="textarea"><?php echo $KT_fakeRs->Fields('titleDesc')?></textarea>
</p></td>
</tr>
<tr class="linkbox">
<td nowrap><div align="right">
<p>
<input name="MM_insertTitle" type="submit" value="Create" id="MM_insertTitle">
</p>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<th width="400" height="20" class="TableMainCont"><font color="#FF0000">
<?php
if ($Insert_Image->getErrorNo()) {
?>
<?php
echo $Insert_Image->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($tNG_TitleNew->getErrorNo()) {
?>
<?php
echo $tNG_TitleNew->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($tNG_DirectoryNew->getErrorNo()) {
?>
<?php
echo $tNG_DirectoryNew->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($Insert_Gallery->getErrorNo()) {
?>
<?php
echo $Insert_Gallery->getErrorMsg();
?>
<?php
} // end Display Error
?>
<?php
if ($Image_Update->getErrorNo()) {
?>
<?php
echo $Image_Update->getErrorMsg();
?>
<?php
} // end Display Error
?>
</font></th>
<td width="180" rowspan="2" valign="TOP" class="NavLeftColumn"><br>
<?php if ($totalRows_rsThumbs > 0) { // Show if recordset not empty ?>
<table align="CENTER" id="TableThumbs" width="155" border="0" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF">
<tr>
<td> <div align="center">
<?php
while (!$rsThumbs->EOF) {
?>
<a href="image.php?imageID=<?php echo $rsThumbs->Fields('imageID'); ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image','','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images',1);MM_swapImage('Image','','../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images',1)"><img alt="Click to update: <?php echo $rsThumbs->Fields('imageKeywords'); ?>" src="../Files/<?php echo $rsThumbs->Fields('imageID'); ?>__images" height="50" id="Thumbs" name="Thumbs" border="0"></a>
<?php
$rsThumbs->MoveNext();
}
?>
</div></td>
</tr>
</table>
<table align="CENTER" width="110" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <div align="center">
<table align="center" border="0" width="150" cellpadding="0" cellspacing="0">
<tr>
<td width="55" align="center"><?php if ($pageNum_rsThumbs > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsThumbs=%d%s", $HTTP_SERVER_VARS["PHP_SELF"], max(0, $pageNum_rsThumbs - 1), $queryString_rsThumbs); ?>">Previous</a>
<?php } // Show if not first page ?></td>
<td width="55" align="center"><?php if ($pageNum_rsThumbs < $totalPages_rsThumbs) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsThumbs=%d%s", $HTTP_SERVER_VARS["PHP_SELF"], min($totalPages_rsThumbs, $pageNum_rsThumbs + 1), $queryString_rsThumbs); ?>">Next</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
</div></td>
</tr>
</table>
<?php } // Show if recordset not empty ?> <p align="center"> </p></td>
</tr>
<tr>
<td valign="TOP" class="TableMainCont"> <div align="center">
<?php if ($totalRows_rsAlbum_Photos_Image == 0) { // Show if recordset empty ?>
<img src="../images/invis.gif" height="250" id="Image" name="Image">
<?php } // Show if recordset empty ?>
<?php if ($totalRows_rsAlbum_Photos_Image > 0) { // Show if recordset not empty ?>
<form method="POST" name="Image_Update" id="Image_Update" >
<img alt="<?php echo $rsAlbum_Photos_Image->Fields('imageKeywords'); ?>" src="../Files/<?php echo $rsAlbum_Photos_Image->Fields('imageID'); ?>__images" height="250" id="Image" name="Image">
<table align="center">
<tr valign="baseline">
<td nowrap align="right" valign="top"><p>Description:</p></td>
<td> <textarea name="imageDescription" cols="25" rows="5" wrap="VIRTUAL" id="imageDescription"><?php echo $rsAlbum_Photos_Image->Fields('imageDescription'); ?></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>Keywords:</p></td>
<td><input name="imageKeywords" type="text" value="<?php echo htmlentities($rsAlbum_Photos_Image->Fields('imageKeywords')); ?>" size="25" id="imageKeywords"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p>Gallery:</p></td>
<td> <select name="GalleryUpdate" id="GalleryUpdate">
<option value="<?php echo $rsAlbum_Photos_Image->Fields('galleryID'); ?>"><?php echo $rsGalleryDisplay->Fields('directoryDesc')?>: <?php echo $rsGalleryDisplay->Fields('title'); ?></option>
<option value=" "></option>
<?php
while(!$rsGallery->EOF){
?>
<option value="<?php echo $rsGallery->Fields('galleryID')?>"><?php echo $rsGallery->Fields('directoryDesc')?>: <?php echo $rsGallery->Fields('title'); ?></option>
<?php
$rsGallery->MoveNext();
}
$rsGallery->MoveFirst();
?>
</select>
<input name="galleryID" type="hidden" value="<?php echo $rsAlbum_Photos_Image->Fields('galleryID'); ?>" id="galleryID">
</td>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" name="MM_update" value="Update Record"></td>
</tr>
</table>
<input name="imageID" type="hidden" value="<?php echo $rsAlbum_Photos_Image->Fields('imageID'); ?>" id="imageID">
<input name="MM_update" type="hidden" value="Image_Update" id="MM_update">
</form>
<?php } // Show if recordset not empty ?>
</div></td>
</tr>
<tr>
<td class="NavLeftColumn" valign=top> </td>
<td align="center" valign="TOP" class="TableMainCont"> </td>
<td class="NavRightColumn" align="center" valign=middle> </td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="3" valign="bottom" class="TableBorder3"><img src="../images/invis.gif" width="1" height="5"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" class="TableBorder2"><img src="../images/invis.gif" width="1" height="10"></td>
</tr>
<tr>
<td width="180" valign="bottom" class="TableBorder1"> </td>
<td width="415" valign="bottom" class="TableBorder1"> </td>
<td width="180" align="right" class="TableBorder1"> </td>
</tr>
</table>
</body>
</html>
<?php
$rsDirectories->Close();
$rsTitles->Close();
$rsAlbum_Photos_Image->Close();
$rsAlbum_Photos->Close();
$rsGalleryDisplay->Close();
$rsDirectories->Close();
$rsTitles->Close();
$rsThumbs->Close();
$rsGallery->Close();
?>
Replied 13 Nov 2002 16:39:32
13 Nov 2002 16:39:32 E C replied:
If it makes it any easier...
the recordset is
rsThumbs
Thanks
Emelie
the recordset is
rsThumbs
Thanks
Emelie