Forum Moderators: coopster
class Form
{
public $countGrp;
public $magGrp;
function countME ($dataFrom, $dateTo, $value)
{
global $database;
$database->myDatabaseCon();
$result = "select emp_id, huraLabor from where fromDate= '$dataFrom' and toDate= '$dateTo' and location = '$value)'";
if( odbc_num_rows( $query ) > 0 ){
return odbc_num_rows( $query );
}
}
function TotalMandays ($dataFrom, $dateTo, $value)
{
global $database;
$database->myDatabaseCon();
$result = "select emp_id, huraLabor from where fromDate= '$dataFrom' and toDate= '$dateTo' and location = '$value)'";
$query = odbc_exec($database->connection,$result);
$addMe = 0;
while ( $t = odbc_fetch_array($query))
{
$totalHours = $t['huraLabor'];
$addMe = $addMe + $totalHours;
}
return $addMe;
}
}
class Form
{
public $countGrp;
public $magGrp;
public $getMe;
function countME ($dataFrom, $dateTo, $value)
{
global $database;
$database->myDatabaseCon();
$result = "select emp_id, huraLabor from where fromDate= '$dataFrom' and toDate= '$dateTo' and location = '$value)'";
if( odbc_num_rows( $query ) > 0 ){
return odbc_num_rows( $query );
}
while ( $t = odbc_fetch_array($query))
{
$totalHours = $t['huraLabor'];
$addMe = $addMe + $totalHours;
}
$this->getMe = $addMe;
}
function showGet()
{
echo $this->getMe
}
}
while ( $t = odbc_fetch_array($query))
{
$addMe = $addMe + $t['huraLabor'];
}
$result = "SELECT `emp_id`, `huraLabor` FROM TABLE NAME HERE WHERE `fromDate` = '".$dataFrom."' && `toDate` = '".$dateTo."' && `location` = '".$value."' ";