| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xamppkk/htdocs-khalafsons/ |
Upload File : |
<html>
<?php
session_start();
include('db_con.php');
include('function.php');
?>
<head>
<title>Khala Sons Real Estate</title>
<link rel="icon" href="kvt_con/khalaf_log.jpg" type="image/ico">
<link rel="stylesheet" type="text/css" href="main_css/extraction.css" />
</head>
<?php
if(isset($_SESSION['id']))
{
$my_id = $_SESSION['id'];
$my_cpr = $_SESSION['user_cpr'];
//echo"$user_cpr";
// echo"$user_email";
}
?>
<input id="my_id" style="display:none;" value="<?php echo"$my_id";?>" />
<input id="my_cpr" style="display:none;" value="<?php echo"$my_cpr";?>" />
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
/*echo"$user_ip";
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/
?>
<?php
$cur_day = date('d');
$cur_month = date('m');
$cur_year = date('Y');
?>
<input type="text" id="country_user" class="helping_id" style="display:none;" value="<?php echo $country;?>">
<input type="text" id="region_user" class="helping_id" style="display:none;" value="<?php echo $region;?>">
<input type="text" id="city_user" class="helping_id" style="display:none;" value="<?php echo $city;?>">
<input type="text" id="cur_day" class="helping_id" style="display:none;" value="<?php echo $cur_day;?>">
<input type="text" id="cur_month" class="helping_id" style="display:none;" value="<?php echo $cur_month;?>">
<input type="text" id="cur_year" class="helping_id" style="display:none;" value="<?php echo $cur_year;?>">
<script>
function add_new_location()
{
document.getElementById('add_location_div').style.display="block";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_location_div()
{
document.getElementById('add_location_div').style.display="none";
}
function show_add_building_type_div()
{
document.getElementById('add_building_type_div').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_close_aadd_building_type_div()
{
document.getElementById('add_building_type_div').style.display="none";
}
function show_add_new_building()
{
document.getElementById('add_new_building').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_new_building()
{
document.getElementById('add_new_building').style.display="none";
}
function show_add_new_add_div()
{
document.getElementById('add_new_add_div').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_new_add_div()
{
document.getElementById('add_new_add_div').style.display="none";
}
function show_add_new_property()
{
document.getElementById('add_new_property').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_new_property()
{
document.getElementById('add_new_property').style.display="none";
}
function show_add_new_job()
{
document.getElementById('post_new_job_div').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_post_new_job_div()
{
document.getElementById('post_new_job_div').style.display="none";
}
function show_add_shop_name_div()
{
document.getElementById('add_shop_name_div').style.display="block";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
}
function close_add_shop_name_div()
{
document.getElementById('add_shop_name_div').style.display="none";
}
function show_shop_expend_details_div()
{
document.getElementById('shop_expend_details_div').style.display="block"
document.getElementById('add_shop_name_div').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
}
function close_shop_expend_details_div()
{
document.getElementById('shop_expend_details_div').style.display="none";
}
function show_add_new_graph_data()
{
document.getElementById('add_graph_data_div').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_new_project').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_new_graph_data()
{
document.getElementById('add_graph_data_div').style.display="none";
}
function show_add_new_project()
{
document.getElementById('add_new_project').style.display="block";
document.getElementById('add_location_div').style.display="none";
document.getElementById('add_building_type_div').style.display="none";
document.getElementById('add_new_building').style.display="none";
document.getElementById('add_new_add_div').style.display="none";
document.getElementById('add_new_property').style.display="none";
document.getElementById('post_new_job_div').style.display="none";
document.getElementById('add_graph_data_div').style.display="none";
document.getElementById('shop_expend_details_div').style.display="none";
document.getElementById('add_shop_name_div').style.display="none";
}
function close_add_new_project()
{
document.getElementById('add_new_project').style.display="none";
}
</script>
<body>
<div class="main_home">
<div class="main_home_title">Khala Sons Real Estate</div>
</div>
<div class="postion_main_home"></div>
<div class="main_home_left">
<a href="index.php"><button class="left_home_btn" >Home</button></a>
<button class="left_home_btn">Project</button>
<a href="property.php"><button class="left_home_btn">Property</button></a>
<a href="purchase"><button class="left_home_btn">Purchase</button></a>
<a href="contact.php"><button class="left_home_btn">Contacts</button></a>
<button class="left_home_btn">About</button>
</div>
<?php
$get_adm_user ="select * from khalaf_admintb where user_id_adm='$my_id' ";
$run_adm_user = mysqli_query($con,$get_adm_user);
$check_adm_user = mysqli_fetch_array($run_adm_user);
if($check_adm_user <1){
echo"<div style='float:left;width:80%;height:50px;font-size:1.3em;margin-left:17%;margin-top:20%;text-align:center;font-weight:bold;color:red;'>OOPS THIS PAGE HAS BEEN DELETED GO BACK TO The MAIN PAGE</div>";
}else{
?>
<div class="more_action_btn_right">
<button onClick="add_new_location();" class="left_home_btn" >Add Location</button>
<button onClick="show_add_building_type_div();" class="left_home_btn">Add Building Type</button>
<button onClick="show_add_new_building();" class="left_home_btn">Add New Building</button>
<button onClick="show_add_new_add_div();" class="left_home_btn">Add Advert</button>
<button onClick="show_add_new_property();" class="left_home_btn">Add Property</button>
<button onClick="show_add_new_job();" class="left_home_btn">Add New Job</button>
<button id="add_shop_name_btn" onClick="show_add_shop_name_div();" class="left_home_btn">Add Shop</button>
<button id="add_shop_detail_btn" onClick="show_shop_expend_details_div();" class="left_home_btn">Shop Details</button>
<button id="graph_data_btn" onClick="show_add_new_graph_data();" class="left_home_btn">Graph Data</button>
<button onClick="show_add_new_project();" class="left_home_btn">New Projects</button>
<button class="left_home_btn">About</button>
</div>
<div id="add_location_div" class="add_location_div">
<div class="add_location_title">Add Location Window</div>
<button onClick="close_add_location_div();" class="close_add_location_div">x</button>
<form method="post" >
<input type="text" name="add_location_input" class="add_location_input" placeholder="Write New Location..." />
<button name="add_location_btn" class="add_location_btn" >OK</button>
<?php
if(isset($_POST['add_location_btn']))
{
$add_location = $_POST['add_location_input'];
$add_location = mysqli_real_escape_string($con,$add_location);
if($add_location==""){
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Fill All The Spaces</div>";
}else{
$get_location ="select * from bd_locationtb where location_name='$add_location'";
$run_get_location = mysqli_query($con,$get_location);
$check_location = mysqli_num_rows($run_get_location);
if($check_location >0){
echo"<div style='float:left;width:100%;text-align:center;color:red;'>This Location Already Exists</div>";
}else{
$nlocation_insert ="insert into bd_locationtb(user_id,location_name,curr_date,curr_time) values('$my_id','$add_location',CURDATE(),CURTIME() )";
$run_location_insert = mysqli_query($con,$nlocation_insert);
if($run_location_insert){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;margin-top:5px;color:purple;' >Your New Location Has Been Added</div>";
}else{
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Something Went Wrong Information Not Saved</div>";
}
}
}
}
?>
</form>
</div>
<div id="add_building_type_div" class="add_building_type_div">
<div class="add_location_title">Add Building Type Window</div>
<button onClick="close_close_aadd_building_type_div();" class="close_add_location_div">x</button>
<form method="post" >
<!--input type="text" name="bd_name_input" class="add_building_type_input" placeholder="Building Name" /-->
<select type="text" name="bd_name_input" class="add_building_type_input">
<option selected disabledk>Select Building Name</option>
<?php option_building_name(); ?>
</select>
<!--input type="text" name="bd_location_input" class="add_building_type_input" placeholder="Building Location" /-->
<select type="text" name="bd_location_input" class="add_building_type_input">
<option selected disabledk>Select Location</option>
<?php option_building_location(); ?>
</select>
<!--input type="text" name="bd_description_input" class="add_building_type_input" placeholder="Building Description" /-->
<select id="bd_description_input" name="bd_description_input" type="text" class="add_building_type_input" >
<option selected disabled>Select</option>
<option>Residential</option>
<option>Medical Shop</option>
<option>Show Room</option>
<option>Shop</option>
<option>Office</option>
<option>Villa</option>
</select>
<button name="add_building_type_btn" class="add_building_type_btn" >OK</button>
<?php
if(isset($_POST['add_building_type_btn']))
{
$bd_name = $_POST['bd_name_input'];
$bd_name = mysqli_real_escape_string($con,$bd_name);
$bd_location = $_POST['bd_location_input'];
$bd_location = mysqli_real_escape_string($con,$bd_location);
$bd_description = $_POST['bd_description_input'];
if($bd_name=="" || $bd_location=="Select Location" || $bd_description==""){
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Fill All The Spaces</div>";
}else{
$get_bd_type ="select * from buliding_type where buliding_name='$bd_name' AND location='$bd_location' AND description='$bd_description' ";
$run_get_bd_type = mysqli_query($con,$get_bd_type);
$check_get_bd_type = mysqli_num_rows($run_get_bd_type);
if($check_get_bd_type >0){
echo"<div style='float:left;width:100%;text-align:center;color:red;'>Building Type And Description Already Exists</div>";
}else{
$bd_type_insert ="insert into buliding_type(user_id,buliding_name,location,description,curr_date,curr_time) values('$my_id','$bd_name','$bd_location','$bd_description',CURDATE(),CURTIME() )";
$run_bd_type = mysqli_query($con,$bd_type_insert);
if($run_bd_type){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;margin-top:5px;color:purple;' >Your New Building Type Has Been Added</div>";
}else{
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Something Went Wrong Information Not Saved</div>";
}
}
}
}
?>
</form>
</div>
<div id="add_new_building" class="add_new_building">
<form method="post" enctype="multipart/form-data" >
<div class="add_building_tile" >Add New Building Window</div>
<button onClick="close_add_new_building();" class="close_add_location_div">x</button>
<div class="add_building_lebal" >Building Name</div>
<input id="bd_name_input" name="bd_name_input" type="text" class="add_building_input" />
<div class="add_building_lebal" >Location</div>
<!--input id="bd_location_input" name="bd_location_input" type="text" class="add_building_input" /-->
<select type="text" id="bd_location_input" name="bd_location_input" class="add_building_input">
<option selected disabledk>Select Location</option>
<?php option_building_location(); ?>
</select>
<div class="add_building_lebal" >Description</div>
<select id="bd_description_input" name="bd_description_input" type="text" class="add_building_input" >
<option selected disabled>Select</option>
<option>Residential</option>
<option>Medical Shop</option>
<option>Show Room</option>
<option>Shop</option>
<option>Office</option>
<option>Villa</option>
</select>
<div class="add_building_lebal" >Building No</div>
<input id="bd_no_input" name="bd_no_input" type="text" class="add_building_input" />
<div class="add_building_lebal" >Road No</div>
<input id="bd_roadno_input" name="bd_roadno_input" type="text" class="add_building_input" />
<div class="add_building_lebal" >Manager Name</div>
<input id="bd_manager_name_input" name="bd_manager_name_input" type="text" class="add_building_input" />
<div class="add_building_lebal" >Manager Tel</div>
<input id="bd_manager_tel_input" name="bd_manager_tel_input" type="text" class="add_building_input" />
<div class="add_building_lebal" >Image</div>
<input id="bd_image_input" name="bd_image_input" type="file" class="add_building_input" />
<div id="add_building_output" type="text" class="add_building_input" ></div>
<button class="add_building_btn_clear">Clear</button>
<button id="add_building_btn_next" name="add_building_btn_next" class="add_building_btn_save">Next</button>
<button id="add_building_btn_save" name="add_building_btn_save" class="add_building_btn_save" style="display:none;" >Sava Data</button>
</form>
<script>
document.getElementById("add_building_btn_next").addEventListener("click", function(event){
event.preventDefault();
var bd_name = document.getElementById('bd_name_input').value;
var bd_location = document.getElementById('bd_location_input').value;
var bd_description = document.getElementById('bd_description_input').value;
var bd_no = document.getElementById('bd_no_input').value;
var bd_road_no = document.getElementById('bd_roadno_input').value;
var bd_manager_name = document.getElementById('bd_manager_name_input').value;
var bd_manager_tel = document.getElementById('bd_manager_tel_input').value;
var bd_image =document.getElementById('bd_image_input').files[0];
if(bd_name=="" || bd_location=="" || bd_description=="" || bd_no=="" || bd_road_no=="" || bd_image==""){
document.getElementById('add_building_output').innerHTML="<div style='color:red;'>Fill All The Spaces</div>";
}else{
var file_type = bd_image.type;
if(file_type !=='image/jpeg' && file_type !=='image/JPEG' && file_type !=='image/png' && file_type !=='image/PNG')
{
alert(file_type);
document.getElementById('add_building_output').innerHTML="<div style='color:red;'>File Formate Not Supported</div>";
}else{
document.getElementById('add_building_btn_next').style.display="none";
document.getElementById('add_building_btn_save').style.display="block";
}
}
});
</script>
<?php
if(isset($_POST['add_building_btn_save']))
{
$bd_name = $_POST['bd_name_input'];
$bd_location = $_POST['bd_location_input'];
$bd_description = $_POST['bd_description_input'];
$bd_description = mysqli_real_escape_string($con,$bd_description);
$bd_no = $_POST['bd_no_input'];
$bd_roadno = $_POST['bd_roadno_input'];
$bd_manager_name = $_POST['bd_manager_name_input'];
$bd_manager_tel = $_POST['bd_manager_tel_input'];
$image_url = $_FILES['bd_image_input']['name'];
$type = explode('.',$image_url);
$type =end($type);
$random_name =rand();
$image_tmp = $_FILES['bd_image_input']['tmp_name'];
$new_building_insert ="insert into main_buildingtb(user_id,building_name,building_location,bd_description,building_no,road_no,manager_name,manager_tel,image_url,curr_date,curr_time)
values('$my_id','$bd_name','$bd_location','$bd_description','$bd_no','$bd_roadno','$bd_manager_name','$bd_manager_tel','$random_name.$type',CURDATE(),CURTIME() )";
$run_building_insert = mysqli_query($con,$new_building_insert);
if($run_building_insert){
move_uploaded_file($image_tmp,'main_building_images/'.$random_name.'.'.$type);
echo"<div style='float:left;width:100%;text-align:center;'>Your Building Information Has Been Saved.</div>";
}else{echo"<div style='float:left;width:100%;color:red;text-align:center;'>Something Went Wrong Information Not Saved</div>";}
}
?>
</div>
<div id="add_new_add_div" class="add_new_add_div">
<div class="add_building_tile" >Adding New Ad Window</div>
<button onClick="close_add_new_add_div();" class="close_add_location_div">x</button>
<form method="post" enctype="multipart/form-data" >
<div class="new_ad_lebal" >Building Name</div>
<select id="new_ad_bd_name_input" name="new_ad_bd_name_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<?php option_building_name(); ?>
</select>
<div class="new_ad_lebal" >Building No.</div>
<input id="new_ad_bd_no_input" name="new_ad_bd_no_input" type="text" class="new_ad_input" />
<div class="new_ad_lebal" >Location</div>
<!--input id="new_ad_bd_location_input" name="new_ad_bd_location_input" type="text" class="new_ad_input" /-->
<select type="text" id="new_ad_bd_location_input" name="new_ad_bd_location_input"class="new_ad_input">
<option selected disabledk>Select Location</option>
<?php option_building_location(); ?>
</select>
<div class="new_ad_lebal" >Road No.</div>
<input id="new_ad_bd_roadno_input" name="new_ad_bd_roadno_input" type="text" class="new_ad_input" />
<div class="new_ad_lebal" >Bedroom No.</div>
<select id="new_ad_bedroom_input" name="new_ad_bedroom_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Studio</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>Large</option>
<option>Medium</option>
<option>Small</option>
</select>
<div class="new_ad_lebal" >Bathroom No.</div>
<select id="new_ad_bathroom_input" name="new_ad_bathroom_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Price</div>
<input id="new_ad_price_input" name="new_ad_price_input" type="text" class="new_ad_input" />
<div class="new_ad_lebal" >Description</div>
<select id="new_ad_descrip_input" name="new_ad_descrip_input" type="text" class="new_ad_input" >
<option selected disabled>Select</option>
<option>Residential</option>
<option>Medical Shop</option>
<option>Show Room</option>
<option>Shop</option>
<option>Office</option>
<option>Villa</option>
</select>
<div class="new_ad_lebal" >Kitchen</div>
<select id="new_ad_kitchen_input" name="new_ad_kitchen_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Open</option>
<option>Closed</option>
<option>Semi</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Swimming Pool</div>
<select id="new_ad_swimming_pool_input" name="new_ad_swimming_pool_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Sauna Room</div>
<select id="new_ad_sauna_input" name="new_ad_sauna_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Squash Room</div>
<select id="new_ad_squash_input" name="new_ad_squash_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Furnished</div>
<select id="new_ad_furniture_input" name="new_ad_furniture_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Fully Furnished</option>
<option>Semi Furnished</option>
<option>Un Furnished</option>
</select>
<div class="new_ad_lebal" >Gym Room</div>
<select id="new_ad_gym_input" name="new_ad_gym_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Steam Room</div>
<select id="new_ad_steam_input" name="new_ad_steam_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Balicon</div>
<select id="new_ad_balicon_input" name="new_ad_balicon_input" type="text" class="new_ad_input" >
<option disabled selected>Select</option>
<option>Yes</option>
<option>No</option>
</select>
<div class="new_ad_lebal" >Building Image</div>
<input id="new_ad_image_input" name="new_ad_image_input" type="file" class="new_ad_input" />
<div id="new_ad_output" class="new_ad_output" ></div>
<button id="clear_new_building_ad_btn" name="clear_new_building_ad_btn" class="new_ad_btn_clear">Clear</button>
<button id="new_building_ad_next" class="new_ad_btn_save">Next</button>
<button id="new_building_ad_save" name="new_building_ad_save" class="new_ad_btn_save" style="display:none;">Save Data</button>
</form>
<script>
document.getElementById("new_building_ad_next").addEventListener("click", function(event){
event.preventDefault();
var bd_name = document.getElementById('new_ad_bd_name_input').value;
var bd_location = document.getElementById('new_ad_bd_location_input').value;
var bedroom_no = document.getElementById('new_ad_bedroom_input').value;
var ad_bathroom = document.getElementById('new_ad_bathroom_input').value;
var new_ad_descrip = document.getElementById('new_ad_descrip_input').value;
var new_ad_kitchen = document.getElementById('new_ad_kitchen_input').value;
var new_ad_swimming_pool= document.getElementById('new_ad_swimming_pool_input').value;
var new_ad_sauna= document.getElementById('new_ad_sauna_input').value;
var new_ad_squash = document.getElementById('new_ad_squash_input').value;
var new_ad_furniture = document.getElementById('new_ad_furniture_input').value;
var new_ad_gym = document.getElementById('new_ad_gym_input').value;
var new_ad_steam = document.getElementById('new_ad_steam_input').value;
var new_ad_balicon = document.getElementById('new_ad_balicon_input').value;
var bd_image =document.getElementById('new_ad_image_input').files[0];
if(bd_name=="Select" || bd_location=="" || new_ad_descrip=="" || bedroom_no=="Select" || ad_bathroom=="Select" || new_ad_kitchen=="Select" || new_ad_swimming_pool=="Select" || new_ad_sauna=="Select" || new_ad_squash=="Select" || new_ad_furniture=="Select" || new_ad_gym=="Select" || new_ad_steam=="Select" || new_ad_balicon=="Select" ){
document.getElementById('new_ad_output').innerHTML="<div style='color:red;'>Fill All The Spaces</div>";
}else{
var file_type = bd_image.type;
if(file_type !=='image/jpeg' && file_type !=='image/JPEG' && file_type !=='image/png' && file_type !=='image/PNG')
{ alert(new_ad_descrip);
document.getElementById('new_ad_output').innerHTML="<div style='color:red;'>File Formate Not Supported</div>";
}else{
document.getElementById('new_building_ad_next').style.display="none";
document.getElementById('new_building_ad_save').style.display="block";
alert(file_type);
}
}
});
</script>
<?php
if(isset($_POST['new_building_ad_save']))
{
$bd_name_ad = $_POST['new_ad_bd_name_input'];
$location_ad = $_POST['new_ad_bd_location_input'];
$bedroom_ad = $_POST['new_ad_bedroom_input'];
$bathroom_ad = $_POST['new_ad_bathroom_input'];
$description_ad = $_POST['new_ad_descrip_input'];
$kitchen_ad = $_POST['new_ad_kitchen_input'];
$swimming_pool_ad = $_POST['new_ad_swimming_pool_input'];
$sauna_ad = $_POST['new_ad_sauna_input'];
$squash_ad = $_POST['new_ad_squash_input'];
$furniture_ad= $_POST['new_ad_furniture_input'];
$gym_ad = $_POST['new_ad_gym_input'];
$steam_ad = $_POST['new_ad_steam_input'];
$price_ad = $_POST['new_ad_price_input'];
$roadno_ad = $_POST['new_ad_bd_roadno_input'];
$bd_no_ad = $_POST['new_ad_bd_no_input'];
$balicon_ad = $_POST['new_ad_balicon_input'];
$image_url = $_FILES['new_ad_image_input']['name'];
$type = explode('.',$image_url);
$type =end($type);
$random_name =rand();
$image_tmp = $_FILES['new_ad_image_input']['tmp_name'];
$ninsert_adert ="insert into adverttb(user_id,building_name,location,building_no,road_no,bedroom_no,bathroom_no,price,description,kitchen,swimming_pool,suana,squash,furniture,gym,steam,balicon,image_url,curr_date,curr_time)
values('$my_id','$bd_name_ad','$location_ad','$bd_no_ad','$roadno_ad','$bedroom_ad','$bathroom_ad','$price_ad','$description_ad','$kitchen_ad','$swimming_pool_ad','$sauna_ad','$squash_ad','$furniture_ad','$gym_ad','$steam_ad','$balicon_ad','$random_name.$type',CURDATE(),CURTIME() )";
$run_advert_insert = mysqli_query($con,$ninsert_adert);
if($run_advert_insert){
move_uploaded_file($image_tmp,'advert_images/'.$random_name.'.'.$type);
echo"<div style='float:left;width:100%;text-align:center;'>Your Advert Information Has Been Saved.</div>";
}else{echo"<div style='float:left;width:100%;color:red;text-align:center;'>Something Went Wrong Information Not Saved</div>";}
}
?>
</div>
<?php
if(isset($_GET['ad_id'])){
$new_post_id = $_GET['ad_id'];
$get_advert ="select * from adverttb where id='$new_post_id'";
$run_advert = mysqli_query($con,$get_advert);
while($row_advert = mysqli_fetch_array($run_advert))
{
$post_id = $row_advert['id'];
$building_name = $row_advert['building_name'];
$location = $row_advert['location'];
$building_no = $row_advert['building_no'];
$image_url = $row_advert['image_url'];
?>
<div style="float:left;width:60%;height:150px;margin-left:20%;margin-top:20px;background:#1FADDA;border-radius:10px;border:5px solid #ccc;">
<div style="float:left;width:100%;height:30px;font-size:1.3em;font-weight:bold;text-align:center;margin-top:10px;color:white;">From Here Add More Advert Images</div>
<form method="post" enctype="multipart/form-data">
<input type="file" name="more_advert_images" style="float:left;width:60%;height:40px;background:white;font-size:1.1em;margin-left:10%;margin-top:20px;" />
<button name="add_more_advert_images" style="float:left;width:20%;height:40px;margin-left:5px;margin-top:20px;">Add Image</button>
<?php
if(isset($_POST['add_more_advert_images']))
{
$more_advert_img = $_FILES['more_advert_images']['name'];
$type = explode('.',$more_advert_img);
$type =end($type);
$random_name =rand();
$image_tmp = $_FILES['more_advert_images']['tmp_name'];
if($more_advert_img==""){echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>Fill All The Spaces</div>";}
else{
if($type !=='jpg' && $type !=='png' && $type !=="jpeg" && $type !=='JPG' && $type !=="PNG" && $type !=="JPEG" ){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>File Format Not Supported</div>";
}else{
$insert_more_ad_image = "insert into advert_albumtb (user_id,post_id,building_name,building_no,location,image_url,curr_date,curr_time)
values('$my_id','$post_id','$building_name','$building_no','$location','$random_name.$type',CURDATE(),CURTIME() )";
$run_more_ad_image = mysqli_query($con,$insert_more_ad_image);
if($run_more_ad_image){
move_uploaded_file($image_tmp,'advert_album_images/'.$random_name.'.'.$type);
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:green;'>New Image Added To Your Album</div>";
}else{echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>Something Went Wrong,Data Not Saved</div>";}
}
}
}
?>
</form>
</div>
<?php } } ?>
<div id="add_new_property" class="add_new_property" style="display:none;">
<div class="add_new_property_title">Khalaf Sons Real Estate Properties</div>
<button onClick="close_add_new_property();" class="close_add_location_div">x</button>
<form method="post" enctype="multipart/form-data" >
<div class="propert_bd_name_lebal">Property Name</div>
<!--input type="text" id="propert_bd_name_input" name="propert_bd_name_input" class="propert_bd_name_input" /-->
<select type="text" id="propert_bd_name_input" name="propert_bd_name_input" class="propert_bd_name_input" >
<option disabled selected>Select</option>
<?php option_building_name(); ?>
</select>
<div class="propert_bd_name_lebal">Property Details</div>
<textarea type="text" id="property_detail" name="property_detail" class="propert_bd_textarea" ></textarea>
<div class="propert_bd_name_lebal">Property Location</div>
<!--input type="text" id="propert_location_input" name="propert_location_input" class="propert_bd_name_input" /-->
<select type="text" id="propert_location_input" name="propert_location_input" class="propert_bd_name_input">
<option selected disabledk>Select Location</option>
<?php option_building_location(); ?>
</select>
<div class="propert_bd_name_lebal">Property Road No.</div>
<input type="text" id="propert_road_no_input" name="propert_road_no_input" class="propert_bd_name_input" />
<div class="propert_bd_name_lebal">Property Building No.</div>
<input type="text" id="propert_building_no_input" name="propert_building_no_input" class="propert_bd_name_input" />
<div class="propert_bd_name_lebal">Property Image</div>
<input type="file" id="propert_image" name="propert_image" class="propert_bd_name_input" />
<div id="new_property_output" class="propert_bd_name_input" style="line-height:40px;text-align:center;" ></div>
<button class="add_new_property_clear_btn">Clear</button>
<button type="submit" id="continue_add_new_property_btn" class="continue_add_new_property_btn">Continue</button>
<button id="property_save_btn" name="property_save_btn" class="continue_add_new_property_btn" style="display:none;">Finish</button>
</form>
<script>
document.getElementById("continue_add_new_property_btn").addEventListener("click", function(event){
event.preventDefault();
var propert_bd_name_input = document.getElementById('propert_bd_name_input').value;
var property_detail = document.getElementById('property_detail').value;
var property_propert_location = document.getElementById('propert_location_input').value
var property_propert_road_no = document.getElementById('propert_road_no_input').value
var propert_building_no = document.getElementById('propert_building_no_input').value
var propert_image = document.getElementById('propert_image').value;
if(propert_bd_name_input=="" || property_detail=="" || propert_image=="" || property_propert_location =="" || property_propert_road_no=="" || propert_building_no==""){
document.getElementById('new_property_output').innerHTML="Fill All The Spaces ";
}else{
var my_file =document.getElementById('propert_image').files[0];
//var file_type =document.getElementById('sms_chat_file_mob').files[0].type;
var file_type = my_file.type;
//var file_name = my_file.name;
if(file_type !=='image/jpeg' && file_type !=='image/png' && file_type !=='image/JPEG' && file_type !=="image/PNG"){
document.getElementById('new_property_output').innerHTML="Image Format Not Supported";
}else{
document.getElementById('new_property_output').innerHTML="Supported";
document.getElementById('continue_add_new_property_btn').style.display="none";
document.getElementById('property_save_btn').style.display="block";
}
}
});
</script>
<?php
if(isset($_POST['property_save_btn']))
{
$propert_bd_name= $_POST['propert_bd_name_input'];
$property_detail= $_POST['property_detail'];
$property_detail = mysqli_real_escape_string($con,$property_detail);
$propert_location= $_POST['propert_location_input'];
$property_road_no= $_POST['propert_road_no_input'];
$propert_building_no= $_POST['propert_building_no_input'];
$property_image = $_FILES['propert_image']['name'];
$type = explode('.',$property_image);
$type =end($type);
$random_name =rand();
$image_tmp = $_FILES['propert_image']['tmp_name'];
$insert_new_propertty = "insert into khalaf_propertytbb (user_id,property_name,property_details,property_location,property_road_no,property_build_no,property_image,curr_date,curr_time)
values('$my_cpr','$propert_bd_name','$property_detail','$propert_location','$property_road_no','$propert_building_no','$random_name.$type',CURDATE(),CURTIME() )";
$run_insert_new_propertty = mysqli_query($con,$insert_new_propertty);
if($run_insert_new_propertty){
move_uploaded_file($image_tmp,'property_images/'.$random_name.'.'.$type);
}else{echo"Something Went Wrong,Data Not Saved";}
}
?>
</div><!-- end of add_new_property-->
<?php
if(isset($_GET['proper_id'])){
$property_id = $_GET['proper_id'];
?>
<div class="more_propery_images" style="float:left;width:50%;height:auto;background:#A92600;margin-left:25%;border:5px solid #ccc;margin-top:20px;">
<form method="post" enctype="multipart/form-data" >
<div style="float:left;width:100%;height:40px;line-height:40px;text-align:center;font-size:1.3em;color:white;">Upload New Property Images</div>
<input name="property_file" type="file" style="float:left;width:80%;height:40px;margin-left:10%;margin-bottom:20px;font-size:1.1em;color:#1FADDA;" />
<button name="update_more_property_images" style="float:left;width:50%;height:40px;margin-left:25%;margin-bottom:20px;font-size:1.1em;border:transparent;background:white;color:#1FADDA;border-radius:5px;cursor:pointer;">Upload New Image</button>
</form>
<?php
if(isset($_POST['update_more_property_images'])){
$property_image = $_FILES['property_file']['name'];
$type = explode('.',$property_image);
$type =end($type);
if($property_image==""){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>Fill All The Spaces</div>";
}else{
if($type !=='jpg' && $type !=='png' && $type !=='jpeg' && $type !=='JPG' && $type !=="PNG" && $type !=='JPEG'){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>Image Format Not Supported</div>";
}else{
$random_name =rand();
$image_tmp = $_FILES['property_file']['tmp_name'];
$insert_more_property_image = "insert into property_albumtb (user_id,property_id,image_url,curr_date,curr_time) values('$my_id','$property_id','$random_name.$type',CURDATE(),CURTIME() )";
$run_more_property_image = mysqli_query($con,$insert_more_property_image);
if($run_more_property_image){
move_uploaded_file($image_tmp,'property_album_images/'.$random_name.'.'.$type);
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:green;'>New Property Image Added</div>";
}else{
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;color:red;'>Something Went Wrong,Data Not Saved</div>";
}
}
}
}
?>
</div>
<?php } ?>
<?php
if(isset($_GET['pedit'])){
$property_id = $_GET['pedit'];
?>
<div id="edit_property_div" class="add_new_property" style="displayk:none;">
<?php
$get_property = "select * from khalaf_propertytbb where id='$property_id'";
$run_get_property = mysqli_query($con,$get_property);
while($row_get_property = mysqli_fetch_array($run_get_property))
{
$property_id = $row_get_property['id'];
$property_name = $row_get_property['property_name'];
$property_details = $row_get_property['property_details'];
$property_image = $row_get_property['property_image'];
$property_location= $row_get_property['property_location'];
$property_road_no = $row_get_property['property_road_no'];
$property_build_no= $row_get_property['property_build_no'];
?>
<form method="post" enctype="multipart/form-data" >
<div class="add_new_property_title"> Edit Khalaf Sons Real Estate Properties</div>
<div class="propert_bd_name_lebal">Property Name</div>
<input type="text" id="propert_bd_name_input" name="propert_bd_name_input" value="<?php echo"$property_name"; ?>" class="propert_bd_name_input" />
<div class="propert_bd_name_lebal">Property Details</div>
<textarea type="text" id="property_detail" name="property_detail" class="propert_bd_textarea" >
<?php echo"$property_details"; ?>
</textarea>
<div class="propert_bd_name_lebal">Property Location</div>
<input type="text" id="propert_location_input" name="propert_location_input" value="<?php echo"$property_location"; ?>" class="propert_bd_name_input" />
<div class="propert_bd_name_lebal">Property Road No.</div>
<input type="text" id="propert_road_no_input" name="propert_road_no_input" value="<?php echo"$property_road_no"; ?>" class="propert_bd_name_input" />
<div class="propert_bd_name_lebal">Property Building No.</div>
<input type="text" id="propert_building_no_input" name="propert_building_no_input" value="<?php echo"$property_build_no"; ?>" class="propert_bd_name_input" />
<!--div class="propert_bd_name_lebal">Property Image</div>
<input type="file" id="propert_image" name="propert_image" class="propert_bd_name_input" />
<div id="new_property_output" class="propert_bd_name_input" >Kato</div>
<button class="add_new_property_clear_btn">Clear</button>
<button type="submit" id="continue_add_new_property_btn" class="continue_add_new_property_btn">Continue</button-->
<button id="property_update_btn" name="property_update_btn" class="continue_add_new_property_btn" style="margin-left:40%;displayk:none;">Update Data</button>
</form>
<?php
if(isset($_POST['property_update_btn']))
{
$propert_bd_name= $_POST['propert_bd_name_input'];
$property_detail= $_POST['property_detail'];
$property_detail = mysqli_real_escape_string($con,$property_detail);
$propert_location= $_POST['propert_location_input'];
$property_road_no= $_POST['propert_road_no_input'];
$propert_building_no= $_POST['propert_building_no_input'];
if($propert_bd_name=="" || $property_detail=="" || $propert_location=="" || $property_road_no=="" || $propert_building_no=="" ){
echo"<div style='float:left;width:100%;height:30px;text-align:center;color:red;font-size:1.1em;'>Fill All The Spaces</div>";
}else{
$update_property = "update khalaf_propertytbb set property_name='$propert_bd_name',property_details='$property_detail',property_location='$propert_location',property_road_no='$property_road_no',property_build_no='$propert_building_no' where id='$property_id'";
$run_update_property = mysqli_query($con,$update_property);
if($run_update_property){
echo"<div style='float:left;width:100%;height:30px;text-align:center;color:green;font-size:1.1em;'>Your Information Has Been Updated</div>";
}else{echo"<div style='float:left;width:100%;height:30px;text-align:center;color:red;font-size:1.1em;'>Something Went Wrong,Data Not Saved</div>";}
}
?>
<script>window.scrollTo(0,70);</script>
<?php
}
?>
<?php } ?>
</div>
<script>document.getElementById('edit_property_div').style.display="block";</script>
<?php } ?>
<div id="post_new_job_div" class="post_new_job_div">
<div class="post_job_title">Post New Job Window</div>
<button onClick="close_post_new_job_div();" class="close_post_new_job_div">x</button>
<form method="post" >
<input type="text" name="job_title_input" class="post_job_input" placeholder="Job title" />
<textarea type="text" name="job_description_input" class="job_description_input" placeholder="Job Description" ></textarea>
<!--input type="text" name="job_location" class="post_job_input" placeholder="Job location" /-->
<select type="text" name="job_location" class="post_job_input" >
<option selected>Select Location</option>
<?php option_building_location(); ?>
</select>
<button name="insrt_new_job_btn" class="post_job_btn" >Post</button>
<?php
if(isset($_POST['insrt_new_job_btn']))
{
$job_title = $_POST['job_title_input'];
$job_title = mysqli_real_escape_string($con,$job_title);
$job_description = $_POST['job_description_input'];
$job_description = mysqli_real_escape_string($con,$job_description);
$job_location = $_POST['job_location'];
if($job_title=="" || $job_description=="" || $job_location==""){
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Fill All The Spaces</div>";
}else{
$get_job_post ="select * from jobstb where job_title='$job_title' AND job_description='$job_description' AND job_location='$job_location' ";
$run_get_job_post = mysqli_query($con,$get_job_post);
$check_get_job_post = mysqli_num_rows($run_get_job_post);
if($check_get_job_post >0){
echo"<div style='float:left;width:100%;text-align:center;color:red;'>Job Type And Description Already Exists</div>";
}else{
$job_post_insert ="insert into jobstb(user_id,job_title,job_description,job_location,curr_date,curr_time) values('$my_id','$job_title','$job_description','$job_location',CURDATE(),CURTIME() )";
$run_job_post = mysqli_query($con,$job_post_insert);
if($run_job_post){
echo"<div style='float:left;width:100%;text-align:center;font-size:1.1em;margin-top:5px;color:purple;' >Your New Job Has Been Published</div>";
}else{
echo"<div style='float:left;width:100%;color:red;text-align:center;'>Something Went Wrong Information Not Saved</div>";
}
}
}
}
?>
</form>
</div>
<div id="add_shop_name_div" class="add_graph_data_div" style="background:purple;" >
<div id="" class="add_graph_data_title" style="color:#fff;" >Add Shop</div>
<button onClick="close_add_shop_name_div();" class="close_graph_info_input_div" >X</button>
<input id="shop_name_input" class="graph_info_input" placeholder="Shop Name" />
<!--input id="percentage" class="graph_info_input" placeholder="Percentage" />
<input id="tran_start_date" class="graph_info_input" placeholder="Start Date" />
<input id="tran_end_date" class="graph_info_input" placeholder="End Date" /-->
<div id="add_shop_output_div" class="graph_output_div"></div>
<button onClick="save_new_shop();" class="graph_info_save_btn" >Enter</button>
<script>
function save_new_shop()
{
my_id = document.getElementById("my_id").innerHTML;
shop_name = document.getElementById("shop_name_input").value;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","transaction_auto.php?my_id="+my_id+"&&shop_name="+shop_name+"&&status=insert_new_shop",false);
xmlhttp.send(null);
document.getElementById('add_shop_output_div').innerHTML=xmlhttp.responseText;
document.getElementById("shop_name_input").value="";
alert(shop_name);
}
</script>
</div>
<div id="shop_expend_details_div" class="add_graph_data_div" style="background:orange;" >
<div id="" class="add_graph_data_title" >SHOP DETAILS</div>
<button onClick="close_shop_expend_details_div();" class="close_graph_info_input_div" >X</button>
<select id="shop_name" class="graph_info_input" >
<option disabled selected>Select Shop</option>
<?php option_shop_name(); ?>
</select>
<input id="property_amount" class="graph_info_input" placeholder="Amount" />
<input id="tran_start_date" class="graph_info_input" placeholder="Start Date" />
<input id="tran_end_date" class="graph_info_input" placeholder="End Date" />
<div id="shop_expend_detail_output_div" class="graph_output_div"></div>
<button onClick="save_expenditure_details();" class="graph_info_save_btn" >Enter</button>
<script>
function save_expenditure_details()
{
my_id = document.getElementById("my_id").innerHTML;
shop_name = document.getElementById("shop_name").value;
property_amount = document.getElementById("property_amount").value;
tran_start_date = document.getElementById("tran_start_date").value;
tran_end_date = document.getElementById("tran_end_date").value;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","transaction_auto.php?my_id="+my_id+"&&shop_name="+shop_name+"&&property_amount="+property_amount+"&&tran_start_date="+tran_start_date+"&&tran_end_date="+tran_end_date+"&&status=insert_expenditure_details",false);
xmlhttp.send(null);
clear_response_text = document.getElementById('shop_expend_detail_output_div').innerHTML=xmlhttp.responseText;
document.getElementById("shop_name").value="Select Shop";
document.getElementById("property_amount").value="";
}
</script>
</div>
<div id="add_graph_data_div" class="add_graph_data_div" >
<div id="" class="add_graph_data_title" >Add Graph Info</div>
<button onClick="close_add_new_graph_data();" class="close_graph_info_input_div" >X</button>
<select id="property_name" class="graph_info_input" >
<option disabled selected>Select Building</option>
<?php option_building_name(); ?>
</select>
<select id="shop_name_graph" class="graph_info_input" >
<option disabled selected>Select Shop</option>
<?php option_shop_name(); ?>
</select>
<select id="property_owner" class="graph_info_input" >
<option disabled selected>Select Holder</option>
<option>KHALAF SONS </option>
<option>ADEL AND SALAH </option>
<option>ADEL </option>
<option>SALAH </option>
</select>
<input id="property_amount_graph" class="graph_info_input" placeholder="Amount" />
<!--input id="percentage" class="graph_info_input" placeholder="Percentage" /-->
<input id="tran_start_date_graph" class="graph_info_input" placeholder="Start Date" />
<input id="tran_end_date_graph" class="graph_info_input" placeholder="End Date" />
<div id="graph_output_div" class="graph_output_div"></div>
<button onClick="graph_info_save();" class="graph_info_save_btn" >Enter</button>
<script>
function graph_info_save()
{
my_id = document.getElementById("my_id").innerHTML;
propert_name = document.getElementById("property_name").value;
shop_name = document.getElementById("shop_name_graph").value;
property_amount = document.getElementById("property_amount_graph").value;
property_owner = document.getElementById("property_owner").value;
tran_start_date = document.getElementById("tran_start_date_graph").value;
tran_end_date = document.getElementById("tran_end_date_graph").value;
if(propert_name=="Select Building" || shop_name=="Select Shop" || property_amount=="" || tran_start_date=="" || tran_end_date==""){
document.getElementById('graph_output_div').innerHTML="Fill All The Filds.";
}else{
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","transaction_auto.php?my_id="+my_id+"&&propert_name="+propert_name+"&&shop_name="+shop_name+"&&property_amount="+property_amount+"&&property_owner="+property_owner+"&&tran_start_date="+tran_start_date+"&&tran_end_date="+tran_end_date+"&&status=insert_graph_data",false);
xmlhttp.send(null);
document.getElementById('graph_output_div').innerHTML=xmlhttp.responseText;
document.getElementById("property_name").value="Select Building";
document.getElementById("property_name").value="Select Shop";
document.getElementById("property_amount_graph").value="";
document.getElementById("property_owner").value="Select Holder";
//disp_preview_graph_data();
//alert(tran_start_date);
}
}
</script>
</div>
<?php
if(isset($_GET['status_code'])){
$status_code = $_GET['status_code'];
//echo"$status_code";
?>
<input type="text" id="id_calender" value="<?php echo"$status_code"; ?>" style="display:none;" />
<div id="preview_add_graph_data" class="preview_add_graph_data" >
<div id="graph_data_previwe_output"></div>
<script>
disp_preview_graph_data();
function disp_preview_graph_data()
{
id_calender = document.getElementById('id_calender').value;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","transaction_auto.php?id_calender="+id_calender+"&status=disp_preview_graph_data",false);
xmlhttp.send(null);
document.getElementById('graph_data_previwe_output').innerHTML=xmlhttp.responseText;
document.getElementById('preview_add_graph_data').style.display="block";
}
</script>
</div>
<div id="edit_graph_data_div" class="edit_graph_data_div" >
<div id="" class="add_graph_data_title" >Edit Graph Information</div>
<button onClick="close_edit_new_graph_data();" class="close_graph_info_input_div" >X</button>
<select id="property_name_edit" class="graph_info_input" >
<option disabled selected>Select Property</option>
<?php option_building_name(); ?>
</select>
<input id="property_amount_edit" class="graph_info_input" placeholder="Amount" />
<!--input id="percentage_edit" class="graph_info_input" placeholder="Percentage" /-->
<select id="property_owner_edit" class="graph_info_input" >
<option disabled selected>Select Holder</option>
<option>KHALAF SONS</option>
<option>ADEL AND SALAH</option>
<option>ADEL</option>
<option>SALAH</option>
</select>
<input id="tran_start_date_edit" class="graph_info_input" placeholder="Start Date" />
<input id="tran_end_date_edit" class="graph_info_input" placeholder="End Date" />
<div id="edit_graph_output_div" class="graph_output_div" ></div>
<button onClick="graph_info_save_edit();" class="graph_info_save_btn" >Enter</button>
<script>
document.getElementById('edit_graph_data_div').style.display="block";
document.getElementById('graph_data_btn').style.display="none";
function graph_info_save_edit()
{
my_id = document.getElementById("my_id").innerHTML;
id_calender = document.getElementById('id_calender').value;
propert_name = document.getElementById("property_name_edit").value;
property_amount = document.getElementById("property_amount_edit").value;
property_owner_edit = document.getElementById("property_owner_edit").value;
tran_start_date = document.getElementById("tran_start_date_edit").value;
tran_end_date = document.getElementById("tran_end_date_edit").value;
if(propert_name !=="Select Property" || property_amount !==""){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","transaction_auto.php?my_id="+my_id+"&&id_calender="+id_calender+"&&propert_name="+propert_name+"&&property_amount="+property_amount+"&&property_owner_edit="+property_owner_edit+"&&tran_start_date="+tran_start_date+"&&tran_end_date="+tran_end_date+"&&status=edit_graph_data",false);
xmlhttp.send(null);
document.getElementById('edit_graph_output_div').innerHTML=xmlhttp.responseText;
disp_preview_graph_data();
//alert(property_amount);
}
}
function close_edit_new_graph_data()
{
window.open('purchase.php','_self');
}
</script>
</div>
<?php } ?>
<div id="add_new_project" class="add_new_project">
<div class="add_new_project_title" >Add New Project<button onClick="close_new_project_div();" class="close_graph_info_input_div">X</button></div>
<form method="post" enctype="multipart/form-data" >
<input id="project_description_input" name="project_description_input" class="project_description_input" placeholder="Description" />
<input type="file" id="project_file_input" name="project_file_input" onChange="show_file_name();" style="display:none;" />
<input type="submit" id="upload_project_btn" name="upload_project_btn" style="display:none;" />
</form>
<button id="select_project_file_btn" onClick="document.getElementById('project_file_input').click();" class="select_project_file" >Select File</button>
<button id="project_help_btn" class="upload_project_btn" >Upload Project</button>
<button id="upload_project_btn_final_btn" onClick="document.getElementById('upload_project_btn').click();" class="upload_project_btn" style="display:none;" >Upload Project</button>
<script>
function show_file_name()
{
project_description = document.getElementById('project_description_input').value;
file_type = document.getElementById('project_file_input').files[0].type;
if(file_type == "image/jpeg" || file_type == "video/mp4" && project_description !=="" )
{
document.getElementById('select_project_file_btn').innerHTML ="File Selected";
document.getElementById('select_project_file_btn').style="color:green;";
document.getElementById('project_help_btn').style.display="none";
document.getElementById('upload_project_btn_final_btn').style="color:green;display:block;";
//alert(file_type);
}else{
document.getElementById('project_help_btn').style.display="block";
document.getElementById('upload_project_btn_final_btn').style="color:green;display:none;";
alert('First Filds Empty Or Your File Format Not Supported ');
}
}
function close_new_project_div()
{
document.getElementById('add_new_project').style.display="none";
}
</script>
<?php
if(isset($_POST['upload_project_btn']))
{
$project_description = $_POST['project_description_input'];
$project_file = $_FILES['project_file_input']['name'];
$type = explode('.',$project_file);
$type =end($type);
$random_name =rand();
$image_tmp = $_FILES['project_file_input']['tmp_name'];
$insert_project = "insert into projecttb(my_id,description,file_url,file_type,curr_day,curr_month,curr_year,time)
values('$my_id','$project_description','$random_name','.$type','$cur_day','$cur_month','$cur_year',CURTIME())";
$run_insert_project = mysqli_query($con,$insert_project);
if($run_insert_project){
echo"New Data Inserted";
echo"<script>window.open('projects.php','_self')</script>";
}else{echo"Something Went Wrong.";}
if($type =="mp4" || $type =="MP4"){
move_uploaded_file($image_tmp,'project_videos/'.$random_name.'.'.$type);
//echo"video";
}elseif($type == "JPG" || $type == "jpg" || $type == "png" || $type == "PNG" || $type =="JPEG" || $type =="jpeg" ){
move_uploaded_file($image_tmp,'project_images/'.$random_name.'.'.$type);
}
}
?>
</div><!-- end of add_new_project-->
<?php } ?>
</body>
</html>