项目作者: reyven90

项目描述 :
php ajax crud with file upload, checkbox and pagination
高级语言: PHP
项目地址: git://github.com/reyven90/crud-php-ajax.git
创建时间: 2018-03-15T01:13:10Z
项目社区:https://github.com/reyven90/crud-php-ajax

开源协议:

下载


PHP-AJAX-CRUD + FILE UPLOAD + PAGINATION + MULTIPLE DELETE with CHECKBOX

This is a simple CRUD Application for PHP AJAX with the following functionality .

  • Create, Update, Delete
  • Pagination
  • File upload
  • multiple delete with checkbox

Folder Structure

  1. ├── assets/
  2. ├── action.js -- your action js
  3. ├── custom.css -- your custom css
  4. ├── jquery-3.1.1.min -- jquery library
  5. ├── config/ -- your db connection
  6. ├── template/
  7. ├── header.php
  8. ├── content.php
  9. ├── foorter.php
  10. ├── upload/ -- your stoarage for images
  11. ├── view / -- your pages
  12. ├── index.php -- your simple route logic

SQL

Create database and copy paste SQL Code below.

  1. -- phpMyAdmin SQL Dump
  2. -- version 4.7.7
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: 127.0.0.1
  6. -- Generation Time: Mar 19, 2018 at 11:35 AM
  7. -- Server version: 10.1.30-MariaDB
  8. -- PHP Version: 7.2.2
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET AUTOCOMMIT = 0;
  11. START TRANSACTION;
  12. SET time_zone = "+00:00";
  13. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  14. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  15. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  16. /*!40101 SET NAMES utf8mb4 */;
  17. --
  18. -- Database: `crud_review_2018`
  19. --
  20. -- --------------------------------------------------------
  21. --
  22. -- Table structure for table `employee`
  23. --
  24. CREATE TABLE `employee` (
  25. `emp_id` int(11) NOT NULL,
  26. `firstname` varchar(200) NOT NULL,
  27. `lastname` varchar(200) NOT NULL,
  28. `address` varchar(200) NOT NULL,
  29. `image_name` varchar(100) NOT NULL
  30. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  31. --
  32. -- Dumping data for table `employee`
  33. --
  34. INSERT INTO `employee` (`emp_id`, `firstname`, `lastname`, `address`, `image_name`) VALUES
  35. (32, 'johnysd', 'bravo', 'atlanta', 'Penguins.jpg'),
  36. (37, 'john ', 'tumulak', 'bankal', 'Chrysanthemum.jpg');
  37. --
  38. -- Indexes for dumped tables
  39. --
  40. --
  41. -- Indexes for table `employee`
  42. --
  43. ALTER TABLE `employee`
  44. ADD PRIMARY KEY (`emp_id`);
  45. --
  46. -- AUTO_INCREMENT for dumped tables
  47. --
  48. --
  49. -- AUTO_INCREMENT for table `employee`
  50. --
  51. ALTER TABLE `employee`
  52. MODIFY `emp_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
  53. COMMIT;
  54. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  55. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  56. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

db.php

Create database connection

  1. <?php session_start() ?>
  2. <?php
  3. $ServerName = "localhost";
  4. $Username = "root";
  5. $Password = "";
  6. $DbName = "crud_review_2018";
  7. $db = null;
  8. try {
  9. $db = new PDO("mysql:host=$ServerName;dbname=$DbName",$Username,$Password);
  10. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  11. } catch (PDOException $e) {
  12. echo "Connection Failed:" . $e->getMessage();
  13. die();
  14. }
  15. ?>
  16. <?php require 'functions.php' ?>

just download to checkout the full details https://github.com/reyven90/php-ajax-login

more question just pm me on facebook https://www.facebook.com/jay.romantiko

thank you for following Goodbless :-)