ACC SHELL

Path : /srv/www/vhosts/marevva/nadaciakrizovatka/admin/
File Upload :
Current File : /srv/www/vhosts/marevva/nadaciakrizovatka/admin/admin-product-before-save.php

<?php
		
	if ( isset( $_POST['ID'] ) && ( $_POST['ID'] != 0 ) )
	{
		$productVariations = $this->getDb()->getAllItems( 'productVariation', " WHERE `productID`=" . $_POST['ID'] );
		if ( count( $productVariations ) == 0 )
		{
			$this->getDb()->insertItem( 'productVariation', array( 'productID'=>$_POST['ID'], 'color'=>'ffffff', 'text'=>$_POST['title'], 'count'=>1, 'availability'=>1 ) );
		}
	}
	
	// check if root comment exists
	if ( $_POST['commentID'] == 0 )
	{
		$this->getDb()->insertItem( 'comment', array() );
		$newCommentID = $this->getDb()->getLastID();
		
		$_POST['commentID'] = $newCommentID;
		
		// *magic*
		$_POST['visibility'] = '1';		
	}
	
?>

ACC SHELL 2018