Giter Club home page Giter Club logo

simplestock's Introduction

Status Issues License

Made with ♥ by GrowStocks Development

Proprietary PHP Library for GrowStocks now OPEN-SOURCED!

Requirements

  • PHP 7.1+
  • Text Editor (Prefferably VSCode or Sublime Text)
  • Local Server (localhost:3600)
  • a database with the required columns (see below) [MySQL]
  • Basic MySQL Database management skills
  • Basic PHP skills

What is SimpleStock?

It is GrowStock's proprietary PHP library to make their website, it let's their developers do less code and make the most out of the function, hence the name SimpleStock. It's basically a library of commands that the developers use in their website pages, now we decided to make it open source so everyone can contribute to the project!

Terms of Use

If you do want to use this library in your websites, webapps and apps, please do keep these points in mind:

  • You can use the plugins as much as you want to, but do credit GrowStocks for the plugins used.

How to use

Well we are still working on the functions needed but here are the first steps on making the plugins work.

1. Database creation

Make sure that you make a MySQL database (via phpMyAdmin) with the following columns:

rowID ID itemName itemQty itemWls itemRate itemStatus itemDemand
01 0 Blank 0 0 NULL UNDEF UNDEF

2. Inclusion of files

Make sure that the files of this library is in the same folder as the website. After that, include the autoload.php file to the pages you want the plugin to be in by adding this to the top of the file:

<?php
  include("autoload.php");
?>

Just by adding this command on top, will automatically load every command needed in the files.

3. Connection

Of course we need to connect your database to the website itself for it to function. Now, open the includes directory and click the dbconn.php file. Now fill up the file with the following:

<?php
  $servername = "localhost (if it's a remote database, please change the localhost to the appropriate server name/address)";
  $username = "(your database username here)";
  $password = "(your database password here)";
  $dbname = "(the database name goes here)";
  
  //This connects the whole website to the database:
  $conn = mysqli_connect($servername, $username, $password, $dbname);
  
  //Error handler:
  if(!$conn){
    exit("Couldn't establish a database conection! Please refresh this page.");
  }
?>

4. Commands

Once everything is in place, it's time to use the commands in the library.

Command Function
rate($rawData) it auto calculates the rate of an item.
price($rawData) it retrieves the compiled price of an item, it combines the two string variables $data['itemQty'] & $data['itemWls'].
status($rawData) it determines the current price status of the item.
trend($rawData) it determines the current trend status of the item.
rec($rawData) it determines the recommendation status of an item.
More commands to produce soon!

simplestock's People

Contributors

matteusan avatar

Watchers

 avatar

Forkers

notwes

simplestock's Issues

WE NEED HELP!

Yes! We need help developing this plugin for the community. You can do it by replying here and I will let you contribute to this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.