RogerR
Posts: 21
|
Posted: 02/12/2004, 8:48 AM |
|
Not having used a time field in CCS before I don't know if this is a bug that has just shown up or if I've some how managed to screw something up. Since, as I said, I've not used a time field before I'm more inclined to think it is something that I've done; any way here is my problem:
[The database is MySQL and the code is of course PHP]
Problem: The Time Field is empty, as you can see from the source code generated from the loaded page. [see below]
<tr>
<td class="BlueNoteDataTD"><a class="BlueNoteDataLink" href="timesheet_maint.php?timesheetOrder=Sorter_logTime×heetDir=ASC&id=1">Record</a> </td>
<td class="BlueNoteDataTD">1 </td>
<td class="BlueNoteDataTD">Ester, Polly </td>
<td class="BlueNoteDataTD">Administrative </td>
<td class="BlueNoteDataTD">Reception Services </td>
<td class="BlueNoteDataTD">02/11/2004 </td>
<td class="BlueNoteDataTD"> </td> +++[Time should be displayed here]+++
<td class="BlueNoteDataTD">IN </td>
</tr>
The time is found in the database table but is not loading with the rest of the data when populating a page.
I apologize for the length of this post but I hope I'm providing everything necessary to get some help with this problem. Below is the code from the PHP page that I think is relavent to my problem without posting the whole page:
--------------------------------------[Code Segments Start Here]------------------------------------------------
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM ((timesheet LEFT JOIN employees ON " .
"timesheet.emp_id = employees.emp_id) LEFT JOIN divisions ON " .
"timesheet.division_id = divisions.DivID) LEFT JOIN units ON " .
"timesheet.unit_id = units.unitID";
$this->SQL = "SELECT id, timesheet.emp_id AS timesheet_emp_id, timesheet.unit_id AS timesheet_unit_id, timesheet.division_id AS timesheet_division_id, " .
"logDate, logTime, `Action`, employees.emp_id AS employees_emp_id, emp_name AS employees_emp_name, DivisionName, UnitName " .
"FROM ((timesheet LEFT JOIN employees ON " .
"timesheet.emp_id = employees.emp_id) LEFT JOIN divisions ON " .
"timesheet.division_id = divisions.DivID) LEFT JOIN units ON " .
"timesheet.unit_id = units.unitID";
$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);
}
-----------------------------------------------------------------------------------------------------
function SetValues()
{
$this->id->SetDBValue(trim($this->f("id")));
$this->emp_name->SetDBValue($this->f("employees_emp_name"));
$this->DivisionName->SetDBValue($this->f("DivisionName"));
$this->UnitName->SetDBValue($this->f("UnitName"));
$this->logDate->SetDBValue(trim($this->f("logDate")));
$this->logTime->SetDBValue(trim($this->f("logTime")));
$this->Action->SetDBValue($this->f("Action"));
}
-----------------------------------------------------------------------------------------------------
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_emp_id"] = CCGetFromGet("s_emp_id", "");
$this->ds->Parameters["urls_division_id"] = CCGetFromGet("s_division_id", "");
$this->ds->Parameters["urls_unit_id"] = CCGetFromGet("s_unit_id", "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->ds->Prepare();
$this->ds->Open();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$is_next_record = $this->ds->next_record();
if($is_next_record && $ShownRecords < $this->PageSize)
{
do {
$this->ds->SetValues();
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->Detail->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->Detail->Parameters = CCAddParam($this->Detail->Parameters, "id", $this->ds->f("id"));
$this->Detail->Page = "timesheet_maint.php";
$this->id->SetValue($this->ds->id->GetValue());
$this->emp_name->SetValue($this->ds->emp_name->GetValue());
$this->DivisionName->SetValue($this->ds->DivisionName->GetValue());
$this->UnitName->SetValue($this->ds->UnitName->GetValue());
$this->logDate->SetValue($this->ds->logDate->GetValue());
$this->logTime->SetValue($this->ds->logTime->GetValue());
$this->Action->SetValue($this->ds->Action->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->Detail->Show();
$this->id->Show();
$this->emp_name->Show();
$this->DivisionName->Show();
$this->UnitName->Show();
$this->logDate->Show();
$this->logTime->Show();
$this->Action->Show();
$Tpl->block_path = $ParentPath . "/" . $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);
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$this->Navigator->PageNumber = $this->ds->AbsolutePage;
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Sorter_id->Show();
$this->Sorter_emp_name->Show();
$this->Sorter_DivisionName->Show();
$this->Sorter_UnitName->Show();
$this->Sorter_logDate->Show();
$this->Sorter_logTime->Show();
$this->Sorter_Action->Show();
$this->timesheet_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
--------------------------------------[Code Segments End Here]------------------------------------------------
From everything I can see there is no obvious reason for the logTime not to show but yet it does not. Oh as an aside I found that the logTime doesn't showup in the edit screen either.
Any help in solving this mystery will be greatly appreciated.
RogerR
_________________
***********************************************************
The best antivirus a windose user can get - LINUX!
*********************************************************** |