예제 #1
0
         $imgno = '2';
         $img_title = 'Image 2';
     } elseif (isset($_FILES['image_3'])) {
         $image = $_FILES['image_3'];
         $imgno = '3';
         $img_title = 'Image 3';
     } elseif (isset($_FILES['image_4'])) {
         $image = $_FILES['image_4'];
         $imgno = '4';
         $img_title = 'Image 4';
     }
     $uploadedimgsize = @getimagesize($image['tmp_name']);
     if ($uploadedimgsize[0] > $imglimit || $uploadedimgsize[0] > $imglimit) {
         $result = 'File is too big, max width/height allowed is ' . $imglimit . 'px';
     } else {
         $design->uploadImage($imgno, $image['tmp_name'], $image['name']);
         $result = webImage($design->{'image_' . $imgno}, $imgsize, $imgsize, $img_title, 'img-border');
     }
     echo utf8_encode($result);
     exit;
 } elseif ($_POST['me_action'] == 'DELETEIMAGE') {
     $imgfield = tep_db_prepare_input($_POST['imgfield']);
     $design = new design($id);
     $result = array();
     $result['id'] = $imgfield;
     if ($imgfield == 'image_1') {
         $design->removeImage('1', true);
         $result['img'] = webImage($design->image_1, $imgsize, $imgsize, 'Main Image', 'img-border', '');
     } elseif ($imgfield == 'image_2') {
         $design->removeImage('2', true);
         $result['img'] = webImage($design->image_2, $imgsize, $imgsize, 'Alternate Image', 'img-border', '');