Location: PHPKode > projects > Bug Jr. Support System > dist/issres.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 clsRecordissuesSearch { //issuesSearch Class @21-42DBD3FC

//Variables @21-90DA4C9A

    // Public variables
    var $ComponentName;
    var $HTMLFormAction;
    var $PressedButton;
    var $Errors;
    var $FormSubmitted;
    var $Visible;
    var $Recordset;

    var $CCSEvents = "";
    var $CCSEventResult;

    var $ds;
    var $EditMode;
    var $ValidatingControls;
    var $Controls;

    // Class variables
//End Variables

//Class_Initialize Event @21-CFB7EF56
    function clsRecordissuesSearch()
    {

        global $FileName;
        $this->Visible = true;
        $this->Errors = new clsErrors();
        if($this->Visible)
        {
            $this->ComponentName = "issuesSearch";
            $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $this->ComponentName);
            $CCSForm = CCGetFromGet("ccsForm", "");
            $this->FormSubmitted = ($CCSForm == $this->ComponentName);
            $Method = $this->FormSubmitted ? ccsPost : ccsGet;
            $this->s_keyword = new clsControl(ccsTextBox, "s_keyword", "s_keyword", ccsText, "", CCGetRequestParam("s_keyword", $Method));
            $this->DoSearch = new clsButton("DoSearch");
        }
    }
//End Class_Initialize Event

//Validate Method @21-F230E30A
    function Validate()
    {
        $Validation = true;
        $Where = "";
        $Validation = ($this->s_keyword->Validate() && $Validation);
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
        return (($this->Errors->Count() == 0) && $Validation);
    }
//End Validate Method

//Operation Method @21-6E019663
    function Operation()
    {
        if(!$this->Visible)
            return;

        global $Redirect;
        global $FileName;

        $this->EditMode = true;
        if(!$this->FormSubmitted)
            return;

        if($this->FormSubmitted) {
            $this->PressedButton = "DoSearch";
            if(strlen(CCGetParam("DoSearch", ""))) {
                $this->PressedButton = "DoSearch";
            }
        }
        $Redirect = "issres.php?" . CCGetQueryString("Form", Array("DoSearch","ccsForm"));
        if($this->Validate()) {
            if($this->PressedButton == "DoSearch") {
                if(!CCGetEvent($this->DoSearch->CCSEvents, "OnClick")) {
                    $Redirect = "";
                } else {
                    $Redirect = "issres.php?" . CCGetQueryString("Form", Array("DoSearch"));
                }
            }
        } else {
            $Redirect = "";
        }
    }
//End Operation Method

//Show Method @21-EF1FA547
    function Show()
    {
        global $Tpl;
        global $FileName;
        $Error = "";

        if(!$this->Visible)
            return;


        $RecordBlock = "Record " . $this->ComponentName;
        $Tpl->block_path = $RecordBlock;
        if(!$this->FormSubmitted)
        {
        }

        if($this->FormSubmitted) {
            $Error .= $this->s_keyword->Errors->ToString();
            $Error .= $this->Errors->ToString();
            $Tpl->SetVar("Error", $Error);
            $Tpl->Parse("Error", false);
        }
        $Tpl->SetVar("Action", $this->HTMLFormAction);
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
        $this->s_keyword->Show();
        $this->DoSearch->Show();
        $Tpl->parse("", false);
        $Tpl->block_path = "";
    }
//End Show Method

} //End issuesSearch Class @21-FCB6E20C

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

//Variables @20-DA6CA065

    // 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;
    var $AltRowControls;
    var $IsAltRow;
    var $Sorter_issue_title;
    var $Sorter_issue_symptoms;
    var $Navigator;
//End Variables

//Class_Initialize Event @20-20F82DE8
    function clsGridissues()
    {
        global $FileName;
        $this->ComponentName = "issues";
        $this->Visible = True;
        $this->IsAltRow = false;
        $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->SorterName = CCGetParam("issuesOrder", "");
        $this->SorterDirection = CCGetParam("issuesDir", "");

        $this->Link1 = new clsControl(ccsLink, "Link1", "Link1", ccsText, "", CCGetRequestParam("Link1", ccsGet));
        $this->issue_symptoms = new clsControl(ccsLabel, "issue_symptoms", "issue_symptoms", ccsMemo, "", CCGetRequestParam("issue_symptoms", ccsGet));
        $this->Link2 = new clsControl(ccsLink, "Link2", "Link2", ccsText, "", CCGetRequestParam("Link2", ccsGet));
        $this->Alt_issue_symptoms = new clsControl(ccsLabel, "Alt_issue_symptoms", "Alt_issue_symptoms", ccsMemo, "", CCGetRequestParam("Alt_issue_symptoms", ccsGet));
        $this->Sorter_issue_title = new clsSorter($this->ComponentName, "Sorter_issue_title", $FileName);
        $this->Sorter_issue_symptoms = new clsSorter($this->ComponentName, "Sorter_issue_symptoms", $FileName);
        $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpCentered);
    }
//End Class_Initialize Event

//Initialize Method @20-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 @20-B4A83CA3
    function Show()
    {
        global $Tpl;
        if(!$this->Visible) return;


        $ShownRecords = 0;

        $this->ds->Parameters["urls_keyword"] = CCGetFromGet("s_keyword", "");
        $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();
                if(!$this->IsAltRow)
                {
                    $Tpl->block_path = $GridBlock . "/Row";
                    $this->Link1->SetValue($this->ds->Link1->GetValue());
                    $this->Link1->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
                    $this->Link1->Parameters = CCAddParam($this->Link1->Parameters, "issue_id", $this->ds->f("issue_id"));
                    $this->Link1->Page = "ShowIssue.php";
                    $this->issue_symptoms->SetValue($this->ds->issue_symptoms->GetValue());
                    $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
                    $this->Link1->Show();
                    $this->issue_symptoms->Show();
                    $Tpl->block_path = $GridBlock;
                    $Tpl->parse("Row", true);
                }
                else
                {
                    $Tpl->block_path = $GridBlock . "/AltRow";
                    $this->Link2->SetValue($this->ds->Link2->GetValue());
                    $this->Link2->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
                    $this->Link2->Parameters = CCAddParam($this->Link2->Parameters, "issue_id", $this->ds->f("issue_id"));
                    $this->Link2->Page = "ShowIssue.php";
                    $this->Alt_issue_symptoms->SetValue($this->ds->Alt_issue_symptoms->GetValue());
                    $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
                    $this->Link2->Show();
                    $this->Alt_issue_symptoms->Show();
                    $Tpl->block_path = $GridBlock;
                    $Tpl->parseto("AltRow", true, "Row");
                }
                $this->IsAltRow = (!$this->IsAltRow);
                $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);
        }

        $this->Navigator->TotalPages = $this->ds->PageCount();
        $this->Sorter_issue_title->Show();
        $this->Sorter_issue_symptoms->Show();
        $this->Navigator->Show();
        $Tpl->parse("", false);
        $Tpl->block_path = "";
    }
//End Show Method

} //End issues Class @20-FCB6E20C

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

//DataSource Variables @20-A7C28593
    var $CCSEvents = "";
    var $CCSEventResult;

    var $CountSQL;
    var $wp;

    // Datasource fields
    var $Link1;
    var $issue_symptoms;
    var $Link2;
    var $Alt_issue_symptoms;
//End DataSource Variables

//Class_Initialize Event @20-2590C7A9
    function clsissuesDataSource()
    {
        $this->Initialize();
        $this->Link1 = new clsField("Link1", ccsText, "");
        $this->issue_symptoms = new clsField("issue_symptoms", ccsMemo, "");
        $this->Link2 = new clsField("Link2", ccsText, "");
        $this->Alt_issue_symptoms = new clsField("Alt_issue_symptoms", ccsMemo, "");

    }
//End Class_Initialize Event

//SetOrder Method @20-AB024379
    function SetOrder($SorterName, $SorterDirection)
    {
        $this->Order = "";
        $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, 
            array("Sorter_issue_title" => array("issue_title", ""), 
            "Sorter_issue_symptoms" => array("issue_symptoms", "")));
    }
//End SetOrder Method

//Prepare Method @20-4DBA77E3
    function Prepare()
    {
        $this->wp = new clsSQLParameters();
        $this->wp->AddParameter("1", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "");
        $this->wp->AddParameter("2", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "");
        $this->wp->AddParameter("3", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "");
        $this->wp->AddParameter("4", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "");
        $this->wp->Criterion[1] = $this->wp->Operation(opContains, "`issue_title`", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo));
        $this->wp->Criterion[2] = $this->wp->Operation(opContains, "`issue_symptoms`", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsMemo));
        $this->wp->Criterion[3] = $this->wp->Operation(opContains, "`issue_problem`", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsMemo));
        $this->wp->Criterion[4] = $this->wp->Operation(opContains, "`issue_solution`", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsMemo));
        $this->Where = $this->wp->opOR(false, $this->wp->opOR(false, $this->wp->opOR(false, $this->wp->Criterion[1], $this->wp->Criterion[2]), $this->wp->Criterion[3]), $this->wp->Criterion[4]);
    }
//End Prepare Method

//Open Method @20-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 @20-7CECFC5E
    function SetValues()
    {
        $this->Link1->SetDBValue($this->f("issue_title"));
        $this->issue_symptoms->SetDBValue($this->f("issue_symptoms"));
        $this->Link2->SetDBValue($this->f("issue_title"));
        $this->Alt_issue_symptoms->SetDBValue($this->f("issue_symptoms"));
    }
//End SetValues Method

} //End issuesDataSource Class @20-FCB6E20C

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

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

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

//Initialize Objects @1-83F49D35
$DBBJSS = new clsDBBJSS();

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

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

//Execute Components @1-9072BEB0
$issuesSearch->Operation();
//End Execute Components

//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-36A994DA
$issuesSearch->Show();
$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