KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/academic/demo/SmartReport/wizard/engine/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/academic/demo/SmartReport/wizard/engine/_common.php
<?php
 session_start();
  error_reporting(E_ERROR  | E_PARSE);
 //creating the report folder
 function RecursiveMkdir($path)
 {
   if (!file_exists($path))
   {
      RecursiveMkdir(dirname($path));
      mkdir($path, 0777);
    }
  }
  
 $file_name = $_SESSION['file_name'];
 $file_name = str_replace(" ","",$file_name);
 $folder_name = str_replace(".php","",$file_name);
 $report_path = "C:\Xampp\xampp\htdocs\Reports/$folder_name";
 RecursiveMkdir($report_path);
 
 //records per page
 if($_SESSION['records_per_page']<1)
 $_SESSION['records_per_page']=10;

 //regarding the statestical fields
 if (isset($_SESSION["affected_column"])&& !empty($_SESSION["affected_column"]))
 {
    //CHANGING THE FIELDS ARRAY
    $flds = $_SESSION["fields"];
    $_SESSION["fields"]=array();
    $new_flds = array();
    foreach($flds as $f)
    {
      if($f == $_SESSION["affected_column"])
       $new_flds[]= $_SESSION["function"]."(`$f`)";
      else
      $new_flds[]=$f;
    }
   $_SESSION["fields"] = $new_flds;
   
   //remove the affected column from group by array and sort array
   
   $group = $_SESSION["group_by"];
   $_SESSION["group_by"] = array();
   $new_group = array();
   foreach($group as $g)
   {
      if($g != $_SESSION["affected_column"])
      $new_group[]= $g ;
   }
  $_SESSION["group_by"]=  $new_group;
  
  $sort = $_SESSION["sort_by"];
  $_SESSION["sort_by"] = array();
  $new_sort = array();
  
  foreach($sort as $arr)
  {
    if($arr[0]!=$_SESSION["affected_column"])
    $new_sort[]=$arr ;
  }
  $_SESSION["sort_by"] = $new_sort;

 }



 //creating config.php
 
$fp=fopen($report_path."/config.php","w+");
fwrite($fp,'<?php'."\n");

foreach($_SESSION as $k=>$val)
{

  $temp = "$";
  $temp .= "$k=";
  if(empty($val))
  {
    if($k== "group_by") $temp .= "array()";
    elseif($k=="sort_by") $temp .= "array()";
    else $temp .= "''";

  }
  elseif(is_array($val))
  {
     $temp .= "array(";
       foreach($val as $v)
       {

            if(is_array($v))
            {
              $temp .= "array(";
              foreach($v as $v1)
              {
                $temp .= "'$v1',";
              }
              $temp .= "),";
              //removin last comma
              $temp = str_replace(",)",")",$temp);
            }
            else
            {
            $temp .= "'$v',";
            }
       }
      $temp .= ")" ;
      //removing last comma
      $temp = str_replace(",)" ,")",$temp);

   
  }
  else
  {
    $temp .= "'$val'" ;
  }
  
  $temp .= ";\n";
  fwrite($fp,$temp);
}
fwrite($fp,'?>');
fclose($fp);

//moving the CSS
$css = "../styles/".$_SESSION["style_name"].".css" ;
copy($css,$report_path."/".$_SESSION["style_name"].".css");
if($_SESSION['layout']=="Stepped" || $_SESSION['layout']=="Block")
{
copy("print1.css",$report_path."/print.css");
}
else
{
copy("print.css",$report_path."/print.css");
}
//moving the functions lib
copy("lib.php",$report_path."/lib.php");

//move menu file
copy("menu.php",$report_path."/menu.php");

//move images
copy("tri.gif",$report_path."/tri.gif");
copy("tridown.gif",$report_path."/tridown.gif");
copy("trileft.gif",$report_path."/trileft.gif");
@copy("email_report.php",$report_path."/email_report.php");
@copy("bg_table.gif",$report_path."/bg_table.gif");
//direct the user to the layout...
$layout = "layouts/".$_SESSION["layout"].".php";
copy($layout,"$report_path/$folder_name.php");
//echo "$report_path/$folder_name.php";
header("location: $report_path/$folder_name.php");













?>

Anon7 - 2021