Quick Start

Last updated: Dec 17th, 2017

Software Structure

Languages and Frameworks used in this software

  • PHP 7.0
  • PDO
  • MySqli
  • Bootstrap
  • JQuery AJAX

Folder Structure

Main Folder
	|
	|-- assests 		(This folder contain CSS and Javascript libraries)
	|
	|-- dbBackup		(This folder contain Backups of ESDN Store)
	|
	|-- Documenation	(This folder have complete documentation of our product)
	|
	|-- libs		(This folder contain all neccessary PHP classes)
	|	
	|-- mod			(This folder contain main files of ESDN Store)	
	|
	|-- sys_images		(All images are stored this folder)	
                                        

Working with our code

Classses and Functions
Main Folder
	|-- libs
	  |-- classes
	    |-- CRUD.php		(This file contain all PDO code to acces database)
	    |-- DB.php			(This file contain a very easy functions to execute SQL queries)
	    |-- MyMethods.php		(This file contain function related to images uploading, filtering inputs, validation, alerts and many more..)
                                        
Code Example -- Clean and Clear Code With Comments
										CRUD.php

	class CRUD {
		private $db_user;
		private $db_pass;
		private $db_name;
		private $host;
		protected $con;

		//To check sql query if needed
		public $sqlToReturn;
		public $tempVar;
		//default constructor to build the connection to db
		function __construct(){
			$this->db_user = $userName;
			$this->db_pass = $PassWord;
			$this->db_name = $DbName;
			$this->host = $Host;
			$this->Folder = $Dir;
		}		
		function __destruct(){
			try{
				$this->con = null;
			}catch(PDOException $exc){
				
			}
		}
		/**
		 * connect() function to connect to database
		 */
		protected function connect(){
			try{
				$this->con = new PDO("mysql:host={$this->host};dbname={$this->db_name};charset=utf8", $this->db_user, $this->db_pass); 
				$this->con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
				//$this->con->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
			}catch(PDOException $ex){
				return $ex->getMessage();
			}
		}
	}	
    /** ___________________________________________________________________________________________
      getValue() function takes two parameters
      1- Query : proper sql query
      $sql = 'SELECT * FROM table WHERE sno = :sno';
      2- $bindVars : Array i.e.
      $sno = 30;
      $arry = array(":sno"=>$sno);  ___________________________________________________________________________________
      Code Snippet:
      $user_name = '%sh%';
      $aray = array(':user_name'=>$user_name);
      $sql = "SELECT user_name FROM users WHERE user_name LIKE :user_name";
      echo($crud->getValue($sql,$aray));
	  _________________________________________________________________________________ */
    public function getValue($sql, $bindVars = array()) {
        try {
            $this->connect();
            $statement = $this->con->prepare($sql);
            $statement->execute($bindVars);
            return $statement->fetchColumn();
            $this->con = null;
        } catch (PDOException $ex) {
            return $ex->getMessage(); //Developer Machine: Display Exceptions in browser
        }
    }

    /* 


                                        
										save_store.php

/* save new store to database  */
//start session for get client id 
session_start();
require_once ("../../../../libs/classes/DB.php");
require_once ("../../../../libs/classes/MyMethods.php");
$db = new DB();
$method = new MyMethods();
//check the store name and address feild data if isset and !empty
if ($method->isOk($_POST['s_name']) && $method->isOk($_POST['s_address'])) {
	//post data from store.js
    $s_name = $_POST['s_name'];
    $s_contact = $_POST['s_contact'];
    $s_address = $_POST['s_address'];
	//array  for search query
    $inputVars = array(
        ':s_name' => $s_name,
        ':s_address' => $s_address
    );
	//search the store name id database if already exist
    $sqlSearch = "SELECT * FROM stores WHERE store_name = :s_name AND store_address = :s_address ";
    if ($db->dbQuery($sqlSearch, $inputVars)) {
        $method->b_notify("", "Store with same name and address is already exist, please try any other Name", "danger");
    } 
	//if store not exist
	else {
		//array for insert query
        $inputsVars = array(
            ':s_name' => $s_name,
            ':s_contact' => $s_contact,
            ':s_address' => $s_address,
            ':client_id' => $_SESSION['client_id']
        );
		//mysqli  insert query
        $sqlInsert = "INSERT INTO stores(
				store_name,
				store_phone,
				store_address,
				client_id
				
				)
			  VALUES (
				:s_name,
				:s_contact,
				:s_address,
				:client_id
				)";
				//if insert query is success
        if ($db->dbQuery($sqlInsert, $inputsVars)) {
			//show animated message
            $method->b_notify("", "Store Addedd Successfully", "success");
        } 
		// if any error in insert query
		else {
            $method->b_notify("", "Internal Server Error", "danger");
			/*for display the query error just type here
			echo("Error :".$method->tempVar);
			*/
        }
    }//dbQuery for search()
}//isOk()
//if store name and address are empty
else {
    $method->b_notify("", "Empty fields are not allowed", "danger");
}
		

                                        

Admin Module and User Module
Main Folder
	|-- mod
	  |-- panels
	    |-- admin	(This folder contain all files which are used in Admin Module)
	    |-- user	(This folder contain all file which are used in User Module)
                                        

Customize our code
Main Folder
	|-- mod
	  |-- panels
	    |-- admin OR User	(We have created very easy structure of our files so every one can understand it easily)
	      |-- ajaxPhp	(This folder contain all PHP files which are used in AJAX Requests.)
	      |-- pages		(Pages contain main interface files of every activity.)
	      |-- pages_js	(This folder contain all Javascript Files. Each file contain JQuery/Javascript functions.
				These functions are mostly used for AJAX Requests to manage Database.)
                                        

Requirements

  • PHP version 7.0 and above
  • MySql version 5.0 and above
  • Latest version of any web browser

Required Softwares
Required Files

Setting Environment

Step One

XAMPP Installation
  • Download & extract/install XAMPP to any drive. Example C: drive or D: drive etc

Step Two

ESDN STORE v1.0 Installation
  • Dowload required files from above link
  • And extract esdn_store.zip to C:\xampp\htdocs

Installation

To start with ESDN STORE v1.0, you need some basic and very easy steps.

  • Start XAMPP Server
  • Open any web browser and type http://localhost/folder_name in address bar.
  • After above steps, installation process will be start.

Installation Process

Step One
  • Provide all information very carefully
Step Two
  • Enter username and password. And click on Ready to GO!

Create Store

Here you can create store very easily. Just click on Create New Store in Dashboard and follow the following steps.

Useful Tip:

You can edit store name, contact and address or even delete a store. You can also print your stores list.

Create User

Here you can create many users for stores very easily. Just click on Create New User in Dashboard and follow the following steps.

Language

In this section you can manage languages which are used in ESDN Store.

  • Type language name and select language direction (LTR or RTL) and click on Add button.
  • If you are developer then you can create a new phrase (Lable) to use in code.
  • Another interesting thing, that you can edit all lables of any language with easy steps below.

Database Backup

The most interesting thing about our ESDN Store is Database Backup.

  • To take Backup form your data just click on BIG green button
  • You can download you backup file to your computer drive.
  • You can send backup file to your email if you want by clicking mail button.
  • One of Golden feature is restoration of database. Just click on Restore button.
  • You can also delete a backup file by clicking Trash button.

Email Templates

E-mail is better way to facilitate your client but what if the client don't like your email design (template). Don't be afraid! ESDN Store brings this feature to your screen.

  • You can design you own E-mail templates with GUI interface.
  • To edit E-mail template just select template for editing. Example select Sale Invoice
  • Email Sender: This email is used to display as sender email address to reciever of an email.
  • Email Subject: This is an email subject.
  • Email Status: The status is important option which is used to enabling and disabling of sending of email when sale invoice is created.
  • Email Detail: In this area we can design our email template.
  • Parameters: The parameters are specail keywords which will replace during sending email.

SMS Templates

SMS Templates are those templates which are used for the format of SMS Alert text.

  • You can edis the following SMS templates with help of some parameters below.
  • Parameters: The parameters are specail keywords which will be replace on actual value during sending SMS.

PHP Mailer

PHP Mailer is used for sending emails from any SMTP Server.

  • Host Email: Enter HOST email address.
  • User Email: Enter email from which email be send to others (From Email).
  • Email Password: Enter email password.
  • Reply Email: Address to which recipient will reply
  • Port: Enter port address of your SMTP, if you'r using gmail then enter 537.
  • TLS: If your are using Gmail then select "YES", other wise select "NO".

Free Updates

ESDN Store also provide Updates Feature. You can get lifetime free updates once you buy our product.

Create Invoice

Follow the following steps to create beautiful invoices.

Invoice List

Follow the following steps to manage your invoices.

Add New Product

When you install your store and want to add new products to your inventory follow the following steps.

Note: If products are already added, and new shipment arrive for your store then go to Invoices Menu and click on Purchase Invoice

Add New Customer

  • Add New Customer
  • Edit customer information
  • Delete customer entry
  • Print all customer in list

Note: When you add new customer, SMS Alert will be send to that customer as welcome message.

Add New Supplier

  • Add New Supplier
  • Edit supplier information
  • Delete supplier entry
  • Print all supplier in list

Expense Entry

Add New Account

Create Cash Receipt

Create a Receipt for customers when they pay you.

  • Email will be send to customers whey they pay you, if Customer Receipt Email is enabled in Admin Account.
  • Also receipt info will be send by SMS, if SMS Alert is enabled in Admin Account.


General Settings

  • Update your store information like Name, Address and Phone Number.
  • Change your store logo.
  • Enabaled and disabled some features in Invoice.

Ledger Reports

In this section you can find every transaction report in detail. Some of features are below.

  • General Ledger: Display Credit, Debit and Balance of all customers and suppliers.
  • Customer Ledger: Display customers ledger.
  • Supplier Ledger: Display suppliers ledger
  • Accounts Ledger: Display acconts ledger

Sale Reports

Everyone wants to see their Store Sale Report to find out that what products are making profits. So we created a detail reports for your Sale.

  • All Sale Report: To see whole sale report.
  • Customer Sale Report: To see customer sale report separately.

Inventory Reports

User Profile

User Profile contain following features.

  • Updating user login username.
  • Updating user information like Name, Phone and Email.
  • Changing user password.