 <?php 
   require_once("../head2Alts.php");
   if(isset($_POST['post']))

  {
    $post=$_POST['post'];
    
        $shopid=$_POST['shopid'];
        $ownID=$_POST['owniD'];
        
         $MS=$mcon->getThisMyShop($ownID,$shopid);
 if ($MS->rowCount()>0) {
  

 $shop=$MS->fetch();

  $shopid=$shop['shopid'];
                     }

     if ($post=="Delete") {

            $accountId =$_POST['emID'];

             ?>

              <center>
   
               <label id="succ">
               <?php  
      
              echo  $mcon->DeleteEmployee($accountId,$shopid);
                 ?>
   
                </label>
              </center> 
 
              <?php
            }


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

    //HOTEL NAVIGATION LINKS-->
      //require_once("my_hotel_main_nav_link.php");
     //-MAIN NAVIGATION LINK END-->
     $shop=$mcon->getShopName($shopid)->fetch();
      
    }

         $W=$mcon->getShopWorkers($shopid);

       
  }
?> 

<table width="100%" border="0">
  <tr>
    
  <td valign="top" width="85%" colspan="12">
    <label id="main_lab"><?php echo $shop["shopname"];?> </label><br/>
  
 <!-- <ul >
      <li>
                 <form action="myShopIemListView.php" method="post">

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


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

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

                 </form>

                </li>
       <li>
        
                <form action="newshopitempost.php" method="post">

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


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

 

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

                 </form>

       </li>

       <li >
        
                <form action="OrderToMyShop.php" method="post">

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


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

 

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

                 </form>

       </li>
        <li >
        
                <form action="shopWorkersProfile.php" method="post">

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


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

 

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

                 </form>

       </li>
  </ul>-->
 <?php
     require_once('shopNavLink.php');
  ?>
  </td>
  </tr>
  
 <tr><td colspan="4"><label id="main_lab"><?php echo $shop["shopname"];?> employee's profile
 </label></td>

 <td colspan="8" align="right"><ul> 

                           <li>
                  <form action="addShopWorkers.php" method="post">

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


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

                 <input class="pos" type="submit" value="New employee" name="post">

                        </form>
                        </li></ul></td></tr>
  <tr class="tr1" >

  <td rowspan="2">

         <label id="min_lab">NAME</label>

  </td>

  <td rowspan="2">

         <label id="min_lab">EMAIL</label>

  </td>

  <td rowspan="2">

         <label id="min_lab">PHONE NUMBER</label>

  </td>

  <td rowspan="2">

        <label id="min_lab">GENDER</label>

  </td>

  <td rowspan="2">

        <label id="min_lab">OCCUPATION</label>

  </td> 

  <td colspan="5">

  <label id="min_lab"> PHYSICAL ADDRESS</label>

  </td>

  <td rowspan="2">

         <label id="min_lab">JOBTITLE</label>

  </td>


  <td rowspan="2">

         <label id="min_lab">SALARY</label>

  </td>

</tr>
 <tr class="tr1">

 <td>

<label id="min_lab">COUNTRY</label>

</td>

<td>
 
<label id="min_lab">REGION</label>

</td>

<td>

<label id="min_lab">DISTRICT</label>

</td>

<td>

<label id="min_lab">WARD</label>

</td>

<td>

<label id="min_lab">STREET</label>

</td>



</tr>

<?php
 
 if($W->rowCount()>0){
  $rN=$W->fetchAll();
  foreach ($rN as $key => $nR){
    
  $accountId=$nR["accountId"];

  $hW=$con->getHotelWorkersDetail($accountId);

  if ($hW->rowCount()>0) {
     
      $N=$hW->fetch();
?>   
<tr class="tr2">

<td>
  <?php
  echo $N["fname"]." ".$N["mname"]." ".$N["lname"];
 
  ?>
</td>

<td>
  
 <?php
echo  $N["email"];
 ?>
</td>

<td>
  <?php
echo $N["phoneno"];
 ?>

</td>

<td>
  
<?php
echo $N["gender"];
 ?>
</td>

<td>
  <?php
echo $N["occupation"];
 ?>

</td>

<td>
  <?php
echo $N["country"];
 ?>
</td>

<td>
  
<?php
echo $N["city"];
 ?>
</td>

<td>
  <?php
echo $N["district"];
 ?>
</td>

<td>
  <?php
echo $N["ward"];
 ?>
</td>

<td>
  <?php
echo $N["street"];
 ?>

</td>

<td>
  <?php
echo $nR["jobtitle"];
 ?>

</td>

<td>
  <?php
echo $nR["salary"];
 ?>

</td>
</tr>
<tr>
<td height="16px" colspan="11" align="right">
    <form action="editShopEmployeeProfile.php" method="post">

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

                              <input class="hi" type="hidden" name="emID"  value="<?php echo $nR["accountId"];?>">

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

                              <input class="pos" type="submit" value="Edit" name="post">

                        </form>


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

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

                              <input class="hi" type="hidden" name="emID"  value="<?php echo $nR["accountId"];?>">

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

                              <input class="pos" type="submit" name="post" value="Delete" name="post">

                        </form>

</td>

</tr>
<?php
}/*
else
{
?>
<tr class="tr2"><td colspan="12"> No employee currently register</td></tr>
<?php
}
*/
}

}
else
{
?>
<tr class="tr2"><td colspan="12"> No employee currently register</td></tr>
<?php
}
?>

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