<?php
  require_once('includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(1);
?>
<?php
  $categorie = find_by_id_new('articlestagedetails',(int)$_GET['StageId'],'Id');
  if(!$categorie){
    $session->msg("d","Missing Stage id.");
    redirect('articlestage.php');
  }
  
  //$stockcheck = find_by_column("stockdetails",(int)$_GET['UnitId'],"UnitId");

  //if(isset($stockcheck['UnitId'])) {
   // $session->msg("d","Unable to detele!... A dependend entry is existing in the database ");
   // redirect('units.php');
  //}
  
?>
<?php
  $delete_id = delete_by_id_new('articlestagedetails',(int)$categorie['Id'],'Id');
  if($delete_id){
      $session->msg("s","Article Stage deleted.");
      redirect('articlestage.php');
  } else {
      $session->msg("d","Article  deletion failed.");
      redirect('articlestage.php');
  }
?>
