Petit nouveau ! |
3 Messages
08 mai 2007, 10:01
//select for batch
$list_batch = array();
$query_b = "SELECT distinct (batch) from batch_control WHERE major_code='". $major_code2 ."' and faculty_code='". $faculty_code2 ."' and program_code='". $program_code2 ."'";
$result_b = mysql_query($query_b) or die("Query failed 1: " . mysql_error());
while ($row_b= mysql_fetch_array($result_b,MYSQL_ASSOC))
{
if($row_b['batch']== $batch1)
{
array_push($list_batch,array("batch" => $row_b['batch'] , "batch" => $row_b['batch'], "selected" => "Selected" ));
}
else
{
array_push($list_batch,array("batch" => $row_b['batch'] , "batch"=>$row_b['batch'], "selected" => "" ));
}
}
$smarty->assign('list_batch', $list_batch);
mysql_free_result($result_b);
//select for Semester
$querys = "SELECT curr_sem from batch_control where batch='". $batch2 ."' and major_code='". $major_code2 ."' and faculty_code='". $faculty_code2 ."' and program_code='". $program_code2 ."' ";
$results = mysql_query($querys) or die("Query failed 2 : " . mysql_error());
//$default=1;
$list_semester = array();
$row_s= mysql_fetch_array($results,MYSQL_ASSOC);
$curr=$row_s["curr_sem"];
$default=$curr_sem1;
for ($i=1;$i <= $row_s['curr_sem'];$i++)
{
if($default == $i)
{
array_push($list_semester,array("curr_sem" => $i , $i=> $i, "selected" => "Selected" ));
}
else
{
array_push($list_semester,array("curr_sem" => $i , $i=>$i, "selected" => "" ));
}
}
$smarty->assign('list_semester', $list_semester);
$test=mysql_free_result($results);
// check box
$query_checkbox="select distinct(A.fee_code),B.fee_desc,B.fee_desc_e from fee_management as A, fee_type as B where A.fee_code=B.fee_code and A.faculty_code='$faculty_code2' and A.batch='$batch2' and A.major_code='$major_code2 'and A.semester='$sem_code'and A.flag=0";
$result_check_box=mysql_query($query_checkbox) or die("Query box failed : " . mysql_error());
[/quote]
j'ai mis a un extrait du code parce que il est très et le début est redondant pour la selection des personnes.
Après la requete, j'ai tenté plusieurs chose mais en vain...
Merci de ta réponse rapide à mon premier poste