| @@ 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'; |
|
| @@ 299-310 (lines=12) @@ | ||
| 296 | return number_format($retorno, 2, ',', '.'); |
|
| 297 | } |
|
| 298 | ||
| 299 | public function uploadImage(&$image) { |
|
| 300 | $type = substr($image['name'], -4); |
|
| 301 | $nameImage = uniqid() . md5($image['name']) . $type; |
|
| 302 | $dir = APP . 'webroot/uploads/produto/imagens/'; |
|
| 303 | ||
| 304 | $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
|
| 305 | ||
| 306 | if (!$returnUpload) |
|
| 307 | return array('nome' => null, 'status' => false); |
|
| 308 | ||
| 309 | return array('nome' => $nameImage, 'status' => true); |
|
| 310 | } |
|
| 311 | ||
| 312 | public function visualizar_cadastro($id) { |
|
| 313 | $this->layout = 'wadmin'; |
|