Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

protected function handleAddItemPost() { if (isset($_POST['Item'])) ..

Decoded Output download

<?      protected function handleAddItemPost() 
    { 
        if (isset($_POST['Item'])) 
        { 
            // for barcode use text 
            $item_id = ltrim(substr($_POST['Item']['field'], -7), '0'); 
            $quantity = $_POST['Item']['mode']; 
            if ($item_id){ 
                //$addResult = ShopItemService::addItem($item_id, $quantity); 
                if (!ShopItemService::addItem($item_id, $quantity)){ 
					Yii::app()->user->setFlash('error', 'Item '.$_POST['Item']['field'].' tidak ditemukan!'); 
					$this->redirect(Yii::app()->homeUrl); 
				} 
            } 
			$this->redirect(Yii::app()->homeUrl); 
            //$this->refresh(); 
        } elseif (isset($_POST['Itemname'])) { 
            // for autocomplete use id 
            $item_id = $_POST['Itemname']['item_id']; 
            $quantity = $_POST['Itemname']['mode']; 
            if ($item_id){ 
                $model = new Message(); 
                $model->cKode = $item_id; 
                $model->save(); 
 
                $addResult = ShopItemService::addItem($item_id, $quantity); 
            } 
            //$this->refresh(); 
			$this->redirect(Yii::app()->homeUrl); 
        } 
    } 
 ?>

Did this file decode correctly?

Original Code

    protected function handleAddItemPost()
    {
        if (isset($_POST['Item']))
        {
            // for barcode use text
            $item_id = ltrim(substr($_POST['Item']['field'], -7), '0');
            $quantity = $_POST['Item']['mode'];
            if ($item_id){
                //$addResult = ShopItemService::addItem($item_id, $quantity);
                if (!ShopItemService::addItem($item_id, $quantity)){
					Yii::app()->user->setFlash('error', 'Item '.$_POST['Item']['field'].' tidak ditemukan!');
					$this->redirect(Yii::app()->homeUrl);
				}
            }
			$this->redirect(Yii::app()->homeUrl);
            //$this->refresh();
        } elseif (isset($_POST['Itemname'])) {
            // for autocomplete use id
            $item_id = $_POST['Itemname']['item_id'];
            $quantity = $_POST['Itemname']['mode'];
            if ($item_id){
                $model = new Message();
                $model->cKode = $item_id;
                $model->save();

                $addResult = ShopItemService::addItem($item_id, $quantity);
            }
            //$this->refresh();
			$this->redirect(Yii::app()->homeUrl);
        }
    }

Function Calls

None

Variables

None

Stats

MD5 cc5ced6ebc4c4d026c2e41cde8766868
Eval Count 0
Decode Time 51 ms