'; echo 'alert(\'Topic removed!\');'; echo 'location.href = \'iframe_topic.php\';'; echo ''; } if (isset($_POST['remove'])) { $id = (integer)$_POST['remove']; $bid = (integer)$_POST['bid']; $sql_op = new simbio_dbop($dbs); $sql_op->delete('biblio_topic', 'topic_id='.$id.' AND biblio_id='.$bid); 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_topic_q = $dbs->query("SELECT bt.*, t.topic, t.topic_type FROM biblio_topic AS bt LEFT JOIN mst_topic AS t ON bt.topic_id=t.topic_id WHERE bt.biblio_id=$biblioID ORDER BY level ASC"); $row = 1; while ($biblio_topic_d = $biblio_topic_q->fetch_assoc()) { // alternate the row color $row_class = ($row%2 == 0)?'alterCell':'alterCell2'; // remove link $remove_link = 'Delete'; $topic = $biblio_topic_d['topic']; $topic_type = $sysconf['subject_type'][$biblio_topic_d['topic_type']]; $table->appendTableRow(array($remove_link, $topic, $topic_type, $sysconf['subject_level'][$biblio_topic_d['level']])); $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="font-weight: bold; width: 50%;"'); $table->setCellAttr($row, 2, 'valign="top" class="'.$row_class.'" style="font-weight: bold; width: 20%;"'); $table->setCellAttr($row, 3, 'valign="top" class="'.$row_class.'" style="width: 20%;"'); $row++; } echo $table->printTable(); // hidden form echo '
'; } else { if ($_SESSION['biblioTopic']) { $table = new simbio_table(); $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"'; $row = 1; $row_class = 'alterCell2'; foreach ($_SESSION['biblioTopic'] as $biblio_session) { // remove link $remove_link = 'Remove'; if ($biblio_session) { $topic_q = $dbs->query("SELECT topic, topic_type FROM mst_topic WHERE topic_id=".$biblio_session[0]); $topic_d = $topic_q->fetch_row(); $topic = $topic_d[0]; $topic_type = $sysconf['subject_type'][$topic_d[1]]; } $table->appendTableRow(array($remove_link, $topic, $topic_type, $sysconf['subject_level'][$biblio_session[1]])); $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';