diff --git a/action/csv.php b/action/csv.php index aff86eb..9d6fd50 100644 --- a/action/csv.php +++ b/action/csv.php @@ -17,50 +17,84 @@ } else{ - $sql = "INSERT into user_student_detail ( - student_IDNumber - ,student_fName -,student_mName -,student_lName -,student_address -,student_civilStat -,student_dob -,student_gender -,student_contact -,student_admission -,student_year_grad -,student_department - -) - values ( - '".$getData[0]."', - '".$getData[1]."', - '".$getData[2]."', - '".$getData[3]."', - '".$getData[4]."', - '".$getData[5]."', - '".$getData[6]."', - '".$getData[7]."', - '".$getData[8]."', - '".$getData[9]."', - '".$getData[10]."', - '".$getData[11]."', - - ) - "; + $student_IDNumber = $getData[0] ; + $student_fName = $getData[1]; + $student_mName = $getData[2]; + $student_lName = $getData[3]; + $student_address = $getData[4]; + $student_civilStat = $getData[5]; + $student_dob = $getData[6]; + $student_gender = $getData[7]; + $student_contact = $getData[8]; + $student_admission = $getData[9]; + $student_year_grad = $getData[10]; + $student_department = $getData[11]; + $sql = mysqli_query($con,"SELECT * FROM `marital_status` WHERE marital_Name like '%$student_civilStat%'"); + $mstat = mysqli_fetch_array($sql); + $student_civilStat = $mstat['ID']; + + $sql = mysqli_query($con,"SELECT * FROM `cvsu_department` WHERE department_name like '%$student_department%'"); + $dep = mysqli_fetch_array($sql); + $student_department = $dep['department_ID']; + if (strtoupper($student_gender) == 'MALE') { + $student_gender = "M"; + } + if (strtoupper($student_gender) == 'FEMALE') { + $student_gender = "F"; + } + $sql = "INSERT INTO `user_student_detail` +( +`student_ID`, +`student_userID`, + `student_img`, + `student_IDNumber`, + `student_fName`, + `student_mName`, +`student_lName`, + `student_address`, + `student_civilStat`, + `student_dob`, + `student_gender`, + `student_contact`, + `student_admission`, + `student_year_grad`, + `student_department`, + `student_status`, + `student_secretquestion`, + `student_secretanswer`) +VALUES +( +NULL, + NULL, + 'temp.gif', + '".$student_IDNumber."', + '".$student_fName."', + '".$student_mName."', + '".$student_lName."', + '".$student_address."', + '".$student_civilStat."', + '".$student_dob."', + '".$student_gender."', + '".$student_contact."', + '".$student_admission."', + '".$student_year_grad."', + '".$student_department."', + 'unregister', + NULL, + NULL)"; $result = mysqli_query($con, $sql); if(!isset($result)) { - echo ""; + // echo ""; } else { - echo ""; + // echo ""; } } @@ -70,9 +104,44 @@ fclose($file); } } -if(isset($_POST["Import_teacher"])){ +// if(isset($_POST["Import_teacher"])){ + +// "INSERT INTO `user_teacher_detail` +// (`teacher_ID`, +// `teacher_userID`, +// `teacher_img`, +// `teacher_facultyID`, +// `teacher_fName`, +// `teacher_mName`, +// `teacher_lName`, +// `teacher_gender`, +// `teacher_dob`, +// `teacher_contact`, +// `teacher_address`, +// `teacher_civilStat`, +// `teacher_department`, +// `teacher_status`, +// `teacher_secretquestion`, +// `teacher_secretanswer`) +// VALUES ( +// NULL, +// NULL, +// 'temp.gif', +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// 'unregister', +// NULL, +// NULL);" -} +// } if(isset($_POST["Export"])){ header('Content-Type: text/csv; charset=utf-8'); diff --git a/csv_format.csv b/csv_format.csv index 8c9618a..17155ff 100644 --- a/csv_format.csv +++ b/csv_format.csv @@ -1,14 +1,14 @@ -student_IDNumber,student_fName,student_mName,student_lName,student_address,student_civilStat,student_dob,student_gender,student_contact,student_admission,student_year_grad,student_department, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, -3123,z,z,z,z,1,z,m,123123,6/1/2013,6/1/2013,1, +student_IDNumber,student_fName,student_mName,student_lName,student_address,student_civilStat,student_dob,student_gender,student_contact,student_admission,student_year_grad,student_department +1321,h,z,z,czxczzxc,Single,3/29/2018,Male,123123,6/1/2013,6/1/2013,Computer Science +1322,fgh,z,z,ret,Single,3/29/2018,Female,123123,6/1/2013,6/1/2013,Information Technology +1323,ty,z,z,rt,Widowed,3/29/2018,Male,123123,6/1/2013,6/1/2013,Office Administration +1324,fgh,z,z,fg,Single,3/29/2018,Male,123123,6/1/2013,6/1/2013,Office Administration +1325,gfh,z,z,asdasdasd,Married,3/29/2018,Male,123123,6/1/2013,6/1/2013,Information Technology +1326,fgh,z,z,vbc,Single,3/29/2018,Male,123123,6/1/2013,6/1/2013,Office Administration +1327,z,z,z,cxv,Single,3/29/2018,Male,123123,6/1/2013,6/1/2013,Office Administration +1328,fgh,z,z,fgh,Single,5/29/2018,Male,123123,6/1/2013,6/1/2013,Information Technology +1329,fgh,z,z,asdasdasd,Single,3/29/2018,Female,123123,6/1/2013,6/1/2013,Information Technology +1330,fgh,z,z,fgh,Single,3/29/2018,Female,123123,6/1/2013,6/1/2013,Office Administration +1331,vbnvb,z,z,zxcasd,Single,3/29/2018,Female,123123,6/1/2013,6/1/2013,Office Administration +1332,vbnvb,z,z,bvnfgh,Single,4/29/2018,Female,123123,6/1/2013,6/1/2013,Office Administration +1333,ertert,z,z,asdasdasd,Single,3/30/2018,Female,123123,6/1/2013,6/1/2013,Office Administration diff --git a/db/tracerdata.sql b/db/tracerdata.sql index d7e435c..be34517 100644 --- a/db/tracerdata.sql +++ b/db/tracerdata.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Mar 06, 2018 at 12:26 AM +-- Generation Time: Mar 07, 2018 at 05:04 PM -- Server version: 10.1.26-MariaDB -- PHP Version: 7.1.8 @@ -728,7 +728,8 @@ CREATE TABLE `user_teacher_detail` ( INSERT INTO `user_teacher_detail` (`teacher_ID`, `teacher_userID`, `teacher_img`, `teacher_facultyID`, `teacher_fName`, `teacher_mName`, `teacher_lName`, `teacher_gender`, `teacher_dob`, `teacher_contact`, `teacher_address`, `teacher_civilStat`, `teacher_department`, `teacher_status`, `teacher_secretquestion`, `teacher_secretanswer`) VALUES (130, 8, 'temp.gif', 68, 'sarada', '', 'uchiha', 'F', '2018-01-28', '123123', '123123', 1, 2, 'register', '', ''), -(140, 17, 'temp.gif', 54, 'z', 'z', 'z', 'M', '0004-08-05', '85', 'z', 1, 1, 'register', '', ''); +(140, 17, 'temp.gif', 54, 'z', 'z', 'z', 'M', '0004-08-05', '85', 'z', 1, 1, 'register', '', ''), +(141, NULL, 'temp.gif', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'unregister', NULL, NULL); -- -------------------------------------------------------- @@ -1157,13 +1158,13 @@ ALTER TABLE `user_notif_type` -- AUTO_INCREMENT for table `user_student_detail` -- ALTER TABLE `user_student_detail` - MODIFY `student_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; + MODIFY `student_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `user_teacher_detail` -- ALTER TABLE `user_teacher_detail` - MODIFY `teacher_ID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=141; + MODIFY `teacher_ID` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=142; -- -- AUTO_INCREMENT for table `view_counter` diff --git a/recordteacher.php b/recordteacher.php index 9e79c51..8af79f5 100644 --- a/recordteacher.php +++ b/recordteacher.php @@ -202,7 +202,7 @@
- +