One Hat Cyber Team
Your IP :
172.16.0.254
Server IP :
58.26.163.33
Server :
Windows NT DGPENSV2LPKMN 10.0 build 14393 (Windows Server 2016) AMD64
Server Software :
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.3.25
PHP Version :
7.3.25
Buat File
|
Buat Folder
Eksekusi
Dir :
C:
/
xampp7
/
htdocs
/
edgpens
/
reports
/
View File Name :
audit_trail_1.php
<?php $userx = get_user_full($_SESSION['session']); $roles = (int)$userx['idRoles']; $idUser = (int)$userx['idUser']; if($searchme == 'y'){ $param_data = array(); $comb1 = ""; if($roles == 2 || $roles == 3){ $comb1 .= " AND a.idUser = ? "; $param_data['idUser'] = $idUser; $username = $userx['nameUser']; }else{ if(!empty($user)){ $comb1 .= " AND a.idUser = ? "; $param_data['idUser'] = $user; $sqlx = " SELECT nameUser FROM user_list WHERE idUser=? "; $param_datax['idUser'] = $user; $resultx = mysqli_prepare_all($sqlx,$param_type = "auto",$param_datax); $aax = $resultx->fetch_assoc(); $username = $aax['nameUser']; }else{ $username = "All"; } } if(!empty($role)){ $comb1 .= " AND b.idRoles = ? "; $param_data['idRoles'] = $role; } if(!empty($from)){ $from_exp = explode('-', $from); $comb1 .= " AND DATE_FORMAT(a.exec_time,'%Y-%m-%d') >= ? "; $param_data['exec_date1'] = $from_exp[2].'-'.$from_exp[1].'-'.$from_exp[0]; } if(!empty($to)){ $to_exp = explode('-', $to); $comb1 .= " AND DATE_FORMAT(a.exec_time,'%Y-%m-%d') <= ? "; $param_data['exec_date2'] = $to_exp[2].'-'.$to_exp[1].'-'.$to_exp[0]; } if(!empty($descr)){ $comb1 .= " AND a.descr like ? "; $param_data['descr'] = '%'.$descr.'%'; } // if(!empty($user)){ // $comb1 .= " AND a.nameUser LIKE ? "; // $param_data['nameUser'] = "%{$user}%"; // } // if(!empty($idrole)){ // $comb1 .= " AND a.idRoles = ? "; // $param_data['idRoles'] = $idrole; // } if($roles == 2 || $roles == 3) $comb2 = " AND descr != ''"; $sql = " SELECT a.*, b.nameUser FROM audit_trail a LEFT JOIN user_list b ON b.idUser = a.idUser WHERE 1 {$comb1} {$comb2} ORDER BY id DESC "; $result2 = mysqli_prepare_all($sql,$param_type = "auto",$param_data); // print_r($param_data); // // while($row_data = $data->fetch_assoc()) { // echo nl2br($row_data['running_sql'])."<br>"; // } // exit(); }else{ } $from = (empty($from)) ? '*' : $from ; $to = (empty($to)) ? '*' : $to ; ?> <h4><b>Audit Trail</b></h4> User : <?php echo $username;?> <br> Date : <?php echo "From : ".$from.' || To : '.$to; ?> <hr> <table id="example-datatable" class="table table-striped table-bordered table-condensed table-vcenter table-hover no_add_delete"> <thead> <tr> <?php if($roles !== 2 && $roles !== 3) {?> <th class="text-center no_sorting" style="width: 5%">No.</th> <th style="width: 35%;">Running SQL</th> <th class="text-left" style="width: 30%">Description</th> <th class="text-left" style="width: 15%;">User</th> <th class="text-center" style="width: 15%">Date & Time</th> <?php }else{?> <th class="text-center no_sorting" style="width: 5%">No.</th> <th class="text-left" style="width: 80%">Description</th> <th class="text-center" style="width: 15%">Date & Time</th> <?php }?> </tr> </thead> <tbody> <?php $i=1; while($aa = $result2->fetch_assoc()){ ?> <tr class="<?php echo $tr_class;?>"> <?php if($roles !== 2 && $roles !== 3) {?> <td class="align-top text-right" style="width: 5%;"><?php echo $i++; ?>.</td> <td class="align-top text-left" style="width: 35%;"><?php echo nl2br($aa['running_sql']); ?></td> <td class="align-top text-left" style="width: 30%;"><?php echo $aa['descr']; ?></td> <td class="align-top text-left" style="width: 15%;"><?php echo nl2br($aa['nameUser']); ?></td> <td class="align-top text-right" style="width: 15%;"><?php echo $aa['exec_time']; ?></td> <?php }else{?> <td class="align-top text-right" style="width: 5%;"><?php echo $i++; ?>.</td> <td class="align-top text-left" style="width: 80%;"><?php echo $aa['descr']; ?></td> <td class="align-top text-right" style="width: 15%;"><?php echo $aa['exec_time']; ?></td> <?php }?> </tr> <?php } ?> </tbody> </table>