diff options
-rwxr-xr-x | textbook_companion_fixer.module | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/textbook_companion_fixer.module b/textbook_companion_fixer.module index d31eac8..e26f2ee 100755 --- a/textbook_companion_fixer.module +++ b/textbook_companion_fixer.module @@ -571,11 +571,11 @@ function scilab_fixer_aicte_form_submit($form, &$form_state) )); $query->condition('id', $v["aicte_id"]); $num_updated = $query->execute(); - drupal_set_message("Book updated successfully", "status"); + drupal_set_message(t('Book updated successfully'), 'status'); } //$v["aicte_id"] else { $query = " - INSERT INTO textbook_companion_aicte + INSERT INTO {textbook_companion_aicte} (book, author, category, isbn, publisher, edition, year) VALUES (:book, :author, :category, :isbn, :publisher, :edition, :year) @@ -590,7 +590,7 @@ function scilab_fixer_aicte_form_submit($form, &$form_state) ':year' => $v["year"] ); $result = db_query($query, $args); - drupal_set_message("Book added successfully", "status"); + drupal_set_message(t('Book added successfully'),'status'); } } function scilab_fixer_aicte_all() @@ -754,6 +754,30 @@ function scilab_fixer_code_form($form, &$form_state) ); return $form; } +function _tbc_fixer_list_of_category($category_id = NULL) +{ + $category[0] = "Please select"; + if ($category_id == NULL) + { + $query = db_select('list_of_category'); + $query->fields('list_of_category'); + $query->orderBy('id', 'ASC'); + $category_list = $query->execute(); + } //$category_id == NULL + else + { + $query = db_select('list_of_category'); + $query->fields('list_of_category'); + $query->condition('category_id', $category_id); + $query->orderBy('id', 'ASC'); + $category_list = $query->execute(); + } + while ($category_list_data = $category_list->fetchObject()) + { + $category[$category_list_data->category_id] = $category_list_data->category_name; + } //$category_list_data = $category_list->fetchObject() + return $category; +} function scilab_fixer_code_all() { $page_content = ""; |