summaryrefslogtreecommitdiff
path: root/scilab_fixer.module
diff options
context:
space:
mode:
authorprashant2014-09-25 15:14:21 +0530
committerprashant2014-09-25 15:14:21 +0530
commit1fc8484b3ad7858ee19b3658ac3f3d099e1e54c9 (patch)
treec7ea5221d53e335d44c3ad6c23d148f4203a29b8 /scilab_fixer.module
parent107d64f7166cca11233a690ee127838bade6108d (diff)
downloadtextbook_companion_fixer-1fc8484b3ad7858ee19b3658ac3f3d099e1e54c9.tar.gz
textbook_companion_fixer-1fc8484b3ad7858ee19b3658ac3f3d099e1e54c9.tar.bz2
textbook_companion_fixer-1fc8484b3ad7858ee19b3658ac3f3d099e1e54c9.zip
added aicte book disable eanble functionaty
Diffstat (limited to 'scilab_fixer.module')
-rwxr-xr-xscilab_fixer.module45
1 files changed, 35 insertions, 10 deletions
diff --git a/scilab_fixer.module b/scilab_fixer.module
index 5e210f4..33235e1 100755
--- a/scilab_fixer.module
+++ b/scilab_fixer.module
@@ -11,7 +11,6 @@
"title" => "Add AICTE books",
"page callback" => "scilab_fixer_aicte_all",
"access arguments" => array("fix scilab"),
- "access arguments" => array("fix scilab"),
"weight" => 30,
"type" => MENU_NORMAL_ITEM
);
@@ -28,7 +27,7 @@
"access arguments" => array("fix scilab"),
"weight" => 2,
"type" => MENU_LOCAL_TASK
- );
+ );
$items["fix/aicte/in"] = array(
"title" => "Mark Indian edition books",
"page callback" => "scilab_fixer_aicte_in_all",
@@ -37,8 +36,7 @@
);
$items["fix/code"] = array(
"title" => "Edit TBC code",
- "page callback" => "scilab_fixer_code_all",
- "access arguments" => array("fix scilab"),
+ "page callback" => "scilab_fixer_code_all",
"access arguments" => array("fix scilab"),
"type" => MENU_CALLBACK
);
@@ -47,6 +45,11 @@
"access callback" => TRUE,
"type" => MENU_CALLBACK
);
+ $items["fix/aicte/book/ajax"] = array(
+ "page callback" => "scilab_fixer_aicte_ajax",
+ "access callback" => TRUE,
+ "type" => MENU_CALLBACK
+ );
return $items;
}
@@ -208,12 +211,27 @@
";
db_query($query, $key);
$data .= "updated";
- } else {
+ }else {
$data = "Nothing to display.";
}
echo $data;
exit();
}
+ function scilab_fixer_aicte_ajax($item="", $key="") {
+ $data = "";
+ if($item == "selected") {
+ $query = "
+ UPDATE textbook_companion_aicte
+ SET selected = !selected
+ WHERE id = {$key}
+ ";
+ db_query($query);
+ $data = "updated";
+ }
+ echo $data;
+ exit();
+ }
+
function scilab_fixer_aicte_form($form_state, $aicte_id) {
$query = "
@@ -342,7 +360,7 @@
}
function scilab_fixer_aicte_edit_all($aicte_id=0) {
- $page_content = "";
+ $page_content = "";
if($aicte_id) {
$page_content .= drupal_get_form("scilab_fixer_aicte_form", $aicte_id);
} else {
@@ -356,22 +374,29 @@
"Edition", "Action",
);
$rows = array();
+
while($row = db_fetch_object($result)) {
- $item = array(
+ $item = array(
"{$row->book}",
"{$row->author}",
"{$row->edition}",
- l(t("Edit"), "fix/aicte/edit/{$row->id}")
+ l(t("Edit"), "fix/aicte/edit/{$row->id}")
);
+ if($row->selected) {
+ $check = "<input class='selected' type='checkbox' data-bid='{$row->id}' checked>";
+ } else {
+ $check = "<input class='selected' type='checkbox' data-bid='{$row->id}'>";
+ }
+ array_push($item, $check);
array_push($rows, $item);
- }
+ }
$page_content .= theme("table", $headers, $rows);
}
return $page_content;
}
function scilab_fixer_aicte_in_all(){
- $page_content = "";
+ $page_content = "";
$query = "
SELECT * FROM textbook_companion_aicte
";