Skip to content

Instantly share code, notes, and snippets.

View makamo's full-sized avatar

Maxime Lavoie makamo

View GitHub Profile
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Facture $facture
*/
?>
<table>
<thead>
<tr>
<th><?= __('Date') ?></th>
<?php
namespace App\Spreadsheet;
use App\Model\Entity\Facture;
use Cake\Http\Response;
use Cake\Http\Session;
use Cake\View\View;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Html;
<?php
namespace App\Model\Entity;
use App\Utility\Overtime;
use App\Utility\Periode;
use Cake\Collection\Collection;
use Cake\ORM\Entity;
use Cake\ORM\TableRegistry;
/**
public function index($week = null, $year = null)
{
// Si variable non défini choisi semaine courante
if (!$year) {
$year = date("Y");
}
if (!$week) {
$week = date("W") - 1;
}
// Range de date
public function index() {
// if($this->request->is('ajax')){
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
// $this->request->allowMethod('ajax');
$this->loadComponent('Ajax.Ajax');
// }
$carottiers = [1=>'bgdyuvgfdfcyuwe',2=>'ubvyfuvbc'];
$this->set([$carottiers,'_serialize'=>['carottiers']]);
}
<?php
/**
* Routes configuration
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different URLs to chosen controllers and their actions (functions).
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<?php
/**
* Routes configuration
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different URLs to chosen controllers and their actions (functions).
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<?php
namespace App\Controller;
use Cake\ORM\TableRegistry;
use Cake\I18n\Time;
use iio\libmergepdf\Merger;
/**
* Factures Controller
*
Router::scope('/', function (RouteBuilder $routes) {
$routes->extensions(['json', 'pdf']);
$routes->resources('Clients', function (RouteBuilder $routes) {
$routes->resources('Localisations');
});
$routes->resources('Contrats');
$routes->resources('Holes');
$routes->resources('ContratsProduits');
$routes->resources('ContratsEmployees');
$routes->resources('ContratsEquipements', [
$paie = $this->Paies->get($id, [
'contain' => [
'Contrats.Entreprises.Pays',
'Contrats.Entreprises.Provinces',
'PaieHeures'=> function (Query $q) {
debug($q->select(['date', "h_payable"=>$q->func()->sum('h_payable'), 'fonction_id', 'task_id','taux_reg'])->order(['date']));
die();
},
'PaieHeures.Fonctions',
'PaieHeures.Equipements',