| @@ 110-121 (lines=12) @@ | ||
| 107 | } |
|
| 108 | } |
|
| 109 | ||
| 110 | public function uploadImage(&$image) { |
|
| 111 | $type = substr($image['name'], -4); |
|
| 112 | $nameImage = uniqid() . md5($image['name']) . $type; |
|
| 113 | $dir = APP . 'webroot/uploads/banner/imagens/'; |
|
| 114 | ||
| 115 | $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
|
| 116 | ||
| 117 | if (!$returnUpload) |
|
| 118 | return array('nome' => null, 'status' => false); |
|
| 119 | ||
| 120 | return array('nome' => $nameImage, 'status' => true); |
|
| 121 | } |
|
| 122 | ||
| 123 | public function excluir_cadastro() { |
|
| 124 | $this->layout = 'ajax'; |
|
| @@ 220-231 (lines=12) @@ | ||
| 217 | return number_format($retorno, 2, ',', '.'); |
|
| 218 | } |
|
| 219 | ||
| 220 | public function uploadImage(&$image) { |
|
| 221 | $type = substr($image['name'], -4); |
|
| 222 | $nameImage = uniqid() . md5($image['name']) . $type; |
|
| 223 | $dir = APP . 'webroot/uploads/produto/imagens/'; |
|
| 224 | ||
| 225 | $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
|
| 226 | ||
| 227 | if (!$returnUpload) |
|
| 228 | return array('nome' => null, 'status' => false); |
|
| 229 | ||
| 230 | return array('nome' => $nameImage, 'status' => true); |
|
| 231 | } |
|
| 232 | ||
| 233 | public function visualizar_cadastro($id) { |
|
| 234 | $this->layout = 'wadmin'; |
|