Ejemplo n.º 1
0
 <?php 
require_once 'vendor/autoload.php';
use Subash\Classes\UploadFileLog;
require_once 'header.php';
$objFileLog = new UploadFileLog();
ini_set("upload_max_filesize", '10M');
// print_r($_POST);exit;
if (isset($_POST["submit"])) {
    // echo "<pre>";print_r($_FILES);
    $target_dir = "uploads/";
    $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
    $uploadOk = 1;
    // Check if image file is a actual image or fake image
    // Check if file already exists
    if (file_exists($target_file)) {
        echo "Sorry, file already exists.";
        $uploadOk = 0;
    }
    // Check file size
    if ($_FILES["fileToUpload"]["size"] > 5000000) {
        echo "Sorry, your file is too large.";
        $uploadOk = 0;
    }
    // Check if $uploadOk is set to 0 by an error
    if ($uploadOk == 0) {
        echo "Sorry, your file was not uploaded.";
        // if everything is ok, try to upload file
    } else {
        if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
            $objFileLog->createUploadFileLog($target_file, 0, 'FX');
            echo "The file " . basename($_FILES["fileToUpload"]["name"]) . " has been uploaded.";
Ejemplo n.º 2
0
<?php

/**
* SET FOREIGN_KEY_CHECKS=0;
TRUNCATE team;
TRUNCATE player;
*/
require_once 'vendor/autoload.php';
use Subash\Classes\CSVFile;
use Subash\Classes\Teams;
use Subash\Classes\Player;
use Subash\Classes\UploadFileLog;
while (true) {
    logme("polling");
    $objFileLog = new UploadFileLog();
    $isQueuedItem = $objFileLog->getQueuedItem('PLD');
    if (count($isQueuedItem) > 0) {
        $objTeam = new Teams();
        $teams = $objTeam->getTeamIds();
        print_r($teams);
        $objPlayer = new Player();
        $players = $objPlayer->getPlayerIds();
        $filePath = $isQueuedItem['filename'];
        $uploadId = $isQueuedItem['id'];
        $fileObject = new CSVFile(__DIR__ . "/" . $filePath, true, ',', '"', '\\', true);
        $insertArray = [];
        $indexCount = 1;
        $fileObject->seek(PHP_INT_MAX);
        $totalCount = $fileObject->key();
        $fileObject->seek(0);
        $proccessed = 0;
Ejemplo n.º 3
0
 <?php 
require_once 'vendor/autoload.php';
use Subash\Classes\UploadFileLog;
require_once 'header.php';
$objFileLog = new UploadFileLog();
ini_set("upload_max_filesize", '10M');
// print_r($_POST);exit;
if (isset($_POST["submit"])) {
    // echo "<pre>";print_r($_FILES);
    $target_dir = "uploads/";
    $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
    $uploadOk = 1;
    // Check if image file is a actual image or fake image
    // Check if file already exists
    if (file_exists($target_file)) {
        echo "Sorry, file already exists.";
        $uploadOk = 0;
    }
    // Check file size
    if ($_FILES["fileToUpload"]["size"] > 5000000) {
        echo "Sorry, your file is too large.";
        $uploadOk = 0;
    }
    // Check if $uploadOk is set to 0 by an error
    if ($uploadOk == 0) {
        echo "Sorry, your file was not uploaded.";
        // if everything is ok, try to upload file
    } else {
        if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
            $objFileLog->createUploadFileLog($target_file);
            echo "The file " . basename($_FILES["fileToUpload"]["name"]) . " has been uploaded.";