mirror of https://github.com/itflow-org/itflow
Initial work on switching companies, added error if not able to connect to database
This commit is contained in:
parent
7a0ef334a3
commit
a14ec04d5a
|
|
@ -6,7 +6,7 @@ if(isset($_GET['calendar_id'])){
|
|||
|
||||
?>
|
||||
|
||||
<div class="card"><?php echo $client_id; ?>
|
||||
<div class="card">
|
||||
<div id='calendar'></div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
12
post.php
12
post.php
|
|
@ -13,6 +13,18 @@ require_once $mpdf_path . '/vendor/autoload.php';
|
|||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
if(isset($_GET['switch_company'])){
|
||||
$company_id = intval($_GET['switch_company']);
|
||||
|
||||
$session_company_id = $company_id;
|
||||
|
||||
$_SESSION['alert_type'] = "info";
|
||||
$_SESSION['alert_message'] = "Switched Companies!";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_user'])){
|
||||
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
|
|
|
|||
|
|
@ -98,11 +98,11 @@ if(isset($_POST['add_database'])){
|
|||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "\$mysqli = mysqli_connect(\$dbhost, \$dbusername, \$dbpassword, \$database);\n\n";
|
||||
$txt = "\$mysqli = mysqli_connect(\$dbhost, \$dbusername, \$dbpassword, \$database) or die('Database Connection Failed');\n\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "\$config_app_name = 'IT CRM';\n";
|
||||
$txt = "\$config_app_name = 'ITFlow';\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue