user_exists == 0 && $setting['setting_permission_profile'] == 0) { $page = "error"; $smarty->assign('error_header', 639); $smarty->assign('error_message', 656); $smarty->assign('error_submit', 641); include "footer.php"; } $userid = $user->user_info['user_id']; $user_displayname = $user->user_displayname; $user_username = $user->user_info['user_username']; $data=date("Y-m-d"); //echo ("SELECT * from appelli WHERE app_disponibile='Y' and app_data>='$data' and app_id not in (select distinct pre_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_id) and app_id not in (select distinct pre_app_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_app_id) and app_app_id not in (select distinct pre_app_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_app_id) order by app_data"); //$esa_echo="SELECT * from appelli WHERE app_disponibile='Y' and app_data>='$data' and app_id not in (select distinct pre_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_id) and app_id not in (select distinct pre_app_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_app_id) and app_app_id not in (select distinct pre_app_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_app_id) order by app_data"; $appelli = $database->database_query("SELECT * from appelli WHERE (app_disponibile='Y' or app_disponibile='F') and app_data>='$data' order by app_data"); while($appelli_info = $database->database_fetch_assoc($appelli)) { $appelli_ids[] = $appelli_info[app_id]; $appelli_dis[] = $appelli_info[app_disponibile]; $appelli_max[] = $appelli_info[app_max]; $appelli_nome[] = $appelli_info[app_nome]; $appelli_desc[] = $appelli_info[app_desc]; $appelli_data[]= data_it($appelli_info[app_data]); $appelli_app_id[]= $appelli_info[app_app_id]; $appelli_deadline[]= data_it($appelli_info[app_deadline]); if($appelli_info[app_deadline]<$data){$appelli_past[]= 0;}else{$appelli_past[]= 1;} } $total_appelli = count($appelli_ids); $smarty->assign('appelli_ids', $appelli_ids); $smarty->assign('appelli_dis', $appelli_dis); $smarty->assign('appelli_max', $appelli_max); $smarty->assign('appelli_nome', $appelli_nome); $smarty->assign('appelli_desc', $appelli_desc); $smarty->assign('appelli_data', $appelli_data); $smarty->assign('appelli_aid', $appelli_app_id); $smarty->assign('appelli_deadline', $appelli_deadline); $smarty->assign('appelli_past', $appelli_past); $smarty->assign('total_appelli', $total_appelli); //$esa_echo="SELECT * from appelli WHERE app_data>='$data' and app_id in (select distinct pre_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_id) order by app_data"; $esami = $database->database_query("SELECT * from appelli WHERE app_data>='$data' and app_id in (select distinct pre_app_id from prenotazioni where pre_matricola='{$user->user_info['user_username']}' group by pre_app_id) order by app_data"); //$esami = $database->database_query("SELECT * from appelli WHERE app_data>='$data' order by app_data"); while($esami_info = $database->database_fetch_assoc($esami)) { $esami_ids[] = $esami_info[app_id]; $esami_nome[] = $esami_info[app_nome]; $esami_desc[] = $esami_info[app_desc]; //$esami_data[] = $esami_info[app_data]; $esami_data[]= data_it($esami_info[app_data]); $deadline2 = strtotime ( '-4 day' , strtotime ( $esami_info[app_data]) ) ; $esami_deadline2[] = data_it(date ( 'Y-m-d' , $deadline2)); //if($esami_info[app_deadline2]<$esami_info[app_data]){$esami_past2[]= 0;}else{$esami_past2[]= 1;} if ($deadline2 < strtotime("now") ){ $esami_past2[]= 0; }else{ $esami_past2[]= 1; } } $total_esami = count($esami_ids); $smarty->assign('esa_echo', $esa_echo); $smarty->assign('esami_ids', $esami_ids); $smarty->assign('esami_nome', $esami_nome); $smarty->assign('esami_desc', $esami_desc); $smarty->assign('esami_data', $esami_data); $smarty->assign('total_esami', $total_esami); $smarty->assign('esami_deadline2', $esami_deadline2); $smarty->assign('esami_past2', $esami_past2); $smarty->assign('user_matr', $user->user_info['user_username']); $smarty->assign('user_displayname', $user_displayname); $smarty->assign('myuser_id', $userid); include "footer.php"; ?>