!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/msdp.undp.org.ua/modules/projects/   drwxr-xr-x
Free 117.19 GB of 200.55 GB (58.43%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     module.php (9.56 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
class Projects
{
    var 
$UserMode   true;
    var 
$AdminMode  true;
    var 
$SearchMode false;
    var 
$PanelMode  false;
    var 
$AdminAsynchMode true;
    var 
$Table;
    var 
$TableCities;
    var 
$ClassName 'Projects';
    var 
$Photomanager;
    var 
$Directory;
    function 
Projects()
    {
        global 
$ulang;
        
$this->Directory dirname(__FILE__);
        
$this->Table = new AMTable2('AMCMS_projects');
        
$this->Table->Module($this->ClassName);
        
$this->Table->AddIndexField("project_id");
        
$this->Table->AddPositionField("project_position");
        
$this->TableCities = new AMTable2('AMCMS_projects_cities');
        
$this->TableCities->Module($this->ClassName);
        
$this->TableCities->AddIndexField("city_id");
        
$this->TableCities->AddPositionField("city_name_{$ulang}");        
    }
    function 
User()
    {                
         global 
$ulang$ULANG;
        if (!isset(
$_GET['project_id']) && isset($_GET['city_id']))
        {
            
$rows $this->Table->GetRows("project_id ASC""city_id = '{$_GET['city_id']}'");
            
$city $this->TableCities->GetRowById($_GET['city_id']);
            
$cities $this->TableCities->GetRows("city_id");
            
//if ($rows == null) return;
            
            
$smarty = new Template("user/templates/projects/projects.tpl");
            
$smarty->setParam('ulang'$ulang);
            
$smarty->setParam('cities'$cities);
            
$smarty->setParam('rows'$rows);
            
$smarty->setParam('mod'$this->ClassName);                        
            
$navigator = new AMNavigator();
            
$title $ulang == "ukr" "Проекти громад" "Community Projects";
            
$navigator->AddLink($title"/projects"); 
            
$navigator->AddLink($city["city_name_{$ulang}"], "");
            
$result['Title'] = $city["city_name_{$ulang}"];
            
$result['Content']   = $smarty->getTemplate();
            
$result['GlobalParams']['Description'] = "";
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $title;
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;                        
        }
        if (isset(
$_GET['project_id']) && isset($_GET['city_id']))
        {
            
$row $this->Table->GetRowById($_GET['project_id']);
            
$city $this->TableCities->GetRowById($row['city_id']);
            if (
$row == null) return;
            
$name[] = array('ukr' => "Організація громади, що виконує проект",     'eng' => 'Implementing Partner');
            
$fields[] = array('ukr' => 'project_implementing_partner_ukr',     'eng' => 'project_implementing_partner_eng');
            
$name[] = array('ukr' => "Назва проекту",     'eng' => 'Project Name');
            
$fields[] = array('ukr' => 'project_name_ukr',     'eng' => 'project_name_eng');
            
$name[] = array('ukr' => "Сфера",             'eng' => 'Project Type');
            
$fields[] = array('ukr' => 'project_type_ukr',     'eng' => 'project_type_eng');
            
$name[] = array('ukr' => "Дата початку",     'eng' => 'Initiation Date');
            
$fields[] = array('ukr' => 'project_initial_date',     'eng' => 'project_initial_date');
            
$name[] = array('ukr' => "Загальний бюджет",     'eng' => 'Total Cost');
            
$fields[] = array('ukr' => 'project_total_cost_ukr',     'eng' => 'project_total_cost_eng');
            
$name[] = array('ukr' => "Внесок ПРООН/МПВСР",     'eng' => 'UNDP/MGSDP Contribution');
            
$fields[] = array('ukr' => 'project_undp_contribution_ukr',     'eng' => 'project_undp_contribution_eng');
            
$name[] = array('ukr' => "Внесок міської ради",     'eng' => 'City Council Contribution');
            
$fields[] = array('ukr' => 'project_city_contribution_ukr',     'eng' => 'project_city_contribution_eng');
            
$name[] = array('ukr' => "Внесок громади",     'eng' => 'Community Contribution');
            
$fields[] = array('ukr' => 'project_community_contribution_ukr',     'eng' => 'project_community_contribution_eng');
            
$name[] = array('ukr' => "Внесок 3-х сторін",     'eng' => 'Third Parties Contribution');
            
$fields[] = array('ukr' => 'project_third_contribution_ukr',     'eng' => 'project_third_contribution_eng');
            
$name[] = array('ukr' => "Кількість членів громади (чол./жін./діт.)",     'eng' => 'Number of members of Community Organisation (men/women/children)');
            
$fields[] = array('ukr' => 'project_members_ukr',     'eng' => 'project_members_eng');
            
$smarty = new Template("user/templates/projects/project.tpl");
            
$smarty->setParam('ulang'$ulang);
            
$smarty->setParam('name'$name);
            
$smarty->setParam('row'$row);
            
$smarty->setParam('mod'$this->ClassName);                        
            
$navigator = new AMNavigator();
            
$title $ulang == "ukr" "Проекти громад" "Community Projects";
            
$navigator->AddLink($title"/projects"); 
            
$navigator->AddLink($city["city_name_{$ulang}"], "/projects/{$city['city_id']}");
            
$navigator->AddLink($row["project_name_{$ulang}"], "");
            
$result['Title'] = $city["city_name_{$ulang}"];
            
$result['Content']   = $smarty->getTemplate();
            
$result['GlobalParams']['Description'] = "";
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $title;
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;                        
        }
        if (isset(
$_GET['partner_id']))
        {

            
$row $this->Table->GetRowById($_GET['partner_id']);
            if (
$row == null) return;
            
$smarty GetUserSmarty($this->ClassName);
            
$smarty->assign('row'$row);
            
$smarty->assign('mod'$this->ClassName);                        
            
$navigator = new AMNavigator();
            
$title $ulang == "ukr" "Міста-партнери" "Partner Municipalities";
            
$navigator->AddLink($title"/map"); 
            
$navigator->AddLink($row["partner_name_{$ulang}"], "");
            
$result['Title'] = $row["partner_name_{$ulang}"];
            
$result['Content']   = $smarty->fetch("user-page.tpl");
            
$result['GlobalParams']['Description'] = "";
            
$result['GlobalParams']['Navigator'] = $navigator->Fetch();
            
$result['GlobalParams']['PageTitle'] = $title;
            
$result['Module'] = $this->ClassName;
            
$result['Print'] = true;    
            return 
$result;            
        }
    }    
    function 
Menu()
    {
        global 
$ALANG;
        return array(
                array(
'title' => 'Додати проект',          'link' => '?mod='.$this->ClassName.'&add'),
                array(
'title' => 'Список проектів',        'link' => '?mod='.$this->ClassName.'&list')
            );
    }
    function 
Admin()
    {
            global 
$ALANG$alang$_LANG_ID;
            
$smarty GetAdminSmarty($this->ClassName);
            if (isset(
$_GET['list']))
            {                                
                {
                    if (!isset(
$_REQUEST['city_id']))
                        
$_REQUEST['city_id'] = 1;
                    
$fields     = array("project_name_ukr");
                    
$captions   = array("Назва проекту");
                    
$conditions "city_id = '{$_REQUEST['city_id']}'";
                    
$order        "project_position DESC";
                    
$links         = array("delete""edit");
                    
$multiple     = array("delete");
                    
$params     = array("sortable" => "yes""id" => "actual");
                    
$html $this->Table->GetAdminTable($fields$captions$conditions$order$links$multiple$params);
                    
$cities $this->TableCities->GetRows("city_id");
                      
$smarty->assign('cities'$cities);
                    
$result['Title']     = "Список проектів";
                    
$result['Content']     = $smarty->fetch("city.tpl").$html;
                    return 
$result;
                } 
            }
            if (isset(
$_GET['add']))
            {
                if (isset(
$_POST['oper']) && ($_POST['oper'] == 'add'))
                {
                        
$_POST['project_initial_date'] = DateConvert($_POST['project_initial_date_year'], $_POST['project_initial_date_month'], $_POST['project_initial_date_day'], 00);
                        
$id $this->Table->Insert($_POST);
                        
header("Location: ?mod=".$this->ClassName."&list&city_id={$_POST['city_id']}");
                }                
                
$smarty GetAdminSmarty($this->ClassName);
                  foreach(
$_POST as $key => $value)
                      
$smarty->assign($key$value);
                
$cities $this->TableCities->GetRows("city_id");
                  
$smarty->assign('oper''add');
                  
$smarty->assign('cities'$cities);
                  
$result['Title']         = "Додавання проекту";
                
$result['Content']         = $smarty->fetch('project.tpl');
                return 
$result;
            }
            if (isset(
$_GET['edit']) && isset($_GET['project_id']))
            {
                
$_POST['project_initial_date'] = DateConvert($_POST['project_initial_date_year'], $_POST['project_initial_date_month'], $_POST['project_initial_date_day'], 00);                
                
$id $_GET['project_id'];
                
$row $this->Table->GetRowById($id);
                if (isset(
$_POST['oper']) && ($_POST['oper'] == 'edit'))
                {                    
                        
                    
$this->Table->Update($_POST$id);
                    
header("Location: ?mod=".$this->ClassName."&list&city_id=".$_REQUEST['city_id']);
                }
                foreach(
$row as $key => $value)
                    
$smarty->assign($key$value);
                  
$smarty->assign('oper''edit');                  
                
$cities $this->TableCities->GetRows("city_id");
                
$smarty->assign('cities'$cities); 
                  
$result['Title']     = "Редагування проекту";
                  
$result['Content'] = $smarty->fetch('project.tpl');
                  return 
$result;                    
            }
    }    

    function 
AdminAsynch()
    {
        global 
$alang$ALANG;
        if (isset(
$_POST['oper']) && ($_POST['oper'] == 'toarchive'))
        {
            
$id $_POST['id'];
            
$row['actual_date_of_archiving'] = GetCurrentDateAndTime();
            
$row['actual_type'] = 2;
            
AMCMS_Cache::SetCacheFlag("Actual""panel"""1);                        
            
$this->Table->Update($row$id);
            
$res["status"] = "ok";
            
$res["code"]   = $id;
            echo 
json_encode($res);
            die;
        }
        if (isset(
$_POST['oper']) && ($_POST['oper'] == 'fromarchive'))
        {
            
$id $_POST['id'];
            
$row['actual_date_of_archiving'] = "";
            
$row['actual_type'] = 1;
            
AMCMS_Cache::SetCacheFlag("Actual""panel"""1);                        
            
$this->Table->Update($row$id);
            
$res["status"] = "ok";
            
$res["code"]   = $id;
            echo 
json_encode($res);
            die;
        }
        
$this->Table->Run($_POST);
        
AMCMS_Cache::SetCacheFlag("Actual""panel"""1);                        
    }
}

$Modules ['Projects'] = new Projects();
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.038 ]--