示例#1
0
     WSErro("Oppsss: Você tentou editar uma categoria que não existe no sistema!", TW_INFOR);
 } elseif ($update === true) {
     WSErro("Categoria atualizada com sucesso!", TW_ACCEPT);
 } elseif ($create === true) {
     WSErro("Categoria criada com sucesso!", TW_ACCEPT);
 }
 $action = filter_input(INPUT_GET, 'action', FILTER_DEFAULT);
 $confirma = filter_input(INPUT_GET, 'confirma', FILTER_VALIDATE_BOOLEAN);
 require '_models/AdminCategoria.class.php';
 if ($action) {
     $catDelete = new AdminCategoria();
     $cat = filter_input(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
     switch ($action) {
         case 'delete':
             if ($confirma == 'true') {
                 $catDelete->ExeDelete($cat, $userlogin['user_id']);
                 $log->RecordLog("Deleção: categoria: " . $cat, "Alerta: Categoria deletada");
             } else {
                 $catDelete->ExeConfirma($cat, $userlogin['user_id']);
                 $log->RecordLog("Deleção: categoria: " . $cat, "Alerta: Confirmação");
             }
             WSErro($catDelete->getError()[0], $catDelete->getError()[1]);
             break;
         default:
             $log->RecordLog("Ação não reconhecida", "Erro: ação inexistente");
             WSErro("Ação não foi identifica pelo sistema, favor utilize os botões!", TW_ALERT);
     }
 }
 $readCat = new Read();
 $readCat->ExeRead(DB_PRODUTOS_CATEGORIAS, "ORDER BY cat_name ASC");
 ?>