By: robee
Date: 2003-08-25
Time: 06:17
|
manipulating data through tbs..
hi sir, thanks for answering my previous posts..I'll be applying it all on my project..in the meantime, Im having problems again with the forms..here's what i got:
catalog.php
<link href="../lib/layouts/css/spec.css" rel="stylesheet" type="text/css">
<?
include_once("../lib/tbs_class.php") ;
include_once("../lib/GetData.class.php");
require_once("../lib/elements/ConnectDB/connectDB.php");
$agency='FNRI';
$id='100';
//instantiate TBS object
$catalog = new clsTinyButStrong ;
$catalog->LoadTemplate("../lib/layouts/Catalog.htm") ;
//create query string and assign to a variable
$query = "Select * from tblHoldings where HoldingsID='$id' and AgencyCode='$agency'";
$e_query = mysql_query($query);
$row = mysql_fetch_array($e_query);
$title = $row["Title"]; echo 'before'.$title;
$catalog_date = $row["CatalogDate"];
$lccn = $row["LCCN"];
$issn = $row["ISSN"];
$catalog_source = $row["CatalogSourceCode"];
$_POST[language] = $row["Language"]; echo 'before'.$language;
$subtitle = $row["SubTitle"];
$seriestitle = $row["SeriesTitle"];
$pub_place = $row["PublicationPlace"];
$pub_date = $row["PublicationDate"];
$phy_ext = $row["PhysicalExtension"];
$phy_des = $row["PhysicalDescription"];
$phy_dim = $row["PhysicalDimension"];
$pub_fre = $row["PublicationFrequency"];
$phy_med = $row["PhysicalMedium"];
$notes = $row["GeneralNote"];
$summary = $row["SummaryAbstracts"];
$ret = new Retrieve();
$ret->m_Prm_Retrieve('Submit,id,title,catalog_date,language,selectField');
echo $_POST[title];
echo $_POST[language];
if ($_POST[Submit] == "Update") {
$query = "Update tblHoldings Set HoldingsID = '$id',
Title = '$title',Language='$language'";
$e_query = mysql_query($query);
}
//repeatable
$c_author = $row["CorporateAuthor"];
$publisher = $row["Publisher"];
$subjects = $row["SubjectHeadings"];
//close database connection
mysql_close($cnx_id);
$catalog->Show() ;
?>
|
and the template
catalog.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/spec.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="34%" border="1">
<tr>
<td width="27%" height="20"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="Catalog.php?[var.id]">Catalog</a></font></td>
<td width="39%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="Subscription.php?[var.id]">Subscription</a></font></td>
<td width="34%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="Holdings.php?[var.id]">Holdings</a></font></td>
</tr>
</table>
<form action="[sys.script_name]" method="post" name="frm_catalog">
<table width="500" cellpadding="0" cellspacing="0" class="tblOutHead">
<tr class="tblOutHead">
<td class="fontHead">Cataloguing</td>
</tr>
<tr class="tblOutBody">
<td height="513"><br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#f0f0f0">
<td width="100%" class="fontHeadIn">References</td>
</tr>
<tr>
<td class="fontHeadIn"><br>
<table width="350" border="0" align="center">
<tr>
<td width="35%" class="fontForm">Record #</td>
<td width="65%">[var.id]
<input type="hidden" name="id" value="[var.id]"></td>
</tr>
<tr>
<td class="fontForm">Catalog Date</td>
<td><input name="catalog_date" type="text" size="35" value="[var.catalog_date]"></td>
</tr>
<tr>
<td class="fontForm">LCCN</td>
<td><input name="lccn" type="text" size="35" value="[var.lccn]"></td>
</tr>
<tr>
<td class="fontForm">ISSN</td>
<td><input name="issn" type="text" size="35" value="[var.issn]"></td>
</tr>
<tr>
<td class="fontForm">Catalog Source</td>
<td><input name="catalog_source" type="text" size="35" value="[var.catalog_source]"></td>
</tr>
</table>
<br>
</td>
</tr>
</table>
<br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#f0f0f0">
<td width="100%" class="fontHeadIn">Title</td>
</tr>
<tr>
<td class="fontHeadIn"><br>
<table width="350" border="0" align="center">
<tr>
<td width="35%" class="fontForm">Corporate Author</td>
<td width="65%"><input name="c_author" type="text" size="35" value="[var.c_author]"></td>
</tr>
<tr>
<td class="fontForm">Language</td>
<td><input name="language" type="text" size="35" value="[var.language]"></td>
</tr>
<tr>
<td class="fontForm">Title</td>
<td><textarea name="title" cols="27" rows="4">[var.title]</textarea></td>
</tr>
<tr>
<td class="fontForm">Sub Title</td>
<td><textarea name="subtitle" cols="27" rows="2">[var.subtitle]</textarea></td>
</tr>
<tr>
<td class="fontForm">Series Title</td>
<td><textarea name="seriestitle" cols="27" rows="2">[var.seriestitle]</textarea></td>
</tr>
</table>
<br> </td>
</tr>
</table><br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#f0f0f0">
<td width="100%" class="fontHeadIn">Publication data</td>
</tr>
<tr>
<td class="fontHeadIn"><br>
<table width="350" border="0" align="center">
<tr>
<td width="35%" class="fontForm">Publication Place</td>
<td width="65%"><input name="pub_place" type="text" size="35" value="[var.pub_place]"></td>
</tr>
<tr>
<td class="fontForm">Publisher</td>
<td><input name="publisher" type="text" size="35" value="[var.publisher]"></td>
</tr>
<tr>
<td class="fontForm">Publication Date</td>
<td><input name="pub_date" type="text" size="35" value="[var.pub_date]"></td>
</tr>
</table>
<br> </td>
</tr>
</table><br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#f0f0f0">
<td width="100%" class="fontHeadIn">Other details ...</td>
</tr>
<tr>
<td class="fontHeadIn"><br>
<table width="350" border="0" align="center">
<tr>
<td width="35%" class="fontForm">Physical Ext.</td>
<td width="65%"><input name="phy_ext" type="text" size="35" value="[var.phy_ext]"></td>
</tr>
<tr>
<td class="fontForm">Phys Description</td>
<td><input name="phy_des" type="text" size="35" value="[var.phy_des]"></td>
</tr>
<tr>
<td class="fontForm">Phys Dimension</td>
<td><input name="phy_dim" type="text" size="35" value="[var.phy_dim]"></td>
</tr>
<tr>
<td class="fontForm">Publication Frequency</td>
<td><input name="pub_fre" type="text" size="35" value="[var.pub_fre]"></td>
</tr>
<tr>
<td class="fontForm">Phys Medium</td>
<td><input name="phy_med" type="text" size="35" value="[var.phy_med]"></td>
</tr>
<tr>
<td class="fontForm">General Notes</td>
<td><textarea name="notes" cols="27" rows="4">[var.notes]</textarea></td>
</tr>
<tr>
<td class="fontForm">Summary</td>
<td><textarea name="summary" cols="27" rows="4">[var.summary]</textarea></td>
</tr>
</table>
<br> </td>
</tr>
</table><br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#f0f0f0">
<td width="100%" class="fontHeadIn">Subjects</td>
</tr>
<tr>
<td class="fontHeadIn"><br>
<table width="350" border="0" align="center">
<tr>
<td width="35%" class="fontForm">Subject/s:</td>
<td width="65%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000">
<a href="AddSubject.php">[var.subjects]Economic Development<br>
Economic Assistance</a></font></td>
</tr>
<tr>
<td colspan="2" class="fontForm"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="Holdings.php">Add
Subject </a></font></td>
</tr>
</table>
<br> </td>
</tr>
</table><br>
<table width="80%" align="center" cellpadding="0" cellspacing="0" class="tblBodyIn">
<tr bgcolor="#CCCCCC">
<td bgcolor="#FAE4C5" class="fontHeadIn">
<input type="submit" name="Submit" value="AddNew" class="submitButton">
<input type="submit" name="Submit" value="Update" class="submitButton">
<input type="submit" name="Submit" value="Delete" class="submitButton"></td>
</tr>
</table>
<br> </td>
</tr>
</table>
<p> </p></form>
</body>
</html>
|
I can easily put values on the form upon upload..but when I want to edit or delete the record, it didnt work...it seems that it can't pass the modified value to the form..what's wrong with the code?
|