daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Mar 20th, 2017 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     $DB_host = "localhost";
  3.     $DB_user = "root";
  4.     $DB_pass = "";
  5.     $DB_name = "dbpdo";
  6.  
  7.     try
  8.     {
  9.         $DB_con = new PDO("mysql:host{$DB_host}; dbname={$DB_name}",$DB_user,$DB_pass);
  10.         $DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  11.     }
  12.     catch (PDOException $e)
  13.     {
  14.         echo $e->getMessage();
  15.     }
  16.  
  17.     include_once 'class.crud.php';
  18.     $crud = new crud($DB_con);
  19. ?>
  20.    
  21. <?php include_once 'dbconfig.php'; ?>
  22.     <?php include_once 'header.php'; ?>
  23.  
  24.     <div class="clearfix"></div>
  25.  
  26.     <div class="container">
  27.         <a href="add-data.php" class="btn btn-large btn-info"><i class="glyphicon glyphicon-plus"></i> &nbsp; Gravar</a>
  28.     </div><!--container-->
  29.  
  30.     <div class="clearfix"></div><br />
  31.  
  32.     <div class="container">
  33.         <table class='table table-border table-responsive'>
  34.             <tr>
  35.                 <th>#</th>
  36.                 <th>Nome</th>
  37.                 <th>Sobrenome</th>
  38.                 <th>Email</th>
  39.                 <th>Telefone</th>
  40.                 <th colspan="2" align="center">Ação</th>            
  41.             </tr>
  42.             <?php
  43.                 $query="SELECT * FROM tbl_usuarios";
  44.                 $record_per_page=3;
  45.                 $newquery=$crud->paging($query,$records_per_page);
  46.                 $crud->dataview($newquery);
  47.             ?>
  48.             <tr>
  49.                 <td colspan="7" align="center">
  50.                     <div class="pagination-wrap">
  51.                         <?php $crud->paginglink($query,$record_per_page); ?>
  52.  
  53.                     </div><!--pagination-wrap-->                
  54.                 </td>
  55.             </tr>
  56.  
  57.         </table>
  58.  
  59.     </div><!--container-->
  60.  
  61.     <?php include_once 'footer.php';?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top