From 262130c9dbbe11024d0d10c2b9ba1d0aa2e760ff Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 13:58:08 +0530 Subject: [PATCH 01/22] website --- test.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.txt b/test.txt index 9f24223..218311b 100644 --- a/test.txt +++ b/test.txt @@ -1,2 +1,4 @@ -Hello + +Hello +Just another edit From ac707df778f1f93b480da246747cf113a5593b94 Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 18:35:30 +0530 Subject: [PATCH 02/22] website --- CFG.sql | 393 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) create mode 100644 CFG.sql diff --git a/CFG.sql b/CFG.sql new file mode 100644 index 0000000..6ab2b9f --- /dev/null +++ b/CFG.sql @@ -0,0 +1,393 @@ +-- MySQL dump 10.13 Distrib 5.5.49, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: CFG +-- ------------------------------------------------------ +-- Server version 5.5.49-0ubuntu0.14.04.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `Access_Role` +-- + +DROP TABLE IF EXISTS `Access_Role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Access_Role` ( + `Role_ID` int(10) NOT NULL, + `Role_Name` varchar(25) NOT NULL, + PRIMARY KEY (`Role_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Access_Role` +-- + +LOCK TABLES `Access_Role` WRITE; +/*!40000 ALTER TABLE `Access_Role` DISABLE KEYS */; +/*!40000 ALTER TABLE `Access_Role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Attendance` +-- + +DROP TABLE IF EXISTS `Attendance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Attendance` ( + `Student_ID` int(10) NOT NULL, + `Date` date NOT NULL, + `Present` tinyint(1) NOT NULL, + `Bridge` tinyint(1) NOT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Attendance_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Attendance` +-- + +LOCK TABLES `Attendance` WRITE; +/*!40000 ALTER TABLE `Attendance` DISABLE KEYS */; +/*!40000 ALTER TABLE `Attendance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Documents_Collected` +-- + +DROP TABLE IF EXISTS `Documents_Collected`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Documents_Collected` ( + `Student_ID` int(10) DEFAULT NULL, + `Document_Type` varchar(25) NOT NULL, + `Document_ID` varchar(25) NOT NULL, + `Document_URL` varchar(50) NOT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Documents_Collected_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Documents_Collected` +-- + +LOCK TABLES `Documents_Collected` WRITE; +/*!40000 ALTER TABLE `Documents_Collected` DISABLE KEYS */; +/*!40000 ALTER TABLE `Documents_Collected` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Health_Info` +-- + +DROP TABLE IF EXISTS `Health_Info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Health_Info` ( + `Student_ID` int(10) NOT NULL, + `Dental` int(1) NOT NULL, + `Vision` int(1) NOT NULL, + `Medical` int(1) NOT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Health_Info_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Health_Info` +-- + +LOCK TABLES `Health_Info` WRITE; +/*!40000 ALTER TABLE `Health_Info` DISABLE KEYS */; +/*!40000 ALTER TABLE `Health_Info` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Location_History` +-- + +DROP TABLE IF EXISTS `Location_History`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Location_History` ( + `Student_ID` int(10) DEFAULT NULL, + `City` varchar(25) DEFAULT NULL, + `Start_Date` date DEFAULT NULL, + `End_Date` date DEFAULT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Location_History_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Location_History` +-- + +LOCK TABLES `Location_History` WRITE; +/*!40000 ALTER TABLE `Location_History` DISABLE KEYS */; +/*!40000 ALTER TABLE `Location_History` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Relative_Details` +-- + +DROP TABLE IF EXISTS `Relative_Details`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Relative_Details` ( + `Student_ID` int(10) NOT NULL, + `Name` varchar(25) NOT NULL, + `Family_Income` int(7) NOT NULL, + `Mobile` int(10) NOT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Relative_Details_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Relative_Details` +-- + +LOCK TABLES `Relative_Details` WRITE; +/*!40000 ALTER TABLE `Relative_Details` DISABLE KEYS */; +/*!40000 ALTER TABLE `Relative_Details` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `School` +-- + +DROP TABLE IF EXISTS `School`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `School` ( + `School_ID` int(10) NOT NULL, + `School_Name` varchar(25) NOT NULL, + `Mobile` int(10) NOT NULL, + `City` varchar(25) NOT NULL, + `State` varchar(25) NOT NULL, + PRIMARY KEY (`School_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `School` +-- + +LOCK TABLES `School` WRITE; +/*!40000 ALTER TABLE `School` DISABLE KEYS */; +/*!40000 ALTER TABLE `School` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Sibling` +-- + +DROP TABLE IF EXISTS `Sibling`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Sibling` ( + `Student_ID` int(10) DEFAULT NULL, + `Sibling_ID` int(10) DEFAULT NULL, + KEY `Student_ID` (`Student_ID`), + KEY `Sibling_ID` (`Sibling_ID`), + CONSTRAINT `Sibling_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`), + CONSTRAINT `Sibling_ibfk_2` FOREIGN KEY (`Sibling_ID`) REFERENCES `Student` (`Student_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Sibling` +-- + +LOCK TABLES `Sibling` WRITE; +/*!40000 ALTER TABLE `Sibling` DISABLE KEYS */; +/*!40000 ALTER TABLE `Sibling` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Student` +-- + +DROP TABLE IF EXISTS `Student`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Student` ( + `Student_ID` int(10) NOT NULL DEFAULT '0', + `Name` varchar(25) NOT NULL, + `DOB` date NOT NULL, + `Enrolled` tinyint(1) NOT NULL, + `Gender` char(1) NOT NULL, + `School_ID` int(10) NOT NULL, + `Photo_URL` varchar(50) NOT NULL, + PRIMARY KEY (`Student_ID`), + KEY `School_ID` (`School_ID`), + CONSTRAINT `Student_ibfk_1` FOREIGN KEY (`School_ID`) REFERENCES `School` (`School_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Student` +-- + +LOCK TABLES `Student` WRITE; +/*!40000 ALTER TABLE `Student` DISABLE KEYS */; +/*!40000 ALTER TABLE `Student` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Student_Academic_Record` +-- + +DROP TABLE IF EXISTS `Student_Academic_Record`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Student_Academic_Record` ( + `Student_ID` int(10) DEFAULT NULL, + `Marks_Percentage` int(2) DEFAULT NULL, + `Behaviour` int(1) DEFAULT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Student_Academic_Record_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Student_Academic_Record` +-- + +LOCK TABLES `Student_Academic_Record` WRITE; +/*!40000 ALTER TABLE `Student_Academic_Record` DISABLE KEYS */; +/*!40000 ALTER TABLE `Student_Academic_Record` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Student_Contact_Details` +-- + +DROP TABLE IF EXISTS `Student_Contact_Details`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Student_Contact_Details` ( + `Student_ID` int(10) NOT NULL, + `Mobile` int(10) NOT NULL, + `Pincode` int(6) NOT NULL, + `City` varchar(25) NOT NULL, + `State` varchar(25) NOT NULL, + KEY `Student_ID` (`Student_ID`), + CONSTRAINT `Student_Contact_Details_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Student_Contact_Details` +-- + +LOCK TABLES `Student_Contact_Details` WRITE; +/*!40000 ALTER TABLE `Student_Contact_Details` DISABLE KEYS */; +/*!40000 ALTER TABLE `Student_Contact_Details` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Teacher_Ref` +-- + +DROP TABLE IF EXISTS `Teacher_Ref`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Teacher_Ref` ( + `Student_ID` int(10) DEFAULT NULL, + `Teacher_ID` int(10) DEFAULT NULL, + KEY `Student_ID` (`Student_ID`), + KEY `Teacher_ID` (`Teacher_ID`), + CONSTRAINT `Teacher_Ref_ibfk_1` FOREIGN KEY (`Student_ID`) REFERENCES `Student` (`Student_ID`), + CONSTRAINT `Teacher_Ref_ibfk_2` FOREIGN KEY (`Teacher_ID`) REFERENCES `Teachers` (`Teacher_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Teacher_Ref` +-- + +LOCK TABLES `Teacher_Ref` WRITE; +/*!40000 ALTER TABLE `Teacher_Ref` DISABLE KEYS */; +/*!40000 ALTER TABLE `Teacher_Ref` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Teachers` +-- + +DROP TABLE IF EXISTS `Teachers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Teachers` ( + `Teacher_ID` int(10) NOT NULL, + `Teacher_Name` varchar(25) NOT NULL, + `Mobile` int(10) NOT NULL, + `School_ID` int(10) NOT NULL, + PRIMARY KEY (`Teacher_ID`), + KEY `School_ID` (`School_ID`), + CONSTRAINT `Teachers_ibfk_1` FOREIGN KEY (`School_ID`) REFERENCES `School` (`School_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Teachers` +-- + +LOCK TABLES `Teachers` WRITE; +/*!40000 ALTER TABLE `Teachers` DISABLE KEYS */; +/*!40000 ALTER TABLE `Teachers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `User` +-- + +DROP TABLE IF EXISTS `User`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `User` ( + `Username` varchar(25) NOT NULL, + `Password` varchar(40) NOT NULL, + `Role_ID` int(10) NOT NULL, + PRIMARY KEY (`Username`), + KEY `Role_ID` (`Role_ID`), + CONSTRAINT `User_ibfk_1` FOREIGN KEY (`Role_ID`) REFERENCES `Access_Role` (`Role_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `User` +-- + +LOCK TABLES `User` WRITE; +/*!40000 ALTER TABLE `User` DISABLE KEYS */; +/*!40000 ALTER TABLE `User` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2016-07-09 18:32:53 From 063b5905a9f8f266eb2359730f539749f8d94c17 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sat, 9 Jul 2016 18:49:58 +0530 Subject: [PATCH 03/22] Database Connection Script Database Connection (MySql) Script --- samridhdhi_webapp/samridhdhi/website/connection.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 samridhdhi_webapp/samridhdhi/website/connection.php diff --git a/samridhdhi_webapp/samridhdhi/website/connection.php b/samridhdhi_webapp/samridhdhi/website/connection.php new file mode 100644 index 0000000..a43e126 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/connection.php @@ -0,0 +1,11 @@ + + From 7092f94effd08ab89902bcc2a4ccb658fbe9ff51 Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 19:12:09 +0530 Subject: [PATCH 04/22] website --- CFG.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CFG.sql b/CFG.sql index 6ab2b9f..84054fc 100644 --- a/CFG.sql +++ b/CFG.sql @@ -233,7 +233,7 @@ CREATE TABLE `Student` ( `DOB` date NOT NULL, `Enrolled` tinyint(1) NOT NULL, `Gender` char(1) NOT NULL, - `School_ID` int(10) NOT NULL, + `School_ID` int(10) DEFAULT NULL, `Photo_URL` varchar(50) NOT NULL, PRIMARY KEY (`Student_ID`), KEY `School_ID` (`School_ID`), @@ -390,4 +390,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-07-09 18:32:53 +-- Dump completed on 2016-07-09 19:00:29 From 3820c40bc60d46d528834dc471fb0e475f12185a Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 19:14:17 +0530 Subject: [PATCH 05/22] website --- relocation.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 relocation.php diff --git a/relocation.php b/relocation.php new file mode 100644 index 0000000..82b2e13 --- /dev/null +++ b/relocation.php @@ -0,0 +1,23 @@ + \ No newline at end of file From 124c210d9087bb5f1bb07557396e1ab6bcd01191 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sat, 9 Jul 2016 19:45:25 +0530 Subject: [PATCH 06/22] Changed DB name --- samridhdhi_webapp/samridhdhi/website/connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samridhdhi_webapp/samridhdhi/website/connection.php b/samridhdhi_webapp/samridhdhi/website/connection.php index a43e126..c277033 100644 --- a/samridhdhi_webapp/samridhdhi/website/connection.php +++ b/samridhdhi_webapp/samridhdhi/website/connection.php @@ -3,7 +3,7 @@ //server name $servername="localhost"; //Database Name - $dbname = "myDB"; + $dbname = "cfg"; //mysql username $username = "root"; //mysql password From 50d13005a0edcb934e10d7d21cf15401c1116cf4 Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 22:23:03 +0530 Subject: [PATCH 07/22] website --- relocation.php | 54 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/relocation.php b/relocation.php index 82b2e13..7886108 100644 --- a/relocation.php +++ b/relocation.php @@ -1,23 +1,43 @@ \ No newline at end of file From 00f6a40f4a047103d42f0334b9255f563ff31aa5 Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sat, 9 Jul 2016 22:25:14 +0530 Subject: [PATCH 08/22] Relocation Code --- .../samridhdhi/website/relocation.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 samridhdhi_webapp/samridhdhi/website/relocation.php diff --git a/samridhdhi_webapp/samridhdhi/website/relocation.php b/samridhdhi_webapp/samridhdhi/website/relocation.php new file mode 100644 index 0000000..7886108 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/relocation.php @@ -0,0 +1,43 @@ + \ No newline at end of file From 5ec148201277ac902767c42b3c07233006db4e66 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sat, 9 Jul 2016 20:42:50 +0530 Subject: [PATCH 09/22] Directory structure updated --- .../include}/connection.php | 0 samridhdhi/src/enrollment.php | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+) rename {samridhdhi_webapp/samridhdhi/website => samridhdhi/include}/connection.php (100%) create mode 100644 samridhdhi/src/enrollment.php diff --git a/samridhdhi_webapp/samridhdhi/website/connection.php b/samridhdhi/include/connection.php similarity index 100% rename from samridhdhi_webapp/samridhdhi/website/connection.php rename to samridhdhi/include/connection.php diff --git a/samridhdhi/src/enrollment.php b/samridhdhi/src/enrollment.php new file mode 100644 index 0000000..08ab474 --- /dev/null +++ b/samridhdhi/src/enrollment.php @@ -0,0 +1,42 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + // prepare sql and bind parameters + $sql = "INSERT INTO student (name, dob, gender) VALUES (:name, :dob, :gender)"; + $stmt = $conn->prepare($sql); + $stmt->bindParam(':name', $name); + $stmt->bindParam(':dob', $dob); + $stmt->bindParam(':gender', $gender); + $stmt->execute(); + $sql = "INSERT INTO relative_details (name,family_income,mobile) VALUES (:name,:family_income,:mobile)"; + $stmt = $conn->prepare($sql); + $stmt->bindParam(':name', $relative_name); + $stmt->bindParam(':family_income',$family_income); + $stmt->bindParam(':mobile',$relative_mobile); + $stmt->execute(); + $sql = "INSERT INTO student_contact_details (mobile,pincode,city,state) VALUES (:mobile,:pincode,:city,:state)"; + $stmt = $conn->prepare($sql); + $stmt->bindParam(':mobile', $student_mobile); + $stmt->bindParam(':pincode',$pincode); + $stmt->bindParam(':city',$city); + $stmt->bindParam(':state',$state); + $stmt->execute(); + } + catch(PDOException $e) + { + echo "Error: " . $e->getMessage(); + } +?> \ No newline at end of file From f640250a384370a9c00a19d81517e51a1ea12fed Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sat, 9 Jul 2016 21:05:16 +0530 Subject: [PATCH 10/22] Minor changes in connection db --- samridhdhi/include/connection.php | 2 ++ samridhdhi/src/enrollment.php | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/samridhdhi/include/connection.php b/samridhdhi/include/connection.php index c277033..3cec182 100644 --- a/samridhdhi/include/connection.php +++ b/samridhdhi/include/connection.php @@ -8,4 +8,6 @@ $username = "root"; //mysql password $password = "password"; + $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); ?> diff --git a/samridhdhi/src/enrollment.php b/samridhdhi/src/enrollment.php index 08ab474..adec8e8 100644 --- a/samridhdhi/src/enrollment.php +++ b/samridhdhi/src/enrollment.php @@ -1,7 +1,8 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // prepare sql and bind parameters $sql = "INSERT INTO student (name, dob, gender) VALUES (:name, :dob, :gender)"; $stmt = $conn->prepare($sql); From 7d8fa604042ad425299efa2a3d2bfc5aa144bcb7 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sat, 9 Jul 2016 23:17:31 +0530 Subject: [PATCH 11/22] Comments added to enrollment.php --- samridhdhi/src/enrollment.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/samridhdhi/src/enrollment.php b/samridhdhi/src/enrollment.php index adec8e8..8b47b3c 100644 --- a/samridhdhi/src/enrollment.php +++ b/samridhdhi/src/enrollment.php @@ -1,8 +1,10 @@ + prepare($sql); $stmt->bindParam(':name', $name); $stmt->bindParam(':dob', $dob); $stmt->bindParam(':gender', $gender); + //execute the statement $stmt->execute(); $sql = "INSERT INTO relative_details (name,family_income,mobile) VALUES (:name,:family_income,:mobile)"; + // prepare query statement and bind the parameters $stmt = $conn->prepare($sql); $stmt->bindParam(':name', $relative_name); $stmt->bindParam(':family_income',$family_income); $stmt->bindParam(':mobile',$relative_mobile); + //execute the statement $stmt->execute(); $sql = "INSERT INTO student_contact_details (mobile,pincode,city,state) VALUES (:mobile,:pincode,:city,:state)"; + // prepare query statement and bind the parameters $stmt = $conn->prepare($sql); $stmt->bindParam(':mobile', $student_mobile); $stmt->bindParam(':pincode',$pincode); $stmt->bindParam(':city',$city); $stmt->bindParam(':state',$state); + //execute the statement $stmt->execute(); } catch(PDOException $e) From 04bf04626b00c2077325e4d0614ec4133e83c8b7 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sun, 10 Jul 2016 00:20:35 +0530 Subject: [PATCH 12/22] Login Script Role based access redirect to be added --- samridhdhi/src/login.php | 91 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 samridhdhi/src/login.php diff --git a/samridhdhi/src/login.php b/samridhdhi/src/login.php new file mode 100644 index 0000000..b443149 --- /dev/null +++ b/samridhdhi/src/login.php @@ -0,0 +1,91 @@ + + 50 || strlen($_POST['username']) < 3) + { + echo 'Incorrect Length for Username'; + } + // check the password is the correct length + elseif (strlen( $_POST['password']) > 20 || strlen($_POST['password']) < 4) + { + echo 'Incorrect Length for Password'; + } + // check the password has only alpha numeric characters + elseif (ctype_alnum($_POST['password']) != true) + { + // if there is no match + echo "Password must be alpha numeric"; + } + else + { + // if we are here the data is valid and we can insert it into database + $user = filter_var($_POST['username'], FILTER_SANITIZE_STRING); + $pwd = filter_var($_POST['password'], FILTER_SANITIZE_STRING); + // encrypt the password + $pwd = sha1( $pwd ); + // connect to database + include './include/connection.php'; + try + { + $dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); + // set the error mode to excptions + $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + // prepare the select statement + $sql = "SELECT username,password,role_id FROM user WHERE username = :username AND password = :pwd"; + $stmt = $dbh->prepare($sql); + // bind the parameters + $stmt->bindParam(':username', $user, PDO::PARAM_STR); + $stmt->bindParam(':pwd', $pwd, PDO::PARAM_STR, 40); + // execute the prepared statement + $stmt->execute(); + // login id is stored in $user_id + $user_id = $stmt->fetchColumn(0); + // role is stored in $rolew + $role = $stmt->fetchColumn(1); + // if we have no result then login Failed + if($user_id == false) + { + echo 'Login Failed'; + } + // if we do have a result, all is well + else + { + // set the session user_id variable + $_SESSION['user_id'] = $user_id; + if($role == 1) + { + header('Location: localhost:8080/'); + } + elseif($role == 2) + { + header('Location: localhost:8080/'); + } + else if($role == 3) + { + header('Location: localhost:8080/'); + } + else($role == 4) + { + header('Location: localhost:8080/'); + } + } + } + catch(Exception $e) + { + // if we are here, something has gone wrong with the database + echo "Please try again later"; + } + } +?> \ No newline at end of file From fe924e69116e017246edd49e1c084fa4adc4a7e0 Mon Sep 17 00:00:00 2001 From: JyotshnaUmmadireddy Date: Sun, 10 Jul 2016 01:21:51 +0530 Subject: [PATCH 13/22] UI for Main page --- samridhdhi/src/enrollment.html | 113 +++++++++++++++++++++++++++++++++ samridhdhi/src/home.html | 43 +++++++++++++ samridhdhi/src/index.html | 38 +++++++++++ samridhdhi/src/login.html | 63 ++++++++++++++++++ 4 files changed, 257 insertions(+) create mode 100644 samridhdhi/src/enrollment.html create mode 100644 samridhdhi/src/home.html create mode 100644 samridhdhi/src/index.html create mode 100644 samridhdhi/src/login.html diff --git a/samridhdhi/src/enrollment.html b/samridhdhi/src/enrollment.html new file mode 100644 index 0000000..35bf2bd --- /dev/null +++ b/samridhdhi/src/enrollment.html @@ -0,0 +1,113 @@ + + + + + + + + + + Samridhdhi + + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/samridhdhi/src/home.html b/samridhdhi/src/home.html new file mode 100644 index 0000000..28624f1 --- /dev/null +++ b/samridhdhi/src/home.html @@ -0,0 +1,43 @@ +< + + + + + + + + + Samridhdhi + + + +

Samridhdhi Trust is a start-up, non-profit organization.

+

Samridhdhi’s Vision is to enable every underprivileged child get access to equal opportunity of holistic education leading to Enrichment or “Samridhdhi”

+

Samridhdhi’s Mission is to ensure measurable, irreversible and substantial positive change in the lives of children we reach out to, leading them to a world of possibilities through schooling and education.

+

Samridhdhi's Culture includes creating opportunity by evolving and implementing need based ideas. We are focused on consistency, perseverance and hard work, adapting to change as and when needed. We believe in responsive action leading to intuitive, simple and pragmatic solutions of ever emerging issues on ground rather than depending on premeditated boardroom models and academic research and plans.

+

Samridhdhi's Core Values are guided by Absolute Honesty, Active Integrity, Rigorous Implementation of Ideas, Focused Hard Work, Consistency, Perseverance and Clinical Transparency.

+ + \ No newline at end of file diff --git a/samridhdhi/src/index.html b/samridhdhi/src/index.html new file mode 100644 index 0000000..dd76be0 --- /dev/null +++ b/samridhdhi/src/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + Samridhdhi + + + + + \ No newline at end of file diff --git a/samridhdhi/src/login.html b/samridhdhi/src/login.html new file mode 100644 index 0000000..32cffbf --- /dev/null +++ b/samridhdhi/src/login.html @@ -0,0 +1,63 @@ + + + + + + + + + + Samridhdhi + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + \ No newline at end of file From b083eb4fe1c7ea0a4061f79c26b7bfc4d91bebb1 Mon Sep 17 00:00:00 2001 From: saurabhrajani Date: Sun, 10 Jul 2016 02:09:21 +0530 Subject: [PATCH 14/22] Website --- home.php | 0 .../samridhdhi/website/Student/relocation.php | 43 +++++++++++++ .../samridhdhi/website/teacher/connection.php | 10 +++ .../website/teacher/getStudents.php | 31 ++++++++++ .../samridhdhi/website/teacher/home.php | 62 +++++++++++++++++++ .../website/teacher/postAttendance.php | 11 ++++ 6 files changed, 157 insertions(+) create mode 100644 home.php create mode 100755 samridhdhi_webapp/samridhdhi/website/Student/relocation.php create mode 100755 samridhdhi_webapp/samridhdhi/website/teacher/connection.php create mode 100755 samridhdhi_webapp/samridhdhi/website/teacher/getStudents.php create mode 100755 samridhdhi_webapp/samridhdhi/website/teacher/home.php create mode 100644 samridhdhi_webapp/samridhdhi/website/teacher/postAttendance.php diff --git a/home.php b/home.php new file mode 100644 index 0000000..e69de29 diff --git a/samridhdhi_webapp/samridhdhi/website/Student/relocation.php b/samridhdhi_webapp/samridhdhi/website/Student/relocation.php new file mode 100755 index 0000000..b240313 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/Student/relocation.php @@ -0,0 +1,43 @@ += '9999-12-30'"; + mysqli_query($conn, $query) or die("Could not execute query 3"); + $query = "INSERT INTO Location_History VALUES ($studentID,'$city','".date('Y-m-d')."','9999-12-30')"; + mysqli_query($conn, $query) or die("Could not execute query 4"); + } + } + else{ + header("Location: home.html"); + } +?> \ No newline at end of file diff --git a/samridhdhi_webapp/samridhdhi/website/teacher/connection.php b/samridhdhi_webapp/samridhdhi/website/teacher/connection.php new file mode 100755 index 0000000..5c7b6e7 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/teacher/connection.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/samridhdhi_webapp/samridhdhi/website/teacher/getStudents.php b/samridhdhi_webapp/samridhdhi/website/teacher/getStudents.php new file mode 100755 index 0000000..74261c2 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/teacher/getStudents.php @@ -0,0 +1,31 @@ + + $row[0] + $row[1] + + + + "; + } + } + echo ""; + /*} + else{ + header("Location: login.php"); + }*/ +?> \ No newline at end of file diff --git a/samridhdhi_webapp/samridhdhi/website/teacher/home.php b/samridhdhi_webapp/samridhdhi/website/teacher/home.php new file mode 100755 index 0000000..cd2cf18 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/teacher/home.php @@ -0,0 +1,62 @@ + + + + Home + + + + + + + + + +
+
+ + + + + + + + + + + +
IDStudent NameAttendance
+
+
+ +
+
+ + \ No newline at end of file diff --git a/samridhdhi_webapp/samridhdhi/website/teacher/postAttendance.php b/samridhdhi_webapp/samridhdhi/website/teacher/postAttendance.php new file mode 100644 index 0000000..e3114e6 --- /dev/null +++ b/samridhdhi_webapp/samridhdhi/website/teacher/postAttendance.php @@ -0,0 +1,11 @@ + \ No newline at end of file From b1d6624241fe958ce6f4a6c289d309218cc78b04 Mon Sep 17 00:00:00 2001 From: Ranjit Date: Sun, 10 Jul 2016 02:13:30 +0530 Subject: [PATCH 15/22] Updated Enrolment Form Backend Integration for enrolment form --- samridhdhi/{include => src}/connection.php | 0 samridhdhi/src/enrollment.html | 209 ++++++++++----------- samridhdhi/src/enrollment.php | 6 +- samridhdhi/src/login.php | 2 +- 4 files changed, 106 insertions(+), 111 deletions(-) rename samridhdhi/{include => src}/connection.php (100%) diff --git a/samridhdhi/include/connection.php b/samridhdhi/src/connection.php similarity index 100% rename from samridhdhi/include/connection.php rename to samridhdhi/src/connection.php diff --git a/samridhdhi/src/enrollment.html b/samridhdhi/src/enrollment.html index 35bf2bd..8cf7803 100644 --- a/samridhdhi/src/enrollment.html +++ b/samridhdhi/src/enrollment.html @@ -1,113 +1,108 @@ - - - - - - - - Samridhdhi - - + + + + + + + Samridhdhi + -
-
- -
- -
-
-
- -
- -
-
-
- - - - + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ + + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
-
- -
-
- - + - - \ No newline at end of file diff --git a/samridhdhi/src/enrollment.php b/samridhdhi/src/enrollment.php index 8b47b3c..e7854d0 100644 --- a/samridhdhi/src/enrollment.php +++ b/samridhdhi/src/enrollment.php @@ -3,11 +3,11 @@ try { // including the connection script - include "./include/connection.php"; + include "connection.php"; //Receiving values from the enrollment form - $name = $_POST['name']; + $name = $_POST['sname']; $dob = $_POST['DOB']; - $gender = $_POST['gender']; + $gender = "M"; $student_mobile = $_POST['student_mobile']; $relative_mobile = $_POST['relative_mobile']; $pincode = $_POST['pincode']; diff --git a/samridhdhi/src/login.php b/samridhdhi/src/login.php index b443149..a288290 100644 --- a/samridhdhi/src/login.php +++ b/samridhdhi/src/login.php @@ -52,7 +52,7 @@ $stmt->execute(); // login id is stored in $user_id $user_id = $stmt->fetchColumn(0); - // role is stored in $rolew + // role is stored in $role $role = $stmt->fetchColumn(1); // if we have no result then login Failed if($user_id == false) From 2ee9f87cb620128017538a2c0e5794e43eb78add Mon Sep 17 00:00:00 2001 From: JyotshnaUmmadireddy Date: Sun, 10 Jul 2016 02:34:16 +0530 Subject: [PATCH 16/22] Duplicates --- samridhdhi/src/home.html | 919 ++++++++++++++++++++++++++++++++-- samridhdhi/src/index.html | 890 +++++++++++++++++++++++++++++++-- samridhdhi/src/login.html | 1000 +++++++++++++++++++++++++++++++++++-- 3 files changed, 2693 insertions(+), 116 deletions(-) diff --git a/samridhdhi/src/home.html b/samridhdhi/src/home.html index 28624f1..7cd312a 100644 --- a/samridhdhi/src/home.html +++ b/samridhdhi/src/home.html @@ -1,43 +1,886 @@ -< - - - - - - - - - Samridhdhi - -