connect(); if (isset($_GET['id'])){ $mhs->deletemhs($_GET['id']); } $page = null; $search = null; //cek apakah ada getPage if (isset($_GET['page']))$page = $_GET['page']; //cek apakah ada getSearch if ((isset($_GET['search'])) && (($_GET['search'])!='')){ $search = $_GET['search']; $mhs->select('mahasiswa','*',"nama LIKE '%$search%' or nim LIKE '%$search%'"); } else{ $mhs->select('mahasiswa'); } $res = $mhs->getResult(); //pagination if (!array_key_exists(0, $res)){ $resu[0]=$res; $result = $mhs->paging($resu,5,$page,$search); } else{ $result = $mhs->paging($res,5,$page,$search); } ?>