PHP Classes

eprotech: Application to access medical product suppliers

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 33 All time: 11,097 This week: 455Up
Version License PHP version Categories
eprotech 1.0Custom (specified...5PHP 5, Content management
Description 

Author

This package provides an application to access medical product suppliers.

It provides a Web interface to allow the users to perform several types of operations to access a database of suppliers of medical products.

Currently the application provides pages to:

- Allow regular users and administrators to login

- Allow administrators to add users

- Edit supplier companies

- Edit supplier products

Picture of Braun Okoi Boniface
Name: Braun Okoi Boniface <contact>
Classes: 2 packages by
Country: Nigeria Nigeria
Age: 38
All time rank: 410036 in Nigeria Nigeria
Week rank: 195 Up6 in Nigeria Nigeria Up

 

Example

<?php
session_start
(); //Optional if you know how to start your session outside this file

function loadClasses($class) {
   
$path = "./classes/";
    require_once(
"{$path}{$class}.php");
}

spl_autoload_register('loadClasses');

//Instantiating the CRUD Class
$crud = new CRUD("localhost", "root", "", "eprotech");

//Making Connection to Database
$conn = $crud->connect();

//Add Company
if(isset($_POST['addCompBtn'])) {
   
$add_comp = $crud->add($conn, "tbl_suppliers", $_POST, [], ['cat_id'=>'i'], true);

    if(
$add_comp) {
       
$crud->redirect("suppliers.php?stat=1");
    }
}

if(isset(
$_GET['task']) && isset($_GET['comp_id']) && $_GET['task']=="comp_details") {
   
$get_comp_details = $crud->get($conn, "SELECT * FROM tbl_suppliers WHERE id={$_GET['comp_id']}");
   
$company = $get_comp_details->fetch_assoc();
}

//Login Handler
$msg = "";
if(isset(
$_POST['loginBtn'])) {
   
$username = $_POST['username'];
   
$password = $_POST['password'];

   
$login = $crud->login("SELECT * FROM tbl_staffs WHERE email='{$username}' AND `password`='{$password}'");

    if(
$login) {
        if(
$login === false) {
           
$msg = "Invalid Username and Password combination";
           
$_SESSION['loginErr'] = $login;
           
$crud->redirect("login.php?{$_SESSION['loginErr']}");
        } else {
           
$_SESSION['login_status'] = "loggedin";
           
$crud->redirect("index.php");
        }
    }
}

//Unlock Handler
$msg = "";
if(isset(
$_POST['unlockBtn'])) {
    if(
$_SESSION['login_status'] == "locked") {
       
$password = $_POST['password'];

   
$unlock = $crud->get($conn, "SELECT email, `password` FROM tbl_staffs WHERE `password`='{$password}' AND email='{$_SESSION['email']}'");
   
$unlocked = $unlock->fetch_assoc();
//print_r($unlocked); exit;
       
if($unlock) {
            if(
$unlock === false) {
               
$msg = "Invalid Password combination";
               
$_SESSION['loginErr'] = "true";
               
$crud->redirect("login.php?{$_SESSION['loginErr']}");
            } else {
                if(
$_SESSION['email'] == $unlocked['email']) {
                   
$_SESSION['login_status'] = "loggedin";
                   
$crud->redirect("index.php");
                }
            }
        }
    }
}

//Logout Action
if(isset($_GET['action']) && isset($_GET['check'])) {
   
$action = $_GET['action'];
   
$check = $_GET['check'];
   
$logout = $crud->logout($action, $check);
    if(
$logout) {
       
$crud->redirect("login.php");
    }
}

//Lock Action
if(isset($_GET['action']) && isset($_GET['check'])) {
   
$action = $_GET['action'];
   
$check = $_GET['check'];
    if(
$action == "lock" && $check == "true") {
       
$_SESSION['login_status'] = "locked";
       
$_SESSION['password'] = "";

       
//unset
       
unset($_SESSION['password']);
    }

    if(
$_SESSION['login_status'] == "locked") {
       
$crud->redirect("lock.php");
    }
}


Details

E-Protech Suppliers Database

A database that list all the local and international suppliers of medical equipments


  Files folder image Files (522)  
File Role Description
Files folder imageassets (5 directories)
Files folder imageclasses (2 files)
Files folder imageincludes (7 files)
Files folder imagevendor (1 directory)
Accessible without login Plain text file app.php Example Example script
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file lock.php Aux. Auxiliary script
Accessible without login Plain text file login.php Aux. Auxiliary script
Accessible without login Plain text file README.md Data Read me
Accessible without login Plain text file suppliers.php Example Example script
Accessible without login Plain text file user-groups.php Example Example script
Accessible without login Plain text file users.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:33
This week:0
All time:11,097
This week:455Up