forked from fotosentez/mutasyon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoiceadj.php
56 lines (52 loc) · 1.79 KB
/
invoiceadj.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
require_once('configs/config.php');
$page_name = "invoiceadj";
$smarty->assign("page_name", $page_name);
if(isset($_SESSION['login']))
{
//Get inf
$invoiceadj = Check::getValue("invoiceadj");
$delinvoiceadjid = Check::getValue("delinvoiceadjid");
$editinvoiceadjid = Check::getValue("editinvoiceadjid");
$editinvoiceadjname = Check::getValue("editinvoiceadjname");
if($invoiceadj)
{
if(Check::strlen($invoiceadj) > 3)
{
$infmaxstr = $smarty->getVariable('_inf_maximum_str');
echo $infmaxstr."3<script>$('input').removeClass('alert-danger');$('select').removeClass('alert-danger');$('input[name=invoiceadj]').addClass('alert-danger');</script>";
echo "<script>return false</script>";
exit();
}
else
{
$getadj = $db->prepare("INSERT INTO invoiceadj (invoiceadj_name) VALUES (:adjname)");
$getadj->execute(array(
'adjname'=>$invoiceadj,
));
$infaddentry = $smarty->getVariable('_inf_add_success');
echo $infaddentry;
echo '<script>$(".invadj").load(location.href + " .invadj");$(".addadjm").click()</script>';
}
}
else if($delinvoiceadjid)
{
$deladj = $db->prepare("DELETE FROM invoiceadj WHERE invoiceadj_id = :dadjid");
$deladj->execute(array(
'dadjid'=>$delinvoiceadjid,
));
echo "Önek başarıyla silindi!";
}
else if($editinvoiceadjid)
{
$upadj = $db->prepare("UPDATE invoiceadj SET invoiceadj_name = :adjnewname WHERE invoiceadj_id = :adjid");
$upadj->execute(array(
'adjnewname'=>$editinvoiceadjname,
'adjid'=>$editinvoiceadjid,
));
echo "Önek başarıyla güncellendi!";
}
}//login
else{
$smarty->display(theme_base.'login.html');
}