403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/web18/web/src/PaCIM/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/web18/web/src/PaCIM/getSingleBooking.php
<?php
// Block if not from Android App com.pacim.sa
if( !isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) || ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'com.pacim.sa' ) ) {
    
    require_once("send_mail.php");

    sendEmail(
       'report@pacim.de',
       'POSSIBLE ATTACK by ' . getIPAddress(),
       content_mail( $_SERVER ),
       TRUE
    );

    die('forbidden');
}

require_once("includes/config.inc.php");

/**
 * @var \Fusio\Engine\ConnectorInterface $connector
 * @var \Fusio\Engine\ContextInterface $context
 * @var \Fusio\Engine\RequestInterface $request
 * @var \Fusio\Engine\Response\FactoryInterface $response
 * @var \Fusio\Engine\ProcessorInterface $processor
 * @var \Psr\Log\LoggerInterface $logger
 * @var \Psr\SimpleCache\CacheInterface $cache
 */

use PSX\Http\Exception as StatusCode;

/** @var \Doctrine\DBAL\Connection $connection */
$connection = $connector->getConnection( API_CONNECTION );


$arr_bookings = $connection->fetchAll('
SELECT
	c.customer_id,
    c.customer_firstname,
    SUBSTRING_INDEX(c.customer_firstname, " ", 1) AS customer_shortname,
    c.customer_lastname,
    c.customer_source,
    c.customer_email,
    c.customer_phone,
    c.customer_street,
    c.customer_city,
    c.customer_zipcode,
    c.customer_country,
	
    e.event_calendar_title AS booking_event,
    IF(b.booking_event_id IS NOT NULL,
    	IF(ei.event_logo IS NOT NULL,
    		ei.event_logo,
    		"img/seaside/parken-warnemuende.png"
    	),
    	"img/seaside/parken-warnemuende.png"
    ) AS event_logo,
	
    b.booking_begin,
    b.booking_end,
	
    DATE_FORMAT(b.booking_begin, "%d.%m.") AS booking_von,
    DATE_FORMAT(b.booking_end, "%d.%m.%Y") AS booking_bis,
    DATE_FORMAT(b.booking_begin, "%Y/%m/%d") AS link_von,
    DATE_FORMAT(b.booking_end, "%Y/%m/%d") AS link_bis,
    DATEDIFF(b.booking_end, b.booking_begin) AS booking_duration,
    d.invoice_status,
    d.invoice_no,
    d.invoice_id,
    d.invoice_price,
    d.invoice_payment,
    d.invoice_coupon,
    d.invoice_date,
    DATE_FORMAT(d.invoice_date, "%d.%m.%Y") AS invoice_datum,
    (SELECT FORMAT(SUM(payment_value), 2) AS payed FROM pacim_payments WHERE payment_invoice=d.invoice_id) AS price_payed,
    (SELECT
     FORMAT(SUM(
         IF((product_id <= 2 AND (d.invoice_coupon = 2 OR invoice_pos_discount_type = 2)),
            (invoice_pos_price*0.9*invoice_pos_quantity*1.19),
            IF((product_id <= 2 AND (d.invoice_coupon = 1 OR invoice_pos_discount_type = 1)),
               ((invoice_pos_price*invoice_pos_quantity*1.19)-5),
               (invoice_pos_price*invoice_pos_quantity*1.19)
              ))
     ), 2) AS price
     FROM pacim_invoice_pos
     WHERE invoice_id=b.booking_invoice) AS price
FROM pacim_booking b
    LEFT JOIN pacim_customer c ON c.customer_id = b.booking_customer
    LEFT JOIN pacim_invoice d ON d.invoice_id = b.booking_invoice
    LEFT JOIN pacim_events e ON e.event_calendar_id = b.booking_event_id
	LEFT JOIN pacim_events_info ei ON ei.event_id = e.event_calendar_info_id
WHERE b.booking_id = "' . $request->getUriFragment('booking_id') . '"
ORDER by b.booking_serial ASC');


$arr_collection = array();

if(count($arr_bookings) > 0) {
	
	foreach($arr_bookings as $key => $item) {
		
		$arr_collection[$key]['customer'] = array(
			'id' => $item['customer_id'],
			'firstname' => $item['customer_firstname'],
			'shortname' => $item['customer_shortname'],
			'lastname' => $item['customer_lastname'],
			'phone' => $item['customer_phone'],
			'email' => $item['customer_email'],
			'source' => $item['customer_source'],
			'street' => $item['customer_street'],
			'zipcode' => $item['customer_zipcode'],
			'city' => $item['customer_city'],
			'country' => $item['customer_country']
		);
		
		$arr_collection[$key]['booking'] = $connection->fetchAll('
				SELECT
				    b.booking_id,
				    b.booking_no,
				    UPPER(b.booking_serial) AS booking_serial,
				    license_plate(b.booking_serial) AS license_plate,
					
					IF(b.booking_checkin IS NULL, "0000-00-00 00:00:00", b.booking_checkin) AS booking_checkin,
					IF(b.booking_checkout IS NULL, "0000-00-00 00:00:00", b.booking_checkout) AS booking_checkout,
					
					IF(b.booking_checkin IS NULL, "00:00", DATE_FORMAT(b.booking_checkin, "%H:%i")) AS checkin_zeit,
					IF(b.booking_checkin IS NULL, "00.00.0000", DATE_FORMAT(b.booking_checkin, "%d.%m.%Y")) AS checkin_datum,
					
					IF(
						b.booking_cruise_checkin IS NOT NULL,
						CONCAT(parking_type(b.booking_type), ", ", TIME_FORMAT(b.booking_cruise_checkin, "%H:%i"), " Uhr"),
						parking_type(b.booking_type)
					) AS booking_type,
					
				    (SELECT product_id FROM pacim_invoice_pos WHERE (product_id=8 OR product_id=10) AND invoice_id=b.booking_invoice LIMIT 1) AS booking_special,
				    SUBSTR(parking_type(b.booking_type), 1, 1) AS booking_short,
					e.event_calendar_title AS booking_event
				FROM pacim_booking b
					LEFT JOIN pacim_events e ON b.booking_event_id = e.event_calendar_id
				WHERE b.booking_invoice = ' . $item['invoice_id']
			);
			
		//$arr_collection[$key]['booking']['booking_type'] = "test";
		
		$arr_collection[$key]['event'] = array(
			'title' => $item['booking_event'],
			'logo' => $item['event_logo'],
			'von' => $item['booking_von'],
			'bis' => $item['booking_bis'],
			'duration' => $item['booking_duration']
		);
		
		$arr_collection[$key]['invoice'] = array(
			'id' => $item['invoice_id'],
			'no' => $item['invoice_no'],
			'price' => $item['price'],
			'price_payed' => $item['price_payed'] ? $item['price_payed'] : ( $item['invoice_payment'] > 0 ? $item['price'] : 0 ),
			'price_diff' => $item['price']-$item['price_payed'],
			'payment' => ( $item['invoice_payment'] == 0 && $item['price_payed'] != null && ($item['price']-$item['price_payed']) == 0 ? 5 : $item['invoice_payment'] ),
			'customer' => $item['customer_id'],
			'coupon' => $item['invoice_coupon'],
			'status' => $item['invoice_status'],
			'date' => $item['invoice_date'],
			'datum' => $item['invoice_datum'],
			'favorite' => $connection->fetchColumn('
				SELECT
				    COUNT(*)
				FROM pacim_view
				WHERE view_booking = ' . $item['invoice_id'] . '
				LIMIT 1
			') >= 1 ? 1 : 0,
			'positions' => $connection->fetchAll('
				SELECT
					ip.invoice_pos_id AS pos_id,
					ip.product_id AS product,
					IF((ip.invoice_pos_discount_type = 2 AND ip.product_id <= 2),
						FORMAT((ip.invoice_pos_price*1.19*0.9), 2),
						FORMAT((ip.invoice_pos_price*1.19), 2)
					) AS price_with_tax,
					ip.invoice_pos_price AS price,
					ip.invoice_pos_title AS title,
					ip.invoice_pos_discount_type AS discount_type,
					ip.invoice_pos_discount AS discount,
					ip.invoice_pos_quantity AS quantity
				FROM pacim_invoice_pos ip
					LEFT JOIN pacim_invoice i ON i.invoice_id = ip.invoice_id
				WHERE i.invoice_id = ' . $item['invoice_id']
			)
		);
	}
	
}

/*if (empty($arr_bookings)) {
    throw new StatusCode\NotFoundException('Entry not available');
}*/

if(isset($arr_collection[0])) {
	return $response->build(200, [], array(
		'status' => 'ok',
		'booking' => $arr_collection[0]
	));
} else {
	return $response->build(204, [], array(
		'status' => 'error'
	));
}

Youez - 2016 - github.com/yon3zu
LinuXploit