| Server IP : 172.67.216.113 / Your IP : 104.23.243.32 [ 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_old/ |
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.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;$data=array();
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]['CaseTimeSheetId'] =$row['CaseTimeSheetId'];
$data[$i]['CaseNumber'] =$row['CaseNumber'];
$data[$i]['CustomerCode'] =$row['CustomerCode'];
$data[$i]['CustomerName'] =$row['CustomerName'];
$i++;
}
}
return $data;
}
public function Index2($UserId,$year,$month){
$count = " t.TimeSheetId,t.TaskDate,t.TaskDescription,t.Duration,t.Del,t.CaseId,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;$data=array();
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]['CaseTimeSheetId'] =$row['CaseTimeSheetId'];
$data[$i]['CaseNumber'] =$row['CaseNumber'];
$data[$i]['CustomerCode'] =$row['CustomerCode'];
$data[$i]['CustomerName'] =$row['CustomerName'];
$i++;
}
}
$data['sql'] = $view;
return $data;
}
}
?>