PHP Classes

PHP Bootstrap Database Patent Application: Manage patents stored in a MySQL database

Recommend this page to a friend!
  Info   View files Example   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 175 This week: 1All time: 8,774 This week: 560Up
Version License PHP version Categories
bootstrap-patent-db 1.0.0Freeware5PHP 5, Databases, Content management
Description 

Author

This class can manage a patent database with a Bootstrap based UI.

It can manage patents stored in a MySQL database by providing means to create, retrieve, update, delete and check patent records.

The patent records are stored in a table that includes fields for the patent title, year, earnings and status.

Innovation Award
PHP Programming Innovation award nominee
August 2017
Number 2


Prize: One downloadable e-book of choice by O'Reilly
Patents are used to record inventions done by many people.

This package can manage a patent database, so users can review or update the list of recorded patents.

Manuel Lemos
Picture of Timothy Malche
  Performance   Level  
Name: Timothy Malche <contact>
Classes: 2 packages by
Country: India India
Age: 44
All time rank: 3733256 in India India
Week rank: 411 Up26 in India India Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
require_once ('EmpPatent.php');


$pstatusList = array(1 => 'Filed', 'Granted', 'Published', 'Owned');

$act = $_GET['act'];
$pid = $_GET['pid'];

if (
$act == 1) {
   
$result = "<table class='table table-bordered'><tr><td><h4 align='center' >Add Patent Details</h4></td></tr></table>"
           
. "<form method='post' id='add' action='' enctype='multipart/form-data'><div class='row' style='margin-left: 0'>"
           
. " <div class='span12'> "
           
. "<table class='table table-bordered table-striped table-condensed cf table-hover form-group' style='font-size:12px;'>"
           
. "<tr>"
           
. "<td><b>Patent No :</b></td>"
           
. "<td><input type='text' id='pno' name='pno' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Title :</b></td>"
           
. "<td><input type='text' id='title' name='title' class='form-control' style='height:30px;width:90%;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Earnings (in Rs.) :</b></td>"
           
. "<td><input type='number' id='earnings' name='earnings' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Status :</b></td>"
           
. "<td><select id='status' name='status' required>"
           
. "<option value=''> -- Select -- </option>";
    foreach (
$pstatusList as $key => $value) {
       
$result .= "<option value='" . $key . "'>" . $value . "</option>";
    }

   
$result .= "</select></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Year :</b></td>"
           
. "<td><input type='number' id='year' name='year' min='1900' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td colspan='2' style='text-align: center;'><button id='btnsubmit2' name='btnsubmit' type='submit' class='btn btn-default' value='add' style='width:25%;background:lightgray;'><b> Add </b></button></td>"
           
. "</tr>"
           
. "</table>"
           
. "</form>";

    echo
$result;
    } elseif (
$act == 2 && $pid != "") {
       
$objPatent = EmpPatent::GetRecordById($pid);

   
$result = "<table class='table table-bordered'><tr><td><h4 align='center' >Edit Patent Details</h4></td></tr></table>"
           
. "<form method='post' id='edit' action='' enctype='multipart/form-data'><div class='row' style='margin-left: 0'>"
           
. " <div class='span12'> "
           
. "<table class='table table-bordered table-striped table-condensed cf table-hover form-group' style='font-size:12px;'>"
           
. "<tr>"
           
. "<td><b>Patent No :</b></td>"
           
. "<td><input type='hidden' name='pid' id='pid' value='" . $objPatent->getId() . "'>"
            
. "<input type='text' id='pno' name='pno' value='" . $objPatent->getPNo() . "' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Title :</b></td>"
           
. "<td><input type='text' id='title' name='title' value='" . $objPatent->getTitle() . "' class='form-control' style='height:30px;width:90%;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Earnings (in Rs.) :</b></td>"
           
. "<td><input type='number' id='earnings' name='earnings' value='" . $objPatent->getEarnings() . "' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Status :</b></td>"
           
. "<td><select id='status' name='status' required>"
           
. "<option value=''> -- Select -- </option>";
    foreach (
$pstatusList as $key => $value) {
       
$result .= "<option value='" . $key . "'";
        if (
$key == $objPatent->getStatus()) {
           
$result .= " selected='true' ";
        }
       
$result .= ">" . $value . "</option>";
    }

   
$result .= "</select></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Year :</b></td>"
           
. "<td><input type='number' id='year' name='year' min='1900' value='" . $objPatent->getPYear() . "' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td colspan='5' style='text-align: center;'><button id='btnsubmit2' name='btnsubmit' type='submit' class='btn btn-default' align='center' value='edit' style='width:25%;background:lightgray;'><b> Edit </b></button></td>"
           
. "</tr>"
           
. "</table>"
           
. "</form>";
    echo
$result;
} elseif (
$act == 3 && $pid != "") {
   
$objPatent = EmpPatent::GetRecordById($pid);

   
//Check for proper user
    //if ($objPatent->getPf_no() != $emp->getPfno()) {
    // header('Location: patents.php');
    // exit();
   // }

   
$result = "<table class='table table-bordered'><tr><td><h4 align='center'><font color='red'>DELETE Patent Details</font></h4></td></tr></table>"
           
. "<form method='post' id='delete' action='' enctype='multipart/form-data'><div class='row' style='margin-left: 0'>"
           
. " <div class='span12'> "
           
. "<table class='table table-bordered table-striped table-condensed cf table-hover form-group' style='font-size:12px;'>"
           
. "<tr>"
           
. "<td><b>Patent No :</b></td>"
           
. "<td><input type='hidden' name='pid' id='pid' value='" . $objPatent->getId() . "'>"
            
. "<input type='text' id='pno' name='pno' value='" . $objPatent->getPNo() . "' class='form-control' style='height:30px;' required/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Title :</b></td>"
           
. "<td><input type='text' id='title' name='title' value='" . $objPatent->getTitle() . "' class='form-control' style='height:30px;width:90%;' disabled/></td>"
           
. "</tr>"
            
. "<tr>"
           
. "<td><b>Earnings (in Rs.) :</b></td>"
           
. "<td><input type='number' id='earnings' name='earnings' value='" . $objPatent->getEarnings() . "' class='form-control' style='height:30px;' disabled/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Status :</b></td>"
           
. "<td><select id='status' name='status' disabled>"
           
. "<option value=''> -- Select -- </option>";
    foreach (
$pstatusList as $key => $value) {
       
$result .= "<option value='" . $key . "'";
        if (
$key == $objPatent->getStatus()) {
           
$result .= " selected='true' ";
        }
       
$result .= ">" . $value . "</option>";
    }

   
$result .= "</select></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td><b>Year :</b></td>"
           
. "<td><input type='number' id='year' name='year' min='1900' value='" . $objPatent->getPYear() . "' class='form-control' style='height:30px;' disabled/></td>"
           
. "</tr>"
           
. "<tr>"
           
. "<td colspan='5' style='text-align: center;'><button id='btnsubmit2' name='btnsubmit' type='submit' class='btn btn-danger' align='center' value='delete' style='width:25%;'><b> Delete </b></button></td>"
           
. "</tr>"
           
. "</table>"
           
. "</form>";
    echo
$result;
}
?>


Details

contents of applications /bootstrap - file folder actionPatent.php EmpPatent.php footer.php header.php patents.php payent.sql

  Files folder image Files  
File Role Description
Files folder imagebootstrap (2 directories)
Plain text file actionPatent.php Example php code
Plain text file EmpPatent.php Class php code
Plain text file footer.php Aux. php code
Plain text file header.php Aux. php code
Plain text file OOP_PHP_DB Data contents description
Plain text file patent.sql Data sql script
Plain text file patents.php Data php code
Image file screenshot1.jpg Screen jpg image
Image file screenshot2.jpg Screen jpg image

  Files folder image Files  /  bootstrap  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (3 files)

  Files folder image Files  /  bootstrap  /  css  
File Role Description
  Plain text file bootstrap.min.css Data style sheet

  Files folder image Files  /  bootstrap  /  js  
File Role Description
  Plain text file bootstrap.min.js Data java script
  Plain text file jquery-1.11.1.min.js Data java script
  Plain text file jquery-1.9.1.min.js Data java script

 Version Control Unique User Downloads Download Rankings  
 0%
Total:175
This week:1
All time:8,774
This week:560Up
User Comments (1)
is dengerous, No sanitize PDO posts
6 years ago (gabriele)
17%Star