Şuanki Dizin: /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old/grv/admin/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old/grv/admin/student-excel-upload.php |
<?php require_once('lib/functions.php'); $db = new db_functions(); if(!isset($_SESSION['login_admin_user_id'])) { header("location:index.php"); } $flag = 0; $success_flag = 0; ?> <!-- Author: W3layouts Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ --> <!DOCTYPE HTML> <html> <head> <title> <?php echo $application_title; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="Novus Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.css" rel='stylesheet' type='text/css' /> <!-- Custom CSS --> <link href="css/style.css" rel='stylesheet' type='text/css' /> <!-- font CSS --> <!-- font-awesome icons --> <link href="css/font-awesome.css" rel="stylesheet"> <!-- //font-awesome icons --> <!-- js--> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/modernizr.custom.js"></script> <!--webfonts--> <link href='//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'> <!--//webfonts--> <!--animate--> <link href="css/animate.css" rel="stylesheet" type="text/css" media="all"> <script src="js/wow.min.js"></script> <script> new WOW().init(); </script> <!--//end-animate--> <!-- chart --> <script src="js/Chart.js"></script> <!-- //chart --> <!--Calender--> <link rel="stylesheet" href="css/clndr.css" type="text/css" /> <script src="js/underscore-min.js" type="text/javascript"></script> <script src= "js/moment-2.2.1.js" type="text/javascript"></script> <script src="js/clndr.js" type="text/javascript"></script> <script src="js/site.js" type="text/javascript"></script> <!--End Calender--> <!-- Metis Menu --> <script src="js/metisMenu.min.js"></script> <script src="js/custom.js"></script> <link href="css/custom.css" rel="stylesheet"> <!--//Metis Menu --> </head> <body class="cbp-spmenu-push"> <div class="main-content"> <!--left-fixed -navigation--> <?php include("left-section.php"); ?> <!--left-fixed -navigation--> <!-- header-starts --> <?php include("header.php"); ?> <!-- //header-ends --> <!-- main content start--> <div id="page-wrapper" style="min-height:700px;"> <div class="main-page signup-page"> <h3 class="title1"> Student Data Upload (Excel)</h3> <div class="sign-up-row widget-shadow"> <form method="POST" autocomplete="off" action="<?php echo $_SERVER['PHP_SELF'] ?>" enctype="multipart/form-data"> <?php if($success_flag==1) { ?> <div class="alert alert-success"> <span class="alert-link">Success! </span>Record added successfully. </div> <?php } ?> <?php if($success_flag==2) { ?> <div class="alert alert-danger"> <span class="alert-link">Failed! </span>This Record Already Exist. </div> <?php } ?> <div class="form-group col-lg-6"> <label> Select Excel File To Upload : </label> <input type="file" class="form-control" name="photoimg" required autofocus style="cursor:pointer;" /> </div> <div class="sub_home"> <input type="submit" value="Upload Student Excel" name="submit_btn" style="width:30%;"> <div class="clearfix"> </div> </div> </form> <?php error_reporting(E_ERROR | E_PARSE); if(isset($_POST['submit_btn'])) { require("reader.php"); $path = "excel/"; echo $name = $_FILES['photoimg']['name']; if(strlen($name)) { $valid_formats = array("xlsx","xls"); list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { $files = array(); $tmp = $_FILES['photoimg']['tmp_name']; $num = rand(0,15200); $actual_image_name = session_id().$num.".".strtolower("xls"); if(move_uploaded_file($tmp, $path.$actual_image_name)) { $file = $path.$actual_image_name; //$file = $_FILES['photoimg']['name']; $connection=new Spreadsheet_Excel_Reader(); // our main object $connection->read($file); $startrow=1; # Get first sheet $sheet = $connection->sheets[0]; # Get all rows in the sheet $rows = $sheet['cells'];; # Find total number of rows $rowCount = count($rows); $endrow=$rowCount; $col1=1; $actual_image_name = ""; $actual_image_name1 = ""; $actual_image_name2 = ""; $advertising_board = ""; $news_paper = ""; $teachers = ""; $friends = ""; $ex_students = ""; $pre_class = ""; $other = ""; for($i=$startrow;$i<$endrow;$i++) { $class = $connection->sheets[0]["cells"][$i][1]; $medium = $connection->sheets[0]["cells"][$i][2]; $division = $connection->sheets[0]["cells"][$i][3]; $roll_no = $connection->sheets[0]["cells"][$i][4]; $surname = $connection->sheets[0]["cells"][$i][5]; $stud_name = $connection->sheets[0]["cells"][$i][6]; $father_name = $connection->sheets[0]["cells"][$i][7]; $mother_name = $connection->sheets[0]["cells"][$i][8]; $stud_contact = $connection->sheets[0]["cells"][$i][9]; $father_contact = $connection->sheets[0]["cells"][$i][10]; $mother_contact = $connection->sheets[0]["cells"][$i][11]; $residential_no = $connection->sheets[0]["cells"][$i][12]; $address = $connection->sheets[0]["cells"][$i][13]; $cor_address = $connection->sheets[0]["cells"][$i][14]; $child_desc = $connection->sheets[0]["cells"][$i][15]; $email = $connection->sheets[0]["cells"][$i][16]; $aadhar_number = $connection->sheets[0]["cells"][$i][17]; $religion = $connection->sheets[0]["cells"][$i][18]; $caste = $connection->sheets[0]["cells"][$i][19]; $category = $connection->sheets[0]["cells"][$i][20]; $mother_tongue = $connection->sheets[0]["cells"][$i][21]; $nationality = $connection->sheets[0]["cells"][$i][22]; $birth_place = $connection->sheets[0]["cells"][$i][23]; $birth_date = $connection->sheets[0]["cells"][$i][24]; $gender = $connection->sheets[0]["cells"][$i][25]; $last_school = $connection->sheets[0]["cells"][$i][26]; $admission_date = $connection->sheets[0]["cells"][$i][27]; $blood_group = $connection->sheets[0]["cells"][$i][28]; $height = $connection->sheets[0]["cells"][$i][29]; $weight = $connection->sheets[0]["cells"][$i][30]; $remarks = $connection->sheets[0]["cells"][$i][31]; $no_of_pupil = $connection->sheets[0]["cells"][$i][32]; $stud_id_for_lc = $connection->sheets[0]["cells"][$i][33]; $g_r_no = $connection->sheets[0]["cells"][$i][34]; $qualification = $connection->sheets[0]["cells"][$i][35]; $occupation = $connection->sheets[0]["cells"][$i][36]; $monthly_income = $connection->sheets[0]["cells"][$i][37]; $office_add = $connection->sheets[0]["cells"][$i][38]; $residential_add = $connection->sheets[0]["cells"][$i][39]; $mother_qualifi = $connection->sheets[0]["cells"][$i][40]; $mother_occupation = $connection->sheets[0]["cells"][$i][41]; $mother_income = $connection->sheets[0]["cells"][$i][42]; $mother_office_add = $connection->sheets[0]["cells"][$i][43]; $mother_resident_add= $connection->sheets[0]["cells"][$i][44]; /*$machine_no = $connection->sheets[0]["cells"][$i][1]; $machine_name = $connection->sheets[0]["cells"][$i][2]; $use_status = $connection->sheets[0]["cells"][$i][3]; */ $exsit = $db->get_student_id($class,$medium,$division,$surname,$stud_name,$father_name,$father_contact); if($exsit!="") { echo $surname." ".$stud_name." ".$father_name."<span style='color:red;'> -> Already exist</span><br />"; $flag = 1; } else { if($db->save_student_record($class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$birth_place,$birth_date,$gender,$last_school,$admission_date,$blood_group,$height,$weight,$actual_image_name,$actual_image_name1,$actual_image_name2,$advertising_board,$news_paper,$teachers,$friends,$ex_students,$pre_class,$other,$remarks,$no_of_pupil,$stud_id_for_lc,$g_r_no,$qualification,$occupation,$monthly_income,$office_add,$residential_add,$mother_qualifi,$mother_occupation,$mother_income,$mother_office_add,$mother_resident_add)) { echo $surname." ".$stud_name." ".$father_name."<span style='color:Green;'> -> Student added successfully</span><br />"; $flag = 2 ; } } } } else { $attachement_error = "Failed to upload"; } } } else { $attachement_error = "Please select file"; } } ?> </div> </div> </div> <!--footer--> <?php include("footer.php"); ?> <!--//footer--> <!-- Classie --> <script src="js/classie.js"></script> <script> var menuLeft = document.getElementById( 'cbp-spmenu-s1' ), showLeftPush = document.getElementById( 'showLeftPush' ), body = document.body; showLeftPush.onclick = function() { classie.toggle( this, 'active' ); classie.toggle( body, 'cbp-spmenu-push-toright' ); classie.toggle( menuLeft, 'cbp-spmenu-open' ); disableOther( 'showLeftPush' ); }; function disableOther( button ) { if( button !== 'showLeftPush' ) { classie.toggle( showLeftPush, 'disabled' ); } } </script> <!--scrolling js--> <script src="js/jquery.nicescroll.js"></script> <script src="js/scripts.js"></script> <!--//scrolling js--> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.js"> </script> </body> </html>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4