ステートメントsif()
と. いくつかの直接一致と他の方法を試しました。OR
$pattern
$boxclr
とに基づいて を割り当てるOR
ことができませんpreg_match()
。私は何を間違っていますか?
$row['casetype_txt'] = $var; // $var = ADDICTION or GOTOBO etc..
$pattern = "/^".$_POST["loc_type"]."/"; // ADDI or GOTO etc...
while ($row = @mysql_fetch_assoc($result))
{
///////////////////////////////////////////////////
///////////////////// TYPE 1 /////////////////////////
///////////////////////////////////////////////////
if ( // TYPE 1
preg_match($pattern, $row['casetype_txt'])
AND
$row['last_action_txt'] == 'A'
OR $row['last_action_txt'] == 'B'
OR $row['last_action_txt'] == 'C'
OR $row['last_action_txt'] == 'D'
)
{
$boxclr = "type1"; // assigning class
} elseif ( // TYPE 1-2
preg_match($pattern, $row['casetype_txt'])
AND
$row['case_disp'] == 'C'
OR $row['case_disp_txt'] == 'E'
OR $row['case_disp_gp'] == 'F'
OR $row['disp_act_txt'] == 'G'
) {
$boxclr = "type1-2"; // assigning class
}
///////////////////////////////////////////////////
///////////////////// TYPE 2 /////////////////////////
///////////////////////////////////////////////////
elseif ( // TYPE 2
preg_match($pattern, $row['casetype_txt'])
AND
$row['last_action_txt'] == 'H'
OR $row['last_action_txt'] == 'I'
OR $row['last_action_txt'] == 'J'
OR $row['last_action_txt'] == 'K'
)
{
$boxclr = "type2"; // assigning class
} elseif ( // TYPE 2-2
preg_match($pattern, $row['casetype_txt'])
AND
$row['case_disp'] == 'C'
OR $row['case_disp_txt'] == 'L'
OR $row['case_disp_gp'] == 'M'
OR $row['disp_act_txt'] == 'N'
)
{
$boxclr = "type2-2"; // assigning class
}
///////////////////////////////////////////////////
///////////////////// TYPE 3 ////////////////////////
///////////////////////////////////////////////////
elseif...