| Server IP : 172.67.216.113 / Your IP : 172.71.28.146 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home2/cp648411/public_html/ilawasia.onnud20.com/class/ |
Upload File : |
<?php
class timesheetClass extends Viewdata
{
//$con=$this->setconnect();
public function Index($UserId,$year,$month){
$count = " t.TimeSheetId,t.TaskDate,t.TaskDescription,t.Duration,t.Del,t.CaseId,t.CategoryId,t.CaseTimeSheetId,c.CaseNumber,n.NamesCode as CustomerCode,CONCAT(n.NamesCode, ' ', n.NamesName) as CustomerName";
$name_table = " ct_timesheet t";
$name_table .= " LEFT JOIN ct_case c ON t.CaseId=c.CaseId";
$name_table .= " LEFT JOIN t_names_mas n ON t.CustomerId=n.NamesId";
$secrch = " t.Del = 0 ";
if($UserId!=''){
$secrch .= " AND t.CreateBy = '".$UserId."'";
}
if($year!=''){
$secrch .= " AND YEAR(t.TaskDate)='".$year."'";
}
if($month!=''){
$secrch .= " AND MONTH(t.TaskDate)='".$month."'";
}
$secrch .= " ORDER BY t.TaskDate,t.TimeSheetId";
$sql = array('table'=>$name_table,'count'=>$count ,'where'=>$secrch);
$view = $this->view($sql);
$result = $this->q_re($view);
$result_num = $this->q_nr($result);
$i=0;
if($result_num>0){
while ($row = $this->q_ro($result)) {
$data[$i]['TimeSheetId'] =$row['TimeSheetId'];
$data[$i]['TaskDate'] =$row['TaskDate'];
$data[$i]['TaskDescription'] =$row['TaskDescription'];
$data[$i]['Duration'] =$row['Duration'];
$data[$i]['CaseId'] =$row['CaseId'];
$data[$i]['CategoryId'] =$row['CategoryId'];
$sql_cate = array('table'=>'ct_category_timesheet','where'=>'CategoryId = "'.$row['CategoryId'].'"');
$view_cate = $this->view($sql_cate);
$row_cate = $this->q($view_cate);
$data[$i]['Category'] =$row_cate['CategoryName'];
//$data[$i]['sql'] =$view_cate;
$data[$i]['CaseTimeSheetId'] =$row['CaseTimeSheetId'];
$data[$i]['CaseNumber'] =$row['CaseNumber'];
$data[$i]['CustomerCode'] =$row['CustomerCode'];
$data[$i]['CustomerName'] =$row['CustomerName'];
$i++;
}
}else{
$data = array();
}
return $data;
}
public function LoadCategoryAutoComplete($Keyword)
{
$name_table = "ct_category_timesheet";
$start_count = 0;
$max_rows = 10;
$secrch = "CategoryName Like '%".$Keyword."%' AND Del = '0' AND Status = '1'";
$count ='';
$sql = array('table'=>$name_table, 'count'=>$count,'where'=>$secrch, 'limit'=> "$start_count,$max_rows");
$view = $this->view($sql);
$result = $this->q_re($view);
$i=0;$data=array();
while ($row = $this->q_ro($result)) {
$data[$i]['cateId'] =$row['CategoryId'];
$data[$i]['cateName'] =$row['CategoryName'];
$i++;
}
//$data['sql'] = $view;
return $data;
}
}
?>