"Testimonials by FOSSEE Summer Fellows", "page callback" => "fellowship_testimonials_display_all", "access arguments" => array("view fellowship_testimonials"), "type" => MENU_CALLBACK );*/ $items["internship-experiences"] = array( "title" => "Intership Experiences", "page callback" => "drupal_get_form", "page arguments" => array( "fellowship_testimonials_display_form" ), "access arguments" => array( "view fellowship_testimonials" ), "type" => MENU_NORMAL_ITEM ); $items["internship-experiences/year-wise"] = array( "title" => "Testimonials by FOSSEE internship-experiences year wise", "page callback" => "fellowship_testimonials_display_year_wise", "access arguments" => array("view fellowship_testimonials"), "type" => MENU_CALLBACK, 'file' => 'testimonials_year_wise.inc' ); $items["internship-experiences/add"] = array( "title" => "Add internship-experiences", "page callback" => "fellowship_testimonials_add_all", "access arguments" => array("manage fellowship_testimonials"), "type" => MENU_CALLBACK, 'file' => 'testimonials_add.inc' ); $items["internship-experiences/edit"] = array( "title" => "Edit internship-experiences", "page callback" => "fellowship_testimonials_edit_all", "access arguments" => array("manage fellowship_testimonials"), "type" => MENU_CALLBACK, 'file' => 'testimonials_edit.inc' ); $items["internship-experiences/delete"] = array( "title" => "Delete internship-experiences", "page callback" => "fellowship_testimonials_delete_all", "access arguments" => array("manage fellowship_testimonials"), "type" => MENU_CALLBACK ); $items["animation-hackathon/vle-registration"] = array( "title" => "All India 2D Animation Hackathon registration", "page callback" => "animation_hackathon_vle_registration", //"page arguments" => "animation_hackathon_vle_registration_form", "access arguments" => array("Animation Hackathon registration"), "type" => MENU_NORMAL_ITEM, "file" => 'vle_registration.inc' ); $items["animation-hackathon/view/registrations"] = array( "title" => "All India 2D Animation Hackathon Registered particpants", "page callback" => "view_animation_hackathon_vle_registrations", /*"page arguments" => "",**/ "access arguments" => array("Manage Animation Hackathon registration"), "type" => MENU_NORMAL_ITEM, "file" => 'vle_registration.inc' ); $items["animation-hackathon/view/registrations/download"] = array( "title" => "All India 2D Animation Hackathon Registered particpants", "page callback" => "download_registration_details", /*"page arguments" => "",**/ "access arguments" => array("Manage Animation Hackathon registration"), "type" => MENU_NORMAL_ITEM, "file" => 'vle_registration.inc' ); return $items; } function fellowship_testimonials_permission() { return array( "view fellowship_testimonials" => array ( "title" => t("view fellowship_testimonials"), 'restrict access' => TRUE, ), "manage fellowship_testimonials" => array ( "title" => t("manage fellowship_testimonials"), 'restrict access' => TRUE, ), "Animation Hackathon registration" => array( "title" => t("Animation Hackathon registration"), 'restrict access' => TRUE ), "Manage Animation Hackathon registration" => array( "title" => t("Manage Animation Hackathon registration"), 'restrict access' => TRUE ) ); } function get_video_testimonials() { $page_content = ""; /*$query = " SELECT * FROM fellowship_testimonials ORDER BY id DESC "; $result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM fellowship_testimonials");*/ $query = db_select('fellowship_testimonials'); $query->fields('fellowship_testimonials'); $query->condition('testimonial_type', 'V'); $query->orderBy('year', 'DESC'); //$result = $query->extend('PagerDefault')->limit(3)->execute(); $result = $query->execute(); $page_content .= "
"; while($row = $result->fetchObject()) { $speakerquery = db_select('fellows'); $speakerquery->fields('fellows'); $speakerquery->condition('t_id', $row->id); $speakerresult = $speakerquery->execute(); $page_content .= "
"; while($speakerrow = $speakerresult->fetchObject()){ $page_content .= "

{$speakerrow->name}
Institute: {$speakerrow->institute}, {$speakerrow->place}

"; } $page_content .= "{$row->activity}

Floss: {$row->fellowship_task}

Year of participation: {$row->year}

"; } $page_content .= "
"; //$page_content .= theme("pager", NULL, 4, 0); $page_content .= theme('pager', array('header' => NULL, 'rows' => 4 )); return $page_content; } function get_text_testimonials() { $page_content = ""; /*$query = " SELECT * FROM fellowship_testimonials ORDER BY id DESC "; $result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM fellowship_testimonials");*/ $query = db_select('fellowship_testimonials'); $query->fields('fellowship_testimonials'); $query->condition('testimonial_type', 'T'); $query->orderBy('year', 'DESC'); //$result = $query->extend('PagerDefault')->limit(3)->execute(); $result = $query->execute(); $page_content .= "
"; while($row = $result->fetchObject()) { $speakerquery = db_select('fellows'); $speakerquery->fields('fellows'); $speakerquery->condition('t_id', $row->id); $speakerresult = $speakerquery->execute(); $speakerrow = $speakerresult->fetchObject(); $page_content .= "

{$row->testimonial_text}

"; //while($speakerrow = $speakerresult->fetchObject()){ $page_content .= "

{$speakerrow->name}
{$speakerrow->institute}, {$speakerrow->place}
"; // } $page_content .= "{$row->fellowship_task}, {$row->activity}, {$row->year}

"; } $page_content .= "
"; //$page_content .= theme("pager", NULL, 4, 0); $page_content .= theme('pager', array('header' => NULL, 'rows' => 4 )); return $page_content; } function fellowship_testimonials_init() { drupal_add_css(drupal_get_path("module", "fellowship_testimonials") . "/css/fellowship_testimonials.css"); } function fellowship_testimonials_display_form($form, $form_state){ $form = array(); $form['tab_content'] = array( '#type' => 'item', '#markup' => '
' . get_text_testimonials() . '
' . get_video_testimonials() . '
' ); $form['lastdiv'] = array( '#type' => 'item', '#markup' => '', '#suffix' => '' ); return $form; } function _hackathon_list_of_states() { $states = array(''=> '- Select -'); $states_list = db_query("SELECT state FROM state_wise_csc_academies ORDER BY state ASC"); while ($states_list_data = $states_list->fetchObject()) { $states[$states_list_data->state] = $states_list_data->state; } return $states; } function _hackathon_list_of_district($state=Null) { $district = array(''=> '- Select -'); if($state){ $district_list = db_query("SELECT district FROM state_wise_csc_academies WHERE state = :state ORDER BY district ASC", array(':state'=> $state)); while ($district_list_data = $district_list->fetchObject()) { $district[$district_list_data->district] = $district_list_data->district; } } return $district; } function _hackathon_list_of_cities($state=Null, $district=NULL) { $csc_block_name = array(''=> '- Select -'); if($state){ $csc_block_name_list = db_query("SELECT block_name FROM state_wise_csc_academies WHERE state = :state AND district = :district ORDER BY block_name ASC", array(':state'=> $state, ':district' =>$district)); //var_dump($csc_block_name_list->rowCount());die; while ($csc_block_name_list_data = $csc_block_name_list->fetchObject()) { $csc_block_name[$csc_block_name_list_data->block_name] = $csc_block_name_list_data->block_name; } } return $csc_block_name; } function vle_registration_csv_path() { return $_SERVER['DOCUMENT_ROOT'] . base_path() . 'data/'; }