$music_genre_name); if ($action == 'insert') { $insert_sql_data = array('date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_MUSIC_GENRE, $sql_data_array); $music_genre_id = zen_db_insert_id(); } elseif ($action == 'save') { $update_sql_data = array('last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); zen_db_perform(TABLE_MUSIC_GENRE, $sql_data_array, 'update', "music_genre_id = '" . (int)$music_genre_id . "'"); } zen_redirect(zen_href_link(FILENAME_MUSIC_GENRE, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'mID=' . $music_genre_id)); break; case 'deleteconfirm': // demo active test if (zen_admin_demo()) { $_GET['action']= ''; $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); zen_redirect(zen_href_link(FILENAME_MUSIC_GENRE, 'page=' . $_GET['page'])); } $music_genre_id = zen_db_prepare_input($_GET['mID']); /* There are no images associated with Music Genres, so this section is commented out: if (isset($_POST['delete_image']) && ($_POST['delete_image'] == 'on')) { $music_genre = $db->Execute("select music_genre_image from " . TABLE_MUSIC_GENRE . " where music_genre_id = '" . (int)$music_genre_id . "'"); $image_location = DIR_FS_CATALOG_IMAGES . $music_genre->fields['music_genre_image']; if (file_exists($image_location)) @unlink($image_location); } */ $db->Execute("delete from " . TABLE_MUSIC_GENRE . " where music_genre_id = '" . (int)$music_genre_id . "'"); // $db->Execute("delete from " . TABLE_MUSIC_GENRE_INFO . " // where music_genre_id = '" . (int)$music_genre_id . "'"); if (isset($_POST['delete_products']) && ($_POST['delete_products'] == 'on')) { $products = $db->Execute("select products_id from " . TABLE_PRODUCT_MUSIC_EXTRA . " where music_genre_id = '" . (int)$music_genre_id . "'"); while (!$products->EOF) { zen_remove_product($products->fields['products_id']); $products->MoveNext(); } } else { $db->Execute("update " . TABLE_PRODUCT_MUSIC_EXTRA . " set music_genre_id = '' where music_genre_id = '" . (int)$music_genre_id . "'"); } zen_redirect(zen_href_link(FILENAME_MUSIC_GENRE, 'page=' . $_GET['page'])); break; } } ?> > <?php echo TITLE; ?>
'' . TEXT_HEADING_NEW_MUSIC_GENRE . ''); $contents = array('form' => zen_draw_form('music_genre', FILENAME_MUSIC_GENRE, 'action=insert', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_NEW_INTRO); $contents[] = array('text' => '
' . TEXT_MUSIC_GENRE_NAME . '
' . zen_draw_input_field('music_genre_name', '', zen_set_field_length(TABLE_MUSIC_GENRE, 'music_genre_name'))); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'edit': $heading[] = array('text' => '' . TEXT_HEADING_EDIT_MUSIC_GENRE . ''); $contents = array('form' => zen_draw_form('music_genre', FILENAME_MUSIC_GENRE, 'page=' . $_GET['page'] . '&mID=' . $aInfo->music_genre_id . '&action=save', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_INTRO); $contents[] = array('text' => '
' . TEXT_MUSIC_GENRE_NAME . '
' . zen_draw_input_field('music_genre_name', $aInfo->music_genre_name, zen_set_field_length(TABLE_MUSIC_GENRE, 'music_genre_name'))); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'delete': $heading[] = array('text' => '' . TEXT_HEADING_DELETE_MUSIC_GENRE . ''); $contents = array('form' => zen_draw_form('music_genre', FILENAME_MUSIC_GENRE, 'page=' . $_GET['page'] . '&mID=' . $aInfo->music_genre_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO); $contents[] = array('text' => '
' . $aInfo->music_genre_name . ''); // $contents[] = array('text' => '
' . zen_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE); if ($aInfo->products_count > 0) { $contents[] = array('text' => '
' . zen_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS); $contents[] = array('text' => '
' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $aInfo->products_count)); } $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($aInfo) && is_object($aInfo)) { $heading[] = array('text' => '' . $aInfo->music_genre_name . ''); $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ''); $contents[] = array('text' => '
' . TEXT_DATE_ADDED . ' ' . zen_date_short($aInfo->date_added)); if (zen_not_null($aInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($aInfo->last_modified)); $contents[] = array('text' => '
' . TEXT_PRODUCTS . ' ' . $aInfo->products_count); } break; } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { echo ' ' . "\n"; } ?>
Execute($music_genre_query_raw); while (!$music_genre->EOF) { if ((!isset($_GET['mID']) || (isset($_GET['mID']) && ($_GET['mID'] == $music_genre->fields['music_genre_id']))) && !isset($aInfo) && (substr($action, 0, 3) != 'new')) { $music_genre_products = $db->Execute("select count(*) as products_count from " . TABLE_PRODUCT_MUSIC_EXTRA . " where music_genre_id = '" . (int)$music_genre->fields['music_genre_id'] . "'"); $aInfo_array = array_merge($music_genre->fields, $music_genre_products->fields); $aInfo = new objectInfo($aInfo_array); } if (isset($aInfo) && is_object($aInfo) && ($music_genre->fields['music_genre_id'] == $aInfo->music_genre_id)) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> MoveNext(); } ?>
 
fields['music_genre_name']; ?> fields['music_genre_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?> fields['music_genre_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ''; ?> fields['music_genre_id'] == $aInfo->music_genre_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>
display_count($music_genre_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_MUSIC_GENRES); ?> display_links($music_genre_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
music_genre_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '