'; echo 'alert(\''.__('Biblio relation succesfully removed!').'\');'; echo 'location.href = \'iframe_biblio_rel.php\';'; echo ''; } if (isset($_POST['remove'])) { $id = (integer)$_POST['remove']; $bid = (integer)$_POST['bid']; $sql_op = new simbio_dbop($dbs); $sql_op->delete('biblio_relation', 'biblio_id='.$bid.' AND rel_biblio_id='.$id); echo ''; } // if biblio ID is set if ($biblioID) { $table = new simbio_table(); $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"'; // database list $biblio_relation_q = $dbs->query("SELECT b2.title, b2.edition, b2.publish_year, ba.rel_biblio_id FROM biblio_relation AS ba LEFT JOIN biblio AS b2 ON ba.rel_biblio_id=b2.biblio_id WHERE ba.biblio_id=$biblioID ORDER BY rel_type ASC"); $row = 1; while (isset($biblio_relation_q->num_rows) && $biblio_relation_d = $biblio_relation_q->fetch_assoc()) { // alternate the row color $row_class = ($row%2 == 0)?'alterCell':'alterCell2'; // remove link $remove_link = 'Delete'; $title = $biblio_relation_d['title']; $publish_year = $biblio_relation_d['publish_year']; $edition = $biblio_relation_d['edition']; $table->appendTableRow(array($remove_link, $title, $publish_year, $edition)); $table->setCellAttr($row, 0, 'valign="top" class="'.$row_class.'" style="font-weight: bold; width: 10%;"'); $table->setCellAttr($row, 1, 'valign="top" class="'.$row_class.'" style="width: 50%;"'); $table->setCellAttr($row, 2, 'valign="top" class="'.$row_class.'" style="width: 20%;"'); $table->setCellAttr($row, 3, 'valign="top" class="'.$row_class.'" style="width: 20%;"'); $row++; } echo $table->printTable(); // hidden form echo '
'; } else { if ($_SESSION['biblioToBiblio']) { $table = new simbio_table(); $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"'; $row = 1; $row_class = 'alterCell2'; foreach ($_SESSION['biblioToBiblio'] as $biblio_session) { // remove link $remove_link = 'Remove'; if ($biblio_session) { $title_q = $dbs->query("SELECT title, publish_year, edition FROM biblio WHERE biblio_id=".$biblio_session[0]); $title_d = $title_q->fetch_row(); $title = $title_d[0]; $publish_year = $title_d[1]; $edition = $title_d[2]; } $table->appendTableRow(array($remove_link, $title, $publish_year, $edition)); $table->setCellAttr($row, 0, 'valign="top" class="'.$row_class.'" style="font-weight: bold; background-color: #ffc466; width: 10%;"'); $table->setCellAttr($row, 1, 'valign="top" class="'.$row_class.'" style="background-color: #ffc466; width: 50%;"'); $table->setCellAttr($row, 2, 'valign="top" class="'.$row_class.'" style="background-color: #ffc466; width: 20%;"'); $table->setCellAttr($row, 3, 'valign="top" class="'.$row_class.'" style="background-color: #ffc466; width: 20%;"'); $row++; } echo $table->printTable(); } } /* main content end */ $content = ob_get_clean(); // include the page template require SB.'/admin/'.$sysconf['admin_template']['dir'].'/notemplate_page_tpl.php';