<?php
require('../head2Alts.php');

  if(  isset($_POST['shopid']) && isset($_POST['owniD']))
     {

  $ownID=$_POST['owniD'];
  $Acc=$con->getMyProfile($ownID); 
  if ($Acc->rowCount()>0)
     {
      $sAc=$Acc->fetch();
      $status=$sAc['accStatus'];
     }else{
        print_r($Acc->ErrorInfo());
      header("location:home.php");
     }  
 $shopid=$_POST['shopid'];
 $getS=$pcon->getSelectedShopOther($shopid);

 if ($getS->rowCount()>0) {
  $shop=$getS->fetch();
  $img=$shop['directory'];
  $ownerD=$_POST['ownerD'];
 

 
?>

<center><table border="0" width="98%">
<tr>
	<td colspan="2" height="50px" valign="top">
		

	  <label id="main_title"><?php echo $shop['shopname'];?></label>

	</td>
 </tr>
 <tr>
  <td colspan="2">
<ul>
  <li style="padding-right:3%;">
    <form id="order" action="buda_shoping_center.php" method="post">

                      <input   type="hidden" name="owniD" id="owniD" value="<?php  echo $ownID;?>">

                       
                      <input  class="spos" type="submit" value="My shop" name="post"> 

                 </form>  
     
  </li>
<li style="padding-right:70%;">
   <form id="order" action="defaultShopingCenterInOther.php" method="post">

                      <input   type="hidden" name="owniD"  value="<?php  echo $ownID;?>">

                       
                      <input  class="spos" type="submit" value="Other shop" name="post"> 

                 </form> 
</li>
 
<li>
 <form id="order" action="itemViewInOther.php" method="post">

                      <input   type="hidden" name="owniD"  value="<?php  echo $ownID;?>">

                       
                      <input  class="spos" type="submit" value="Item view" name="post"> 

                 </form>   
 </li>
</ul>
</td>
</tr>   
 <tr>
  <td colspan="2" align="center">
    
      <form action="selectedShopItemDetailInOther.php" method="post">

            <label id="search_lab">
                       <i>
                          Search item here:-
                      </i> 
             </label>
                      <input   type="hidden" name="owniD" id="owniD" value="<?php  echo $ownID;?>">

                      <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">


                      <input   type="hidden" name="shopid" id="shopid" value="<?php  echo $shopid;?>">

                      <input type="text" class="hotel_info" height="25px" name="searchValue" id="searchValue"  onkeyup ="submision()">
                      <input class="subs" type="submit" value="Search" name="post"><br>
                      <i>You can search by name and category.</i>
            
      </form>
    </td></tr>
      <tr>
  <td colspan="2">
    <div id="ordercart">
      <?php
         $cc=$pcon->getMyCurrentOrder($ownID,$shopid);
         ///print_r($cc->ErrorInfo());
        // echo $cc->rowCount();
         //echo " CU".$ownID. "SH".$shopid;
      if ($cc->rowCount()>0) {
         $bC=$cc->fetch();
         $batchID=$bC['batchID'];
         $Q=$pcon->getMyCurrentBatch($ownID,$shopid,$batchID)->fetch();
         $QD=$pcon->getMyCurrentOrderClosed($ownID,$shopid,$batchID); 
         if ($QD->rowCount()>0) {
          //$cD=$QD->fetch();
          $Qty=0;
          $value=0;
          $batch=substr(Date("Ymdhis"),2);
         }
         else{
          $batch=$bC['batchID'];
          $Qty=$Q['quantity'];
          $value=$Q['value']; 
         }
         
      }
      else{
          
        $Qty=0;
        $value=0;
        $batch=substr(Date("Ymdhis"),2);
      }
      ?>
      <ul>
        <li style="">
          Current order:<br/>
          Qty:<input type="submit" class="spos" name="qty" id="qty" value="<?php echo $Qty;?>">
          Value:<input type="submit" class="spos" name="value" id="value" value="<?php echo $value;?>">
          <form action="itemInbatchViewOtherIn" method="post">
          <input type="hidden" name="shopid" id="shopid" value="<?php echo $shopid;?>">
          <input type="hidden" name="batchID" id="batchID" value="<?php echo $batch;?>">
           <input type="hidden" name="owniD" id="owniD" value="<?php echo $ownID;?>">
           <input type="submit" name="post" class="spos" id="post" value="View detail">
           </form>
        </li>
      </ul>
    </div>
  </td>
</tr>
<tr><td>
    <div  id="result" >
     <?php
      $post=$_POST['post'];
     if($post=="Search")
       {

        $searchValue=$_POST['searchValue'];
        if ($searchValue!="") {
           
        require("keypressThisShopItemSearchIn.php");
         }////////////////////EMPTY POST 
         else{
          ?>
          <p><label id="min_lab">
           Searching empty results!.. 
           </label>
           <?php

         }
       }
       
 ?>
      </div>
  </td>
</tr>

<tr><td colspan="2">
 
<center>

<table border="1" style="border-color:white" id="output">
    
    
    
    
    <!---////////////ALPHABETICAL SORT///////////---->
    <tr>
        <td colspan="8">
          <table   width="100%" >
        <tr>
           <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
        
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="A" name="post">

                 </form>
    
           </td>
    
    
           <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="B" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="C" name="post">

                 </form>
           </td>
           
           
           
           <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="D" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="E" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="F" name="post">

                 </form>
    
           </td>
           
           
           <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="G" name="post">

                 </form>
           </td>
           
           <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="H" name="post">

                 </form>
           </td>
           
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="I" name="post">

                 </form>
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                      <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="J" name="post">

                 </form>
    
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                  <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="K" name="post">

                 </form>
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="L" name="post">

                 </form>
           </td>
           
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                  <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="M" name="post">

                 </form>
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                      <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                      
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="N" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                   <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="O" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                       <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="P" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                   <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="Q" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="R" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="S" name="post">

                 </form>
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="T" name="post">

                 </form>
           
    
           </td>
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="U" name="post">

                 </form>
           </td>
           
            <td>
    
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="V" name="post">

                 </form>
           </td>
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="W" name="post">

                 </form>
    
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="X" name="post">

                 </form>
    
           </td>
           
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

                      <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="Y" name="post">

                 </form>
    
           </td>
            <td>
    
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="Z" name="post">

                 </form>
    
           </td>
           
       </tr>
    
    </table>   
            
        </td>
    </tr>
    
    
    
    
    
    <!---//////////ALPHABETICAL SORT END---> 
    
    
    
    
    
    
    <tr>
              <td id="td_height" ><label id="inner_top">S/N</label>
       
       
       
      
             <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                    <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">
                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="Order by sn" name="post">

                 </form>
       </td>
       
      <td id="td_height" ><label id="inner_top">NAME</label>
      
        <form action="selectedShopItemDetailInOther.php" method="post">

                     <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">
                     <input  type="hidden" name="ownerD" id="ownerD" value="<?php  echo $ownerD;?>">

                     <input class="hi" type="hidden" name="shopid"  value="<?php echo $shopid;?>">

                    <input  class="spos" type="submit" value="Order by name" name="post">

                 </form>
      
      
      </td>
        
        
         <td><label id="inner_top">WEIGHT / VOLUME</label></td>
              <td><label id="inner_top">CATEGORY</label></td>

               <!-- <td id="td_height" ><label id="inner_top">MANUFACTURE/VENDOR</label></td>


                <td id="td_height" ><label id="inner_top">DESCRIPTION</label></td>-->
 
                <td id="td_height" ><label id="inner_top">PRICE</label></td>  
 
 
                <td colspan="2" id="td_height" ><label id="inner_top">ORDER PLACEMENT</label></td>  
 
                </tr>     
           <input type="hidden" name="accstatus" id="accstatus" value="<?php echo $status;?>"/>

 <?php
    
       
/*      
$dD=$pcon->getShopItemPricesOtherView($shopid,$ownerD); 

if($dD->rowCount()>0){
 $roN=$dD->fetchAll();
 $cc=0;
 foreach ($roN as $key => $rowN){ 
 
  $itemid=$rowN['itemID'];
  
   
       
  $nsD=$pcon->getShopName($shopid);

  $nsroN=$nsD->fetch();

  $item=$pcon->getThisItem($itemid);
if($item->rowCount()>0){
   $it=$item->fetch();*/ 
     //getCheckedShopItemPricesOtherView($itemid,$shopid,$ownerD)
/////////////////////////
////////////////////////////

 $post=$_POST['post'];
    if($post=="Order by sn"){
      $item= $pcon->getAllItemCheck();
      }
      
      
      
      
      else if($post=="Order by name"){
        $item= $pcon->getOrderNameAllItemCheck();
      }
      
      
      else if($post=="A" ||  $post=="B"  ||   $post=="C"  ||  $post=="D"  ||   $post=="E"  ||    $post=="F"  || $post=="G"  ||  $post=="H"  || $post=="I"  || $post=="J"  || $post=="K"  || $post=="L"  ||  $post=="M"  ||  $post=="N"  ||   $post=="P"  || $post=="O"   || $post=="Q"  || $post=="R"  ||$post=="S"  || $post=="T"  || $post=="U"  || $post=="V"  ||  $post=="W"  || $post=="X"  || $post=="Y"  ||  $post=="Z" ){
        $item= $pcon->getNameByFLetterItemCheck($post);
        
        }
    else{
       $item= $pcon->getAllItemCheck();//getShopItemPrices($shopid,$ownID);
       
        }

//////////////////////////
//////////////////////




 //$item=$pcon->getItem(); 

if($item->rowCount()>0){
 $itm=$item->fetchAll();
 $cc=0;
 foreach ($itm as $key => $it){ 
 
  $itemid=$it['itemid'];
  
   
       
  $nsD=$pcon->getShopName($shopid);

  $nsroN=$nsD->fetch();

  $roN=$pcon->getCheckedShopItemPricesOtherView($itemid,$shopid,$ownerD);//getThisItem($itemid);
if($roN->rowCount()>0){
   $rowN=$roN->fetch();
   ?>      
     
 <tr>
     <td id="td_height" >

 <label id="inner_lab"> <?php echo $it["s_no"];?> </label></td>
     
     <td id="td_height" >

 <label id="inner_lab"> <?php echo $it["itemname"];?> </label></td>

     <td><label id="inner_lab"><?php echo $it["itemtype"];?> </label></td>

     <td id="td_height" ><label id="inner_lab"><?php echo $it["itemcategory"];?> </label></td>

     <!--<td><label id="inner_lab"><?php // echo $it["vendor"];?> </label></td>

     <td><label id="inner_lab"><?php // echo $it["description"];?> </label></td>-->
 


     <td > 
<input type="text" name="cost<?php echo $cc;?>"  id="cost<?php echo $cc;?>"  disabled="true" value="<?php echo $rowN["price"];?>" style="background-color:#edf1ff;;border:0px; color:#2f74a6;font-size:14px;font-weight:bold;width:50px;" >

     </td>

      
     
  <td id="td_height">
     Quantity<br>  
     <sup id="rdn<?php echo $cc;?>"></sup>
        <input type="hidden" name="itemid<?php echo $cc;?>" id="itemid<?php echo $cc;?>" value="<?php echo $rowN['itemID'];?>"/>
         <input type="text" name="quantity<?php echo $cc;?>" id="quantity<?php echo $cc;?>" class="prof_info" /><br/>
         
  </td>
  
 
  
 

  <td id="td_height">
  <div style="position:relative;float:right; width:100px;background:green;border-radius:5px; display:none;" id="popup<?php echo $cc;?>" >

    <label style="color:#edf1ff;"> Total price:</label> <input type="text" name="price<?php echo $cc;?>"  id="price<?php echo $cc;?>"  disabled="true"   style="background-color:green;border:0px; color:#edf1ff;font-size:14px;font-weight:bold;width:95%;" >
    
        <input type="submit"   name="post" value="CheckOut" id="submit" 

         style="background-color:green;border:0px; color:#2f74ff;font-size:14px;font-weight:bold;cursor:pointer;"

           onclick="var status=$('#accstatus').val(); if(status=='Active'){var shopid=$('#shopid').val();var ownID=$('#owniD').val(); var batchID=$('#batchID').val(); var quantity=$('#quantity<?php echo $cc;?>').val();var cost=$('#price<?php echo $cc;?>').val(); var itemid =$('#itemid<?php echo $cc;?>').val();if(quantity!='') {$.post('orderPro.php',{itemid:itemid,owniD:ownID,shopid:shopid,quantity:quantity,cost:cost,batchID:batchID},function(data){$('#ordercart').html(data).show();}); $('#post<?php echo $cc;?>').show(); $('#popup<?php echo $cc;?>').hide();} else{document.getElementById('rdn<?php echo $cc;?>').innerHTML='Valide quantity required!..';}} else{
            document.getElementById('rdn<?php echo $cc;?>').innerHTML='Verification of your account is needed..Please sent your identity card photocopy via email:buda.co.tz@gmail.com or whatAp number:255 758 912 113 for account verification!..';
           }" />

           <input type="submit"   name="cancel" value="Cancel" id="cancel" 

         style="background-color:green;border:0px; color:red;font-size:14px;font-weight:bold;cursor:pointer;"

          onclick="document.getElementById('quantity<?php echo $cc;?>').value=''; document.getElementById('price<?php echo $cc;?>').value='';  $('#post<?php echo $cc;?>').show(); $('#popup<?php echo $cc;?>').hide();" />
        </div>

        <input type="submit"   name="post<?php echo $cc;?>" value="Order now" id="post<?php echo $cc;?>" class="spos"  

          onclick="var cost=$('#cost<?php echo $cc;?>').val();  var quantity=$('#quantity<?php echo $cc;?>').val(); var nC =/[0-9]/i; var i=0, j=0; if(quantity==''){ document.getElementById('rdn<?php echo $cc;?>').innerHTML='Quantity are required!..';}else{for(i=0;i<quantity.length;i++){if(!quantity[i].match(nC)){
             j++;}} if(j>0){ document.getElementById('rdn<?php echo $cc;?>').innerHTML='Quantity typed with error!..';}else{ document.getElementById('rdn<?php echo $cc;?>').innerHTML='';var tp=cost*quantity;$('#post<?php echo $cc;?>').hide(); $('#popup<?php echo $cc;?>').show();document.getElementById('price<?php echo $cc;?>').value=tp;
              }
   }
 
    j=0, i=0;
          " />
  </td>

   </tr> 
            
       
 
   
<?php 
}
 $cc++;
}
}
 
else
{
	?>
	<tr>
		<td colspan="2">
		Item not yet uploaded!..
			
		</td>
	</tr>
	<?php
}
?>
</table></center></td></tr></table> </center>
<?php
}
else{
	echo "NETWORK ERROR!..";
    }
}
 else
{
 	 echo "Some thing went wrong while processi the page!..";
}

?>
<script>

  function submision(){
    
    var searchValue=$('#searchValue').val();
    var ownID=$('#owniD').val();
    var ownerD=$('#ownerD').val(); 
    var shopid=$('#shopid').val();
    $('#result').empty();
    $.post('keypressThisShopItemSearchIn.php',{shopid:shopid,ownerD:ownerD,owniD:ownID,searchValue:searchValue},function(data){
      $('#result').html(data);

    });
  }
</script>
<?php
 require_once('../footerIns.php');
?>