Coder Social home page Coder Social logo

Comments (54)

amirsanni avatar amirsanni commented on May 28, 2024 2

@raymonduui @Grzegorz07 I have updated the framework. You can re-download and test.

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Can you send a screenshot? Also ensure you downloaded the complete project, perhaps one or more files are missing.

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

Hello, i've got a problem. I can't log in, alwayes I have info "Log in failed. Please check your internet connection and try again later."

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024
  1. Did you follow the instruction in the readme?
  2. Are you seeing any error in your developer console?
  3. How did you set the app up?
  4. Can I see screenshots?

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

I have the same problem, it seems some folder/ files are missing :
image

the function handleLogin(....) in main.js is trying to ajax "appRoot+access/login", but there is no such directory in the whole project.

function handleLogin(email, password, callback){
    var jsonToReturn = "";
    
    $.ajax(appRoot+'access/login', {
        method: "POST",
        data: {email:email, password:password}
    }).done(function(returnedData){
        
        if(returnedData.status === 1){
            jsonToReturn = {status:1, msg:"Authenticated..."};
        }
        else{
            //display error messages
            jsonToReturn = {status:0, msg:"Invalid email/password combination"};
        }	
		typeof(callback) === "function" ? callback(jsonToReturn) : "";
		
    }).fail(function(){
        //set error message based on the internet connectivity of the user
        var msg = "Log in failed. Please check your internet connection and try again later.";
        

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui There are no files missing. The URI "access/login" is be re-routed to "home/login".

image

Ensure your appRoot and the other setup steps are properly followed.

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui From your screenshot, I can see that you're trying to access localhost:8080/access/login. Is it that the app is directly (not in any folder) inside your public_html OR www OR htdocs etc folder?

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni

Configs for hosting on Apache

My App Location : C:\Apache24\htdocs\mini-inventory-and-sales-management-system (where index.php is located )

Launch the app via : localhost/mini-inventory-and-sales-management-system

In httpd.conf

DocumentRoot "c:/Apache24/htdocs/"
<Directory "c:/Apache24/htdocs/">
......
AllowOverride All
DirectoryIndex index.php
</Directory>

For .htaccess in the root mini-inventory-and-sales-management-system
Stays RewriteBase /mini-inventory-and-sales-management-system

For application/config/config.php
Stays ."/mini-inventory-and-sales-management-system/"

For public/js/main.js
Stays var appRoot = setAppRoot("mini-inventory-and-sales-management-system", "mini-inventory-and-sales-management-system");

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

Changed to sqlite, able to login with default email and password ,but redirected back to login page....
The front is stays in login page, but the back end is logged in already.
image

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui Can you share your config/config.php file? And maybe your config/database.php as well.

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni Thank you.
in config.php, I only remove the "/mini-...." after $protocol.$host as above mentioned.

$host = $_SERVER['HTTP_HOST'];//e.g practa.ng || www.practa.ng || localhost
$protocol = is_https() ? "https://" : "http://";
        
if(is_cli()){
    $config['base_url'] = "";
}

else if(stristr($host, "localhost") !== FALSE || (stristr($host, "192.168.") !== FALSE)|| (stristr($host, "127.0.0.") !== FALSE)){
    $config['base_url'] =  $protocol.$host;
}

else{
    $allowed = ['www.1410inc.xyz', '1410inc.xyz'];//input all allowed urls here e.g. amirsanni.com, www.practa.ng, smartagapp.com

    $config['base_url'] = in_array($host, $allowed) ? $protocol.$host: "http://".$_SERVER['HTTP_HOST']."/";
}

database.php is the same as from git, I didn't do any changes.

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Add "/" after $protocol.$host.

It should look like this $config['base_url'] = $protocol.$host."/";

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui Also ensure codeIgniter is able to connect to your database.

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni thank you for answering.

I have added the ."/" and codeigniter is conected database.. but the same.. which server are you using to set up ?

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui Apache2 and I didn't change the document root (htdocs) as set by xampp.

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@Grzegorz07 Let's do teamviewer in 4hrs. i.e. 9pm GMT+1

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

I would need your help too but I am in timezone GMT+8 , so if possible can we do teamviewer too ?
now my database is connected, all paths are correct, but the uri rewrite is not working, even backend is loaded in , front end is refreshed but back to login page.
image

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui when will you be available to do it? Now?

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

Nah not yet, I am still at work. but about 10PM (GMT+8 ), so 3PM (GMT +1 ) . Thanks

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

I won't be free at that time.

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni what time will you be free later today or Sat ?

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

8am GMT+1 tomorrow (Saturday). 3pm your time (I think)

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni I am ok at that time

from mini-inventory-and-sales-management-system.

Grzegorz07 avatar Grzegorz07 commented on May 28, 2024

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@amirsanni Hi, I didn't have your response on Sat, but I found the problem is the routing, as from the php log , "No URI present. Default controller set", which is causing redirect to the default controller : home.

Problem is : $_SESSION['admin_id'] is empty

What's your structure and settings in xampp ? so I can follow it and test.

Now my structure is

xampp
  --htdocs
       --mini-inventory-and-sales-management-system
  --php
  --mysql

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

@raymonduui Sorry I could not meet up on Saturday. I'm using the default xampp settings. That's the same is @Grzegorz07 is having. The session data gets destroyed almost immediately. Can't tell what could be causing that at the moment. I'll check and get back.

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

@Grzegorz07 @amirsanni I fixed the issue :
1.
Go to system\libraries\Session\Session.php
Comment out both sections:
session_start(); at line 141
and

// Security is king
		ini_set('session.use_trans_sid', 0);
		ini_set('session.use_strict_mode', 1);
	       ini_set('session.use_cookies', 1);
	       ini_set('session.use_only_cookies', 1);
	       ini_set('session.hash_function', 1);
	      ini_set('session.hash_bits_per_character', 4);

at lines 313 to 319.
2.
Add session_start(); in index.php at root directory to a new line after <?php

Disable those security settings should be okay.

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Just realised the issue is CodeIgniter's (version used) compatibility with PHP 7. Switched the one online to PHP 7 and same thing happened. I'd rather just update the framework.

from mini-inventory-and-sales-management-system.

raaaaay-c avatar raaaaay-c commented on May 28, 2024

Thank you !
It works perfectly fine now :)

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Welcome

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

hello I want to tell you that the system looks good but the login error is still unresolved please can you give me a hand with that I am new in this world of php

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Check #35

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

captura

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

What is the name of the folder the app is running from?

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

is a local server with ubuntu

\192.168.x.xxx\www\html

http://192.168.x.xxx/mini-inventory-and-sales-management-system/

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Then you have to ensure your URL is well constructed i.e. really referencing that directory and that you have mod_rewrite enabled. From the screenshot, it says 404 Page Not Found meaning the link does not exist.

Also check the .htaccess file in the root directory. You should remove the directory name there since the app is hosted in the www/html directory.

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

is heading to this but it does not exist
URL /mini-inventory-and-sales-management-system/access/login

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Exactly what I said. It means the URL is not resolving properly.

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

change the name of all the files that you indicate but I am redirected to the same file I have to modify

jquery.min.js:4 POST http://192.168.1.136/mini-inventory-and-sales-management-system/access/login 404 (Not Found)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
handleLogin @ main.js:577
loginForm.onsubmit @ access.js:36

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Did you check the .htaccess file?

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

RewriteEngine On
RewriteBase /Inventory

Disable Directory Browsing

Options All -Indexes

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
#RewriteCond %{REQUEST_URI} ^system.*
#RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

new error
image

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

RewriteBase /Inventory. Is the app inside a dir call Inventory? If no, remove Inventory and leave it as RewriteBase /.

As for the database error, this is a feature in the recent versions of mysql/mariadb. MySQL Doc. You will need to search on how to remove that restriction.

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

See this SO link on how to do that.

from mini-inventory-and-sales-management-system.

serpe99 avatar serpe99 commented on May 28, 2024

thank you very much is already working

from mini-inventory-and-sales-management-system.

amirsanni avatar amirsanni commented on May 28, 2024

Welcome

from mini-inventory-and-sales-management-system.

akhilkumar332 avatar akhilkumar332 commented on May 28, 2024

@amirsanni I've the same issue, it says "Log in failed. Please check your internet connection and try again later"...
Update: Fixed

from mini-inventory-and-sales-management-system.

enea92 avatar enea92 commented on May 28, 2024

i have same error pls help me
image

from mini-inventory-and-sales-management-system.

Related Issues (20)

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.