public function update()
 {
     $args['depto'] = modelClass::getDepto();
     if ($_SERVER['REQUEST_METHOD'] === 'GET' and isset($_GET['id']) and is_numeric($_GET['id'])) {
         $certificate = modelClass::certifyId($_GET['id']);
         if (is_array($certificate)) {
             if (count($certificate) > 0) {
                 $data = modelClass::getRow($_GET['id']);
                 if (is_array($data)) {
                     if (count($data) > 0) {
                         $args['txtcod'] = $data[0]['cod_ciudad'];
                         $args['txtdesc'] = $data[0]['nom_ciudad'];
                         $args['txtdep'] = $data[0]['cod_depto'];
                         $args['txthab'] = $data[0]['habitantes'];
                     }
                 } else {
                     $args['error'] = $data;
                     viewClass::renderHTML('error.php', $args);
                 }
             }
         } else {
             $args['error'] = $certificate;
             viewClass::renderHTML('error.php', $args);
         }
         $args['formAction'] = 'index.php?action=update&id=' . $_GET['id'];
         viewClass::renderHTML('update.php', $args);
     } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $data['nom_ciudad'] = $_POST['txtdesc'];
         $data['cod_depto'] = $_POST['txtdep'];
         $data['habitantes'] = $_POST['txthab'];
         $rsp = modelClass::updateUsuario($_GET['id'], $data);
         if ($rsp === true) {
             $args['success'] = 'Los cambios fueron realizados exitosamente';
         } else {
             $args['error'] = $rsp->getMessage();
         }
         $args['formAction'] = 'index.php?action=update&id=' . $_GET['id'];
         $args = array_merge($args, $_POST);
         viewClass::renderHTML('update.php', $args);
     } else {
         $this->index();
     }
 }
 public function create()
 {
     $args['depto'] = modelClass::getDepto();
     $template = 'create.php';
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $rsp = modelClass::newCity($_POST['codCity'], $_POST['nameCity'], $_POST['txtDepto'], $_POST['txtHabi']);
         if ($rsp === true) {
             $args['success'] = 'El registro fue realizado exitosamente';
             $this->index($args);
         } else {
             $args['error'] = $rsp->getMessage();
             $args['formAction'] = 'index.php=create';
             $args = array_merge($args, $_POST);
             viewClass::renderHTML($template, $args);
         }
     } else {
         $args['formAction'] = 'index.php?action=create';
         viewClass::renderHTML($template, $args);
     }
 }