mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 03:14:52 +00:00
Merge pull request #580 from wrongecho/function-standardise
Convert custom function names to camelCase
This commit is contained in:
@@ -17,7 +17,7 @@ header('Content-Type: application/json');
|
|||||||
$_POST = json_decode(file_get_contents('php://input'), true);
|
$_POST = json_decode(file_get_contents('php://input'), true);
|
||||||
|
|
||||||
// Get user IP
|
// Get user IP
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||||
// Get user agent
|
// Get user agent
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SESSION FINGERPRINT
|
// SESSION FINGERPRINT
|
||||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip()));
|
$session_ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||||
|
|
||||||
// User agent
|
// User agent
|
||||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
$log_description = htmlentities($row['log_description']);
|
$log_description = htmlentities($row['log_description']);
|
||||||
$log_ip = htmlentities($row['log_ip']);
|
$log_ip = htmlentities($row['log_ip']);
|
||||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||||
$log_user_os = get_os($log_user_agent);
|
$log_user_os = getOS($log_user_agent);
|
||||||
$log_user_browser = get_web_browser($log_user_agent);
|
$log_user_browser = getWebBrowser($log_user_agent);
|
||||||
$log_created_at = $row['log_created_at'];
|
$log_created_at = $row['log_created_at'];
|
||||||
$user_id = $row['user_id'];
|
$user_id = $row['user_id'];
|
||||||
$user_name = htmlentities($row['user_name']);
|
$user_name = htmlentities($row['user_name']);
|
||||||
|
|||||||
@@ -66,12 +66,11 @@ function removeDirectory($path) {
|
|||||||
rmdir($path);
|
rmdir($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_user_agent() {
|
function getUserAgent() {
|
||||||
return $_SERVER['HTTP_USER_AGENT'];
|
return $_SERVER['HTTP_USER_AGENT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_ip() {
|
function getIP() {
|
||||||
|
|
||||||
if (defined("CONST_GET_IP_METHOD")) {
|
if (defined("CONST_GET_IP_METHOD")) {
|
||||||
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
|
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
|
||||||
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
@@ -85,7 +84,7 @@ function get_ip() {
|
|||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_web_browser($user_browser) {
|
function getWebBrowser($user_browser) {
|
||||||
$browser = "Unknown Browser";
|
$browser = "Unknown Browser";
|
||||||
$browser_array = array(
|
$browser_array = array(
|
||||||
'/msie/i' => "<i class='fab fa-fw fa-internet-explorer text-secondary'></i> Internet Explorer",
|
'/msie/i' => "<i class='fab fa-fw fa-internet-explorer text-secondary'></i> Internet Explorer",
|
||||||
@@ -103,7 +102,7 @@ function get_web_browser($user_browser) {
|
|||||||
return $browser;
|
return $browser;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_os($user_os) {
|
function getOS($user_os) {
|
||||||
$os_platform = "Unknown OS";
|
$os_platform = "Unknown OS";
|
||||||
$os_array = array(
|
$os_array = array(
|
||||||
'/windows nt 10/i' => "<i class='fab fa-fw fa-windows text-secondary'></i> Windows 10",
|
'/windows nt 10/i' => "<i class='fab fa-fw fa-windows text-secondary'></i> Windows 10",
|
||||||
@@ -130,7 +129,7 @@ function get_os($user_os) {
|
|||||||
return $os_platform;
|
return $os_platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_device() {
|
function getDevice() {
|
||||||
$tablet_browser = 0;
|
$tablet_browser = 0;
|
||||||
$mobile_browser = 0;
|
$mobile_browser = 0;
|
||||||
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
||||||
@@ -142,7 +141,7 @@ function get_device() {
|
|||||||
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) || ((isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])))) {
|
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) || ((isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])))) {
|
||||||
$mobile_browser++;
|
$mobile_browser++;
|
||||||
}
|
}
|
||||||
$mobile_ua = strtolower(substr(get_user_agent(), 0, 4));
|
$mobile_ua = strtolower(substr(getUserAgent(), 0, 4));
|
||||||
$mobile_agents = array(
|
$mobile_agents = array(
|
||||||
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
|
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
|
||||||
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
|
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
|
||||||
@@ -156,7 +155,7 @@ function get_device() {
|
|||||||
if (in_array($mobile_ua,$mobile_agents)) {
|
if (in_array($mobile_ua,$mobile_agents)) {
|
||||||
$mobile_browser++;
|
$mobile_browser++;
|
||||||
}
|
}
|
||||||
if (strpos(strtolower(get_user_agent()),'opera mini') > 0) {
|
if (strpos(strtolower(getUserAgent()),'opera mini') > 0) {
|
||||||
$mobile_browser++;
|
$mobile_browser++;
|
||||||
//Check for tablets on Opera Mini alternative headers
|
//Check for tablets on Opera Mini alternative headers
|
||||||
$stock_ua = strtolower(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])?$_SERVER['HTTP_X_OPERAMINI_PHONE_UA']:(isset($_SERVER['HTTP_DEVICE_STOCK_UA'])?$_SERVER['HTTP_DEVICE_STOCK_UA']:''));
|
$stock_ua = strtolower(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])?$_SERVER['HTTP_X_OPERAMINI_PHONE_UA']:(isset($_SERVER['HTTP_DEVICE_STOCK_UA'])?$_SERVER['HTTP_DEVICE_STOCK_UA']:''));
|
||||||
@@ -216,7 +215,7 @@ function formatPhoneNumber($phoneNumber) {
|
|||||||
return $phoneNumber;
|
return $phoneNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mkdir_missing($dir) {
|
function mkdirMissing($dir) {
|
||||||
if (!is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
mkdir($dir);
|
mkdir($dir);
|
||||||
}
|
}
|
||||||
@@ -437,12 +436,9 @@ function getSSL($name) {
|
|||||||
return $certificate;
|
return $certificate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function strto_AZaz09($string) {
|
function strtoAZaz09($string) {
|
||||||
$string = ucwords(strtolower($string));
|
$string = ucwords(strtolower($string));
|
||||||
|
|
||||||
// Replace spaces with _
|
|
||||||
//$string = str_replace(' ', '_', $string);
|
|
||||||
|
|
||||||
// Gets rid of non-alphanumerics
|
// Gets rid of non-alphanumerics
|
||||||
return preg_replace('/[^A-Za-z0-9_]/', '', $string);
|
return preg_replace('/[^A-Za-z0-9_]/', '', $string);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ include_once("config.php");
|
|||||||
include_once("functions.php");
|
include_once("functions.php");
|
||||||
|
|
||||||
// IP & User Agent for logging
|
// IP & User Agent for logging
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
// Define wording for the user
|
// Define wording for the user
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// Not including the guest header as we don't want any HTML output
|
// Not including the guest header as we don't want any HTML output
|
||||||
include("config.php");
|
include("config.php");
|
||||||
include("functions.php");
|
include("functions.php");
|
||||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,get_ip())));
|
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIP())));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
if (isset($_GET['id']) && isset($_GET['key'])) {
|
if (isset($_GET['id']) && isset($_GET['key'])) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ include("functions.php");
|
|||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,get_ip())));
|
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIP())));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ if (isset($_GET['invoice_id'], $_GET['url_key'])) {
|
|||||||
//Set Currency Format
|
//Set Currency Format
|
||||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||||
|
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||||
|
|
||||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
$os = strip_tags(mysqli_real_escape_string($mysqli,get_os($session_user_agent)));
|
$os = strip_tags(mysqli_real_escape_string($mysqli,getOS($session_user_agent)));
|
||||||
$browser = strip_tags(mysqli_real_escape_string($mysqli,get_web_browser($session_user_agent)));
|
$browser = strip_tags(mysqli_real_escape_string($mysqli,getWebBrowser($session_user_agent)));
|
||||||
|
|
||||||
//Set Badge color based off of invoice status
|
//Set Badge color based off of invoice status
|
||||||
if ($invoice_status == "Sent") {
|
if ($invoice_status == "Sent") {
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ if (isset($_GET['quote_id'], $_GET['url_key'])) {
|
|||||||
//Set Currency Format
|
//Set Currency Format
|
||||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||||
|
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||||
|
|
||||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||||
$os = strip_tags(mysqli_real_escape_string($mysqli,get_os($session_user_agent)));
|
$os = strip_tags(mysqli_real_escape_string($mysqli,getOS($session_user_agent)));
|
||||||
$browser = strip_tags(mysqli_real_escape_string($mysqli,get_web_browser($session_user_agent)));
|
$browser = strip_tags(mysqli_real_escape_string($mysqli,getWebBrowser($session_user_agent)));
|
||||||
|
|
||||||
//Update status to Viewed only if invoice_status = "Sent"
|
//Update status to Viewed only if invoice_status = "Sent"
|
||||||
if ($quote_status == 'Sent') {
|
if ($quote_status == 'Sent') {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ require_once("functions.php");
|
|||||||
require_once("rfc6238.php");
|
require_once("rfc6238.php");
|
||||||
|
|
||||||
// IP & User Agent for logging
|
// IP & User Agent for logging
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
// Block brute force password attacks - check recent failed login attempts for this IP
|
// Block brute force password attacks - check recent failed login attempts for this IP
|
||||||
|
|||||||
4
logs.php
4
logs.php
@@ -141,8 +141,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$log_description = htmlentities($row['log_description']);
|
$log_description = htmlentities($row['log_description']);
|
||||||
$log_ip = htmlentities($row['log_ip']);
|
$log_ip = htmlentities($row['log_ip']);
|
||||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||||
$log_user_os = get_os($log_user_agent);
|
$log_user_os = getOS($log_user_agent);
|
||||||
$log_user_browser = get_web_browser($log_user_agent);
|
$log_user_browser = getWebBrowser($log_user_agent);
|
||||||
$log_created_at = $row['log_created_at'];
|
$log_created_at = $row['log_created_at'];
|
||||||
$user_id = $row['user_id'];
|
$user_id = $row['user_id'];
|
||||||
$user_name = htmlentities($row['user_name']);
|
$user_name = htmlentities($row['user_name']);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (!$_SESSION['client_logged_in']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SESSION FINGERPRINT
|
// SESSION FINGERPRINT
|
||||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, get_ip()));
|
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||||
|
|
||||||
// Get user agent
|
// Get user agent
|
||||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (!isset($_SESSION)) {
|
|||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
$sql_settings = mysqli_query($mysqli, "SELECT config_azure_client_id FROM settings WHERE company_id = '1'");
|
$sql_settings = mysqli_query($mysqli, "SELECT config_azure_client_id FROM settings WHERE company_id = '1'");
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if (!isset($_SESSION)) {
|
|||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,get_ip()));
|
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||||
|
|
||||||
$company_sql = mysqli_query($mysqli, "SELECT company_name FROM companies WHERE company_id = '1'");
|
$company_sql = mysqli_query($mysqli, "SELECT company_name FROM companies WHERE company_id = '1'");
|
||||||
|
|||||||
20
post.php
20
post.php
@@ -4371,7 +4371,7 @@ if(isset($_GET['export_client_contacts_csv'])){
|
|||||||
$sql = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN locations ON location_id = contact_location_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN locations ON location_id = contact_location_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||||
if($sql->num_rows > 0){
|
if($sql->num_rows > 0){
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Contacts-" . date('Y-m-d') . ".csv";
|
$filename = strtoAZaz09($client_name) . "-Contacts-" . date('Y-m-d') . ".csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -4509,7 +4509,7 @@ if(isset($_GET['download_client_contacts_csv_template'])){
|
|||||||
$client_name = $row['client_name'];
|
$client_name = $row['client_name'];
|
||||||
|
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Contacts-Template.csv";
|
$filename = strtoAZaz09($client_name) . "-Contacts-Template.csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -4789,7 +4789,7 @@ if(isset($_GET['export_client_locations_csv'])){
|
|||||||
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL AND company_id = $session_company_id ORDER BY location_name ASC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL AND company_id = $session_company_id ORDER BY location_name ASC");
|
||||||
if($sql->num_rows > 0){
|
if($sql->num_rows > 0){
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Locations-" . date('Y-m-d') . ".csv";
|
$filename = strtoAZaz09($client_name) . "-Locations-" . date('Y-m-d') . ".csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -4915,7 +4915,7 @@ if(isset($_GET['download_client_locations_csv_template'])){
|
|||||||
$client_name = $row['client_name'];
|
$client_name = $row['client_name'];
|
||||||
|
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Locations-Template.csv";
|
$filename = strtoAZaz09($client_name) . "-Locations-Template.csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -5189,7 +5189,7 @@ if(isset($_GET['download_client_assets_csv_template'])){
|
|||||||
$client_name = $row['client_name'];
|
$client_name = $row['client_name'];
|
||||||
|
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Assets-Template.csv";
|
$filename = strtoAZaz09($client_name) . "-Assets-Template.csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -5226,7 +5226,7 @@ if(isset($_GET['export_client_assets_csv'])){
|
|||||||
$sql = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id LEFT JOIN locations ON asset_location_id = location_id WHERE asset_client_id = $client_id ORDER BY asset_name ASC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id LEFT JOIN locations ON asset_location_id = location_id WHERE asset_client_id = $client_id ORDER BY asset_name ASC");
|
||||||
if($sql->num_rows > 0){
|
if($sql->num_rows > 0){
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Assets-" . date('Y-m-d') . ".csv";
|
$filename = strtoAZaz09($client_name) . "-Assets-" . date('Y-m-d') . ".csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -5632,7 +5632,7 @@ if(isset($_GET['export_client_logins_csv'])){
|
|||||||
$sql = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_client_id = $client_id ORDER BY login_name ASC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_client_id = $client_id ORDER BY login_name ASC");
|
||||||
if($sql->num_rows > 0){
|
if($sql->num_rows > 0){
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Logins-" . date('Y-m-d') . ".csv";
|
$filename = strtoAZaz09($client_name) . "-Logins-" . date('Y-m-d') . ".csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -5751,7 +5751,7 @@ if(isset($_GET['download_client_logins_csv_template'])){
|
|||||||
$client_name = $row['client_name'];
|
$client_name = $row['client_name'];
|
||||||
|
|
||||||
$delimiter = ",";
|
$delimiter = ",";
|
||||||
$filename = strto_AZaz09($client_name) . "-Logins-Template.csv";
|
$filename = strtoAZaz09($client_name) . "-Logins-Template.csv";
|
||||||
|
|
||||||
//create a file pointer
|
//create a file pointer
|
||||||
$f = fopen('php://memory', 'w');
|
$f = fopen('php://memory', 'w');
|
||||||
@@ -7864,7 +7864,7 @@ if(isset($_GET['export_client_pdf'])){
|
|||||||
|
|
||||||
var docDefinition = {
|
var docDefinition = {
|
||||||
info: {
|
info: {
|
||||||
title: '<?php echo strto_AZaz09($client_name); ?>- IT Documentation',
|
title: '<?php echo strtoAZaz09($client_name); ?>- IT Documentation',
|
||||||
author: <?php echo json_encode($session_company_name); ?>
|
author: <?php echo json_encode($session_company_name); ?>
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -9046,7 +9046,7 @@ if(isset($_GET['export_client_pdf'])){
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
pdfMake.createPdf(docDefinition).download('<?php echo strto_AZaz09($client_name); ?>-IT_Documentation-<?php echo date('Y-m-d'); ?>.pdf');
|
pdfMake.createPdf(docDefinition).download('<?php echo strtoAZaz09($client_name); ?>-IT_Documentation-<?php echo date('Y-m-d'); ?>.pdf');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
10
setup.php
10
setup.php
@@ -857,7 +857,7 @@ if (isset($_POST['add_user'])) {
|
|||||||
|
|
||||||
$user_id = mysqli_insert_id($mysqli);
|
$user_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
mkdir_missing("uploads/users/$user_id");
|
mkdirMissing("uploads/users/$user_id");
|
||||||
|
|
||||||
//Check to see if a file is attached
|
//Check to see if a file is attached
|
||||||
if ($_FILES['file']['tmp_name'] != '') {
|
if ($_FILES['file']['tmp_name'] != '') {
|
||||||
@@ -934,13 +934,13 @@ if (isset($_POST['add_company_settings'])) {
|
|||||||
|
|
||||||
$company_id = mysqli_insert_id($mysqli);
|
$company_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
mkdir_missing("uploads/clients/$company_id");
|
mkdirMissing("uploads/clients/$company_id");
|
||||||
file_put_contents("uploads/clients/$company_id/index.php", "");
|
file_put_contents("uploads/clients/$company_id/index.php", "");
|
||||||
mkdir_missing("uploads/expenses/$company_id");
|
mkdirMissing("uploads/expenses/$company_id");
|
||||||
file_put_contents("uploads/expenses/$company_id/index.php", "");
|
file_put_contents("uploads/expenses/$company_id/index.php", "");
|
||||||
mkdir_missing("uploads/settings/$company_id");
|
mkdirMissing("uploads/settings/$company_id");
|
||||||
file_put_contents("uploads/settings/$company_id/index.php", "");
|
file_put_contents("uploads/settings/$company_id/index.php", "");
|
||||||
mkdir_missing("uploads/tmp/$company_id");
|
mkdirMissing("uploads/tmp/$company_id");
|
||||||
file_put_contents("uploads/tmp/$company_id/index.php", "");
|
file_put_contents("uploads/tmp/$company_id/index.php", "");
|
||||||
|
|
||||||
//Check to see if a file is attached
|
//Check to see if a file is attached
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ $sql_recent_logs = mysqli_query($mysqli, "SELECT * FROM logs
|
|||||||
$log_id = $row['log_id'];
|
$log_id = $row['log_id'];
|
||||||
$log_ip = htmlentities($row['log_ip']);
|
$log_ip = htmlentities($row['log_ip']);
|
||||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||||
$log_user_os = get_os($log_user_agent);
|
$log_user_os = getOS($log_user_agent);
|
||||||
$log_user_browser = get_web_browser($log_user_agent);
|
$log_user_browser = getWebBrowser($log_user_agent);
|
||||||
$log_created_at = $row['log_created_at'];
|
$log_created_at = $row['log_created_at'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$log_created_at = $row['log_created_at'];
|
$log_created_at = $row['log_created_at'];
|
||||||
$log_ip = htmlentities($row['log_ip']);
|
$log_ip = htmlentities($row['log_ip']);
|
||||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||||
$log_user_os = get_os($log_user_agent);
|
$log_user_os = getOS($log_user_agent);
|
||||||
$log_user_browser = get_web_browser($log_user_agent);
|
$log_user_browser = getWebBrowser($log_user_agent);
|
||||||
$last_login = "$log_user_os<br>$log_user_browser<br><i class='fa fa-fw fa-globe'></i> $log_ip";
|
$last_login = "$log_user_os<br>$log_user_browser<br><i class='fa fa-fw fa-globe'></i> $log_ip";
|
||||||
if (empty($last_login)) {
|
if (empty($last_login)) {
|
||||||
$last_login = "Never logged in";
|
$last_login = "Never logged in";
|
||||||
|
|||||||
Reference in New Issue
Block a user