You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
|
|
class Kaoqin_model extends CI_Model {
|
|
private $ATD;
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->ATD = $this->load->database('ATD', TRUE);
|
|
}
|
|
|
|
public function get_atd_type($ATT_Code='JAB')
|
|
{
|
|
$sql="SELECT ATT_SN from OA_AttendanceType where ATT_Code=?";
|
|
$query = $this->ATD->query($sql,array($ATT_Code));
|
|
$result=$query->result();
|
|
return $result;
|
|
}
|
|
|
|
public function get_epy_by_name($EPY_Name)
|
|
{
|
|
$sql="SELECT EPY_ID from OA_Employee where EPY_Name=? and EPY_DEP_Code=2";
|
|
$query = $this->ATD->query($sql,array($EPY_Name));
|
|
$result=$query->result();
|
|
return $result;
|
|
}
|
|
|
|
public function add_atd($ATD_EPY_Code,$ATD_ATT_Code,$ATD_Duration,$ATD_DateType,$ATD_StartDate,$ATD_EndDate){
|
|
$sql="INSERT INTO OA_Attendance (
|
|
ATD_EPY_Code,
|
|
ATD_ATT_Code,
|
|
ATD_Duration,
|
|
ATD_DateType,
|
|
ATD_StartDate,
|
|
ATD_EndDate,
|
|
ATD_CreateDate,
|
|
ATD_Memo,
|
|
ATD_JTBZ
|
|
) VALUES (?,?,?,?,?,?,?,' ',0.0)";
|
|
$query = $this->ATD->query($sql,array($ATD_EPY_Code,$ATD_ATT_Code,$ATD_Duration,$ATD_DateType,$ATD_StartDate,$ATD_EndDate,date('Y-m-d H:i:s')));
|
|
return $this->ATD->last_id('OA_Attendance');
|
|
}
|
|
|
|
} |