Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16299 | Rev 16767 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16299 Rev 16766
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
namespace LeadersLinked\Controller;
4
namespace LeadersLinked\Controller;
5
 
5
 
6
 
6
 
7
use Laminas\Db\Adapter\AdapterInterface;
7
use Laminas\Db\Adapter\AdapterInterface;
8
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
8
use LeadersLinked\Cache\CacheInterface;
9
use Laminas\Mvc\Controller\AbstractActionController;
9
use Laminas\Mvc\Controller\AbstractActionController;
10
use Laminas\Log\LoggerInterface;
10
use Laminas\Log\LoggerInterface;
Línea 38... Línea 38...
38
    private $adapter;
38
    private $adapter;
Línea 39... Línea 39...
39
    
39
    
40
    
40
    
41
    /**
41
    /**
42
     *
42
     *
43
     * @var AbstractAdapter
43
     * @var CacheInterface
Línea 44... Línea 44...
44
     */
44
     */
45
    private $cache;
45
    private $cache;
Línea 59... Línea 59...
59
    
59
    
60
    
60
    
61
    /**
61
    /**
62
     *
62
     *
63
     * @param AdapterInterface $adapter
63
     * @param AdapterInterface $adapter
64
     * @param AbstractAdapter $cache
64
     * @param CacheInterface $cache
65
     * @param LoggerInterface $logger
65
     * @param LoggerInterface $logger
66
     * @param array $config
66
     * @param array $config
67
     */
67
     */
Línea 145... Línea 145...
145
 
145
 
146
                
146
                
Línea 147... Línea 147...
147
                    
147
                    
148
                
148
                
149
                $search = $this->params()->fromQuery('search', []);
149
                $search = $this->params()->fromQuery('search', []);
150
                $search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
150
                $search = empty($search['value']) ? '' :  Functions::sanitizeFilterString($search['value']);
151
                
151
                
Línea 152... Línea 152...
152
                $page               = intval($this->params()->fromQuery('start', 1), 10);
152
                $page               = intval($this->params()->fromQuery('start', 1), 10);
153
                $records_x_page     = intval($this->params()->fromQuery('length', 10), 10);
153
                $records_x_page     = intval($this->params()->fromQuery('length', 10), 10);
Línea 154... Línea 154...
154
                $order =  $this->params()->fromQuery('order', []);
154
                $order =  $this->params()->fromQuery('order', []);
155
                $order_field        = empty($order[0]['column']) ? 99 :  intval($order[0]['column'], 10);
155
                $order_field        = empty($order[0]['column']) ? 99 :  intval($order[0]['column'], 10);
156
                $order_direction    = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var( $order[0]['dir'], FILTER_SANITIZE_STRING));
156
                $order_direction    = empty($order[0]['dir']) ? 'ASC' : strtoupper(Functions::sanitizeFilterString($order[0]['dir']));
Línea 157... Línea 157...
157
    
157
    
158
                $fields =  ['name'];
158
                $fields =  ['name'];
159
                $order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'name';
159
                $order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'name';
160
                
160
                
161
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
161
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
162
                    $order_direction = 'ASC';
162
                    $order_direction = 'ASC';
163
                }
163
                }
164
                
164
                
165
                $status = filter_var($this->params()->fromQuery('status'), FILTER_SANITIZE_STRING);
165
                $status = Functions::sanitizeFilterString($this->params()->fromQuery('status'));
166
                if(!in_array($status, [
166
                if(!in_array($status, [
Línea 167... Línea 167...
167
                    Company::STATUS_ACTIVE,
167
                    Company::STATUS_ACTIVE,
Línea 168... Línea 168...
168
                    Company::STATUS_DELETED,
168
                    Company::STATUS_DELETED,
169
                    Company::STATUS_INACTIVE,
169
                    Company::STATUS_INACTIVE,
170
                    Company::STATUS_PENDING,
170
                    Company::STATUS_PENDING,
171
                    Company::STATUS_REJECTED
171
                    Company::STATUS_REJECTED
Línea 362... Línea 362...
362
            $serviceMapper = ServiceMapper::getInstance($this->adapter);
362
            $serviceMapper = ServiceMapper::getInstance($this->adapter);
363
            $services = $serviceMapper->fetchAll(); 
363
            $services = $serviceMapper->fetchAll(); 
Línea 364... Línea 364...
364
            
364
            
365
            foreach($services as $service)
365
            foreach($services as $service)
366
            {
366
            {
367
                $status     = filter_var( $this->params()->fromPost('status' . $service->id), FILTER_SANITIZE_STRING);
367
                $status     = Functions::sanitizeFilterString($this->params()->fromPost('status' . $service->id));
368
                $paid_from  = filter_var( $this->params()->fromPost('paid_from' . $service->id), FILTER_SANITIZE_STRING);
368
                $paid_from  = Functions::sanitizeFilterString($this->params()->fromPost('paid_from' . $service->id));
Línea 369... Línea 369...
369
                $paid_to    = filter_var( $this->params()->fromPost('paid_to' . $service->id), FILTER_SANITIZE_STRING);
369
                $paid_to    = Functions::sanitizeFilterString($this->params()->fromPost('paid_to' . $service->id));
370
           
370
           
Línea 371... Línea 371...
371
                $ok = true;
371
                $ok = true;
Línea 705... Línea 705...
705
        }
705
        }
Línea 706... Línea 706...
706
        
706
        
Línea 707... Línea 707...
707
        if($request->isPost()) {
707
        if($request->isPost()) {
708
            
708
            
Línea 709... Línea 709...
709
            
709
            
710
            $status = filter_var( $this->params()->fromPost('status', FILTER_SANITIZE_STRING));
710
            $status = Functions::sanitizeFilterString($this->params()->fromPost('status'));
711
            $user_uuid = filter_var( $this->params()->fromPost('user_uuid', FILTER_SANITIZE_STRING));
711
            $user_uuid = Functions::sanitizeFilterString($this->params()->fromPost('user_uuid'));