load->model('MUsers');
$this->load->helper("accounts");
checkLogin();
}
function deleteVoucher($voucher_id)
{
$this->myaccounts->deleteVoucher($voucher_id);
}
function getVoucherDetailsTable($voucher_id)
{
$VD = $this->db->where("voucher_id", $voucher_id)->get("tbl_voucherdetails")->result();
$html = "
Sales Order
Sn |
Description |
Qty |
Rate |
Total |
|
item_id ?> |
qty ?> |
rate ?> |
qty * $SoDetail->rate); ?>
qty * $SoDetail->rate) ?> |
|
Total |
|
|
|
|
Vat Amount |
|
|
|
|
Grand Total |
|
|
|
db->query($t)->row();
$Employee->employee_type = $this->db->query("select * from tbl_employeetype where employeetype_id=$Employee->employeetype_id")->row();
$Employee->employee_department = $this->db->query("select * from tbl_departments where department_id=$Employee->department_id")->row();
?>
Name |
employee_name ?> |
Employee Type |
employee_type->employeetype_name ?> |
Gender |
employee_gender ?> |
Department |
employee_department->department_name ?> |
Address |
employee_address ?> |
DOB |
employee_dob ?> |
DOJ |
employee_doj ?> |
PAN |
employee_pan ?> |
Email |
employee_email ?> |
Contact |
employee_contact ?> |
$_POST['attendance'],
'reason' => $_POST['reason'],
'status' => 1,
);
$this->db->where('employee_id', $_POST['employee_id']);
$this->db->update('tbl_attendances', $arraydata);
}
function updateholiday()
{
$arraydata = array(
'day_holiday' => $_POST['day_holiday'],
'day_work' => $_POST['day_work'],
);
$this->db->where('day_id', $_POST['day_id']);
$this->db->update('tbl_officecalendar', $arraydata);
redirect($_POST['url']);
}
function updatefactoryholiday()
{
$arraydata = array(
'day_holiday' => $_POST['day_holiday'],
'day_work' => $_POST['day_work'],
);
$this->db->where('day_id', $_POST['day_id']);
$this->db->update('tbl_factorycalendar', $arraydata);
redirect($_POST['url']);
}
function UpdateStock()
{
$stockcheck = $this->db->query("select * from tbl_stocks where item_id='" . $_POST['item_id'] . "' and stockdate='" . date('Y-m-d') . "'")->row();
$arraydata = array(
'stock_value' => $_POST['stock_value'],
'stockdate' => date('Y-m-d'),
'status' => 1,
);
if ($stockcheck == '') {
$arraydata['item_id'] = $_POST['item_id'];
$this->db->insert('tbl_stocks', $arraydata);
} else {
$this->db->where('item_id', $_POST['item_id']);
$this->db->update('tbl_stocks', $arraydata);
}
}
function UpdateStocks()
{
// $stockcheck=$this->db->query("select * from tbl_stock where item_id='".$_POST['item_id']."' and category_id= '".$_POST['category_id']."' and stockdate='".date('Y-m-d')."'")->row();
$arraydata = array(
'stock_in_value' => $_POST['stock_value'],
'stockdate' => date('Y-m-d'),
'category_id' => $_POST['category_id'],
'status' => 1,
);
// print_r($_POST);
$arraydata['item_id'] = $_POST['item_id'];
$this->db->insert('tbl_stock', $arraydata);
}
function TransferStock()
{
$itemalias = $this->db->query("select * from tbl_items where item_id=" . $_POST['item_id'])->row();
$transferStockCheck = $this->db->query("select * from tbl_items where item_alias='" . $_POST['item_alias'] . "' and category_id='5'")->row();
$stockcheck = $this->db->query("select * from tbl_stocks where item_id='" . $transferStockCheck->item_id . "' and stockdate='" . date('Y-m-d') . "'")->row();
$arraydata = array(
'stock_value' => $_POST['stock_value'],
'stockdate' => date('Y-m-d'),
'status' => 1,
);
if ($stockcheck == '') {
$arraydata['item_id'] = $transferStockCheck->item_id;
$this->db->insert('tbl_stocks', $arraydata);
} else {
$this->db->where('item_id', $transferStockCheck->item_id);
$this->db->update('tbl_stocks', $arraydata);
}
}
}