403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.216.231
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/business/applynow_DONE/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/business/applynow_DONE/import_excel.php
<?php

include 'excel/Classes/PHPExcel/IOFactory.php';

require_once("configuration.php");

require_once ("lib/functions.php");

mysql_connect($db_host,$db_user,$db_password) or die("Σφάλμα. Είναι αδύνατη η σύνδεση στη βάση δεδομένων.");
mysql_select_db($db_database) or die("Σφάλμα. Είναι αδύνατη η επιλογή της βάσης δεδομένων.");
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'");
		
restict_access();


error_reporting(E_ALL);

$inputFileName = 'excel/2014.xls';

//  Read your Excel workbook
try {
    $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    $objPHPExcel = $objReader->load($inputFileName);
} catch (Exception $e) {
    die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) 
    . '": ' . $e->getMessage());
}

//  Get worksheet dimensions
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$data=array();

//  Loop through each row of the worksheet in turn
for ($row = 1; $row <= $highestRow; $row++) {
    //  Read a row of data into an array
    $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, 
    NULL, TRUE, FALSE);
	
    foreach($rowData[0] as $k=>$v){
		if (is_numeric($v))	$data[$row][$k+1]=$v;
        //echo "Row: ".$row."- Col: ".($k+1)." = ".$v."<br />";
	}
}
$updates=0;
$candidates=0;
foreach($data as $row=>$value){
		$candidate_d=mysql_query("SELECT * FROM aitiseis_next WHERE id='".$value[1]."'");
		$candidate_i=mysql_fetch_array($candidate_d);
		
		if (mysql_num_rows($candidate_d)==1){
			
			if ($value[13]==0){
				//den prosilthe i apokleistike
				mysql_query("UPDATE aitiseis_next SET criterion_1=".$value[4].", criterion_2=".$value[5].", criterion_3=".$value[6].", criterion_4=".$value[7].", criterion_5=".$value[8].", criterion_6=".$value[9].", criterion_7=".$value[10].", criterion_8=".$value[11].", interview=-1 WHERE id='".$value[1]."'");
				if (mysql_affected_rows()==1){
					echo "Τα δεδομένα του υποψηφίου <b>".$candidate_i["last_name"]." ".$candidate_i["first_name"]."</b> ενημερώθηκαν επιτυχώς (δεν προσήλθε / αποκλείστηκε).<br>";
					$updates++;
				}else{
					echo "Τα δεδομένα του υποψηφίου <b>".$candidate_i["last_name"]." ".$candidate_i["first_name"]."</b> δεν ενημερώθηκαν (δεν έγιναν αλλαγές στο excel - το σύστημα είναι ήδη ενημερωμένο).<br>";
				}
			}else{
				mysql_query("UPDATE aitiseis_next SET criterion_1=".$value[4].", criterion_2=".$value[5].", criterion_3=".$value[6].", criterion_4=".$value[7].", criterion_5=".$value[8].", criterion_6=".$value[9].", criterion_7=".$value[10].", criterion_8=".$value[11].", interview=".$value[13]." WHERE id='".$value[1]."'");
				if (mysql_affected_rows()==1){
					echo "Τα δεδομένα του υποψηφίου <b>".$candidate_i["last_name"]." ".$candidate_i["first_name"]."</b> ενημερώθηκαν επιτυχώς.<br>";
					$updates++;
				}else{
					echo "Τα δεδομένα του υποψηφίου <b>".$candidate_i["last_name"]." ".$candidate_i["first_name"]."</b> δεν ενημερώθηκαν (δεν έγιναν αλλαγές στο excel - το σύστημα είναι ήδη ενημερωμένο).<br>";
				}
			}
			$candidates++;
			
		}
}

echo "<hr>Η εισαγωγή δεδομένων από excel ολοκληρώθηκε επιτυχώς.<br>Ενημερώθηκαν συνολικά ".$updates." από ".$candidates." υποψήφιοι.";
?>

Youez - 2016 - github.com/yon3zu
LinuXploit