<?php

if (!empty($_GET['relation_type'])) {
 $relation_type_h = $_GET['relation_type'];
 $item_relation_object = inv_item_relation::find_all_by_relationType($relation_type_h);
} else {
 $relation_type_h = null;
 if (!empty($_GET['from_item_id_m'])) {
  $item_id_m = $_GET['from_item_id_m'];
  $item_relation_object = inv_item_relation::find_all_by_fromItemIdM($item_id_m);
 }
}

if (empty($item_relation_object)) {
 $item_relation_object = [new inv_item_relation()];
}

$pageno = !empty($_GET['pageno']) ? $_GET['pageno'] : 1;
$per_page = !empty($_GET['per_page']) ? $_GET['per_page'] : 10;
$total_count = count($item_relation_object);
$pagination = new pagination($pageno, $per_page, $total_count);
$pagination->setProperty('_path', 'form');
$position = ($pageno - 1) * $per_page;
?>