|
|
|
Execute($record_company_query_raw);
while (!$record_company->EOF) {
if ((!isset($_GET['mID']) || (isset($_GET['mID']) && ($_GET['mID'] == $record_company->fields['record_company_id']))) && !isset($aInfo) && (substr($action, 0, 3) != 'new')) {
$record_company_products = $db->Execute("select count(*) as products_count
from " . TABLE_PRODUCT_MUSIC_EXTRA . "
where record_company_id = '" . (int)$record_company->fields['record_company_id'] . "'");
$aInfo_array = array_merge($record_company->fields, $record_company_products->fields);
$aInfo = new objectInfo($aInfo_array);
}
if (isset($aInfo) && is_object($aInfo) && ($record_company->fields['record_company_id'] == $aInfo->record_company_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['record_company_name']; ?> |
fields['record_company_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>
fields['record_company_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ''; ?>
fields['record_company_id'] == $aInfo->record_company_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>
|
MoveNext();
}
?>
display_count($record_company_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_RECORD_COMPANIES); ?> |
display_links($record_company_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
|
record_company_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
'' . TEXT_HEADING_NEW_RECORD_COMPANY . '');
$contents = array('form' => zen_draw_form('record_company', FILENAME_RECORD_COMPANY, 'action=insert', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_NAME . ' ' . zen_draw_input_field('record_company_name', '', zen_set_field_length(TABLE_RECORD_COMPANY, 'record_company_name')));
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE . ' ' . zen_draw_file_field('record_company_image'));
$dir = @dir(DIR_FS_CATALOG_IMAGES);
$dir_info[] = array('id' => '', 'text' => "Main Directory");
while ($file = $dir->read()) {
if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
$dir_info[] = array('id' => $file . '/', 'text' => $file);
}
}
$dir->close();
$default_directory = 'record_company/';
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE_DIR . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE_MANUAL . ' ' . zen_draw_input_field('record_company_image_manual'));
$record_company_inputs_string = '';
$languages = zen_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$record_company_inputs_string .= ' ' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('record_company_url[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_RECORD_COMPANY_INFO, 'record_company_url') );
}
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_URL . $record_company_inputs_string);
$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_RECORD_COMPANY . '');
$contents = array('form' => zen_draw_form('record_company', FILENAME_RECORD_COMPANY, 'page=' . $_GET['page'] . '&mID=' . $aInfo->record_company_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_NAME . ' ' . zen_draw_input_field('record_company_name', $aInfo->record_company_name, zen_set_field_length(TABLE_RECORD_COMPANY, 'record_company_name')));
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE . ' ' . zen_draw_file_field('record_company_image') . ' ' . $aInfo->record_company_image);
$dir = @dir(DIR_FS_CATALOG_IMAGES);
$dir_info[] = array('id' => '', 'text' => "Main Directory");
while ($file = $dir->read()) {
if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
$dir_info[] = array('id' => $file . '/', 'text' => $file);
}
}
$dir->close();
$default_directory = substr( $aInfo->record_company_image, 0,strpos( $aInfo->record_company_image, '/')+1);
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE_DIR . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_IMAGE_MANUAL . ' ' . zen_draw_input_field('record_company_image_manual'));
$contents[] = array('text' => ' ' . zen_info_image($aInfo->record_company_image, $aInfo->record_company_name));
$record_company_inputs_string = '';
$languages = zen_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$record_company_inputs_string .= ' ' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('record_company_url[' . $languages[$i]['id'] . ']', zen_get_record_company_url($aInfo->record_company_id, $languages[$i]['id']), zen_set_field_length(TABLE_RECORD_COMPANY_INFO, 'record_company_url'));
}
$contents[] = array('text' => ' ' . TEXT_RECORD_COMPANY_URL . $record_company_inputs_string);
$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_RECORD_COMPANY . '');
$contents = array('form' => zen_draw_form('record_company', FILENAME_RECORD_COMPANY, 'page=' . $_GET['page'] . '&mID=' . $aInfo->record_company_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $aInfo->record_company_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->record_company_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' => ' ' . zen_info_image($aInfo->record_company_image, $aInfo->record_company_name));
$contents[] = array('text' => ' ' . TEXT_PRODUCTS . ' ' . $aInfo->products_count);
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|