MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/inventory/action/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/inventory/action/delete.php
<?php
session_start();
 include'../include/db.php'; 

// $uid = $_SESSION["userId"];

	 date_default_timezone_set('Asia/Kolkata');
 $cudate = date("Y-m-d") ;

extract($_POST);

$id = $_GET['id'];
$table = $_GET['table'];

if($table == 'brand')
{
	$sql = "delete from tbl_brand  where id='$id'";
    $result = mysqli_query($con, $sql) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;

								$_SESSION['flash_message'] = 'bdelete';

								 echo "<script>;
					                window.location.href='../brand_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../brand_list.php';
				                </script>";
							}
}
elseif ($table == 'manufacturer') {
	# code...
    $sqls = "delete from tbl_manufacturer  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 $_SESSION['flash_message'] = 'mdelete';

								 echo "<script>;
					                window.location.href='../manufacturer_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../manufacturer_list.php';
				                </script>";
							}
}
elseif ($table == 'pur_account') {
	# code...
    $sqls = "delete from tbl_pur_acc  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'pdelete';

								 echo "<script>;
					                window.location.href='../pur_account_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../pur_account_list.php';
				                </script>";
							}
}
elseif ($table == 'price') {
	# code...
    $sqls = "delete from tbl_price_list  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'pridelete';

								 echo "<script>;
					                window.location.href='../all_price_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../all_price_list.php';
				                </script>";
							}
}
elseif ($table == 'salespersons') {
	# code...
    $sqls = "delete from tbl_saleperson  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'sdelete';

								 echo "<script>;
					                window.location.href='../saleperson_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../saleperson_list.php';
				                </script>";
							}
}
elseif ($table == 'expense') {
	# code...
    $sqls = "delete from tbl_expense  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'exdelete';

								 echo "<script>;
					                window.location.href='../expense_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../expense_list.php';
				                </script>";
							}
}
elseif ($table == 'owner') {
	# code...
    $sqls = "delete from tbl_admin  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'odelete';

								 echo "<script>;
					                window.location.href='../owner_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../owner_list.php';
				                </script>";
							}
}
elseif ($table == 'project') {
	# code...
    $sqls = "delete from tbl_project  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'prodelete';

								 echo "<script>;
					                window.location.href='../project_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../project_list.php';
				                </script>";
							}
}
elseif ($table == 'task') {
	# code...
    $sqls = "delete from tbl_task  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'tdelete';

								 echo "<script>;
					                window.location.href='../tasklist.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../tasklist.php';
				                </script>";
							}
}
elseif ($table == 'emp') {
	# code...
    $sqls = "delete from tbl_emp  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'tdelete';

								 echo "<script>;
					                window.location.href='../emp_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../emp_list.php';
				                </script>";
							}
}
elseif ($table == 'depart') {
	# code...
    $sqls = "delete from tbl_departmrnt  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'bdelete';

								 echo "<script>;
					                window.location.href='../depart_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../depart_list.php';
				                </script>";
							}
}

elseif ($table == 'desig') {
	# code...
    $sqls = "delete from tbl_desig  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'bdelete';

								 echo "<script>;
					                window.location.href='../designation_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../designation_list.php';
				                </script>";
							}
}

elseif ($table == 'workloc') {
	# code...
    $sqls = "delete from tbl_work_loc  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'bdelete';

								 echo "<script>;
					                window.location.href='../work_loc_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../work_loc_list.php';
				                </script>";
							}
}
elseif ($table == 'user') {
	# code...
    $sqls = "delete from tbl_admin  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'bdelete';

								 echo "<script>;
					                window.location.href='../user_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../user_list.php';
				                </script>";
							}
}
elseif ($table == 'invoice') {
	# code...
    $sqls = "delete from tbl_invoice  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'sdelete';

								 echo "<script>;
					                window.location.href='../invoice_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../invoice_list.php';
				                </script>";
							}
}
elseif ($table == 'warehouse') {
	# code...
    $sqls = "delete from tbl_warhouse  where id='$id'";
    $result = mysqli_query($con, $sqls) or die(mysqli_error($con));

    if($result>0)
							{
								 // $_SESSION["userId"] = $id;
								$_SESSION['flash_message'] = 'wdelete';

								 echo "<script>;
					                window.location.href='../warehouse_list.php';
					                </script>";
							}
							else
							{
								echo "<script>;
				                window.location.href='../warehouse_list.php';
				                </script>";
							}
}
// header('location: ../bank_list.php');
?>

MMCT - 2023