OverLord Shell
<?php
session_start();
require_once("db/conn.php");
if(!isset($_SESSION['company_id']) || !isset($_SESSION['company_name'])){session_destroy();header("location:login.php");}
if(!in_array($_SESSION['loggedin_user'],array('admin','company'))){header("location:404.php");}
$target_dir = "uploads/";
//code to upload logo
if(!empty($_FILES["company_logo_path"]["name"]))
{
$target_logo_file = $target_dir ."company_logo/".time()."_".clean($company_name)."_".basename($_FILES["company_logo_path"]["name"]);
if($_FILES['company_logo_path']['size'] < 2 * 1024 * 1024){
if (move_uploaded_file($_FILES["company_logo_path"]["tmp_name"], $target_logo_file)) {
} else {
echo "Sorry, there was an error uploading company logo.";exit;
}
}else{echo "Logo size error. Max size is 2 MB.";exit;}
}
else
{
$target_logo_file = $_POST["old_company_logo_path"];
}
//code to upload banner
if(!empty($_FILES["company_banner_path"]["name"]))
{
$target_banner_file = $target_dir ."company_banner/".time()."_".clean($company_name)."_".basename($_FILES["company_banner_path"]["name"]);
if($_FILES['company_logo_path']['size'] < 2 * 1024 * 1024){
if (move_uploaded_file($_FILES["company_banner_path"]["tmp_name"], $target_banner_file)) {
} else {
echo "Sorry, there was an error uploading company banner.";exit;
}
}else{echo "Logo size error. Max size is 2 MB.";exit;}
}
else
{
$target_banner_file = $_POST["old_company_banner_path"];
}
$facebook=$_POST['facebook'];
$twitter=$_POST['twitter'];
$linkedin=$_POST['linkedin'];
//echo"update busdir_mst_social set facebook='$facebook' ,twitter='$twitter' ,linkedin='$linkedin' ,active='y' where my_compamy_id=".$_POST['my_company_id']."";exit;
$sasa=explode("~",$_POST['country_id']);
$cname=$sasa[1];
$sasa1=explode("~",$_POST['state_id']);
$sname=$sasa1[1];
$sasa2=explode("~",$_POST['dist_id']);
$dname=$sasa2[1];
if($sasa[0]!='101'){
$sname_main=$_POST['company_other_state'];
}else
{
$sname_main=$sname;
$dist_main=$dname;
}
$ds=$_POST['company_other_state'];
$dd=$_POST['state_id'];
if($dd==''&& $ds==''){
$sname_main=$_POST['def_state_id'];
$dist_main=$_POST['def_dist_id'];
}
$data = array(
'keyword' => $_POST['keyword'],
'company_name' => $_POST['company_name'],
'company_address' => $_POST['company_address'],
'company_website' => $_POST['company_website'],
'company_country' => $cname,
'company_state' => $sname_main,
'company_district' => $dist_main,
'company_city' => $_POST['company_city'],
'company_pinno' => $_POST['company_pinno'],
'company_phone' => $_POST['company_phone'],
'company_mobile' => $_POST['company_mobile'],
'company_fax' => $_POST['company_fax'],
'company_ceoname' => $_POST['company_ceoname'],
'company_email' => $_POST['company_email'],
'Gmap' => $_POST['gmap'],
'company_enquiry_email' => $_POST['company_enquiry_email'],
'company_logo_path' => $target_logo_file,
'company_banner_path' => $target_banner_file,
'contact_person_name' => $_POST['contact_person_name'],
'contact_person_phone' => $_POST['contact_person_phone'],
'contact_person_email' => $_POST['contact_person_email'],
);
$editresult = dbRowUpdate('busdir_mst_all_company', $data,'my_company_id = '.$_POST['my_company_id'].'');
echo $editresult;
$social= "update busdir_mst_social set facebook='$facebook' ,twitter='$twitter' ,linkedin='$linkedin' ,active='y' where my_company_id=".$_POST['my_company_id']."";
$ads=$connection->query($social);
?>
xRyukZ - Copyright 2k19