//Automatically Start Session
if(!session_id()){
session_start();
}
$nice_notice = $_GET['nice_notice'] ?? null;
$notice = $_GET['notice'] ?? null;
$GLOBALS['from_email'] = "noreply@sixhousehosting.com";
$GLOBALS['from_name'] = "NGSG Website";
$GLOBALS['adminEmail']="websales@ngsgi.com";
$GLOBALS['contact_emails'][] = "websales@ngsgi.com";
//Time Zone/////////////
$GLOBALS['time_offset'] = 5 * 3600;
////////Full path////////////////////////////////
$GLOBALS['full_path'] = "/home/ngsgi/";
$GLOBALS['domain'] = "https://ngsgi.com/";
session_save_path ($GLOBALS['full_path']."tmp");
//MySQL CONFIGURATION*************************************************************
$GLOBALS['dbhost']="localhost"; // Your MySQL Server Host URL
$GLOBALS['dbuser']="rrr"; // Your MySQL Username
$GLOBALS['dbpass']="rrr"; // Your MySQL Password
$GLOBALS['dbase']="rrr"; // Your MySQL Database name
//Contact form variables/////////////////////////////////////////////////////////
$contact_to_email = $GLOBALS['adminEmail'];
$application_to_email = $GLOBALS['adminEmail'];
$contact_form_subject = "Contact from NGSG website";
$feedback_form_subject = "Customer Feedback from NGSG website";
$get_started_form_subject = "Information Request from NGSG Website";
//User management variables /////////////////////////////////////////////////////////
$GLOBALS['tbl']="myuser"; // The name of the MySQL table to store the data required
$GLOBALS['tblID']="ID"; // The name of the ID field of the MySQL table
$GLOBALS['tblUserName']="userName"; // The name of the Username field of the MySQL table
$GLOBALS['tblUserPass']="userPass"; // The name of the Userpassword field of the MySQL table
$GLOBALS['tblIsAdmin']="isAdmin"; // The name of the Administator field of the MySQL table
$GLOBALS['tblUserGroup']="userGroup"; // The name of the User Group field of the MySQL table
$GLOBALS['tblSessionID']="sessionID"; // The name of the ID field of the MySQL table
$GLOBALS['tblLastLog']="lastLog"; // The name of the Time field of the MySQL table
$GLOBALS['tblUserRemark']="userRemark";// The name of the Remarks field of the MySQL table
$GLOBALS['tblLastTime']="Last_Time";
$GLOBALS['expireTime']=2592000;
$GLOBALS['admin_login_url'] = "/cp/index.php";
$GLOBALS['public_login_url'] = "/login.php";
$GLOBALS['acceptNoCookies']=true;
$GLOBALS['inactiveMin']="3000"; // The time in minutes to force new login, if account has been inactive
$GLOBALS['loginUrl']="log_in.php"; // The URL of the login page
$GLOBALS['logoutUrl']="logout.html"; // The URL of the logout page
$GLOBALS['enblRemember']=false; // set true to enable Remember Me function
$GLOBALS['cookieRemName']="AdminPro-RememberMyName"; // name of username cookie
$GLOBALS['cookieRemPass']="AdminPro-RememberMyPass"; // name of password
$GLOBALS['cookieExpDays']="30"; // num of days, when remember me cookies expire
$GLOBALS['isMd5']="1";
$GLOBALS['public_group_id'] = 2;
$GLOBALS['admin_group_id'] = 1;
$GLOBALS['subadmin_group_id'] = 3;
$GLOBALS['admin_group_id2'] = 3;
$GLOBALS['admin_default_user_id'] = 1;
//Calendar Variables/////////////////////////////////////////////////////////////////////////
$GLOBALS['calendar_module'] = 0;
$GLOBALS['calendar_url'] = $GLOBALS['domain']."/calendar/";
$GLOBALS['calendar_admin_email'] = $GLOBALS['adminEmail'];
$calendar_rss_title = "Midland Calendar";
$calendar_rss_description = "A quick look at what is happening right now";
$calendar_rss_number_of_results = 10;
//News Variables/////////////////////////////////////////////////////////////////////////
$GLOBALS['news_module'] = 1;
$GLOBALS['news_admin_email'] = $GLOBALS['adminEmail'];
$GLOBALS['news_url'] = $GLOBALS['domain']."/jobs/index.php";
//Blog Variables/////////////////////////////////////////////////////////////////////////
$GLOBALS['blog_module'] = 0;
$GLOBALS['blog_admin_email'] = $GLOBALS['adminEmail'];
$GLOBALS['blog_url'] = $GLOBALS['domain']."/blog/";
//Helper functions
function establish_connect(){
$dbh = mysql_connect($GLOBALS['dbhost'],$GLOBALS['dbuser'],$GLOBALS['dbpass']) or die("There was a problem with the database connection.");
$dbs = mysql_select_db($GLOBALS['dbase'], $dbh) or die("There was a problem selecting the categories.");
return $dbs;
}
function goto_admin_login($notice){
header("Location: ".$GLOBALS['admin_login_url']."?notice=".$notice);
exit;
}
function goto_public_login($notice, $nice_notice, $redirect){
header("Location: ".$GLOBALS['public_login_url']."?notice=".$notice."&redirect=".$redirect."&nice_notice=".$nice_notice);
exit;
}
function timestamp_to_gmt($time_stamp){
$gmt_time = gmdate("Y-m-d H:i:s", $time_stamp - $GLOBALS['time_offset']);
return $gmt_time;
}
function gmt_to_timestamp($gmt_time){
$parsed_time = strtotime($gmt_time . " GMT");
return ($parsed_time + $GLOBALS['time_offset']);
}
function gmt_to_posted_date($gmt_time){
$parsed_time = strtotime($gmt_time . " GMT");
$parsed_time = date("d-m-Y", $parsed_time + $GLOBALS['time_offset']);
return $parsed_time;
}
function posted_date_to_gmt($date){ //takes DD-MM-YYYY
$date_arr = explode("-", $date);
$parsed_time = gmmktime(0, 0, 0, $date_arr[1], $date_arr[0], $date_arr[2]) + $GLOBALS['time_offset'];
$parsed_time = timestamp_to_gmt($parsed_time);
return $parsed_time;
}
function seconds_to_days($seconds){
$days = ((($seconds / 60) / 60) / 24);
$days = ceil($days);
return $days;
}
function posted_time_to_gmt($hour, $minute, $am_pm){
if(!$hour || !$am_pm){
return 0;
}else{
if($am_pm == "PM"){
if($hour != 12){
$hour += 12;
}
}elseif($am_pm != "AM"){
return 0;
}else{
if($hour == 12){
$hour += 12;
}
}
if(mktime($hour,$minute, 0, 1, 1, 2000)){
return timestamp_to_gmt(mktime($hour,$minute, 0, 1, 1, 2000));
}else{
return 0;
}
}
}
function validate_email($email){
$email_explode = explode("@", $email);
if(count($email_explode) == 2){
return 1;
}else{
return 0;
}
}
function validate_name ($name){
//ensures that email has not been entered for name field
$split = explode("@", $name);
if(count($split) > 1){
return 0;
}else{
return 1;
}
}
function validate_month($month){
if($month > 0 && $month < 13){
return 1;
}else{
return 0;
}
}
function validate_year($year){
if($year > 1900 && $year < 2100){
return 1;
}else{
return 0;
}
}
function validate_day($day){
if($day > 0 && $year < 32){
return 1;
}else{
return 0;
}
}
function insert_date_picker($scripts_folder, $field_name, $default_date){
echo '';
if(!$default_date){
echo "";
}else{
echo "";
}
}
function make_admin_page_stats($total_results, $page, $total_pages, $item_name){
if($total_results){
return "Page ".$page." of ".$total_pages." (".$total_results." total ".$item_name.")";
}else{
return "No results were found";
}
}
function render_delete_confirmation($id, $action){
$render_html = '
';
return $render_html;
}
function make_admin_pagination_links($total_results, $page, $total_pages){
if(!$total_results){
return "No results were found";
}else{
$pagination_text = ' BEGIN ';
//Make the previous page link
if($page > 1){
$prev_page = $page - 1;
$pagination_text .= ' < ';
}else{
//$pagination_text .= ' [<<Previous] ';
}
//Make the page numbers
for($ii=0; $ii < $total_pages; $ii++){
$pagination_text .= ' '.($ii+1).' ';
}
//Make the next page link
if($page < $total_pages){
$next_page = $page + 1;
$pagination_text .= ' [Next>>] ';
}else{
//$pagination_text .= ' > ';
}
$pagination_text .= ' END ';
return $pagination_text;
}
}
?>
include_once("model.php");
$action = $_POST['action'];
$send_email_success = 0;
if($action == "send_email"){
//get the corresponding contact email from config.inc
$send_number = $_POST['send_to'];
$_POST['send_to'] = $contact_list[$send_number];
$_POST['message'] = nl2br($_POST['message']);
$required_hash['Name'] = $_POST['full_name'];
$required_hash['Email'] = $_POST['email'];
$required_hash['Confirm Email'] = $_POST['once_again'];
$required_hash['Message'] = $_POST['message'];
function verifyCaptcha($secret, $response) {
$url = "https://www.google.com/recaptcha/api/siteverify";
$data = [
'secret' => $secret,
'response' => $response
];
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
return json_decode($result);
}
$secret="6LdrUqspAAAAAKdnTL4__KZuOCsiIH2hecBKYGZ3";
$captcha_success = verifyCaptcha($secret, $_POST["g-recaptcha-response"]);
if ($captcha_success->success==false) {
$notice = "You must verify that you are not a robot";
$send_email_success = 0;
}elseif ($captcha_success->success==true) {
unset($_POST["g-recaptcha-response"]);
foreach($GLOBALS['contact_emails'] as $curr_email){
$send_email = new send_email($required_hash, $_POST['full_name'], $_POST['email'], $curr_email, $_POST, $contact_form_subject, "", "", $_POST['once_again']);
if(!$send_email->send()){
$notice = $send_email->notice;
}
else{
$nice_notice = $send_email->notice;
$send_email_success = 1;
}
}
}
}
?>
Natural Gas Services Group (NGSG) :: Contact / Locations