<?php require('Connections/boss.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;
}
}

mysql_select_db($database_boss, $boss);
$query_categories = "SELECT * FROM categories WHERE hastop = 0";
$categories = mysql_query($query_categories, $boss) or die(mysql_error());
$row_categories = mysql_fetch_assoc($categories);
$totalRows_categories = mysql_num_rows($categories);



//$query_productorder = sprintf("SELECT * FROM productorder WHERE orderid =".$_SESSION['sess_id1'], GetSQLValueString($_SESSION['sess_id1'], "text"));


//      $sql = "SELECT * FROM productorder ORDER BY orderid ASC";
    //      $query = mysql_query($sql);

        //  while($row = mysql_fetch_assoc($productorder)){

//mysql_select_db($database_boss, $boss);
//$query_productorder = sprintf("SELECT * FROM productorder WHERE orderid = %s", GetSQLValueString($colname_productorder, "text"));
//$productorder = mysql_query($query_productorder, $boss) or die(mysql_error());
//$row_productorder = mysql_fetch_assoc($productorder);
//$totalRows_productorder = mysql_num_rows($productorder);



?><!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>Boss Online</title>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style>
<link href="mycss.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body bgcolor="#e5e4e4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <?php 
  include_once("theme/header.php"); 
//  echo $_SESSION['sess_id1'];

  $colname_productorder = "-1";
if (isset($_SESSION['sess_id1'])) {
  $colname_productorder = $_SESSION['sess_id1'];
}
mysql_select_db($database_boss, $boss);
$query_productorder = sprintf("SELECT * FROM productorder WHERE orderid = %s", GetSQLValueString($colname_productorder, "text"));
$productorder = mysql_query($query_productorder, $boss) or die(mysql_error());
$row_productorder = mysql_fetch_assoc($productorder);
//$totalRows_productorder = mysql_num_rows($productorder);
$count = mysql_num_rows($productorder);
  ?>
  <?php  $colname_totalitem = "-1";
if (isset($_SESSION['sess_id1'])) {
  $colname_totalitem = $_SESSION['sess_id1'];
} 
mysql_select_db($database_boss, $boss);
$query_totalitem = sprintf("SELECT count(*) as totalitem FROM productorder WHERE orderid = %s", GetSQLValueString($colname_totalitem, "text"));
$totalitem = mysql_query($query_totalitem, $boss) or die(mysql_error());
$row_totalitem = mysql_fetch_assoc($totalitem);
$totalRows_totalitem = mysql_num_rows($totalitem);
?>
  <tr>
    <td align="center"><table width="967" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td style="background-image:url(Images/left_bg.jpg); background-repeat:repeat-y; width:15px;">&nbsp;</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="width:15px;">&nbsp;</td>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <?php include_once("flash.php"); ?>
              <tr>
                <td style="height:5px;"></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td valign="top" style="width:200px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td style="background-image:url(Images/menu_left.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                            <td align="left" bgcolor="#525252" class="subheading"><img src="Images/star.jpg" width="14" height="14" align="absmiddle" /> MY CART</td>
                            <td style="background-image:url(Images/menu_right.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#f7f5f5"></td>
                            <td bgcolor="#f7f5f5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td><table width="100%" border="0">
                                  <tr>
                                    <td><img src="Images/basket.jpg" width="40" height="40" /></td>
                                    <td align="center" valign="middle"><br />
                                                        <span class="itemslect">Shoping Cart<br />
                                                        <?php echo $row_totalitem['totalitem']; ?>&nbsp;Items</span><br />
                                                        <br /></td>
                                  </tr>
                                </table></td>
                              </tr>
                            </table></td>
                            <td bgcolor="#f7f5f5"></td>
                          </tr>
                          <tr>
                            <td style="background-image:url(Images/menu_left_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                            <td bgcolor="#f7f5f5"></td>
                            <td style="background-image:url(Images/menu_right_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td style="background-image:url(Images/menu_left.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                            <td align="left" bgcolor="#525252" class="subheading"><img src="Images/star.jpg" width="14" height="14" align="absmiddle" /> CATEGORIES</td>
                            <td style="background-image:url(Images/menu_right.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#f7f5f5"></td>
                            <td bgcolor="#f7f5f5"><?php do { ?>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                              <tr>
                                                <td align="left" class="catagories" style="height:25px;"><a href="product.php?id=<?php echo $row_categories['id']; ?>"><?php echo $row_categories['categories']; ?></a></td>
                                              </tr>
                                              <tr>
                                                <td style="height:1px; background-color:#b6b4b4"></td>
                                              </tr>
                                            </table>
                              <?php } while ($row_categories = mysql_fetch_assoc($categories)); ?></td>
                            <td bgcolor="#f7f5f5"></td>
                          </tr>
                          <tr>
                            <td style="background-image:url(Images/menu_left_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                            <td bgcolor="#f7f5f5"></td>
                            <td style="background-image:url(Images/menu_right_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td><a href="#"><img src="Images/how-to-buy.jpg" width="203" height="220" border="0" /></a></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                    </table></td>
                    <td style="width:15px;"></td>
                    <td valign="top" style="width:705px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td style="background-image:url(Images/menu_left.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                            <td align="left" bgcolor="#525252" class="subheading"><img src="Images/star.jpg" width="14" height="14" align="absmiddle" /> SHOPING CART</td>
                            <td style="background-image:url(Images/menu_right.jpg); background-repeat:no-repeat; width:10px; height:28px;"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#f7f5f5"></td>
                            <td bgcolor="#f7f5f5"><form id="form2" name="form2" method="post" action="">
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="25" align="center" class="detail_txt">Product</td>
                                  <td align="center" class="detail_txt">Product Name</td>
                                  <td align="center" class="detail_txt">Quantity</td>
                                  <td align="center" class="detail_txt">Unit Price </td>
                                  <td align="center" class="detail_txt">Total</td>
                                  <td align="center" class="detail_txt">Delete </td>
                                </tr>
                                <tr>
                                  <td colspan="6" style="background-color:#C9C9C9; height:1px;"></td>
                                </tr>
                                <tr>
                                  <td colspan="6" style="height:5px;"></td>
                                </tr>
                                <?php do { 
                              $a = ( $row_productorder['product_Price'] * $row_productorder['Product_quantity']);
                              //echo "sum(a) = " . array_sum($a) . "\n";
                              ?>
                                <tr>
                                 <td align="center" class="detail_txt"><? /*$id[]=$row_productorder['id'];*/ ?><?php echo $row_productorder['id']; ?></td>
                                  <td height="150" align="center"><img src="<?php echo $row_productorder['product_large']; ?>" alt="" width="100" class="border" /></td>
                                  <td align="center" class="detail_txt"><?php echo $row_productorder['product_name']; ?></td>
                                  <td align="center"><input name="quantity" type="text" id="quantity" value="<?php echo $row_productorder['Product_quantity']; ?>" size="2" /></td>
                                  <td align="center" class="detail_txt"><?php echo $row_productorder['product_Price']; ?></td>
                                  <td align="center" class="detail_txt"><?php echo $a ?> Rs</td>
                                  <td align="center"><input name="checkbox[]" type="checkbox" id="checkbox[]"value="<?php echo $row_productorder['id']; ?>" /></td>
                                </tr>
                                <br />
                                <?php $b = $a + $b; ?>
                                <?php } while ($row_productorder = mysql_fetch_assoc($productorder)); ?>
                                <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td colspan="6" style="background-color:#C9C9C9; height:1px;"></td>
                                </tr>
                                <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td align="center" class="about_heading">Sub-Total:</td>
                                  <td align="center" class="total"><?php echo $b; ?> Rs</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td align="center"><label>
                                    <input  name="update" type="image" src="Images/update.jpg" id="update" value="update" />
                                  </label></td>

                               <?php
// Check if button name "Submit" is active, do this
/*if($update){
for($i=0;$i<$count;$i++){
$sql1="UPDATE productorder SET Product_quantity = '$quantity' WHERE id='$id[$i]'";
$result1=mysql_query($sql1);
}
}
if($result1){
header("location:update_multiple.php");
}
mysql_close();*/

                                 //$update = $_POST['update'];
                                 //$quantity = $_POST['quantity'];
                                 //if($update){
                                 //for($a=0;$a<$count;$a++){
                                 mysql_query ("UPDATE productorder SET Product_quantity = '$quantity'");  
//                               result1 = mysql_query($insert); 
                                 //result1=mysql_query($insert);
                                 echo "your quentity: $quantity";
                                 echo "your id: $id";
                            ?>
                                  <td align="center"><a href="index.php"><img src="Images/continue_shoping.jpg" width="107" height="21" border="0" /></a></td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td align="center"><input name="delete" type="image" src="Images/delete.jpg" id="delete" value="Delete" /></td>
                                </tr>
                                <?php
/*
      $checkbox = $_POST['checkbox'];
      $delete = $_POST['delete'];
      $update = $_POST['update'];
      $quantity = $_POST['quantity'];
// Check if delete button active, start this
    if($delete){
    for($i=0;$i<$count;$i++){
    $del_id = $checkbox[$i];
    $sql = "DELETE FROM productorder WHERE id='$del_id'";
    $result = mysql_query($sql);
}
}
// if successful redirect to delete_multiple.php
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=shoping_cart.php\">";
}
mysql_close();
*/?>
                                <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                                  <td align="center"><a href="checkout.php?id=<?php echo $row_productorder['id']; ?>"><img src="Images/check_out.jpg" width="85" height="20" border="0" /></a></td>
                                </tr>
                              </table>
                            </form>
                            </td>
                            <td bgcolor="#f7f5f5"></td>
                          </tr>
                          <tr>
                            <td style="background-image:url(Images/menu_left_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                            <td bgcolor="#f7f5f5"></td>
                            <td style="background-image:url(Images/menu_right_down.jpg); background-repeat:no-repeat; width:10px; height:11px;"></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
            <td style="width:15px;">&nbsp;</td>
          </tr>
        </table></td>
        <td style="background-image:url(Images/right_bg.jpg); background-repeat:repeat-y; width:15px;">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <?php include_once("theme/footer.php"); ?>
</table>
</body>
</html>
<?php
mysql_free_result($categories);

mysql_free_result($productorder);

mysql_free_result($totalitem);
?>

orcaraheel, What do you really mean by just sending the title "update problem" and some code? Is it a question, a statement or fact ? Do you need help ?!?!?
Plus if you are to paste/type your code, always include it within

tags !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.