query($sqlStmt);
if (DB::isError($result)) die ("$PHP_SELF:
$sqlStmt
" . $result->getMessage());
$count = 0;
while ($row = $result->fetch_assoc()):
$tmpId = $row["ap_id"];
$tmpText = $row["ap_text"];
$tmpText = my_str_check_js($tmpText);
$tmpExecDateTime = $row["ap_execdate"];
$tmpExecDate = substr($tmpExecDateTime,8,2) . "." . substr($tmpExecDateTime,5,2) . "." . substr($tmpExecDateTime,0,4);
$tmpExecTime = substr($tmpExecDateTime,11,5);
$tmpExecYear = substr($tmpExecDateTime,0,4);
$tmpExecMonth = substr($tmpExecDateTime,5,2);
$tmpExecDay = substr($tmpExecDateTime,8,2);
$tmpExecHour = substr($tmpExecDateTime,11,2);
$tmpExecMinute = substr($tmpExecDateTime,14,2);
$tmpCmpId = trim($row["cmp_id"]);
$tmpCmpComp = trim($row["cmp_comp"]);
$tmpCmpComp2 = trim($row["cmp_comp2"]);
$tmpCsId = $row["cs_id"];
$tmpCsEid = $row["cs_eid"];
$tmpEndDateTime = $row["ap_enddate"];
$tmpEndDate = substr($tmpEndDateTime,8,2) . "." . substr($tmpEndDateTime,5,2) . "." . substr($tmpEndDateTime,0,4);
$tmpEndTime = substr($tmpEndDateTime,11,5);
$tmpEndYear = substr($tmpEndDateTime,0,4);
$tmpEndMonth = substr($tmpEndDateTime,5,2);
$tmpEndDay = substr($tmpEndDateTime,8,2);
$tmpEndHour = substr($tmpEndDateTime,11,2);
$tmpEndMinute = substr($tmpEndDateTime,14,2);
$tmpUsrId = trim($row["usr_id"]);
$tmpUsrFirstname = trim($row["usr_firstname"]);
$tmpUsrName = trim($row["usr_name"]);
$tmpApCategory1 = $row["ap_category_1"];
if ($tmpApCategory1 == "") : $tmpApCategory1 = "1"; endif;
$tmpApCategory2 = $row["ap_category_2"];
if ($tmpApCategory2 == "") : $tmpApCategory2 = "1"; endif;
$tmpApCategory3 = $row["ap_category_3"];
if ($tmpApCategory3 == "") : $tmpApCategory3 = "1"; endif;
$tmpApCategory4 = $row["ap_category_4"];
if ($tmpApCategory4 == "") : $tmpApCategory4 = "0"; endif;
$tmpParticipants = $row["ap_participants"];
$tmpParticipants = substr($tmpParticipants,1,-1); // Remove commata from db-field
$tmpConfirmed = trim($row["ap_confirmed"]);
$tmpConfirmed = substr($tmpConfirmed,1,-1); // Remove commata from db-field
$tmpPtCmpComp = trim($row["pt_cmp_comp"]);
$tmpPtCmpComp2 = trim($row["pt_cmp_comp2"]);
$tmpPtCsEid = $row["pt_cs_eid"];
$tmpPtId = $row["pt_id"];
$count++;
endwhile;
$result->free();
if ($count > 0) :
// Begin date fields
echo "setSelectedValue('f_day', " . $tmpExecDay . ");\n";
echo "setSelectedValue('f_month', " . $tmpExecMonth . ");\n";
echo "setSelectedValue('f_year', " . $tmpExecYear . ");\n";
echo "setSelectedValue('f_hour', " . $tmpExecHour . ");\n";
echo "setSelectedValue('f_minute', " . $tmpExecMinute . ");\n";
// End date fields
echo "setSelectedValue('f_day_to', " . $tmpEndDay . ");\n";
echo "setSelectedValue('f_month_to', " . $tmpEndMonth . ");\n";
echo "setSelectedValue('f_year_to', " . $tmpEndYear . ");\n";
echo "setSelectedValue('f_hour_to', " . $tmpEndHour . ");\n";
echo "setSelectedValue('f_minute_to', " . $tmpEndMinute . ");\n";
// Categories
echo "setSelectedValue('f_ap_cat_1', " . $tmpApCategory1 . ");\n";
echo "setSelectedValue('f_ap_cat_2', " . $tmpApCategory2 . ");\n";
echo "setSelectedValue('f_ap_cat_3', " . $tmpApCategory3 . ");\n";
echo "setSelectedValue('f_ap_cat_4', " . $tmpApCategory4 . ");\n";
// Participants
if ($tmpParticipants != "") :
$tmpParticipants = spliti(",", $tmpParticipants); // It has to be an array
$tmpParticipantsLen = count($tmpParticipants);
echo "participantsLen = document.getElementsByName('f_usr_id[]').length;";
echo "for (var i=0; i 0) :
$retValue = implode(",",$usrIdArray);
endif;
echo "retArray = Array(" . $retValue . ");";
elseif ($mode == "4") :
// ...
endif;
?>