if ($newData) {
                if ($_POST['lastIdLogo'] > 0) {
                    if ($model->updateCompanyLogo($_POST['lastIdLogo'], $result['fileName'])) {
                        $lastId = $_POST['lastIdLogo'];
                    }
                } else {
                    $lastId = $model->addCompanyLogo($_POST['companyId'], $result['fileName']);
                }
            }
            $data = array('success' => true, 'fileName' => $result['fileName'], 'wp' => $wp, 'hp' => $hp, 'lastId' => $lastId);
            echo htmlspecialchars(json_encode($data), ENT_NOQUOTES);
        }
        break;
        // 	Crop
    // 	Crop
    case 2:
        $model = new Media_Model();
        $data = $backend->loadBackend();
        if (!empty($_POST)) {
            $dstWidth = 300;
            $dstImageHeight = 150;
            $source = $root . '/img-up/companies_pictures/original/' . $_POST['imgId'];
            $destination = $root . '/img-up/companies_pictures/logo/' . $_POST['imgId'];
            if ($model->cropImage($_POST, $dstWidth, $dstImageHeight, $source, $destination)) {
                echo '1';
            } else {
                echo '0';
            }
        }
        break;
}
Ejemplo n.º 2
0
         }
         $data = array('success' => true, 'fileName' => $result['fileName'], 'wp' => $wp, 'hp' => $hp, 'lastId' => $lastId);
         echo htmlspecialchars(json_encode($data), ENT_NOQUOTES);
     }
     break;
     // 	Crop
 // 	Crop
 case 2:
     $model = new Media_Model();
     $data = $backend->loadBackend();
     if (!empty($_POST)) {
         $dstWidth = 1070;
         $dstImageHeight = 370;
         $source = $root . 'img-up/main-gallery/original/' . $_POST['imgId'];
         $destination = $root . 'img-up/main-gallery/front/' . $_POST['imgId'];
         if ($model->cropImage($_POST, $dstWidth, $dstImageHeight, $source, $destination)) {
             if ($model->cropImage($model->getThumb($_POST['imgId'], $root . 'img-up/main-gallery/front/', $root . 'img-up/main-gallery/thumb/', 200, 'width', ''))) {
                 echo '1';
             } else {
                 echo '0';
             }
         }
     }
     break;
     // 	Update
 // 	Update
 case 3:
     $model = new Layout_Model();
     if (!empty($_POST)) {
         $model->editSliderInfo($_POST);
     }