Location: PHPKode > projects > Bug Jr. Support System > dist/ShowIssue.php
<?php
//Include Common Files @1-5471E0F2
define("RelativePath", ".");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
  
//End Include Common Files

class clsGridissues { //issues class @7-9E712255

//Variables @7-9AD3C4FA

    // Public variables
    var $ComponentName;
    var $Visible; var $Errors;
    var $ds; var $PageSize;
    var $SorterName = "";
    var $SorterDirection = "";
    var $PageNumber;

    var $CCSEvents = "";
    var $CCSEventResult;

    // Grid Controls
    var $StaticControls; var $RowControls;
//End Variables

//Class_Initialize Event @7-95A744C4
    function clsGridissues()
    {
        global $FileName;
        $this->ComponentName = "issues";
        $this->Visible = True;
        $this->Errors = new clsErrors();
        $this->ds = new clsissuesDataSource();
        $this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
        if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
            $this->PageSize = 10;
        else
            $this->PageSize = intval($this->PageSize);
        $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));

        $this->issue_title = new clsControl(ccsLabel, "issue_title", "issue_title", ccsMemo, "", CCGetRequestParam("issue_title", ccsGet));
        $this->issue_symptoms = new clsControl(ccsLabel, "issue_symptoms", "issue_symptoms", ccsMemo, "", CCGetRequestParam("issue_symptoms", ccsGet));
        $this->issue_problem = new clsControl(ccsLabel, "issue_problem", "issue_problem", ccsMemo, "", CCGetRequestParam("issue_problem", ccsGet));
        $this->issue_solution = new clsControl(ccsLabel, "issue_solution", "issue_solution", ccsMemo, "", CCGetRequestParam("issue_solution", ccsGet));
        $this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet));
    }
//End Class_Initialize Event

//Initialize Method @7-383CA3E0
    function Initialize()
    {
        if(!$this->Visible) return;

        $this->ds->PageSize = $this->PageSize;
        $this->ds->SetOrder($this->SorterName, $this->SorterDirection);
        $this->ds->AbsolutePage = $this->PageNumber;
    }
//End Initialize Method

//Show Method @7-EC029A78
    function Show()
    {
        global $Tpl;
        if(!$this->Visible) return;


        $ShownRecords = 0;

        $this->ds->Parameters["urlissue_id"] = CCGetFromGet("issue_id", "");
        $this->ds->Prepare();
        $this->ds->Open();

        $GridBlock = "Grid " . $this->ComponentName;
        $Tpl->block_path = $GridBlock;

        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");


        $is_next_record = $this->ds->next_record();
        if($is_next_record && $ShownRecords < $this->PageSize)
        {
            do {
                    $this->ds->SetValues();
                $Tpl->block_path = $GridBlock . "/Row";
                $this->issue_title->SetValue($this->ds->issue_title->GetValue());
                $this->issue_symptoms->SetValue($this->ds->issue_symptoms->GetValue());
                $this->issue_problem->SetValue($this->ds->issue_problem->GetValue());
                $this->issue_solution->SetValue($this->ds->issue_solution->GetValue());
                $this->Label1->SetValue($this->ds->Label1->GetValue());
                $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
                $this->issue_title->Show();
                $this->issue_symptoms->Show();
                $this->issue_problem->Show();
                $this->issue_solution->Show();
                $this->Label1->Show();
                $Tpl->block_path = $GridBlock;
                $Tpl->parse("Row", true);
                $ShownRecords++;
                $is_next_record = $this->ds->next_record();
            } while ($is_next_record && $ShownRecords < $this->PageSize);
        }
        else // Show NoRecords block if no records are found
        {
            $Tpl->parse("NoRecords", false);
        }

        $Tpl->parse("", false);
        $Tpl->block_path = "";
    }
//End Show Method

} //End issues Class @7-FCB6E20C

class clsissuesDataSource extends clsDBBJSS {  //issuesDataSource Class @7-83C9B2BC

//DataSource Variables @7-9B758D87
    var $CCSEvents = "";
    var $CCSEventResult;

    var $CountSQL;
    var $wp;

    // Datasource fields
    var $issue_title;
    var $issue_symptoms;
    var $issue_problem;
    var $issue_solution;
    var $Label1;
//End DataSource Variables

//Class_Initialize Event @7-DF52167C
    function clsissuesDataSource()
    {
        $this->Initialize();
        $this->issue_title = new clsField("issue_title", ccsMemo, "");
        $this->issue_symptoms = new clsField("issue_symptoms", ccsMemo, "");
        $this->issue_problem = new clsField("issue_problem", ccsMemo, "");
        $this->issue_solution = new clsField("issue_solution", ccsMemo, "");
        $this->Label1 = new clsField("Label1", ccsText, "");

    }
//End Class_Initialize Event

//SetOrder Method @7-9E1383D1
    function SetOrder($SorterName, $SorterDirection)
    {
        $this->Order = "";
        $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, 
            "");
    }
//End SetOrder Method

//Prepare Method @7-75F91029
    function Prepare()
    {
        $this->wp = new clsSQLParameters();
        $this->wp->AddParameter("1", "urlissue_id", ccsInteger, "", "", $this->Parameters["urlissue_id"], "");
        $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "`issue_id`", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger));
        $this->Where = $this->wp->Criterion[1];
    }
//End Prepare Method

//Open Method @7-4F8AF550
    function Open()
    {
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
        $this->CountSQL = "SELECT COUNT(*)  " .
        "FROM issues";
        $this->SQL = "SELECT *  " .
        "FROM issues";
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
        $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
        $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
        $this->MoveToPage($this->AbsolutePage);
    }
//End Open Method

//SetValues Method @7-6FC7FD74
    function SetValues()
    {
        $this->issue_title->SetDBValue($this->f("issue_title"));
        $this->issue_symptoms->SetDBValue($this->f("issue_symptoms"));
        $this->issue_problem->SetDBValue($this->f("issue_problem"));
        $this->issue_solution->SetDBValue($this->f("issue_solution"));
        $this->Label1->SetDBValue($this->f("issue_id"));
    }
//End SetValues Method

} //End issuesDataSource Class @7-FCB6E20C

//Initialize Page @1-79168879
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";

// Events;
$CCSEvents = "";
$CCSEventResult = "";

$FileName = "ShowIssue.php";
$Redirect = "";
$TemplateFileName = "ShowIssue.html";
$BlockToParse = "main";
$PathToRoot = "./";
//End Initialize Page

//Initialize Objects @1-0185E989
$DBBJSS = new clsDBBJSS();

// Controls
$issues = new clsGridissues();
$issues->Initialize();

$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
//End Initialize Objects

//Go to destination page @1-BEB91355
if($Redirect)
{
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
    header("Location: " . $Redirect);
    exit;
}
//End Go to destination page

//Initialize HTML Template @1-A0111C9D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main");
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template

//Show Page @1-5559AF76
$issues->Show();
$Tpl->PParse("main", false);
//End Show Page

//Unload Page @1-AB7622EF
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
unset($Tpl);
//End Unload Page



?>
Return current item: Bug Jr. Support System