Fixed issues with setup.php
This commit is contained in:
@@ -45,9 +45,10 @@ CRM, Accounting and Invoicing System for small managed IT companies
|
|||||||
|
|
||||||
### Installation Instructions
|
### Installation Instructions
|
||||||
|
|
||||||
* Create a mysql database dump db.sql into it
|
* Download the files in this repository
|
||||||
* Set db user and password in config.php
|
* Create a Mysql database
|
||||||
* Point your browser and away you go
|
* Point your browser to setup.php fill in the info
|
||||||
|
* Your Done! that easy..
|
||||||
|
|
||||||
#### Requirements
|
#### Requirements
|
||||||
* Webserver (Apache, NGINX)
|
* Webserver (Apache, NGINX)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
$calendar_name = $row['calendar_name'];
|
$calendar_name = $row['calendar_name'];
|
||||||
$calendar_color = $row['calendar_color'];
|
$calendar_color = $row['calendar_color'];
|
||||||
?>
|
?>
|
||||||
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> value="<?php echo $calendar_id; ?> ><?php echo $calendar_name; ?></option>
|
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
//DB Settings
|
||||||
|
|
||||||
|
$dbhost = "localhost";
|
||||||
|
$dbusername = "root";
|
||||||
|
$dbpassword = "password";
|
||||||
|
$database = "pittpc";
|
||||||
|
|
||||||
|
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database);
|
||||||
|
|
||||||
|
include("get_settings.php");
|
||||||
|
?>
|
||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
//DB Settings
|
|
||||||
|
|
||||||
$dbhost = "localhost";
|
$dbhost = "localhost";
|
||||||
$dbusername = "root";
|
$dbusername = "root";
|
||||||
$dbpassword = "password";
|
$dbpassword = "password";
|
||||||
$database = "pittpc";
|
$database="test";
|
||||||
|
|
||||||
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database);
|
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database);
|
||||||
|
|
||||||
include("get_settings.php");
|
include("get_settings.php");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Binary file not shown.
@@ -7,7 +7,7 @@ if(isset($_POST['add_database'])){
|
|||||||
$username = $_POST['username'];
|
$username = $_POST['username'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
|
|
||||||
$myfile = fopen("dbconnect.php", "w");
|
$myfile = fopen("config.php", "w");
|
||||||
|
|
||||||
$txt = "<?php\n\n";
|
$txt = "<?php\n\n";
|
||||||
|
|
||||||
@@ -31,14 +31,6 @@ if(isset($_POST['add_database'])){
|
|||||||
|
|
||||||
fclose($myfile);
|
fclose($myfile);
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Database successful";
|
|
||||||
|
|
||||||
header("setup.php?import_database");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['import_database'])){
|
|
||||||
|
|
||||||
include("config.php");
|
include("config.php");
|
||||||
|
|
||||||
// Name of the file
|
// Name of the file
|
||||||
@@ -79,6 +71,10 @@ if(isset($_POST['import_database'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW()");
|
mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW()");
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "Database successfully added";
|
||||||
|
|
||||||
|
header("Location: setup.php?user");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['add_user'])){
|
if(isset($_POST['add_user'])){
|
||||||
@@ -100,6 +96,8 @@ if(isset($_POST['add_user'])){
|
|||||||
|
|
||||||
$_SESSION['alert_message'] = "User added";
|
$_SESSION['alert_message'] = "User added";
|
||||||
|
|
||||||
|
header("Location: setup.php?company");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['add_company_settings'])){
|
if(isset($_POST['add_company_settings'])){
|
||||||
@@ -116,7 +114,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO settings SET config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = '$config_company_phone', config_company_site = '$config_company_site', config_start_page = 'dashboard.php'");
|
mysqli_query($mysqli,"INSERT INTO settings SET config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = '$config_company_phone', config_company_site = '$config_company_site', config_start_page = 'dashboard.php'");
|
||||||
|
|
||||||
header("login.php");
|
header("Location: login.php");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +190,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
<div id="content-wrapper">
|
<div id="content-wrapper">
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<?php include("config.php"); ?>
|
||||||
<?php if(isset($_GET['database'])){ ?>
|
<?php if(isset($_GET['database'])){ ?>
|
||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
@@ -203,17 +201,17 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
<form class="p-3" method="post" autocomplete="off">
|
<form class="p-3" method="post" autocomplete="off">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>MySQL Host</label>
|
<label>Database Name</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-database"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="host" placeholder="Usually localhost" required>
|
<input type="text" class="form-control" name="database" placeholder="Name of the database" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>MySQL Username</label>
|
<label>Username</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||||
@@ -223,7 +221,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>MySQL Password</label>
|
<label>Password</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||||
@@ -233,14 +231,15 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-5">
|
<div class="form-group mb-5">
|
||||||
<label>MySQL Database Name</label>
|
<label>Database Host</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-database"></i></span>
|
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="database" placeholder="Name of the database" required>
|
<input type="text" class="form-control" name="host" placeholder="Usually localhost" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<button type="submit" name="add_database" class="btn btn-primary">Save</button>
|
<button type="submit" name="add_database" class="btn btn-primary">Save</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -298,8 +297,6 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
|
|
||||||
<?php }elseif(isset($_GET['company'])){ ?>
|
<?php }elseif(isset($_GET['company'])){ ?>
|
||||||
|
|
||||||
<?php include("config.php"); ?>
|
|
||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h6 class="mt-1"><i class="fa fa-building"></i> Company Settings</h6>
|
<h6 class="mt-1"><i class="fa fa-building"></i> Company Settings</h6>
|
||||||
@@ -378,7 +375,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h6 class="mt-1"><i class="fa fa-database"></i> Start Install</h6>
|
<h6 class="mt-1"><i class="fa fa-database"></i> Start Install <?php echo $database; ?></h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>Click on the install button to start the install process, you must create a database before starting</p>
|
<p>Click on the install button to start the install process, you must create a database before starting</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user