summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprashantsinalkar2018-10-08 17:15:00 +0530
committerprashantsinalkar2018-10-08 17:15:00 +0530
commit7931e4a349a80d20990c0b1a9951766241e37eec (patch)
tree6476e4a2752b47556122640fc9a3fa4826730ebe
parent2efc9c8cf614858173642c2d7021a4f45ccdd853 (diff)
downloadosdag_workshop_booking-7931e4a349a80d20990c0b1a9951766241e37eec.tar.gz
osdag_workshop_booking-7931e4a349a80d20990c0b1a9951766241e37eec.tar.bz2
osdag_workshop_booking-7931e4a349a80d20990c0b1a9951766241e37eec.zip
added form for workshop proposal
-rw-r--r--osdag_workshop_booking.info5
-rw-r--r--osdag_workshop_booking.install0
-rw-r--r--osdag_workshop_booking.module23
-rw-r--r--workshop_registration.inc164
4 files changed, 192 insertions, 0 deletions
diff --git a/osdag_workshop_booking.info b/osdag_workshop_booking.info
new file mode 100644
index 0000000..75329d2
--- /dev/null
+++ b/osdag_workshop_booking.info
@@ -0,0 +1,5 @@
+name = "Odsag Workshop Booking"
+description = "Osdag project, FOSSEE, IIT Bombay"
+package = FOSSEE IITB
+version = "7.1"
+core = "7.x"
diff --git a/osdag_workshop_booking.install b/osdag_workshop_booking.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/osdag_workshop_booking.install
diff --git a/osdag_workshop_booking.module b/osdag_workshop_booking.module
new file mode 100644
index 0000000..9964270
--- /dev/null
+++ b/osdag_workshop_booking.module
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Implementation of hook_menu().
+ */
+function osdag_workshop_booking_menu()
+{
+ $items = array();
+ /* PROPOSAL */
+ $items['osdag-workshop-booking/registration'] = array(
+ 'title' => 'Osdag Workshop Registration form',
+ 'description' => 'Osdag Workshop Registration form',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array(
+ 'osdag_workshop_booking_form'
+ ),
+ 'access arguments' => array(
+ 'workshop booking registration'
+ ),
+ 'type' => MENU_NORMAL_ITEM,
+ 'file' => 'workshop_registration.inc'
+ );
+ return $items;
+}
diff --git a/workshop_registration.inc b/workshop_registration.inc
new file mode 100644
index 0000000..3122452
--- /dev/null
+++ b/workshop_registration.inc
@@ -0,0 +1,164 @@
+<?php
+// $Id$
+/*
+Approval Status :
+0 - Pending
+1 - Approved
+2 - Dis-Approved
+3 - Solved
+Solution Status :
+0 - Pending
+1 - Approved
+2 - Dis-Approved
+Solution Display :
+0 - No
+1 - Yes
+
+Tables :
+lab_migration_solution : approval_status
+0 - Pending
+1 - Approved
+2 - Disapproved (delete it)
+*/
+/* workshop booking registration form */
+function osdag_workshop_booking_form($form, &$form_state)
+{
+ global $user;
+ /************************ start approve book details ************************/
+ $query = db_select('osdag_workshop_booking');
+ $query->fields('osdag_workshop_booking');
+ $query->condition('uid', $user->uid);
+ $query->orderBy('id', 'DESC');
+ $query->range(0, 1);
+ $proposal_q = $query->execute();
+ $proposal_data = $proposal_q->fetchObject();
+ if ($proposal_data)
+ {
+ if ($proposal_data->approval_status == 0 || $proposal_data->approval_status == 1)
+ {
+ drupal_set_message(t('We have already received your proposal.'), 'status');
+ drupal_goto('');
+ return;
+ } //$proposal_data->approval_status == 0 || $proposal_data->approval_status == 1
+ } //$proposal_data
+ $form['#attributes'] = array(
+ 'enctype' => "multipart/form-data"
+ );
+ $form['name_title'] = array(
+ '#type' => 'select',
+ '#title' => t('Title'),
+ '#options' => array(
+ 'Dr' => 'Dr.',
+ 'Prof' => 'Prof.',
+ 'Shri' => 'Shri',
+ 'Smt' => 'Smt',
+ 'Ku.' => 'Ku.',
+ 'Mr.' => 'Mr.',
+ 'Mrs.' => 'Mrs.',
+ 'Ms.' => 'Ms.',
+ ),
+ '#required' => TRUE
+ );
+ $form['fname'] = array(
+ '#type' => 'textfield',
+ '#title' => t('First Name'),
+ '#size' => 30,
+ '#maxlength' => 50,
+ '#required' => TRUE
+ );
+ $form['lname'] = array(
+ '#type' => 'textfield',
+ '#title' => t('last Name'),
+ '#size' => 30,
+ '#maxlength' => 50,
+ '#required' => TRUE
+ );
+ $form['designation'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Designation'),
+ '#size' => 30,
+ '#maxlength' => 50,
+ '#required' => TRUE
+ );
+ $form['institute_company'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Name of the Institute/Company'),
+ '#size' => 30,
+ '#maxlength' => 50,
+ '#required' => TRUE
+ );
+ $form['email_id'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Email'),
+ '#size' => 30,
+ '#value' => $user->mail,
+ '#disabled' => TRUE
+ );
+ $form['alt_email_id'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Organization Email'),
+ '#size' => 30,
+ '#value' => $user->mail,
+ '#disabled' => False
+ );
+ $form['contact_ph'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Contact No.'),
+ '#size' => 30,
+ '#maxlength' => 15,
+ '#required' => TRUE
+ );
+ $form['department'] = array(
+ '#type' => 'select',
+ '#title' => t('Department/Branch'),
+ //'#options' => _lm_list_of_departments(),
+ '#options' => array(""=>""),
+ '#required' => TRUE
+ );
+ $form['university'] = array(
+ '#type' => 'textfield',
+ '#title' => t('University/ Institute'),
+ '#size' => 80,
+ '#maxlength' => 200,
+ '#required' => TRUE,
+ '#attributes' => array(
+ 'placeholder' => 'Insert full name of your institute/ university.... '
+ ),
+ '#description' => 'Please insert full name of your institute/ university.'
+ );
+ $form['city'] = array(
+ '#type' => 'select',
+ '#title' => t('City/ Village'),
+ //'#options' => _lm_list_of_cities(),
+ '#options' => array(""=>""),
+ '#maxlength' => 150,
+ '#required' => TRUE,
+ '#description' => 'Please select location of your institute/ university.'
+ );
+ $form['pincode'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Pincode'),
+ '#size' => 30,
+ '#maxlength' => 6,
+ '#required' => TRUE,
+ '#attributes' => array(
+ 'placeholder' => 'Insert pincode of your city/ village....'
+ ),
+ '#description' => 'Please insert pincode of your institute/ university.'
+ );
+ $form['all_state'] = array(
+ '#type' => 'select',
+ '#title' => t('State'),
+ //'#options' => _lm_list_of_states(),
+ '#options' => array(""=>""),
+ '#required' => TRUE,
+ '#tree' => TRUE,
+ '#validated' => TRUE,
+ '#description' => 'Please select state of your institute/ university.'
+ );
+ $form['submit'] = array(
+ '#type' => 'submit',
+ '#value' => t('Submit')
+ );
+ return $form;
+}