| 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 : |
<?php
session_start();
include('db_con.php');
include('function.php');
include('lang_function.php');
include('print_function.php');
$status = $_GET['status'];
?>
<?php
if(isset($_SESSION['id']))
{
$my_cpr = $_SESSION['user_cpr'];
//echo"$my_cpr";
}
?>
<?php
$curr_date = date("d");
$curr_month = date("m");
$curr_year = date("Y");
?>
<input type="" value="<?php echo"$curr_date"; ?>" style="display:none;" />
<input type="" value="<?php echo"$curr_month"; ?>" style="display:none;" />
<input type="" value="<?php echo"$curr_year"; ?>" style="display:none;" />
<?php
/*
if($status =='make_new_order_insert')
{
$my_id = $_GET['my_id'];
$bd_name = $_GET['building_name'];
$flat_no = $_GET['order_flat_no'];
$name_product = $_GET['product_name'];
$qty_product = $_GET['product_qty'];
$ordered_by = $_GET['order_by'];
$insert_oreder ="insert into new_ordertb (my_id,building_name,flat_no,product_name,product_qty,order_by_id,curr_date,curr_time)
values('$my_id','$bd_name','$flat_no','$name_product','$qty_product','$ordered_by',CURDATE(),CURTIME() )";
$run_order_insert = mysqli_query($con,$insert_oreder);
if(!$run_order_insert){echo"<span style='color:red;'>Something Went Wrong,Your Information Has Not Been Saved</span>";}
}
*/
if($status =='disp_new_orders')
{
//echo"only me";
?>
<div class="order_new_input_title" >Purchase List <button onClick="close_purchase_list_div();" class="close_main_div" >x</button></div>
<div class="order_list_label_div" >
<div class="order_list_label_smallest" >No</div>
<div class="order_list_label_smallest" >Image</div>
<div class="order_list_label_big" >Building</div>
<div class="order_list_label_small" >Flat no</div>
<div class="order_list_label_big" >Product</div>
<div class="order_list_label_small" >Quantity </div>
<div class="order_list_label_big" >Order by </div>
<div class="order_list_label_small" >Date </div>
</div>
<?php
$get_new_order ="select * from new_ordertb order by id desc ";
$run_new_order = mysqli_query($con,$get_new_order);
while($row_new_order = mysqli_fetch_array($run_new_order))
{
$order_id= $row_new_order['id'];
$bd_name = $row_new_order['building_name'];
$flat_no = $row_new_order['flat_no'];
$image_url_one = $row_new_order['image_url_one'];
$image_url_two = $row_new_order['image_url_two'];
$order_by_name = $row_new_order['order_by_id'];
$product_name = $row_new_order['product_name'];
$product_qty = $row_new_order['product_qty'];
//$order_by = $row_new_order['order_by_id'];
$curr_date = $row_new_order['curr_date'];
$curr_time = $row_new_order['curr_time'];
if($image_url_one ==""){$image_url = $image_url_two;}elseif($image_url_two ==""){$image_url = $image_url_one;}else{$image_url = $image_url_one;}
$check_purchased_product ="select * from purchased_producttb where order_id='$order_id'";
$run_purchased_product = mysqli_query($con,$check_purchased_product);
$check_product = mysqli_num_rows($run_purchased_product);
if($check_product >0){echo"";}else{
?>
<div class="order_list_out_div" >
<div class="order_list_out_put_smallest" ><?php //echo"$order_id"; ?></div>
<div class="order_list_out_put_smallest" >
<?php
if($image_url !==""){
?>
<img onClick="zoom_sample_images(this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url"; ?>" width="100%" height="100%" />
<?php } ?>
</div>
<div class="order_list_out_put_big" ><?php echo"$bd_name"; ?></div>
<div class="order_list_out_put_small" ><?php echo"$flat_no"; ?></div>
<div class="order_list_out_put_big" ><?php echo"$product_name"; ?></div>
<div class="order_list_out_put_small" ><?php echo"$product_qty"; ?></div>
<div class="order_list_out_put_big" ><?php echo"$order_by_name"; ?></div>
<div class="order_list_out_put_small" ><?php echo"$curr_date"; ?></div>
<button onClick="show_order_option(this.id);" id="<?php echo"$order_id"; ?>" style="font-size:1.1em;cursor:pointer;color:white;background:transparent;border:transparent;">...</button>
<div onmouseleave="close_order_option();" id="transcation_option_div<?php echo"$order_id"; ?>" class="transcation_option_div">
<button onClick="check_out(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Check</button>
<button onClick="edit_order(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Edit</button>
<button onClick="show_delete_order_confirm_area(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Del</button>
</div>
<div onmouseleave="close_delete_order_confirm_area();" id="delete_order_confirm_area<?php echo"$order_id"; ?>" style="float:left;width:30%;height:60px;background:#ededed;margin-left:35%;display:none;" >
<span style="float:left;width:100%;color:blue;margin-bottom:6px;">Want To Delete This Data</span>
<button onClick="no_del_order(this.id);" id="<?php echo"$order_id"; ?>" style="floatk:left;width:70px;height:30px;margin-right:8px;font-size:0.9em;background:white;color:red;border:transparent;cursor:pointer;">No</button>
<button onClick="delete_order(this.id);" id="<?php echo"$order_id"; ?>" style="floatk:left;width:70px;height:30px;margin-right:8px;font-size:0.9em;background:white;color:green;border:transparent;cursor:pointer;">Yes</button>
</div>
</div>
<div id="zoomed_sample_img_pc<?php echo"$order_id"; ?>" class="zoomed_sample_img_pc">
<?php if($image_url_one !==""){ ?>
<img ondblclick=" (this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url_one"; ?>" class="zoomed_image_pc" />
<?php } if($image_url_two !==""){ ?>
<img ondblclick="close_zoom_sample_images(this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url_two"; ?>" class="zoomed_image_pc" />
<?php } ?>
</div>
<div id="purchase_list_mob_div" class="purchase_list_mob_div">
<div class="order_list_label_mob_div">
<div class="order_list_label_smallest_mob">No</div>
<div class="order_list_label_big_mob">Product name</div>
<div class="order_list_label_smallest_mob">Qty</div>
<div class="order_list_label_smallest_mob">Date</div>
<button onClick="show_order_option(this.id);" id="<?php echo"$order_id"; ?>" class="order_list_option_btn">...</button>
</div>
<div class="order_list_out_mob_div">
<div class="order_list_out_put_smallest_mob"><?php echo"$order_id"; ?></div>
<div class="order_list_out_put_big_mob"><?php echo"$product_name"; ?></div>
<div class="order_list_out_put_smallest_mob"><?php echo"$product_qty"; ?></div>
<div class="order_list_out_put_small_mob"><?php echo"$curr_date"; ?></div>
</div>
<div class="order_list_label_mob_div">
<div class="order_list_label_smallest_mob">image</div>
<div class="order_list_label_big_mob">Building name</div>
<div class="order_list_label_smallest_mob">Flat</div>
<div class="order_list_label_small_mob">Order by</div>
</div>
<div class="order_list_out_mob_div">
<div class="order_list_out_put_smallest_mob">
<?php
if($image_url !==""){
?>
<img onClick="zoom_sample_images(this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url"; ?>" style="cursor:pointer;" width="100%" height="100%" />
<?php } ?>
</div>
<div class="order_list_out_put_big_mob"><?php echo"$bd_name"; ?></div>
<div class="order_list_out_put_smallest_mob"><?php echo"$flat_no"; ?></div>
<div class="order_list_out_put_small_mob"><?php echo"$order_by"; ?></div>
</div>
<div onmouseleave="close_order_option_mob();" id="transcation_option_div2<?php echo"$order_id"; ?>" class="transcation_option_div">
<button onClick="check_out(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Check</button>
<button onClick="edit_order(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Edit</button>
<button onClick="show_delete_order_confirm_area(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Del</button>
<button onClick="close_order_option_mob(this.id);" id="<?php echo"$order_id"; ?>" class="transcation_btn">Exit</button>
</div>
<div onmouseleave="close_delete_order_confirm_area();" id="delete_order_confirm_mob_area<?php echo"$order_id"; ?>" style="float:left;width:80%;height:80px;margin-top:-75px;background:#fff;margin-left:10%;border-radius:15px;border:1px solid #85929E;display:none;" >
<span style="float:left;width:100%;color:blue;margin-bottom:10px;margin-top:10px;text-align:center;">You Want To Delete This Data</span>
<button onClick="no_del_order(this.id);" id="<?php echo"$order_id"; ?>" style="floatk:left;width:70px;height:30px;margin-right:8px;font-size:0.9em;margin-left:25%;background:#ccc;color:red;border:transparent;cursor:pointer;">No</button>
<button onClick="delete_order(this.id);" id="<?php echo"$order_id"; ?>" style="floatk:left;width:70px;height:30px;margin-right:8px;font-size:0.9em;background:#ccc;color:green;border:transparent;cursor:pointer;">Yes</button>
</div>
</div>
<div class="zoom_img_helping_div" >
<div id="zoomed_sample_img_div<?php echo"$order_id"; ?>" class="zoomed_sample_img_div">
<?php if($image_url_one !==""){ ?>
<img onClick="zoom_sample_images(this.id);" ondblclick="close_zoom_sample_images(this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url_one"; ?>" class="zoomed_sample_img" />
<?php } if($image_url_two !==""){ ?>
<img onClick="zoom_sample_images(this.id);" ondblclick="close_zoom_sample_images(this.id);" id="<?php echo"$order_id"; ?>" src="new_order_sample_img/<?php echo"$image_url_two"; ?>" class="zoomed_sample_img" />
<?php } ?>
</div>
</div>
<?php
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='disp_checkout_order_inputs')
{
//echo"Me the programer";
$order_id = $_GET['order_id'];
$get_new_order ="select * from new_ordertb where id='$order_id'";
$run_new_order = mysqli_query($con,$get_new_order);
while($row_new_order = mysqli_fetch_array($run_new_order))
{
$order_id= $row_new_order['id'];
$bd_name = $row_new_order['building_name'];
$flat_no = $row_new_order['flat_no'];
$product_name = $row_new_order['product_name'];
$product_qty = $row_new_order['product_qty'];
$order_by_id = $row_new_order['order_by_id'];
$curr_date = $row_new_order['curr_date'];
$curr_time = $row_new_order['curr_time'];
?>
<div id="new_sales_input_div" class="new_sales_input_div" style="displayk:none;">
<div class="order_new_input_title" >Sales Entry <button onClick="close_new_sales_input_div();" class="close_main_div" >x</button></div>
<div class="order_input_lebal" >Building name</div>
<input id="sale_bd_name" class="order_bd_name_input" value="<?php echo"$bd_name"; ?>" />
<div class="order_input_lebal" >Flat no.</div>
<input id="sale_flat_no" class="order_bd_name_input" value="<?php echo"$flat_no"; ?>" />
<div class="order_input_lebal" >Product name</div>
<input id="sale_product_name" class="order_bd_name_input" value="<?php echo"$product_name"; ?>" />
<div class="order_input_lebal" >Product qty</div>
<input id="sale_product_qty" class="order_bd_name_input" value="<?php echo"$product_qty"; ?>" />
<input id="order_by_id" style="display:none;" value="<?php echo"$order_by_id"; ?>" />
<div class="order_input_lebal" >Shop</div>
<input id="shop_per_iterm" class="order_bd_name_input" />
<div class="order_input_lebal" >Total price</div>
<input id="sale_total_price" class="order_bd_name_input" />
<div class="order_input_lebal" >Picked by</div>
<input id="sale_picked_by" class="order_bd_name_input" />
<div class="order_input_lebal" >Invoice no</div>
<input id="bill_invoice" class="order_bd_name_input" />
<div id="purchased_product_erorr_out_put" class="erorr_out_put" ></div>
<button onClick="cancle_purchase();" class="sales_cancel_btn">Cancel</button>
<button onClick="sale_now_product(this.id);" id="<?php echo"$order_id"; ?>" class="sale_now_btn">Sale</button>
</div><!--end of new_sales_input_div-->
<?php
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='disp_edit_order_inputs')
{
$order_id = $_GET['order_id'];
$get_new_order ="select * from new_ordertb where id='$order_id'";
$run_new_order = mysqli_query($con,$get_new_order);
while($row_new_order = mysqli_fetch_array($run_new_order))
{
$order_id= $row_new_order['id'];
$bd_name = $row_new_order['building_name'];
$flat_no = $row_new_order['flat_no'];
$product_name = $row_new_order['product_name'];
$product_qty = $row_new_order['product_qty'];
$curr_date = $row_new_order['curr_date'];
$curr_time = $row_new_order['curr_time'];
?>
<div id="new_sales_input_div" class="order_edit_input_div" style="displayk:none;">
<div class="order_new_input_title" >Editing Order Window <button onClick="close_edit_order_input_div();" class="close_main_div" >x</button></div>
<div class="order_input_lebal" >Building name</div>
<input id="edit_bd_name" class="order_bd_name_input" value="<?php echo"$bd_name"; ?>" />
<div class="order_input_lebal" >Flat no.</div>
<input id="edit_flat_no" class="order_bd_name_input" value="<?php echo"$flat_no"; ?>" />
<div class="order_input_lebal" >Product name</div>
<input id="edit_product_name" class="order_bd_name_input" value="<?php echo"$product_name"; ?>" />
<div class="order_input_lebal" >Product qty</div>
<input id="edit_product_qty" class="order_bd_name_input" value="<?php echo"$product_qty"; ?>" />
<div id="eidt_order_erorr_out_put" class="erorr_out_put" ></div>
<button onClick="cancle_purchase();" class="sales_cancel_btn">Cancel</button>
<button onClick="update_order_now(this.id);" id="<?php echo"$order_id"; ?>" class="sale_now_btn">Update</button>
</div><!--end of new_sales_input_div-->
<?php
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='update_order_now')
{
$my_id = $_GET['my_id'];
$order_id = $_GET['order_id'];
$edit_bd_name = $_GET['edit_bd_name'];
$edit_flat_no = $_GET['edit_flat_no'];
$edit_product_name = $_GET['edit_product_name'];
$edit_product_qty = $_GET['edit_product_qty'];
$update_order ="update new_ordertb set building_name='$edit_bd_name',flat_no='$edit_flat_no',product_name='$edit_product_name',product_qty='$edit_product_qty' where my_id='$my_id' AND id='$order_id' ";
$run_update_order = mysqli_query($con,$update_order);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='delete_order')
{
$my_id = $_GET['my_id'];
$order_id = $_GET['order_id'];
$get_file_name ="select* from new_ordertb where id='$order_id'";
$run_get_file_name = mysqli_query($con,$get_file_name);
while($row_get_file_name = mysqli_fetch_array($run_get_file_name))
{
$file_nme = $row_get_file_name['image_url_one'];
$file_path ='new_order_sample_img';
if($file_path !=="") {
unlink($file_path .'/'. $file_nme);
$del_order = "delete from new_ordertb where my_id='$my_id' AND id='$order_id' ";
$run_del_order = mysqli_query($con,$del_order);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='insert_sold_products')
{
$my_id = $_GET['my_id'];
$order_id = $_GET['order_id'];
$sale_bd_name = $_GET['sale_bd_name'];
$sale_flat_no = $_GET['sale_flat_no'];
$sale_product_name = $_GET['sale_product_name'];
$sale_product_qty = $_GET['sale_product_qty'];
$shop_per_iterm = $_GET['shop_per_iterm'];
$sale_total_price = $_GET['sale_total_price'];
$sale_order_by_id = $_GET['sale_order_by_id'];
$sale_picked_by = $_GET['sale_picked_by'];
$bill_invoice = $_GET['bill_invoice'];
$insert_purchased_product ="insert into purchased_producttb (user_id,order_id,building_name,flat_no,product_name,product_qty,shop_iterm,total_price,order_by_id,picked_by,invoice_no,curr_date,curr_month,curr_year,curr_time)
values('$my_id','$order_id','$sale_bd_name','$sale_flat_no','$sale_product_name','$sale_product_qty','$shop_per_iterm','$sale_total_price','$sale_order_by_id','$sale_picked_by','$bill_invoice','$curr_date','$curr_month','$curr_year',CURTIME() )";
$run_purchased_product = mysqli_query($con,$insert_purchased_product);
if(!$run_purchased_product){echo"<span style='color:red;'>Something Went Wrong,Your Information Has Not Been Saved</span>";}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_purchase_list')
{
//$order_id = $_GET['order_id'];
?>
<div class="order_new_input_title" >Final Recept
<button onClick="print_purchaed_list();" class="close_main_div" >Pri</button>
<button onClick="close_final_recept_div();" class="close_main_div" >x</button>
</div>
<div class="recept_list_label_div" >
<div class="recept_label_small" >Inv no</div>
<div class="recept_label_big" >Building</div>
<div class="recept_label_small" >Flat no</div>
<div class="recept_label_big" >Product</div>
<div class="recept_label_small" >Quantity </div>
<div class="recept_label_small" >Shop</div>
<div class="recept_label_small" >Total Price </div>
<div class="recept_label_small" >Order by </div>
<div class="recept_label_small" >Picked by</div>
<div class="recept_label_small" style="display:none;" >Served by</div>
<div class="recept_label_small" >Date </div>
</div>
<?php
$get_purchased_product ="select * from purchased_producttb";
$run_purchased_product = mysqli_query($con,$get_purchased_product);
while($row_purchased_product = mysqli_fetch_array($run_purchased_product))
{
$purchased_product_id= $row_purchased_product['id'];
$served_by_id= $row_purchased_product['user_id'];
$bd_name = $row_purchased_product['building_name'];
$flat_no = $row_purchased_product['flat_no'];
$product_name = $row_purchased_product['product_name'];
$product_qty = $row_purchased_product['product_qty'];
$shop_per_iterm = $row_purchased_product['shop_iterm'];
$total_price = $row_purchased_product['total_price'];
$order_by_id = $row_purchased_product['order_by_id'];
$picked_by = $row_purchased_product['picked_by'];
$curr_date = $row_purchased_product['curr_date'];
$curr_month = $row_purchased_product['curr_month'];
$curr_year = $row_purchased_product['curr_year'];
$curr_time = $row_purchased_product['curr_time'];
?>
<div class="recept_out_div" >
<div class="recept_list_out_put_small" ><?php echo"$purchased_product_id"; ?> </div>
<div class="recept_list_out_put_big" ><?php echo"$bd_name"; ?> </div>
<div class="recept_list_out_put_small" ><?php echo"$flat_no"; ?></div>
<div class="recept_list_out_put_big" ><?php echo"$product_name"; ?></div>
<div class="recept_list_out_put_small" ><?php echo"$product_qty"; ?></div>
<div class="recept_list_out_put_small" ><?php echo"$shop_per_iterm"; ?></div>
<div class="recept_list_out_put_small" style="color:green;" ><?php echo"$total_price"; ?></div>
<div class="recept_list_out_put_small" style="display:none;" >
<?php
$in_user ="select * from khalaf_usertb where id='$order_by_id'";
$run_in_user = mysqli_query($con,$in_user);
while($row_user_new_oreder = mysqli_fetch_array($run_in_user)){
$user_fname = $row_user_new_oreder['first_name'];
echo"$user_fname";
}
?></div>
<div class="recept_list_out_put_small" >
<?php
$in_user ="select * from khalaf_usertb where id='$served_by_id'";
$run_in_user = mysqli_query($con,$in_user);
while($row_user_new_oreder = mysqli_fetch_array($run_in_user)){
$user_fname = $row_user_new_oreder['first_name'];
echo"$user_fname";
}
?></div>
<div class="recept_list_out_put_small" ><?php echo"$picked_by"; ?></div>
<div classk="recept_list_out_put_small" style="float:left;width:8.1%;height:40px;line-heightk:40px;background:#fff;text-align:center;border-right:1px solid #ccc;" ><?php echo"<spana style='float:left;height:20px;backgroundk:red;'>$curr_date - $curr_month - $curr_year</span><br/>"; echo"<spana style='float:right;height:20px;font-size:14px;color:blue;backgroundk:green;font-weight:bold;'>$curr_time</span>"; ?></div>
<!--div class="recept_list_out_put_big" ><?php //echo"$order_id"; ?></div-->
</div>
<div class="recept_list_label_div_mob" >
<!--div class="recept_label_small" >Id no</div-->
<div class="recept_label_big_mob" >Building</div>
<div class="recept_label_small_mob" >Flat no</div>
<div class="recept_label_small_mob" >Order by </div>
<div class="recept_label_big_mob" >Date </div>
<!--div class="recept_label_small" >Rate</div>
<div class="recept_label_small" >Total Price </div>
<div class="recept_label_small" >Order by </div>
<div class="recept_label_big" >Date </div-->
</div>
<div class="recept_out_div_mob" >
<!--div class="recept_list_out_put_small_mob" ><?php echo"$purchased_product_id"; ?> </div-->
<div class="recept_list_out_put_big_mob" ><?php echo"$bd_name"; ?> </div>
<div class="recept_list_out_put_small_mob" ><?php echo"$flat_no"; ?></div>
<div class="recept_list_out_put_small_mob" ><?php echo"$picked_by"; ?></div>
<div class="recept_list_out_put_big_mob" ><?php echo"$curr_date"; //echo"|$curr_date"; ?></div>
<!--div class="recept_list_out_put_small" ><?php echo"$price_per_iterm"; ?></div>
<div class="recept_list_out_put_small" style="color:green;" ><?php echo"$total_price"; ?></div>
<div class="recept_list_out_put_small" ><?php echo"$picked_by"; ?></div>
<div class="recept_list_out_put_big" ><?php echo"$curr_date";echo"|$curr_date"; ?></div>
<!--div class="recept_list_out_put_big" ><?php //echo"$order_id"; ?></div-->
</div>
<div class="recept_list_label_div_mob" >
<div class="recept_label_big_mob" >Product</div>
<div class="recept_label_small_mob" >Qnty </div>
<div class="recept_label_small_mob" >Rate</div>
<div class="recept_label_big_mob" >Total Price </div>
</div>
<div class="recept_out_div_mob_two" >
<div class="recept_list_out_put_big_mob" ><?php echo"$product_name"; ?></div>
<div class="recept_list_out_put_small_mob" ><?php echo"$product_qty"; ?></div>
<!--div class="recept_list_out_put_small_mob" ><?php echo"$price_per_iterm"; ?></div-->
<div class="recept_list_out_put_big_mob" style="color:green;" ><?php echo"$total_price"; ?></div>
<!--div class="recept_list_out_put_big" ><?php //echo"$order_id"; ?></div-->
</div>
<?php
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='insert_new_shop')
{
$my_id = $_GET['my_id'];
$shop_name = $_GET['shop_name'];
$get_shop_name = "select * from shoptb where shop_name='$shop_name' ";
$run_get_shop_name = mysqli_query($con,$get_shop_name);
$check_shop_name = mysqli_num_rows($run_get_shop_name);
if($check_shop_name > 0 ){echo"Shop Name Already Exists";}else{
$insert_shop ="insert into shoptb (my_id,shop_name,curr_day,curr_month,curr_year,time) values ('$my_id','$shop_name','$curr_date','$curr_month','$curr_year',CURTIME() )";
$run_insert_shop = mysqli_query($con,$insert_shop);
echo"New Shop Name Added.";
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_expenditure_details")
{
$my_id = $_GET['my_id'];
$shop_name = $_GET['shop_name'];
$property_amount = $_GET['property_amount'];
$tran_start_date = $_GET['tran_start_date'];
$tran_end_date = $_GET['tran_end_date'];
if($shop_name =="Select Shop" || $property_amount =="" || $tran_start_date =="" || $tran_end_date ==""){echo"Fill All Spaces";}else{
$get_shop_name = "select * from shoptb where shop_name='$shop_name'";
$run_get_shop_name = mysqli_query($con,$get_shop_name);
while($row_get_shop_name = mysqli_fetch_array($run_get_shop_name))
{
$shop_id = $row_get_shop_name['id'];
$insert_expend_details = "insert into expendituretb (my_id,shop_id,shop_name,amount,start_date,end_date,curr_day,curr_month,curr_year,currtime)
values ('$my_id','$shop_id','$shop_name','$property_amount','$tran_start_date','$tran_end_date','$curr_date','$curr_month','$curr_year',CURTIME() )";
$run_insert_expend_details = mysqli_query($con,$insert_expend_details);
echo"New data has been saved Thanks.";
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='insert_graph_data')
{
$my_id = $_GET['my_id'];
$propert_name = $_GET['propert_name'];
$shop_name = $_GET['shop_name'];
$property_amount = $_GET['property_amount'];
$property_owner = $_GET['property_owner'];
$tran_start_date = $_GET['tran_start_date'];
$tran_end_date = $_GET['tran_end_date'];
$status_code = rand(1000,1000000);
//$property_owner = mysqli_real_escape_string($con,$property_owner);
$get_shop_name = "select * from expendituretb where shop_name='$shop_name' AND start_date='$tran_start_date' AND end_date='$tran_end_date' ";
$run_get_expenditure = mysqli_query($con,$get_shop_name);
$check_expenditure = mysqli_num_rows($run_get_expenditure);
if($check_expenditure < 1){
echo"<span style='color:red;cursor:pointer;'>Frist add Shop Details </span><button onClick='show_shop_expend_details_div();' style='color:green;cursor:pointer;'>Add Shop Details</button>";
}else{
while($row_get_expenditure = mysqli_fetch_array($run_get_expenditure))
{
//$name_shop = $row_get_expenditure['shop_name'];
$spent_amount = $row_get_expenditure['amount'];
//$start_date= $row_get_expenditure['start_date'];
//$end_date= $row_get_expenditure['end_date'];
$get_calender = "select * from graph_calendartb where shop_name='$shop_name' AND start_date ='$tran_start_date' AND end_date ='$tran_end_date'";// AND curr_day='$curr_date' AND curr_month='$curr_month' AND curr_year='$curr_year' ";
$run_get_calender = mysqli_query($con,$get_calender);
$check_calender = mysqli_num_rows($run_get_calender);
if($check_calender < 1 ){
$insert_calender ="insert into graph_calendartb (my_id,status_code,shop_name,total_amount,start_date,end_date,curr_day,curr_month,curr_year,curr_time) values('$my_id','$status_code','$shop_name','$spent_amount','$tran_start_date','$tran_end_date','$curr_date','$curr_month','$curr_year',CURTIME())";
$run_insert_calender = mysqli_query($con,$insert_calender);
//}
$disp_graph_info = "select * from graph_datatb where property_name='$propert_name' AND amount='$property_amount' AND trans_start_date='$tran_start_date' AND trans_end_date='$tran_end_date'";// AND cur_day='$curr_date' AND cur_month='$curr_month' AND cur_year='$curr_year'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
$check_graph_info = mysqli_num_rows($run_disp_graph_info);
if($check_graph_info < 1 ){
$insert_graph_info = "insert into graph_datatb (my_id,status_code,property_name,property_ower,amount,trans_start_date,trans_end_date,cur_day,cur_month,cur_year,cur_time)
values ('$my_id','$status_code','$propert_name','$property_owner','$property_amount','$tran_start_date','$tran_end_date','$curr_date','$curr_month','$curr_year',CURTIME() )";
$run_graph_info = mysqli_query($con,$insert_graph_info);
echo"New data has been saved Thanks.";
}else{echo"Record Exists";}
}else{echo"Record Exists";}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='edit_graph_data')
{
$my_id = $_GET['my_id'];
$id_calender= $_GET['id_calender'];
$propert_name = $_GET['propert_name'];
$property_amount = $_GET['property_amount'];
$property_owner_edit = $_GET['property_owner_edit'];
$tran_start_date = $_GET['tran_start_date'];
$tran_end_date = $_GET['tran_end_date'];
if($propert_name !=='Select Property' || $property_amount !=="" || $tran_start_date !=="" || $tran_end_date !=="" ){
$insert_graph_info = "insert into graph_datatb (my_id,status_code,property_name,property_ower,amount,trans_start_date,trans_end_date,cur_day,cur_month,cur_year,cur_time)
values ('$my_id','$id_calender','$propert_name','$property_owner_edit','$property_amount','$tran_start_date','$tran_end_date','$curr_date','$curr_month','$curr_year',CURTIME() )";
$run_graph_info = mysqli_query($con,$insert_graph_info);
echo"Data has been saved Thanks.";
}else{echo"Fill All The Spaces Thanks.";}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'disp_preview_graph_data'){
$id_calender = $_GET['id_calender'];
$get_calender = "select * from graph_calendartb where status_code='$id_calender'";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
//$start_date = $row_calender['start_date'];
//$end_date = $row_calender['end_date'];
$main_code = $row_calender['status_code'];
?>
<div class="graph_data_previwe_name">Property Name</div>
<div class="graph_data_previwe_amount">Amount</div>
<?php
$disp_graph_info = "select * from graph_datatb where status_code='$main_code'"; // where trans_start_date='$start_date' AND trans_end_date='$end_date'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
//$amount_percentage = $row_disp_graph_info['amount_percentage'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
?>
<div class="graph_data_previwe_name"><?php echo"$propert_name"; ?></div>
<div class="graph_data_previwe_amount"><?php echo"$propert_amount"; ?></div>
<?php } }
//echo"Katende Vicent";
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='show_graph_diagram')
{
$diff_id = $_GET['diff_id'];
$get_calender = "select * from graph_calendartb where status_code='$diff_id' ";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$shop_name = $row_calender['shop_name'];
$end_date = $row_calender['end_date'];
$final_amount = $row_calender['total_amount'];
?>
<div class="main_graph_title" style="" ><?php echo $shop_name; ?> Expenditure.</div>
<?php
//}
$disp_graph_info = "select * from graph_datatb where status_code='$diff_id' ";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
//$amount_percentage = $row_disp_graph_info['amount_percentage'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
//$percent = $propert_amount / 444 * 100 ;
?>
<div class="graph_draw" style="height:<?php echo"$amount_percentage%"; ?>; ">
<?php
echo"$propert_name"; echo" ";
echo"$amount_percentage%";
?>
</div>
<?php } }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'insert_complaint')
{
$my_cpr = $_GET['my_cpr'];
$complaint_details = $_GET['complaint_details'];
$complaint_building_name = $_GET['complaint_building_name'];
$complaint_flat = $_GET['complaint_flat'];
$complaint_by = $_GET['complaint_by'];
//echo"$complaint_details";
if($complaint_details !=="" && $complaint_building_name !=="Select" && $complaint_by !==""){
$get_complaint_dating ="select * from complaint_datingtb where curr_day='$curr_date' AND curr_month='$curr_month' AND curr_year='$curr_year' ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
$check_complaint_dating = mysqli_num_rows($run_get_complaint_dating);
if($check_complaint_dating >0){}else{
$insert_complaint_dating ="insert into complaint_datingtb(my_id,curr_day,curr_month,curr_year,curr_time) values('$my_cpr','$curr_date','$curr_month','$curr_year',CURTIME())";
$run_complaint_dating = mysqli_query($con,$insert_complaint_dating);
}
$save_complaint ="insert into complainttb(my_id,building_name,flat_no,complaint_detail,complaint_by,curr_day,curr_month,curr_year,curr_time)
values('$my_cpr','$complaint_building_name','$complaint_flat','$complaint_details','$complaint_by','$curr_date','$curr_month','$curr_year',CURTIME())";
$run_save_complaint = mysqli_query($con,$save_complaint);
if($run_save_complaint){echo"Your Complaint Saved";
$get_complaint_id ="select * from complainttb where complaint_detail='$complaint_details' AND flat_no='$complaint_flat' ";
$run_get_complaint_id = mysqli_query($con,$get_complaint_id);
while($row_complaint_id = mysqli_fetch_array($run_get_complaint_id))
{
$complaint_id = $row_complaint_id['id'];
$get_member ="select * from mainttb where employee_cpr !='$my_cpr' ";
$run_member = mysqli_query($con,$get_member);
while($row_member = mysqli_fetch_array($run_member))
{
$user_cpr = $row_member['employee_cpr'];
$insert_kvt ="insert into notiftb(complaint_id,user_cpr) values('$complaint_id','$user_cpr')";
$run_not = mysqli_query($con,$insert_kvt);
}
}
}else{echo"Something Went Wrong.";}
}else{echo"Fill All The Inputs.";}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'display_complaint')
{
$get_complaint_dating ="select * from complaint_datingtb order by id desc ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
while($row_complaint_dating = mysqli_fetch_array($run_get_complaint_dating)){
$compaint_date_id = $row_complaint_dating['id'];
$day_curr = $row_complaint_dating['curr_day'];
$month_curr = $row_complaint_dating['curr_month'];
$year_curr = $row_complaint_dating['curr_year'];
?>
<div style="float:left;width:100%;background:#BB83B1;">
<div classk="complaint_lebal_middle_comp_by" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-left:0.5%;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center; ">COMPLAINT BY</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >COMPLAINT TO</div>
<div classk="complaint_lebal" style="float:left;min-width:163px;width:22.48%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center; ">DETAILS</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >PROPERTY NAME</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;widthK:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >FLAT</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >STATUS</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;">FINISHED BY</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >DATE</div>
<?php
$disp_maint_emp ="select * from mainttb where employee_cpr='$my_cpr' ";
$run_disp_maint_emp = mysqli_query($con,$disp_maint_emp);
while($row_disp_maint_emp = mysqli_fetch_array($run_disp_maint_emp))
{
$emp_cpr = $row_disp_maint_emp['employee_cpr'];
$permission_status = $row_disp_maint_emp['permission_status'];
if($permission_status =="Full Permission"){
?>
<button onClick="show_right_option_div(this.name);" name="<?php echo $compaint_date_id; ?>" style="cursor:pointer;border:transparent;" >...</button>
<?php }elseif($permission_status =="Read/Write"){ ?>
<!--button name="<?php //echo $compaint_date_id; ?>" onClick="edit_complaint_main(this.name);" style="cursor:pointer;border:transparent;" >...</button-->
<button onClick="show_right_option_div(this.name);" name="<?php echo $compaint_date_id; ?>" style="cursor:pointer;border:transparent;" >...</button>
<?php } } ?>
<div id="comp_option_div<?php echo $compaint_date_id; ?>" onmouseleave="close_right_option_div();" class="comp_option_div_right" >
<button onClick="show_add_more_complaint_div(this.name);" name="<?php echo $compaint_date_id; ?>" class="comp_option_btn_right">Add</button>
<button onClick="complait_single_print(this.name);" name="<?php echo $compaint_date_id; ?>" class="comp_option_btn_right" >Print</button>
<button onClick="close_right_option_div();" class="comp_option_btn_right" >Eixt</button>
</div>
</div>
<?php
$get_complaint ="select * from complainttb where curr_day='$day_curr' AND curr_month='$month_curr' AND curr_year='$year_curr' order by id desc ";
$run_get_complaint = mysqli_query($con,$get_complaint);
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
$curr_day = $row_get_complaint['curr_day'];
$curr_month = $row_get_complaint['curr_month'];
$curr_year = $row_get_complaint['curr_year'];
$curr_time = $row_get_complaint['curr_time'];
?>
<div ondblclick="show_comp_option_div(this.id);" id="<?php echo $complaint_id; ?>" classk="complaint_single_div" style="float:left;width:100%;margin-bottom:5px;color:#5D5A5A;border-bottom:1px solid #ccc;background:#BB83B1;">
<div classk="complaint_output_middle_comp_by" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-left:0.5%;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_by"; ?></div>
<div ondblclick="add_complaint_to_name(this.id);" id="<?php echo $complaint_id; ?>" classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_to"; ?></div>
<div classk="complaint_output" id="<?php echo $complaint_id; ?>" style="float:left;width:22.48%;widthk:280px;min-height:40px;height:auto;line-height:20px;margin-right:1px;background:#fff;font-size:1em;text-align:center;word-wrap:break-word;font-size:1.1em;"><?php echo"$complaint_details"; ?></div>
<div classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_building_name"; ?></div>
<div classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$complaint_flat"; ?></div>
<div ondblclick="add_complaint_status(this.id);" id="<?php echo $complaint_id; ?>" classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$complaint_status"; ?></div>
<div ondblclick="complaint_done_by();" classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_doneby"; ?></div>
<div classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$curr_day-$curr_month-$curr_year| <span style='font-size:0.9em;color:blue;'>$curr_time</span>"; ?></div>
</div>
<?php } ?>
<div id="complaint_add_masking_div" onClick="close_add_complaint_div();" style="float:left;width:90.6%;height:100%;position:fixed;background:#000;opacity:0.5;display:none;" ></div>
<div id="complaint_add_div_sub" style="float:left;width:50%;height:50%;margin-left:20%;margin-top:5%;position:fixed;background:#ccc;display:none;" >
<textarea type="text" id="complaint_input_details_add" class="complaint_input_details" placeholder="Write here..." ></textarea>
<select type="text" id="complaint_input_bd_name_add" class="complaint_input_building_name" >
<option disabled selected>Select</option>
<?php option_building_name(); ?>
</select>
<input type="text" id="complaint_input_flat_add" class="complaint_input_flat" placeholder="Flat" />
<input type="text" id="complaint_by_input_add" class="complaint_by_input" placeholder="Complaint By" />
<div id="complaint_add_out_done" class="complaint_out_done"></div>
<button onClick="complaint_add_save();" class="complaint_input_save_btn">Enter</button>
</div>
<div id="comp_option_div" onmouseleavek="close_comp_option_div();" class="comp_option_center" style="">
<button onClick="show_edit_complaint_div();" class="comp_option_btn" >Edit</button>
<button onClick="delete_complaint();" class="comp_option_btn" >Delete</button>
<button onClick="close_add_complaint_div();" class="comp_option_btn" >Eixt</button>
</div>
<?php
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'show_complaint_tobe_edited')
{
$complaint_id = $_GET['complaint_id'];
$get_complaint ="select * from complainttb where id='$complaint_id' ";
$run_get_complaint = mysqli_query($con,$get_complaint);
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
?>
<div id="complaint_add_masking_div" onClick="close_add_complaint_div();" style="float:left;width:90.6%;height:100%;position:fixed;background:#000;opacity:0.5;display:none;" ></div>
<div id="complaint_edit_div_sub" style="float:left;width:50%;height:50%;margin-left:20%;margin-top:5%;position:fixed;background:#ccc;display:none;" >
<textarea type="text" id="complaint_input_details_edit" class="complaint_input_details" ><?php echo $complaint_details; ?></textarea>
<select type="text" id="complaint_input_bd_name_edit" class="complaint_input_building_name" >
<option disabled selected><?php echo $complaint_building_name; ?></option>
<?php option_building_name(); ?>
</select>
<input type="text" id="complaint_input_flat_edit" class="complaint_input_flat" value="<?php echo $complaint_flat ;?>" />
<input type="text" id="complaint_by_input_edit" class="complaint_by_input" value="<?php echo $complaint_by; ?>" />
<!--input type="text" id="complaint_by_input_edit" class="complaint_by_input" value="<?php echo $complaint_by; ?>" /--->
<div id="complaint_edit_out_done" class="complaint_out_done"></div>
<button onClick="complaint_edit_save();" class="complaint_input_save_btn">Enter</button>
</div>
<?php
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'sub_display_complaint')
{
?>
<div class="complaint_lebal_middle_comp_by">COMPLAINT BY</div>
<div class="complaint_lebal_middle">COMPLAINT TO</div>
<div class="complaint_lebal">DETAILS</div>
<div class="complaint_lebal_middle">PROPERTY NAME</div>
<div class="complaint_lebal_small">FLAT</div>
<div class="complaint_lebal_small">STATUS</div>
<div class="complaint_lebal_middle">FINISHED BY</div>
<div class="complaint_lebal_small">DATE</div>
<?php
$get_complaint ="select * from complainttb order by id desc";
$run_get_complaint = mysqli_query($con,$get_complaint);
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
$curr_day = $row_get_complaint['curr_day'];
$curr_month = $row_get_complaint['curr_month'];
$curr_year = $row_get_complaint['curr_year'];
$curr_time = $row_get_complaint['curr_time'];
?>
<div class="complaint_single_div">
<div class="complaint_output_middle_comp_by"><?php echo"$complaint_by"; ?></div>
<?php
$disp_maint_emp ="select * from mainttb where employee_cpr='$my_cpr' ";
$run_disp_maint_emp = mysqli_query($con,$disp_maint_emp);
while($row_disp_maint_emp = mysqli_fetch_array($run_disp_maint_emp))
{
$emp_cpr = $row_disp_maint_emp['employee_cpr'];
$permission_status = $row_disp_maint_emp['permission_status'];
if($permission_status =="Full Permission"){
?>
<div ondblclick="add_complaint_to_name(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_middle"><?php echo"$complaint_to"; ?></div>
<?php }else{ ?>
<div ondblclickk="add_complaint_to_name(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_middle"><?php echo"$complaint_to"; ?></div>
<?php } } ?>
<div class="complaint_output"><?php echo"$complaint_details"; ?></div>
<div class="complaint_output_middle"><?php echo"$complaint_building_name"; ?></div>
<div class="complaint_output_small"><?php echo"$complaint_flat"; ?></div>
<?php
$disp_maint_emp ="select * from mainttb where employee_cpr='$my_cpr' ";
$run_disp_maint_emp = mysqli_query($con,$disp_maint_emp);
while($row_disp_maint_emp = mysqli_fetch_array($run_disp_maint_emp))
{
$emp_cpr = $row_disp_maint_emp['employee_cpr'];
$permission_status = $row_disp_maint_emp['permission_status'];
if($permission_status =="Full Permission"){
?>
<div ondblclick="add_complaint_status(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_small"><?php echo"$complaint_status"; ?></div>
<div ondblclick="complaint_done_by(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_middle"><?php echo"$complaint_doneby"; ?></div>
<?php }else{ ?>
<div ondblclickk="add_complaint_status(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_small"><?php echo"$complaint_status"; ?></div>
<div ondblclickk="complaint_done_by(this.id);" id="<?php echo $complaint_id; ?>" class="complaint_output_middle"><?php echo"$complaint_doneby"; ?></div>
<?php } } ?>
<div class="complaint_output_small"><?php echo"$curr_day-$curr_month-$curr_year"; ?></div>
</div>
<?php
}
?>
<div id="edit_carry_div" class="edit_carry_div" >
<button onClick="close_edit_carry_div();" class="close_edit_carry_div" >X</button>
<div id="complaint_to_sub" style="display:none;" >
<input id="complaint_to_name_input" class="complaint_to_name" placeholder="Complaint To" />
<button onClick="complaint_to_save();" class="complaint_to_name_btn" >OK</button>
</div>
<div id="complaint_status_sub" style="display:none;" >
<select id="complaint_status_input" class="complaint_to_name" >
<option selected disabled >Select Complaint Status</option>
<option>Done</option>
<option>Working</option>
<option>Failed</option>
<option>No Action</option>
<option>Replaced New</option>
<option>Replaced Old</option>
</select><button onClick="complaint_status_save();" class="complaint_to_name_btn" >OK</button>
</div>
<div id="complaint_doneby_sub" style="display:none;" >
<input id="compaint_doneby_input" class="complaint_to_name" placeholder="Complaint Done By" />
<button onClick="complaint_doneby_save();" class="complaint_to_name_btn" >OK</button>
</div>
</div>
<?php
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'complaint_to_save')
{
$my_cpr = $_GET['my_cpr'];
$complaint_id = $_GET['complaint_id'];
$complaint_to_name = $_GET['complaint_to_name'];
$update_complaint ="update complainttb set complaint_to='$complaint_to_name',id_edit_comp_to='$my_cpr' where id='$complaint_id'";
$run_update_complaint = mysqli_query($con,$update_complaint);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'complaint_status_save')
{
$my_cpr = $_GET['my_cpr'];
$status_complaint_id = $_GET['status_complaint_id'];
$complaint_status = $_GET['complaint_status'];
$update_complaint ="update complainttb set comp_status='$complaint_status',id_edit_comp_status='$my_cpr' where id='$status_complaint_id'";
$run_update_complaint = mysqli_query($con,$update_complaint);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'complaint_doneby_save')
{
$my_cpr = $_GET['my_cpr'];
$complaint_id = $_GET['complaint_doneby_id'];
$compaint_doneby_name = $_GET['compaint_doneby_input'];
$update_complaint ="update complainttb set comp_finished_by='$compaint_doneby_name',id_edit_comp_done_by='$my_cpr' where id='$complaint_id'";
$run_update_complaint = mysqli_query($con,$update_complaint);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'insert_complaint_add')
{
$my_cpr = $_GET['my_cpr'];
$complaint_details = $_GET['complaint_details'];
$complaint_building_name = $_GET['complaint_building_name'];
$complaint_flat = $_GET['complaint_flat'];
$complaint_by = $_GET['complaint_by'];
$complaint_date_id = $_GET['complaint_date_id'];
if($complaint_details !=="" && $complaint_building_name !=="Select" && $complaint_by !==""){
$get_complaint_dating ="select * from complaint_datingtb where id='$complaint_date_id' ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
while($row_complaint_dating = mysqli_fetch_array($run_get_complaint_dating)){
$edit_curr_day = $row_complaint_dating['curr_day'];
$edit_curr_month = $row_complaint_dating['curr_month'];
$edit_curr_year = $row_complaint_dating['curr_year'];
$save_complaint ="insert into complainttb(my_id,building_name,flat_no,complaint_detail,complaint_by,curr_day,curr_month,curr_year,curr_time)
values('$my_cpr','$complaint_building_name','$complaint_flat','$complaint_details','$complaint_by','$edit_curr_day','$edit_curr_month','$edit_curr_year',CURTIME())";
$run_save_complaint = mysqli_query($con,$save_complaint);
if($run_save_complaint){echo"Your Complaint Saved";
$get_complaint_id ="select * from complainttb where complaint_detail='$complaint_details' AND flat_no='$complaint_flat' ";
$run_get_complaint_id = mysqli_query($con,$get_complaint_id);
while($row_complaint_id = mysqli_fetch_array($run_get_complaint_id))
{
$complaint_id = $row_complaint_id['id'];
$get_member ="select * from mainttb where employee_cpr !='$my_cpr' ";
$run_member = mysqli_query($con,$get_member);
while($row_member = mysqli_fetch_array($run_member))
{
$user_cpr = $row_member['employee_cpr'];
$insert_kvt ="insert into notiftb(complaint_id,user_cpr) values('$complaint_id','$user_cpr')";
$run_not = mysqli_query($con,$insert_kvt);
}
}
}else{echo"Something Went Wrong.";}
}
}else{echo"Fill All The Inputs.";}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'update_complaint_edit')
{
$my_cpr = $_GET['my_cpr'];
$complaint_id = $_GET['complaint_id'];
$complaint_details = $_GET['complaint_details'];
$complaint_building_name = $_GET['complaint_building_name'];
$complaint_flat = $_GET['complaint_flat'];
$complaint_by = $_GET['complaint_by'];
if($complaint_details !=="" && $complaint_building_name !=="Select" && $complaint_by !==""){
//$save_complaint ="insert into complainttb(my_id,building_name,flat_no,complaint_detail,complaint_by,curr_day,curr_month,curr_year,curr_time)";
$update_complaint_edit ="update complainttb set building_name='$complaint_building_name',flat_no='$complaint_flat',complaint_detail='$complaint_details',complaint_by='$complaint_by' where my_id='$my_cpr' AND id='$complaint_id'";
$run_complaint_update = mysqli_query($con,$update_complaint_edit);
}else{echo"Check All The Filds";}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == "delete_complaint")
{
$my_cpr = $_GET['my_cpr'];
$complaint_id = $_GET['complaint_id'];
$del_complaint = "delete from complainttb where my_id='$my_cpr' AND id='$complaint_id'";
$run_del_complaint = mysqli_query($con,$del_complaint);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_printable_data')
{
$get_complaint_dating ="select * from complaint_datingtb ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
while($row_complaint_dating = mysqli_fetch_array($run_get_complaint_dating)){
$compaint_date_id = $row_complaint_dating['id'];
$day_curr = $row_complaint_dating['curr_day'];
$month_curr = $row_complaint_dating['curr_month'];
$year_curr = $row_complaint_dating['curr_year'];
?>
<div style="float:left;width:970px;line-height:40px;background:#BB83B1;margin-bottomk:5px;font-weight:bold;text-align:center;" >
<div style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-right:1px solid #000;border-top:1px solid #000;font-size:0.8em;colork:blue;">COMPLAINT BY</div>
<div style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;colork:blue;">COMPLAINT TO</div>
<div classk="complaint_lebal" style="float:left;width:228px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">DETAILS </div>
<div classk="complaint_lebal_middle" style="float:left;width:115px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >PROPERTY NAME</div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">FLAT</div>
<div classk="complaint_lebal_small" style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >STATUS</div>
<div classk="complaint_lebal_middle" style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">FINISHED BY</div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >DATE</div>
</div>
<?php
$get_complaint ="select * from complainttb where curr_day='$day_curr' AND curr_month='$month_curr' AND curr_year='$year_curr' order by id desc ";
$run_get_complaint = mysqli_query($con,$get_complaint);
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
$curr_day = $row_get_complaint['curr_day'];
$curr_month = $row_get_complaint['curr_month'];
$curr_year = $row_get_complaint['curr_year'];
$curr_time = $row_get_complaint['curr_time'];
?>
<div style="float:left;width:970px;line-height:40px;background:#BB83B1;borderk:1px solid #000;text-align:center;" >
<div style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_by"; ?></div>
<div style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-right:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_to"; ?></div>
<div classk="complaint_lebal" style="float:left;width:228px;min-height:40px;height:auto;line-height:20px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_details"; ?></div>
<div classk="complaint_lebal_middle" style="float:left;width:115px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"$complaint_building_name"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"$complaint_flat"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_status"; ?></div>
<div classk="complaint_lebal_middle" style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_doneby"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;line-height:20px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"<div style='height:20px;backgroundk:orange;'>$curr_day-$curr_month-$curr_year</div><div style='height:20px;font-size:0.9em;color:blue;backgroundk:green;'>$curr_time</div>"; ?></div>
</div>
<?php } } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_printable_data_single')
{
$print_date_id = $_GET['print_date_id'];
$get_complaint_dating ="select * from complaint_datingtb where id='$print_date_id' ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
while($row_complaint_dating = mysqli_fetch_array($run_get_complaint_dating)){
$compaint_date_id = $row_complaint_dating['id'];
$day_curr = $row_complaint_dating['curr_day'];
$month_curr = $row_complaint_dating['curr_month'];
$year_curr = $row_complaint_dating['curr_year'];
?>
<div style="float:left;width:970px;line-height:40px;background:#BB83B1;margin-bottomk:5px;font-weight:bold;text-align:center;" >
<div style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-right:1px solid #000;border-top:1px solid #000;font-size:0.8em;colork:blue;">COMPLAINT BY</div>
<div style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;colork:blue;">COMPLAINT TO</div>
<div classk="complaint_lebal" style="float:left;width:228px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">DETAILS </div>
<div classk="complaint_lebal_middle" style="float:left;width:115px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >PROPERTY NAME</div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">FLAT</div>
<div classk="complaint_lebal_small" style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >STATUS</div>
<div classk="complaint_lebal_middle" style="float:left;width:105px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;">FINISHED BY</div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#ccc;border:1px solid #000;border-top:1px solid #000;font-size:0.8em;" >DATE</div>
</div>
<?php
$get_complaint ="select * from complainttb where curr_day='$day_curr' AND curr_month='$month_curr' AND curr_year='$year_curr' order by id desc ";
$run_get_complaint = mysqli_query($con,$get_complaint);
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
$curr_day = $row_get_complaint['curr_day'];
$curr_month = $row_get_complaint['curr_month'];
$curr_year = $row_get_complaint['curr_year'];
$curr_time = $row_get_complaint['curr_time'];
?>
<div style="float:left;width:970px;line-height:40px;background:#BB83B1;borderk:1px solid #000;text-align:center;" >
<div style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_by"; ?></div>
<div style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-right:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_to"; ?></div>
<div classk="complaint_lebal" style="float:left;width:228px;min-height:40px;height:auto;line-height:20px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_details"; ?></div>
<div classk="complaint_lebal_middle" style="float:left;width:115px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"$complaint_building_name"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"$complaint_flat"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_status"; ?></div>
<div classk="complaint_lebal_middle" style="float:left;width:105px;height:40px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;"><?php echo"$complaint_doneby"; ?></div>
<div classk="complaint_lebal_small" style="float:left;width:95px;height:40px;line-height:20px;background:#fff;border:1px solid #000;border-rightk:1px solid #000;border-topk:1px solid #000;" ><?php echo"<div style='height:20px;backgroundk:orange;'>$curr_day-$curr_month-$curr_year</div><div style='height:20px;font-size:0.9em;color:blue;backgroundk:green;'>$curr_time</div>"; ?></div>
</div>
<?php } } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status == 'display_complaint_search')
{
?>
<div style="float:left;min-widthk:1400px;width:100%;height:40px;background:#BB83B1;">
<div classk="complaint_lebal_middle_comp_by" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-left:0.5%;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center; ">COMPLAINT BY</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >COMPLAINT TO</div>
<div classk="complaint_lebal" style="float:left;min-width:163px;width:22.48%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center; ">DETAILS</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >PROPERTY NAME</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;widthK:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >FLAT</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >STATUS</div>
<div classk="complaint_lebal_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;">FINISHED BY</div>
<div classk="complaint_lebal_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#ccc;font-size:1em;font-weight:bold;text-align:center;" >DATE</div>
</div>
<?php
$search_property_name = $_GET['search_property_name'];
$search_flat = $_GET['search_flat'];
$search_status = $_GET['search_status'];
$search_complaint_by = $_GET['search_complaint_by'];
$search_complaint_to = $_GET['search_complaint_to'];
$search_complaint_detail = $_GET['search_complaint_detail'];
$get_complaint_dating ="select * from complaint_datingtb ";
$run_get_complaint_dating = mysqli_query($con,$get_complaint_dating);
while($row_complaint_dating = mysqli_fetch_array($run_get_complaint_dating)){
$compaint_date_id = $row_complaint_dating['id'];
$day_curr = $row_complaint_dating['curr_day'];
$month_curr = $row_complaint_dating['curr_month'];
$year_curr = $row_complaint_dating['curr_year'];
$get_complaint ="select * from complainttb where building_name LIKE '$search_property_name%' AND flat_no LIKE '%$search_flat%' AND comp_status LIKE '$search_status%' AND complaint_by LIKE '%$search_complaint_by%' AND complaint_to LIKE '%$search_complaint_to%' AND complaint_detail LIKE '%$search_complaint_detail%' AND curr_day='$day_curr' AND curr_month='$month_curr' AND curr_year='$year_curr' order by id desc ";
$run_get_complaint = mysqli_query($con,$get_complaint);
//$check_comp_search = mysqli_num_rows($run_get_complaint);
//if($check_comp_search <1){echo"<div style='float:left;width:100%;margin-bottom:5px;border-bottom:1px solid #ccc;background:#BB83B1;'>No Search Results found</div>";}else{
while($row_get_complaint = mysqli_fetch_array($run_get_complaint))
{
$complaint_id = $row_get_complaint['id'];
$complaint_details = $row_get_complaint['complaint_detail'];
$complaint_building_name = $row_get_complaint['building_name'];
$complaint_flat = $row_get_complaint['flat_no'];
$complaint_by = $row_get_complaint['complaint_by'];
$complaint_to = $row_get_complaint['complaint_to'];
$complaint_status = $row_get_complaint['comp_status'];
$complaint_doneby = $row_get_complaint['comp_finished_by'];
$curr_day = $row_get_complaint['curr_day'];
$curr_month = $row_get_complaint['curr_month'];
$curr_year = $row_get_complaint['curr_year'];
$curr_time = $row_get_complaint['curr_time'];
?>
<div classk="complaint_single_div" style="float:left;width:100%;margin-bottom:5px;border-bottom:1px solid #ccc;background:#BB83B1;">
<div classk="complaint_output_middle_comp_by" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-left:0.5%;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_by"; ?></div>
<div ondblclick="add_complaint_to_name(this.id);" id="<?php echo $complaint_id; ?>" classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_to"; ?></div>
<div classk="complaint_output" style="float:left;width:22.48%;widthk:280px;min-height:40px;height:auto;line-height:20px;margin-right:1px;background:#fff;font-size:1em;text-align:center;word-wrap:break-word;color:#5D5A5A;font-size:1.1em;"><?php echo"$complaint_details"; ?></div>
<div classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_building_name"; ?></div>
<div classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$complaint_flat"; ?></div>
<div ondblclick="add_complaint_status(this.id);" id="<?php echo $complaint_id; ?>" classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$complaint_status"; ?></div>
<div ondblclick="complaint_done_by();" classk="complaint_output_middle" style="float:left;min-width:163px;width:11%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center; "><?php echo"$complaint_doneby"; ?></div>
<div classk="complaint_output_small" style="float:left;min-width:140px;width:9%;height:40px;line-height:40px;margin-right:1px;background:#fff;font-size:1em;text-align:center;" ><?php echo"$curr_day-$curr_month-$curr_year| <span style='font-size:0.9em;color:blue;'>$curr_time</span>"; ?></div>
</div>
<?php
//}
}
?>
<!--div id="complaint_edit_masking_div" onClick="close_edit_complaint_main();" style="float:left;width:90.6%;height:100%;position:fixed;background:#000;opacity:0.5;display:none;" ></div>
<div id="complaint_edit_div_sub" style="float:left;width:50%;height:50%;margin-left:20%;margin-top:5%;position:fixed;background:#ccc;display:none;" >
<textarea type="text" id="complaint_input_details_edit" class="complaint_input_details" placeholder="Write here..." ></textarea>
<select type="text" id="complaint_input_bd_name_edit" class="complaint_input_building_name" >
<option disabled selected>Select</option>
<?php //option_building_name(); ?>
</select>
<input type="text" id="complaint_input_flat_edit" class="complaint_input_flat" placeholder="Flat" />
<input type="text" id="complaint_by_input_edit" class="complaint_by_input" placeholder="Complaint By" />
<div id="complaint_edit_out_done" class="complaint_out_done"></div>
<button onClick="complaint_edit_save();" class="complaint_input_save_btn">Enter</button>
</div-->
<?php
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='print_purchase_list')
{
?>
<div class="recept_list_label_div_print" >
<div class="recept_label_small_print" >INV NO</div>
<div class="recept_label_big_print" style="width:120px;" >BUILDING</div>
<div class="recept_label_small_print" style="width:50px;" >FLAT</div>
<div class="recept_label_big_print" style="width:154px;" >PRODUCT</div>
<div class="recept_label_small_print" style="width:70px;" >QTY </div>
<div class="recept_label_small_print" style="width:120px;" >SHOP</div>
<div class="recept_label_small_print" style="width:50px;" >PRICE </div>
<div class="recept_label_small_print" >ORDER BY </div>
<div class="recept_label_small_print" >PICKED BY</div>
<div class="recept_label_small_print" style="display:none;" >SERVED BY</div>
<div class="recept_label_small_print" >DATE </div>
</div>
<?php
$get_purchased_product ="select * from purchased_producttb";
$run_purchased_product = mysqli_query($con,$get_purchased_product);
while($row_purchased_product = mysqli_fetch_array($run_purchased_product))
{
$invoice_no= $row_purchased_product['invoice_no'];
$served_by_id= $row_purchased_product['user_id'];
$bd_name = $row_purchased_product['building_name'];
$flat_no = $row_purchased_product['flat_no'];
$product_name = $row_purchased_product['product_name'];
$product_qty = $row_purchased_product['product_qty'];
$shop_per_iterm = $row_purchased_product['shop_iterm'];
$total_price = $row_purchased_product['total_price'];
$order_by_id = $row_purchased_product['order_by_id'];
$picked_by = $row_purchased_product['picked_by'];
$curr_date = $row_purchased_product['curr_date'];
$curr_month = $row_purchased_product['curr_month'];
$curr_year = $row_purchased_product['curr_year'];
$curr_time = $row_purchased_product['curr_time'];
?>
<div class="recept_out_div_print" >
<div class="recept_list_small_print" style="line-height:40px;" ><?php echo"$invoice_no"; ?> </div>
<div class="recept_list_big_print" style="width:120px;height:40px;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow: hidden;" ><?php echo"$bd_name"; ?> </div>
<div class="recept_list_small_print" style="width:50px;line-height:40px;" ><?php echo"$flat_no"; ?></div>
<div class="recept_list_big_print" style="width:154px;" ><?php echo"$product_name"; ?></div>
<div class="recept_list_small_print" style="width:70px;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow: hidden;" ><?php echo"$product_qty"; ?></div>
<div class="recept_list_small_print" style="width:120px;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" ><?php echo"$shop_per_iterm"; ?></div>
<div class="recept_list_small_print" style="width:50px;line-height:40px;color:green;" ><?php echo"$total_price"; ?></div>
<div class="recept_list_small_print" style="display:none;" >
<?php
$in_user ="select * from khalaf_usertb where id='$order_by_id'";
$run_in_user = mysqli_query($con,$in_user);
while($row_user_new_oreder = mysqli_fetch_array($run_in_user)){
$user_fname = $row_user_new_oreder['first_name'];
echo"$user_fname";
}
?></div>
<div class="recept_list_small_print" >
<?php
$in_user ="select * from khalaf_usertb where id='$served_by_id'";
$run_in_user = mysqli_query($con,$in_user);
while($row_user_new_oreder = mysqli_fetch_array($run_in_user)){
$user_fname = $row_user_new_oreder['first_name'];
echo"$user_fname";
}
?></div>
<div class="recept_list_small_print" style="width:84px;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow: hidden;" ><?php echo"$picked_by"; ?></div>
<div class="recept_list_small_print" style="" ><?php echo"<span style='float:left;heightk:20px;font-size:0.9em;'>$curr_date - $curr_month - $curr_year</span><br/>"; echo"<span style='float:right;height:20px;font-size:14px;color:blue;backgroundk:green;font-weight:bold;'>$curr_time</span>"; ?></div>
<!--div class="recept_list_out_put_big" ><?php //echo"$order_id"; ?></div-->
</div>
<?php } ?>
<style>
.recept_list_label_div_print
{
float:left;width:920px;height:auto;margin-leftk:0.4%;background:#5580A5;backgroundk:green;color:#000;font-size:0.9em;font-weight:bold;text-align:center;
}
.recept_label_small_print
{
float:left;width:84px;min-height:40px;height:auto;line-height:40px;background:#ccc;border:1px solid #000;
}
.recept_label_big_print
{
float:left;width:84px;min-height:40px;height:auto;line-height:40px;background:#ccc;border:1px solid #000;
}
.recept_out_div_print
{
float:left;width:920px;height:auto;margin-leftk:0.4%;backgroundk:#5580A5;background:green;colork:#fff;font-size:1em;font-weightk:bold;text-align:center;border-bottomk:1px solid #000;
}
.recept_list_small_print
{
float:left;width:84px;min-height:40px;height:auto;line-heightk:40px;background:#fff;text-align:center;border-right:1px solid #ccc;border:1px solid #000;
}
.recept_list_big_print
{
float:left;width:84px;min-height:40px;height:auto;line-heightk:40px;background:#fff;border-right:1px solid #ccc;border:1px solid #000;
}
</style>
<?php
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_all_comp')
{
$get_calender = "select * from graph_calendartb order by id desc";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
?>
<div class="graph_info_title" style="" ><?php echo $shop_name; ?> Expenditure.</div>
<div id="graph_text_info_head_div" class="graph_text_info_head_div" >
<div class="graph_building_lebal">PROPERTY NAME</div>
<div class="graph_amount_lebal">AMOUNT BD</div>
<div class="graph_percent_lebal">PERCENTAGE</div>
<div class="graph_date4m_lebal">DATE
<button name="<?php echo"$calender_id"; ?>" onmousedown="close_all();" onClick="show_graph_option_btn(this.name)" class="graph_more_option_btn" >...</button>
<div id="graph_more_option_div<?php echo"$calender_id"; ?>" onmouseleave="close_graph_more_option_div();" class="graph_more_option_div" style="display:none;" >
<button id="show_graph_diagram_btn" name="<?php echo"$status_code"; ?>" onClick="show_graph_diagram(this.name)" class="datagraph_btn">Graph</button>
<button onClick="print_text_graph_dat(this.name);" name="<?php echo"$calender_id"; ?>" class="datagraph_btn">Print</button>
<a href="extraction.php?status_code=<?php echo"$status_code"; ?>" ><button class="datagraph_btn">add</button></a>
</div>
</div>
</div>
<?php
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' ";//trans_start_date='$start_date' AND trans_end_date='$end_date'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
?>
<div id="graph_text_info_div" class="graph_text_info_div" >
<div class="graph_building_out"><?php echo"$propert_name"; ?></div>
<div class="graph_amount_out"><?php echo"$propert_amount"; ?></div>
<div class="graph_percent_out"><?php echo"$amount_percentage%"; ?></div>
<div class="graph_date4m_out"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<?php } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_single_comp')
{
$property_owner = $_GET['property_owner'];
?>
<input type="text" id="owner_helping_comp" value="<?php echo $property_owner ?>" style="display:none;"/>
<?php
$get_calender = "select * from graph_calendartb order by id desc ";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
$disp_graph_info_check = "select * from graph_datatb where status_code='$status_code' AND property_ower='$property_owner' ";
$run_disp_graph_info_check = mysqli_query($con,$disp_graph_info_check);
$check_disp_graph_info = mysqli_num_rows($run_disp_graph_info_check);
if($check_disp_graph_info >0){
?>
<div class="graph_info_title" style="" ><?php echo $shop_name; ?> Expenditure.</div>
<div id="graph_text_info_head_div" class="graph_text_info_head_div" >
<div class="graph_building_lebal">PROPERTY NAME</div>
<div class="graph_amount_lebal">AMOUNT BD</div>
<div class="graph_percent_lebal">PERCENTAGE</div>
<div class="graph_date4m_lebal">DATE
<button id="graph_more_option_btn_comp<?php echo"$calender_id"; ?>" name="<?php echo"$calender_id"; ?>" onClick="show_graph_option_btn_comp(this.name)" class="graph_more_option_btn" >..o</button>
<div id="graph_more_option_div_comp<?php echo"$calender_id"; ?>" onmouseleave="close_graph_more_option_div_comp();" class="graph_more_option_div" style="display:none;" >
<!--button id="show_graph_diagram_btn" name="<?php echo"$status_code"; ?>" onClickk="show_graph_diagram(this.name)" class="datagraph_btn">Graphs</button-->
<button onClick="print_text_graph_dat_comp(this.name);" name="<?php echo"$calender_id"; ?>" class="datagraph_btn">Print</button>
<!--a href="extraction.php?status_code=<?php echo"$status_code"; ?>" ><button class="datagraph_btn">add</button></a-->
</div>
</div>
</div>
<?php
$sum=0;
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_ower='$property_owner'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
$sum += $row_disp_graph_info['amount'];
?>
<div id="graph_text_info_div" class="graph_text_info_div" >
<div class="graph_building_out"><?php echo"$propert_name"; ?></div>
<div class="graph_amount_out"><?php echo"$propert_amount"; ?></div>
<div class="graph_percent_out"><?php echo"$amount_percentage%"; ?></div>
<div class="graph_date4m_out"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<!--/div><!--end of print_text_graph_data -->
<?php } ?>
<div style="float:left;width:60%;height:30px;line-height:30px;margin-left:15%;color:#E81C88;font-weight:bold;text-align:center;" >Total: <?php echo $sum; ?> BD</div>
<?php } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='disp_single_comp_print')
{
$property_owner = $_GET['owner_helping_comp'];
$get_calender = "select * from graph_calendartb ";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
$disp_graph_info_check = "select * from graph_datatb where status_code='$status_code' AND property_ower='$property_owner' ";
$run_disp_graph_info_check = mysqli_query($con,$disp_graph_info_check);
$check_disp_graph_info = mysqli_num_rows($run_disp_graph_info_check);
if($check_disp_graph_info >0){
?>
<div id="display_single_comp_print<?php echo $calender_id; ?>" >
<div class="graph_info_title_print" style="" ><?php echo $shop_name; ?> Expenditure.</div>
<div id="graph_text_info_head_div" class="graph_text_info_head_div_print" >
<div class="graph_building_lebal">PROPERTY NAME</div>
<div class="graph_amount_lebal">AMOUNT BD</div>
<div class="graph_percent_lebal">PERCENTAGE</div>
<div class="graph_date4m_lebal">DATE
<!--button id="graph_more_option_btn_comp<?php echo"$calender_id"; ?>" name="<?php echo"$calender_id"; ?>" onClick="show_graph_option_btn_comp(this.name)" class="graph_more_option_btn" >..o</button>
<div id="graph_more_option_div_comp<?php echo"$calender_id"; ?>" onmouseleave="close_graph_more_option_div_comp();" class="graph_more_option_div" style="display:none;" >
<!--button id="show_graph_diagram_btn" name="<?php echo"$status_code"; ?>" onClickk="show_graph_diagram(this.name)" class="datagraph_btn">Graphs</button-->
<!--button onClick="print_text_graph_dat_comp(this.name);" name="<?php echo"$calender_id"; ?>" class="datagraph_btn">Print</button>
<!--a href="extraction.php?status_code=<?php echo"$status_code"; ?>" ><button class="datagraph_btn">add</button></a-->
<!--/div-->
</div>
</div>
<style>
.graph_info_title_print
{
float:left;min-width:1000px;width:69.84%;height:30px;line-height:30px;margin-left:0%;text-align:center;color:#952811;font-weight:bold;font-size:1.1em;background:#ccc;positionk:fixed;
margin-top:10px;border-top: 1px solid gray;border-left: 1px solid gray;border-right: 1px solid gray;
}
.graph_text_info_head_div_print
{
float:left;min-width:1000px;width:70%;height:40px;margin-left:0%;margin-topk:60px;background:white;
}
.graph_building_lebal
{
float:left;width:30%;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;text-align:center;font-weight:bold;
}
.graph_amount_lebal
{
float:left;width:20%;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;text-align:center;font-weight:bold;
}
.graph_percent_lebal
{
float:left;width:20%;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;text-align:center;font-weight:bold;
}
.graph_date4m_lebal
{
float:left;width:29.2%;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;text-align:center;font-weight:bold;
}
.graph_text_info_div_print
{
float:left;min-width:1000px;width:70%;height:auto;margin-left:0%;margin-topk:2px;background:#fff;font-size:1.2em;
}
.graph_building_out
{
float:left;width:30%;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
}
.graph_amount_out
{
float:left;width:20%;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
}
.graph_percent_out
{
float:left;width:20%;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
}
.graph_date4m_out
{
float:left;width:29.2%;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
}
</style>
<?php
$sum = 0;
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_ower='$property_owner'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
$sum += $row_disp_graph_info['amount'];
?>
<div id="graph_text_info_div" class="graph_text_info_div_print" >
<div class="graph_building_out"><?php echo"$propert_name"; ?></div>
<div class="graph_amount_out"><?php echo"$propert_amount"; ?></div>
<div class="graph_percent_out"><?php echo"$amount_percentage%"; ?></div>
<div class="graph_date4m_out"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<!--/div><!--end of print_text_graph_data -->
<?php } ?>
<div style="float:left;width:60%;height:30px;line-height:30px;margin-left:15%;color:#E81C88;font-weight:bold;text-align:center;" >Total: <?php echo $sum; ?> BD</div>
</div><!-- end of display_single_comp_print -->
<?php } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_single_bd_expen_search_result')
{
$ongoing_search = $_GET['ongoing_search'];
$start_search_date = $_GET['start_search_date'];
$get_calender = "select * from graph_calendartb ";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
if($ongoing_search !=="" AND $start_search_date =="Select day-Select month-Select year"){
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%'";
}else{
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%' ";
}
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
$check_disp_graph_info = mysqli_num_rows($run_disp_graph_info);
if($check_disp_graph_info > 0){
?>
<div class="graph_info_title" style="" ><?php echo $shop_name; ?> Expense Search Results.</div>
<div id="graph_text_info_head_div" class="graph_text_info_head_div" >
<div class="graph_building_lebal">PROPERTY NAME</div>
<div class="graph_amount_lebal">AMOUNT BD</div>
<div class="graph_percent_lebal">PERCENTAGE</div>
<div class="graph_date4m_lebal">DATE
<button name="<?php echo"$calender_id"; ?>" onmousedown="close_all();" onClick="show_graph_option_onsearch(this.name)" class="graph_more_option_btn" >...</button>
<div id="graph_more_option_search_div<?php echo"$calender_id"; ?>" onmouseleave="close_graph_option_onsearch();" class="graph_more_option_div" style="display:none;" >
<button id="show_graph_diagram_btn" name="<?php echo"$status_code"; ?>" onClick="show_graph_diagram(this.name)" class="datagraph_btn">Graph</button>
<button onClick="print_text_graph_dat_search(this.name);" name="<?php echo"$calender_id"; ?>" class="datagraph_btn">Print</button>
<!--a href="extraction.php?status_code=<?php //echo"$status_code"; ?>" ><button class="datagraph_btn">add</button></a-->
</div>
</div>
</div>
<?php
//$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%'";
if($ongoing_search !=="" AND $start_search_date =="Select day-Select month-Select year"){
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%'";
}else{
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%' ";
}
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
?>
<div id="graph_text_info_div" class="graph_text_info_div" >
<div class="graph_building_out"><?php echo"$propert_name"; ?></div>
<div class="graph_amount_out"><?php echo"$propert_amount"; ?></div>
<div class="graph_percent_out"><?php echo"$amount_percentage%"; ?></div>
<div class="graph_date4m_out"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<?php } } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='print_single_bd_expen_arabic')
{
?>
<!--div id="print_single_bd_expen_arabic" style="float:left;displayk:none;" >
<!--div id="helping_graph_div" class="helping_graph_div" >
<button onClick="close_graph_div()" class="close_graph_btn">X</button>
<button id="show_graph_diagram_btn" onClick="show_graph_shops_div2();" class="datagraph_btn_two">Back</button>
<button id="show_graph_text_btn" onClick="show_graph_text()" class="datagraph_btn_two" style="display:none;">Data</button>
</div-->
<?php
$lang_output="";
$lang_output2="";
$calender_id = $_GET['calender_id'];
$get_calender = "select * from graph_calendartb where id='$calender_id' ";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
$get_lang ="select * from lang_transtb where english ='$shop_name'";
$run_lang = mysqli_query($con,$get_lang);
while($row_lang = mysqli_fetch_array($run_lang))
{
$lang_output = $row_lang['arabic'];
$lang_output2 = $row_lang['english'];
}
?>
<div id="print_text_graph_data<?php echo $calender_id; ?>" style="float:left;" >
<?php
if($shop_name == $lang_output2){?>
<div style="float:left;width:948px;height:30px;line-height:30px;text-align:center;color:#952811;font-weight:bold;font-size:1.3em;background:#ccc;margin-top:10px;border-top: 1px solid gray;border-left: 1px solid gray;border-right: 1px solid gray;" ><?php echo $lang_output; ?> المصروفات <!--Expenditure.--></div>
<?php }else{ ?>
<div style="float:left;width:948px;height:30px;line-height:30px;text-align:center;color:#952811;font-weight:bold;font-size:1.3em;background:#ccc;margin-top:10px;border-top: 1px solid gray;border-left: 1px solid gray;border-right: 1px solid gray;" ><?php echo $shop_name; ?> المصروفات <!--Expenditure.--></div>
<?php } ?>
<div id="graph_text_info_head_div" style="float:left;width:950px;height:40px;margin-topk:60px;background:red;" >
<div style="float:left;width:245px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><!--PROPERTY NAME--><?php lang_trans_property_name(); ?></div>
<div style="float:left;width:237px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><!--AMOUNT BD--><?php lang_trans_amount(); ?></div>
<div style="float:left;width:230px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><!--PERCENTAGE--><?php lang_trans_percentge(); ?></div>
<div style="float:left;width:230px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><!--DATE--><?php lang_trans_date(); ?></div>
<script>
function print_text_graph_dat(ptgd)
{
restore_page = document.body.innerHTML;
sub_printible_graph_text = 'print_text_graph_data'+ptgd;
printible_graph_text = document.getElementById(sub_printible_graph_text).innerHTML;
document.body.innerHTML = printible_graph_text;
window.print();
document.body.innerHTML = restore_page;
//alert('print_text_graph_data');
}
</script>
</div>
<?php
$lang_output="";
$lang_output2="";
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' ";//trans_start_date='$start_date' AND trans_end_date='$end_date'";
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
$get_lang ="select * from lang_transtb where english ='$propert_name'";
$run_lang = mysqli_query($con,$get_lang);
?>
<div id="graph_text_info_div" style="float:left;width:950px;height:auto;margin-topk:2px;background:#fff;" >
<?php
while($row_lang = mysqli_fetch_array($run_lang))
{
$lang_output = $row_lang['arabic'];
$lang_output2 = $row_lang['english'];
}
if($propert_name == $lang_output2){
?>
<div style="float:left;width:245px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"$lang_output"; ?></div>
<?php }else{ ?>
<div style="float:left;width:245px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"$propert_name"; ?></div>
<?php } ?>
<div style="float:left;width:237px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; "><?php echo"$propert_amount"; ?></div>
<div style="float:left;width:230px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"$amount_percentage"; ?></div>
<div style="float:left;width:230px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<?php } ?>
</div><!--end of print_text_graph_data -->
<?php } ?>
<!--/div><!-- end of print_detailed_expenditure_div-->
<?php
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='print_single_bd_expen_search_result')
{
$calender_id = $_GET['calender_id'];
$ongoing_search = $_GET['ongoing_search'];
$start_search_date = $_GET['start_search_date'];
$get_calender = "select * from graph_calendartb where id='$calender_id'";
$run_get_calender = mysqli_query($con,$get_calender);
while($row_calender = mysqli_fetch_array($run_get_calender)){
$calender_id = $row_calender['id'];
$start_date = $row_calender['start_date'];
$shop_name = $row_calender['shop_name'];
$status_code = $row_calender['status_code'];
$final_amount = $row_calender['total_amount'];
if($ongoing_search !=="" AND $start_search_date =="Select day-Select month-Select year"){
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%'";
}else{
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%' ";
}
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
$check_disp_graph_info = mysqli_num_rows($run_disp_graph_info);
if($check_disp_graph_info > 0){
?>
<div style="float:left;width:948px;height:30px;line-height:30px;text-align:center;color:#952811;font-weight:bold;font-size:1.3em;background:#ccc;margin-top:10px;border-top: 1px solid gray;border-left: 1px solid gray;border-right: 1px solid gray;" ><?php echo $shop_name; ?> Expense Search Results.</div>
<div id="graph_text_info_head_div" style="float:left;width:950px;height:40px;margin-topk:60px;background:red;" >
<div style="float:left;width:245px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><span id="english_lang3">PROPERTY NAME</span> <!--span id="arabic_lang3"> <?php lang_trans_property_name(); ?></span--></div>
<div style="float:left;width:237px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><span id="english_lang4">AMOUNT BD</span> <!--span id="arabic_lang4"><?php lang_trans_amount(); ?></span!--></div>
<div style="float:left;width:230px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;"><span id="english_lang5">PERCENTAGE</span> <!--span id="arabic_lang5"><?php lang_trans_percentge(); ?></span!--></div>
<div style="float:left;width:230px;height:40px;line-height:40px;margin-leftk:5px;margin-bottomk:5px;background:#ccc;colork:white;border:1px solid gray;font-size:1.2em;text-align:center;font-weight:bold;">DATE</div>
</div>
<?php
//$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%'";
if($ongoing_search !=="" AND $start_search_date =="Select day-Select month-Select year"){
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%'";
}else{
$disp_graph_info = "select * from graph_datatb where status_code='$status_code' AND property_name LIKE '$ongoing_search%' AND trans_start_date LIKE '$start_search_date%' ";
}
$run_disp_graph_info = mysqli_query($con,$disp_graph_info);
while($row_disp_graph_info = mysqli_fetch_array($run_disp_graph_info))
{
$propert_name = $row_disp_graph_info['property_name'];
$propert_amount = $row_disp_graph_info['amount'];
$trans_start_date = $row_disp_graph_info['trans_start_date'];
$trans_end_date = $row_disp_graph_info['trans_end_date'];
$my_percentage = 100;
$amount_percentage = number_format($propert_amount / $final_amount * $my_percentage,1,'.','');
?>
<div id="graph_text_info_div" style="float:left;width:950px;height:auto;margin-topk:2px;background:#fff;" >
<div style="float:left;width:245px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"$propert_name"; ?></div>
<div style="float:left;width:237px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; "><?php echo"$propert_amount"; ?></div>
<div style="float:left;width:230px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"$amount_percentage"; ?></div>
<div style="float:left;width:230px;height:30px;line-height:30px;margin-leftk:5px;margin-bottomk:5px;background:#fff;colork:white;border:1px solid gray;text-align:center;font-size:1.2em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo"<span style='color:green'>$trans_start_date </span>/<span style='color:red'> $trans_end_date </span>"; ?></div>
</div><!-- end of graph_text_info_div-->
<?php } } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =='display_main_expenditure_search_result')
{
$ongoing_search = $_GET['ongoing_search'];
$start_search_date = $_GET['start_search_date'];
if($ongoing_search !=="" AND $start_search_date =="Select day-Select month-Select year"){
$get_shop_name = "select * from expendituretb where shop_name LIKE '$ongoing_search%' order by id desc ";
}else{
$get_shop_name = "select * from expendituretb where shop_name LIKE '$ongoing_search%' AND start_date LIKE '$start_search_date%' ";
}
//$get_shop_name = "select * from expendituretb where shop_name LIKE '$ongoing_search%' order by id desc ";
$run_get_expenditure = mysqli_query($con,$get_shop_name);
while($row_get_expenditure = mysqli_fetch_array($run_get_expenditure))
{
$name_shop = $row_get_expenditure['shop_name'];
$spent_amount = $row_get_expenditure['amount'];
$start_date= $row_get_expenditure['start_date'];
$end_date= $row_get_expenditure['end_date'];
?>
<div class="main_expend_out_div" >
<div class="shop_exp_to_name_output"><?php echo $name_shop ?></div>
<div class="shop_exp_to_amount_output"><?php echo $spent_amount ?></div>
<div class="shop_exp_to_date_output"><?php echo"<span style='color:green'>$start_date </span> / <span style='color:red'>$end_date</span>"; ?></div>
</div>
<?php }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>