Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- $obj = new MeliRespostaAutomatica();
- $obj->Start = (isset($_POST['start'])) ? $_POST['start'] : 0;
- $obj->Limit = (isset($_POST['limit'])) ? $_POST['limit'] : 2;
- //var_dump($obj->Limit); die;
- $paginaAtual = (isset($_POST['paginaAtual'])) ? $_POST['paginaAtual'] : 1;
- if (!empty($_POST['id']) && is_numeric($_POST['id'])){
- $obj->RespostaAutomaticaId = $_POST['id'];
- }
- $lstRespostas = $obj->buscarResposta();
- $limit = $obj->Limit;
- $totalReg = $obj->buscarTotalRespostas();
- $totalPag = function($totalReg,$limit){
- $result = $totalReg / $limit;
- $total = intval($result);
- if($total < $result || $total == 0){ $total++; }
- return $total;
- };
- $totalPaginas = $totalPag($totalReg,$limit);
- echo json_encode(array('success'=>1,'rows'=>$lstRespostas, 'totalPaginas' =>$totalPaginas, 'totalReg' => $totalReg, 'paginaAtual' => $paginaAtual)); die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement