Please Help... Recordset Navigation

I am using a PHP/MySQL database to incorporate dynamic data
in my website. In particular, I have a gallery of photo thumbnails
(the thumbnails are displayed via a Recordset). When clicked on,
each thumbnail link opens a pop-up window, which displays the name
and full-size image of the record desired. I've tried to insert a
Repeated Region server behavior within the pop-up to display one
full-size picture at a time and a Recordset navigation bar to click
through the different images. However, I can't seem to figure it
out.
Operating System: Mac OS X (v10.3)
Web Server: Apache
Browser: N/A
Database type: MYSQL
Application server: PHP

Thanks for your advice, Steve! I'm not sure about the form,
though. I'm fairly new to PHP...
Here's the PHP code from the thumbnails page:
<?php require_once('../../Connections/CSA.php'); ?>
<?php
mysql_select_db($database_CSA, $CSA);
$query_Rides = "SELECT * FROM Rides ORDER BY id ASC";
$Rides = mysql_query($query_Rides, $CSA) or
die(mysql_error());
$row_Rides = mysql_fetch_assoc($Rides);
$totalRows_Rides = mysql_num_rows($Rides);
?>
<table align="center" cellpadding="0" cellspacing="10"
style="padding: 5px;">
<tr>
<?php
$Rides_endRow = 0;
$Rides_columns = 6; // number of columns
$Rides_hloopRow1 = 0; // first row flag
do {
if($Rides_endRow == 0 && $Rides_hloopRow1++ != 0)
echo "<tr>";
?>
<td>
<a href="display_ride.php?id=<?php echo
$row_Rides['id']; ?>" target="_blank" alt="<?php echo
$row_Rides['name']; ?>" title="<?php echo $row_Rides['name'];
?>"><img src="pictures/<?php echo $row_Rides['thumb'];
?>" class="ride" /></a></td>
<?php $Rides_endRow++;
if($Rides_endRow >= $Rides_columns) {
?>
</tr>
<?php
$Rides_endRow = 0;
while ($row_Rides = mysql_fetch_assoc($Rides));
if($Rides_endRow != 0) {
while ($Rides_endRow < $Rides_columns) {
echo("<td> </td>");
$Rides_endRow++;
echo("</tr>");
}?>
</table>
<?php
mysql_free_result($Rides);
?>
And here's the code from the popup window:
<?php require_once('../../Connections/CSA.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "", $theNotDefinedValue = "")
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
: $theValue;
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) .
"'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
return $theValue;
$currentPage = $_SERVER["PHP_SELF"];
$colname_current_Ride = "-1";
if (isset($_GET['id'])) {
$colname_current_Ride = $_GET['id'];
mysql_select_db($database_CSA, $CSA);
$query_current_Ride = sprintf("SELECT * FROM Rides WHERE id =
%s", GetSQLValueString($colname_current_Ride, "int"));
$current_Ride = mysql_query($query_current_Ride, $CSA) or
die(mysql_error());
$row_current_Ride = mysql_fetch_assoc($current_Ride);
$totalRows_current_Ride = mysql_num_rows($current_Ride);
$colname_next_Ride = "-1";
if (isset($_GET['id'])) {
$colname_next_Ride = $_GET['id'];
mysql_select_db($database_CSA, $CSA);
$query_next_Ride = sprintf("SELECT * FROM Rides WHERE id >
%s ORDER BY id ASC", GetSQLValueString($colname_next_Ride, "int"));
$next_Ride = mysql_query($query_next_Ride, $CSA) or
die(mysql_error());
$row_next_Ride = mysql_fetch_assoc($next_Ride);
$totalRows_next_Ride = mysql_num_rows($next_Ride);
$colname_previous_Ride = "-1";
if (isset($_GET['id'])) {
$colname_previous_Ride = $_GET['id'];
mysql_select_db($database_CSA, $CSA);
$query_previous_Ride = sprintf("SELECT * FROM Rides WHERE id
< %s ORDER BY id DESC",
GetSQLValueString($colname_previous_Ride, "int"));
$previous_Ride = mysql_query($query_previous_Ride, $CSA) or
die(mysql_error());
$row_previous_Ride = mysql_fetch_assoc($previous_Ride);
$totalRows_previous_Ride = mysql_num_rows($previous_Ride);
$queryString_current_Ride = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_current_Ride") == false
stristr($param, "totalRows_current_Ride") == false) {
array_push($newParams, $param);
if (count($newParams) != 0) {
$queryString_current_Ride = "&" .
htmlentities(implode("&", $newParams));
$queryString_current_Ride =
sprintf("&totalRows_current_Ride=%d%s",
$totalRows_current_Ride, $queryString_current_Ride);
?>
<h1 class="rideTitle" style="position: relative; top:
10px"><?php echo $row_current_Ride['name']; ?></h1>
<area shape="rect" coords="4,3,48,47"
href="display_ride.php?id=<?php echo $row_previous_Ride['id'];
?>" id="Previous Ride" name="Previous Ride" />
<area shape="rect" coords="47,3,99,47"
href="display_ride.php?id=<?php echo $row_next_Ride['id'];
?>" id="Next Ride" name="Next Ride" />
<area shape="rect" coords="851,3,897,47" href="#"
onclick="self.close();" id="Close Window" name="Close Window" />
<img src="pictures/<?php echo
$row_current_Ride['image']; ?>" alt="<?php echo
$row_current_Ride['image']; ?>" title="<?php echo
$row_current_Ride['image']; ?>" class="ride" style="position:
relative; top: -15px" />
<!-- Hide the caption <?php echo
$row_current_Ride['caption']; ?> -->
<?php
mysql_free_result($current_Ride);
mysql_free_result($next_Ride);
mysql_free_result($previous_Ride);
?>
Again, I have a decent sense of what to do with PHP, but I'll
use any help that I can receive. Thanks!
Kevin

Similar Messages

  • URGENT ! Please Help ! Navigation error....

    Hi,
    I am getting the following error during navigation from summary report to detail report..
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1858, message: ORA-01858: a non-numeric character was found where a numeric was expected at OCI call OCIStmtExecute:
    My summary report has a dummy column name 'All' and I have specified a navigation to another detail report. However it is throwing me this error when trying to navigate. This is happening even when I am not passing any filters to the detail report. Please help me to resolve this issue as I need to get this done right away.

    Couple of things you can check to isolate the prb
    Run the detail report individually w/o navigating from the summary report
    Also make sure if your summary report runs well as such.
    As long as they run indivdually and you not even passing filters ideally it shouldnt cause any issue... Does it generate a SQL?
    Thanks
    Prash

  • I got my Iphone 3gs unlocked, but Navigation and Compass are not working. Please help if anybody had faced this problem and got it resolved.

    I got my Iphone 3gs unlocked, but Navigation and Compass are not working. Please help if anybody had faced this problem and got it resolved.

    Only the carrier that the iPhone was locked to can unlock. There you go, hacking void any support from this forum.

  • My keynote seems to be misbehaving. Me, a teacher was preparing a ppt on keynote.all of a sudden, the navigator column to my left goes black and nothing seems to move. Please help! Only 12 hours before I take class.

    My keynote seems to be misbehaving. Me, a teacher was preparing a ppt on keynote.all of a sudden, the navigator column to my left goes black and nothing seems to move. Please help! Only 12 hours before I take class.

    Hi KRKabutoZero,
    Welcome to Apple Discussions
    You may want to look at Knowledge Base Document #58042 on A flashing question mark appears when you start your Mac.
    Do you have access to another Mac? You may want to backing up your files via Target Disk Mode (TDM) as well as running some utilities (Knowledge Base Document #58583 on How to use FireWire target disk mode.
    You may want to invest in a utility like DiskWarrior from Alsoft. It is great for troubleshooting drive malfunctions.
    As said before, you may also want to bring your iBook to your local Apple Store/Reseller.
    Jon
    Mac Mini 1.42Ghz, iPod (All), Airport (Graphite & Express), G4 1.33Ghz iBook, G4 iMac 1Ghz, G3 500Mhz, iBook iMac 233Mhz, eMate, Power Mac 5400 LC, PowerBook 540c, Macintosh 128K, Apple //e, Apple //, and some more...  Mac OS X (10.4.5) Moto Razr, iLife '06, SmartDisk 160Gb, Apple BT Mouse, Sight..

  • Help please with my navigation buttons

    Can anyone please help me with my vertical navigation buttons. I'm trying to set up my nav bar so that all the buttons have a background image (button.jpg) behind them at all times and the only thing that changes when touched or the mouse rolls over them is that the colour of the text changes, except when the sub buttons appear, because the name of some of the sub buttons are so long i have created another button image that is longer (button2.jpg), i only want this to appear on sub buttons otherwise the buttons will end up taking most of the pages space. I'm having great difficulties getting the sub buttons to appear with the correct image (button2.jpg) and am getting increasingly frustrated with it, can anyone please help!!!
    www.milesfunerals.com/index2.html

    index2.html is a broken link for sure. The main index page looks like it's working fine.
    A little styling critique if it's okay... Personally I'd have gone with a CSS or Javascript multi-level menu across the bottom of the header. Saves visitors from having to scroll all the way down the page to see every menu item. And I'd rethink the color of the "Miles & Daughters" in the header image. It kinda gets lost in the roses.
    If you have a link to the "broken" page please put it up so we can analyze it.

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

  • While opening pdf files the menu bar, navigation bar  cracks unobviously and also close and minimise buttons  goes hidden..Facing the problem for last one month. Please help.

    while opening pdf files the menu bar, navigation bar  cracks unobviously and also close and minimise buttons  goes hidden..Facing the problem for last one month. Please help.

    The latest Kaspersky software version is 15.0.1.415 or 15.0.1.415ab.

  • Cant add recordset navigation / paging...ERROR HELP

    I have the above recordset below
    $query_Recordset1 = sprintf("SELECT tk_job_title, tk_job_location, tk_job_salary, LEFT(tk_job_desc,200) as truncated_job_desc FROM think_jobsearch WHERE tk_job_title LIKE %s OR tk_job_location LIKE %%"text")%% OR tk_job_salary LIKE %s", GetSQLValueString("%" . $var_tk_job_title_Recordset1 . "%", "text"),GetSQLValueString($var_tk_job_location_Recordset1, "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    a syntax error is being shown on the top line
    when i tried to add a recordset navigation (below)
    <table border="0">
                      <tr>
                        <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
                            <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
                            <?php } // Show if not first page ?></td>
                        <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
                            <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
                            <?php } // Show if not first page ?></td>
                        <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
                            <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
                            <?php } // Show if not last page ?></td>
                        <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
                            <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
                            <?php } // Show if not last page ?></td>
                      </tr>
                  </table>

    I have the same problem. Sorry I can't add any help. Trying
    to figure this out as well.

  • My ipod touch gets stuck on the same song, even after I uncheck the loop button.  I am trying to play it in my 2007 vw with a power adapter that allows it to charge and play through my navigation unit. Please help.  Thank you.

    My ipod touch gets stuck on the same song, even after I uncheck the loop button.  I am trying to play it in my 2007 vw with a power adapter that allows it to charge and play through my navigation unit. Please help.  Thank you.

    Yes, first try deleing both songs.
    If still problem
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, ,make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • Please help me with selecting the right institute for me

    HI All,
    Please help me which institute I should select for my SAP SD training?
    ONE INSTITUTE COVERING THE FOLLOWING TOPICS:
    Sales overview
    Enterprise structure related to SD
    Master data, like Customer master data, material master data, condition master data and Output master data.
    Partner determination
    Sales document types
    Item categories
    Schedule line categories
    Pricing: Condition table, access sequence, Condition type, pricing procedure
    Stock Posting
    Free goods
    Bills of Material
    Material determination
    Material Listing and Exclusion
    Incompletion logs
    Revenue account determination
    Credit management
    Outline agreements like quantity contract, value contract and scheduling agreements
    Shipping process like Shipping point determination, Route determination, Shipping conditions picking ,PGI
    Delivery types
    Delivery item categories
    Invoice process
    Billing types
    Special sales processes like cash sales, rush orders ,consignment process and Third party process
    Return sales process
    Credit memo process
    Debit memo process
    Availability check
    Rebate processing
    Intercompany sales
    Output determination
    Copy control
    Integration with MM,FI
    Technical topics like ABAP tables, user exits and IDOC’s
    Real time scenario’s
                   OR
    OTHER INSTITUTE COVERING THE FOLLOWING TOPICS:
    1. Introduction to Supply chain management
    2. Introduction to SAP ERP package
    3. Introduction to ASAP implementation methodology
    4. Lecture Demo on Basic navigation skills in SAP R/3
    5. SAP landscape. Tips and tricks
    6. Introduction to Enterprise structure in SD
    7. Overview of Material master records
    8. Demo on ROH, HAL and FERT creation
    9. Hands on exercise on creation of material mastesr records in SAP
    10. Introduction to SD master data (Business partners, conditions and outputs)
    11. Introduction to order processing and Demo
    12. Hands on exercises on sales order processing
    13. Introduction to delivery process, picking and post goods issue process
    14. Introduction to stock transport orders and inter-company stock transport Orders
    15. Exercises on delivery with respect to sales orders
    16. Introduction to billing process (Customer billing, Inter-company, Proforma, Credit memo and Debit memo)
    17. Introduction pricing procedure, condition records, condition tables and access sequence.
    18. Configuration on SD sales order types, delivery and billing
    19. Warehouse management overview
    20. Introduction to SAP WM configuration
    21. Demo by instructor on configuration
    22. Develop configuration scripts
    23. Introduction to develop BPP
    24. Hands on exercises to students
    25. Introduction to WM master data
    26. Introduction to transaction data in WM
    27. Hands on exercises on creation of master data elements in WM
    28. Hands on exercises to students on WM transaction data
    29. Introduction to CTS process (SE10, SCC1)
    30. Demo on WM business scenarios and integration points
    31. Introduction to develop integration test scenarios. Develop test scripts
    32. Introduction to OSS notes and SAP Help
    33. Introduction to EAI tools, FID, RF Gun, MDE, SAP console and hand held devices
    34. Introduction to SAP bold on tools (SRM, CRM, BW, SEM, GTS, CIC, FSCM, DP, SNP, PP/DS, GATP, CIF and Plug in)
    35. Introduction to quick reference guides, cheat sheet, FAQ, work instructions, job aides, transaction aides, work instructions and change management
    36.Interface between SD & FI
    37.C forms, H forms
    38.Excise Related Invoices
    39.CIN configuration (taxes)
    40. Debugging with help of ABAP Tool
    41.Excise Returns Process with pricing details
    42.Order, Delivery, Billing, exicise, Output types configuration

    You should talk to various institute.

  • Please help with my helper class

    Hi,
    plz I need some assistance with this:
    I have a big table which consist of 200 columns. This table gets fields from different tables. It has records of orders which may have several items and each item can have up to 8 taxes. So i have fields reaping for other order order records. I need to display an order then have a navigation to list items in details, with all its taxes, one by one.
    Here is how I have decided to do it in a nutshell. I have decided to get all taxes of a particular item and put in a map with tax_codes as values and tax details arraylist as values. I then add this to an item with its other details. then I add items to a particular order. I have separated orders,items and taxes in their separate beans. Im trying to first the implimentation for each order, item and taxes by displaying them on a JSP. However am currently getting the following error with taxdetails:
    java.lang.ClassCastException: OrderItems.ItemTax cannot be cast to java.lang.String
    at OrderItems.OrderDetails.getItemTaxDetails(OrderDetails.java:166)
    at OrderItems.Controller.processRequest(Controller.java:57)
    at OrderItems.Controller.doGet(Controller.java:72)
    I have a list of all itemTaxCodes am iterating and am casting to string...am not casting ItemTax object.Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxdetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,///a list of tax codes
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    String taxCode = (String)taxCodeIter.next();/////casting taxtCode to string***exception occurs from here
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";///tax code string
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);
                //a HashMap of all tax code as keys and list of details as values 4 each key
                for(int i = 0;i<itemTaxCodes.size(); i++){
                    itemTaxdetails.put(itemTaxCodes.get(i),taxDetails.get(i));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxdetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    int itemNumber = ((Integer)itemIter.next()).intValue();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        //A HashMap of all itemTaxeCodes as its keys and an ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getDeclarations(String key_year,String key_cuo,
                String key_dec,String key_nber){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_cuo = '" + key_cuo + "'" +
                    " AND key_dec = '" + key_dec + "'" +
                    " AND key_nber = '" + key_nber + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_cuo"));
                    lineOrder.setKey_client(rst.getString("key_dec"));
                    lineOrder.setKey_company(rst.getString("key_nber"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    } and my testing servlet controller
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        //private List itemDetails = new ArrayList();
        //private Set orderDetails = new HashSet();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            //String nextView = "/order_list.jsp";
            //String nextView = "/items_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    }I have not included code for beans to reduce on bulk.please help and with suggestions...
    Thanx in advance.
    Edited by: aiEx on Oct 3, 2007 8:13 AM

    aiEx wrote:
    sometimes a tap on the head is needed to really learn and understand :-)You're casting them to the String type while they are of the ItemTax type and you've confirmed it yourself. Likely you misunderstood the concepts behind "casting" and you was expecting some magic that they are automatically converted somehow from the ItemTax type to the String type while the ItemTax class isn't a subclass of the String class :)

  • Hi all. I have a factory unlocked iphone 4s. I'm from Belize but i'm going to visit Fort Lauderdale, FLA. How can I get data for my phone? I checked the web and only got 'not sure to don't know' answers. Whoever has done this please help me

    Hi All. I live outside of the USA and have an iPhone 4s. I'm going to Fort Lauderdale, FLA and want to data service for my iPhone ( navigation using google or imaps, browsing and voip ing when no wi fi available). I browsed the net but seems almost impossible. When I visited Toronto I was able to get data thru Koodo but I don't think this is offered in the USA. Anyone who has real experience with this please help. This is a situation that is best aided by persons who have experienced it. Thanks

    Have a look here:
    http://forums.macrumors.com/archive/index.php/t-982315.html

  • Please help new to macs and my recently purchased power mac keeps freezing :-(

    Hi apple community!
    I recently purchased a power mac g5
    Specs;
    G5 power mac dual core (2.0)
    Power pc 970 mp
    Late 2005
    I don't have an apple mouse/keyboard
    I just use $40 wireless mouse keyboard.
    Upon purchase everything seemed to work as it should....booted up, open and closing apps without freezing.
    However I never had it connected to the Internet when I navigated through system.
    I got it home and installed a 1 tb harddrive (WD mainstream desktop) from future shop. When I installed it in tower I had to buy a sata 2.0 cable as there was not one available for use. Booted up fine and installation went as my research said it should. Turned it on next day....
    Tried to update iTunes and this is where it started actin up. First just froze had to turn off, second time wouldn't even boot up plus fans went into overdrive. Third forth fifth sixth boots fans sometimes kick in, now whenever I try to do any kind of action it freezes. (Only when I click something)
    I read about possible power suppy issue, so I plugged tower and monitor into seperAte plugs,
    They may however be in same circuit because they at in the same wall...would a power conditioner fix this?
    Anyway still froze on any action tried...just opened disk drive...opened then frooze...?
    Anybody have any ideas??
    Please help
    Not sure if this is correct OS ( looked up using serial #)
    Max operating system OSX 10.5.8 leaporad
    Earliest supported OSX version ; 10.4.2 tiger.

    Sorry for the late reply. I want to thank you for taking the time to help me.
    Not sure exactally where I could get something like this your speaking of.
    Update; I have removed the harddrive and will most
    Likely just use an external one, if the computer will even work.
    I ended up taking it in to geeksquad at best buy, they had it for 3 days and also told me after the fact that neither of the techs working on it knew much about macs :-( needless to say I requested my
    Money back due to the fact that the service I paid for could not be completed and literally couldn't tell me anything more than what's below.
    They told me that they could not dock it with thier diagnostic machine, kept restarting on them and the one fella said it was overheating but had no idea why. When I brought it home again I tried it once more computer boots up to desktop as usual, this time had a asterisk window saying " the computer was restarted after mac OSX quit unexpectedly" however my cursor was again locked in the top left of the screen. Would not move, so I could not view the report, shortly after fans kicked into overdrive. I'm losing hope for this machine rapidly. I'm all ears when it comes to anything I may be able to do.
    Should I try an actual apple keyboard/mouse just to eliminate that possible?
    If you have ideas AWSOME, If not, no worries, ill take it into the mac store and see what they say
    P.s the machine is clean inside little to no dust and the tech said he was going to clean it out, hard to tell if he did because it was clean clean before I brought it to him.
    Thanks again for the help you have given me so far and in the future
    I look forward to hearing back
    Sincerally
    Al

  • REPORT DOES NOT RUN CORRECTLY , URGENT PLEASE HELP

    Hi,
    I am trying to run a report from visul basic screen, but it does not run correctly. Here is how I am running the report. There is a screen developed in VB This screen prompts the user for user id and password. Once it gets that, it connects to the oracle database and pulls out a column from a table. And passes that value as a parameter to the report. Now I am calling the the report for each individual value . There are 21 value being pulled out of the database and it invokes the report 21 times. So there are 21 report engines gets started. Is there a better way to do that ? Secondly when I pass the parameter , some parameters does not pass correctly I guess , because its not generating any out put . Like out of 21 may be 10 or 11 reports gets generated correctly but rest of the reports are blank. I debug the screen i saw that the parameter value is correct, everything seems good. But still the reports are comming blank. Any Idea why it is so ? The command line that i am using in VB screen is
    Shell "C:\progra~1\ora95_2\bin\rwrun60.exe P:\Business_Analysis_&_Reporting_Tool\Test_REPORT_Templates\STORE_TYPES\Baby_Distribution_Report.Rdf USERID=" & UID & "/" & PWD & "@cposp201 DESFORMAT=PDF DESTYPE=FILE DESNAME=" & txtPath.Text & Replace(strName, " ", "_") & ".PDF BRND='" & adoRecBrand!Brand & "' PRINTJOB=NO PARAMFORM=NO"
    In the above command " adoRecBrand!Brand " is the parameter thats being passed. This is actually a recordset and brand is the column in it. When I debug the screen , I see the value also there. But the report comes out blank. Please help. This is urgent.
    Thanks
    Feroz

    The way you call reports is not scalable. If you have 100 records come back from database, you would end up launch 100 engines at the same times, which probably will blow up your machine. You should use oracle reports server to do that. You can either use rwcli60 to submit the job to reports server, or invoke rwcgi60 from URL.
    I am afraid some of reports engine failed to start and you get nothing back in your case.
    After switch to use reports server achitecture, if you still see some report is blank in your application, then you can run that report with that special set of parameters manually and see if any problem with the report itself.
    Hope this helps.
    Thanks,
    -Shaun

  • There's video problems with my Zen Vision:M already (M video cable related) Please help

    Some background...
    System:Windows XP with Service Pack 2.
    Player: Brand new Creative Zen Vision: M with no firmware updates.
    My Zen Vision:M has a problem (besides the scratch and fingerprint attracting top surface): It won't play videos on a TV screen when the M Video Cable (also from Creative) is linked to it anymore. It's only been a few hours...
    I had the cable already, and got the player today. I let the player charge to /4th of a battery while I was setting up all the software. I ran the software programs just to take a peek, only changing the name of my player (to my name). I used Winamp 5.3 to put a music track on the player to test it. After that, I hooked it up to the VCR in my room through the white and yellow A/V plugs in front. It worked just fine. It to the tv a little large, but I was okay with it.
    Later on today, the new AC charger I ordered came in the mail (Player came through UPS, charger through USPS). I looked at my old charger (Creative Zen Touch) and realized it would work with the plug-in part of the sync unit at the bottom. I tested it for a minute and it did. I still took it out and tried the new one. This is where, I think, something happened. I had to press the sides to get the thing in, and it was hard to come out. Everything still fit just right, and nothing seemed to be wrong. I used my old charger as I added more of my music library. Now it was on to videos. I had to convert the first two test vids (they were .wmv), but they played on my player fine. I put a bigger .wmv file onto the player to see if it had to convert it, and it did. It still played on the player. When I go to hook it to the TV with the A/V cord again, there was nothing but a black screen with the occasional diagonal scan line. The sound is still there.
    Besides quirks with the navigational system, the player is still great for music and video. Still, I needed no video capability, and one of the things that made the ZVM a buy for me was watching my vids on the big screen. I'd return this for a second try, but I want to know if this is a recurring issue with you guys and if there's something I can do to fix it before a return. Did I mess with a setting? Should I get new firmware? Did I do wrong using my old charger? If any of you have an answer, or need more info on my situation, please let me know.
    And BTW, does anyone know of some better software for organizing files on the ZVM? I used Winamp for my Zen Touch and the music on my ZVM, but videos are another ballpark. I can't transfer a video from one folder to another folder (assuming both folders are on the ZVM). Not to mention the music I transferred using Winamp isn't even showing up in Windows Media Player. I think I need a different program altogether.

    I have got a new Creative Zen Vision W and getting the same problem....when i attach to the tv then i am able to hear the audio content and the video does not show.Are we missing something ? or is it a problem with the player. Also the software provided with the Zen converts small .vob files to .wmv when ever the size is large it gives an error 'conversion?unsucessful'.Any body facing similar problems please help.

Maybe you are looking for

  • Icloud Date Format wrong...

    iCloud date format preferences do not work. Day Month Year is an option but it doesn't reflect in places like the calander.

  • [Help]Add-ons

    I'm about to add new form for my receipt for my Sales Invoice, etc... Where should I do that? And how? Thank you.

  • Firefox will not open when i click icon

    can not open firefox == i try to click firefox icon == == User Agent == Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

  • From VMware to Azure no extensions installed and DVD not recognized

    Hello! I'm trying to migrate a VMware RHEL VM to Microsoft Azure using Microsoft Virtual Machine Converter to convert disks and upload them. Before all this, i've prepared the vm as documentation indicates (http://azure.microsoft.com/en-us/documentat

  • ITunes Match not showing up in sidebar or contextual menus

    I subscribed to iTunes Match, and while I've been able to get it to upload in small batches (e.g. less than 100 songs at a shot), recently it decided to stop showing the "Add to iCloud" option when I select songs, even on brand new tracks I haven't a