$pid = $ps['products_id'];
 $aid = $ps['articles_id'];
 $cs = $ps['stock'];
 $article_stock = '';
 $article_stock .= '<h2>Show Historical data for &nbsp;';
 $article_stock .= '<select id="pah-period">' . loadComboListFromArray($history_options, null, $period, false) . '</select>';
 $article_stock .= '<select id="pah-daisum">' . loadComboListFromArray($history_options_2, null, $daily_summary, false) . '</select>';
 $article_stock .= '</h2>';
 $start_date = "-{$history_options[$period]}";
 $euh_start_date = strtotime($start_date);
 $euh_start = date('d.m.Y', $euh_start_date);
 $euh_end = date('d.m.Y');
 $article_stock .= '<div>';
 $article_stock .= '<h3>On Stock in Database History (' . $euh_end . '-' . $euh_start . ')</h3>';
 if ($daily_summary == '1') {
     $euh_asc = $class_pm->stockRetrieveHistoryDaily($whid, $pid, $aid, $start_date);
     if (count($euh_asc) > 0) {
         $euh = array_reverse($euh_asc);
         //reverse asc sort
         $elup_table = array();
         $bit = array();
         $bit['sort'] = 'No';
         $bit['date_add'] = 'Date';
         $bit['qty add'] = 'Added';
         $bit['qty reduce'] = 'Reduced';
         $bit['source'] = 'On Stock in DB<br />Before Transaction';
         $elup_table[] = $bit;
         $euh_count = 0;
         $stock_movement = $cs;
         foreach ($euh as $h) {
             $euh_count++;