I think I wasn't clean in my explanation when I asked my question (the problem). I have a project PHP, I don't have a local environnement, I'm working on-line: I change my file via Netbeans and I deploy it without tested it locally. My server is of production.My Database (MySQL - phpMyadmin ) in the sever also. I import the data from my disk into the project. Then PHP exploit it via HighChart. The user can see these data per many choices (Date, city, Customer,..) and finally he can download this final result into file csv. Here the problem I can't download all the data, for example: in The Turnover display in the Chart 14Million but in the file csv it display a smaller number of turnover.
this following my code:
class Export{
private $_dataIN=[];
private $_author;
private $_filepath;
public function __construct(array $dataIN) {
$this->_dataIN = $dataIN;
$this->setFilepath();
$this->prepareFile();
}
public function setFilepath() {
$date = new \DateTime();
$this->_filepath='../DATA/ExportFiles/ExportData'.$date->getTimestamp();
}
public function prepareFile(){
$file = fopen($this->_filepath, 'w');
fputcsv($file, array('Piece', 'Client', 'Libelle Client', 'Facturation','OTP','Typcde','Cdecli','Cdesap','Article','Designation','Dev','Montant_fac_dev_ht','Montant_fac_eur','Avion','Nature','Repsite','Zone','LRU','Contract'),';');
foreach ($this->_dataIN as $key => $statement) {
fputcsv($file, array($statement->getId(), $statement->getCustomerId(), $statement->getCustomerName(), $statement->getDate(), $statement->getOTP(), $statement->getCdetype(), $statement->getCdecustomer(), $statement->getSAPcode(), $statement->getArticle(), $statement->getDesigniation(), $statement->getCurrency(), $statement->getAmount(), $statement->getAmountEur(), $statement->getAircraft(), $statement->getNature(), $statement->getRepsite(), $statement->getZone(), $statement->getLru(),$statement->getContract()),';');
}
}
public function download() {
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');//octet-stream'
header('Content-Disposition: attachment; filename='.basename($this->_filepath).'.csv');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($this->_filepath) . 'Giga'); //Kilo
readfile($this->_filepath);
exit();
I hope that this time my explanation is clean and you can help?