Issue Date NameNameName Received Date Received By Expected Date Scanned Date Scanned By Processed Date Processed By Action '; } else if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin") { $str=''; } if($_SESSION['moms_uid'] == '1') { $str='
Issue Date NameNameName Received Date Received By Expected Date Scanned Date Scanned By Processed Date Processed By Action
'; } else if($_SESSION['moms_type'] == "super_admin") { $str='
Issue Date NameNameName Received Date Received By Expected Date Scanned Date Scanned By Processed Date Processed By Action
'; } else if($_SESSION['moms_type'] == "admin") { $str='
Issue Date NameNameName Received Date Received By Expected Date Scanned Date Scanned By Processed Date Processed By Action
'; } if(mysql_num_rows($data)>0){ while( $row = mysql_fetch_array($data)){ $get_name=mysql_fetch_assoc(mysql_query("select * from publication where id_publication=".$row['id_publication'])); //Get frequency name $frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$get_name['id_frequency'])); //Get Country details $country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$get_name['country'])); //Get Type details $get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$get_name['id_publication_type'])); //Get Processed by if(!empty($row['done_by'])){ $Processed=mysql_fetch_assoc(mysql_query("select username from users where id_users=".$row['done_by'])); } //Get Scanned by $Scanned=mysql_fetch_assoc(mysql_query("select username from users where id_users=".$row['created_by'])); // echo "select username from users where id_users=".$row['created_by']; if($get_name['active']=='1') { $img = "images/greencircle.png"; } else { $img = "images/redcircle.png"; } if(!empty($row['expected_date']) && $row['expected_date']!='0000-00-00 00:00:00') { $date_e = date('d-m-Y',strtotime($row['expected_date'])); } else { $date_e = 'N/A'; } if(!empty($row['received_date']) && $row['received_date']!='0000-00-00 00:00:00') { $date_r = date('d-m-Y',strtotime($row['received_date'])); } else { $date_r = 'N/A'; } if(!empty($row['received_by'])) { $get_uname = mysql_fetch_assoc(mysql_query("select * from users where id_users = '".$row['received_by']."'")); $recd_by = $get_uname['username']; } else { $recd_by = 'N/A'; } if(!empty($row['created']) && $row['created']!='0000-00-00 00:00:00') { $cr_by = date('d-m-Y',strtotime($row['created'])); } else { $cr_by = 'N/A'; } if(!empty($Scanned['username'])) { $scn_pub = $Scanned['username']; } else { $scn_pub = 'N/A'; } if(!empty($row['done_time']) && $row['done_time']!='0000-00-00 00:00:00') { $done_time = date('d-m-Y',strtotime($row['done_time'])); } else { $done_time = 'N/A'; } if(!empty($Processed['username'])) { $pro_pub = $Processed['username']; } else { $pro_pub = 'N/A'; } $edit_link = ''; $del_link = ''; if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin") { $str.=''; } else if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin") { $str.=''; } else if($_SESSION['moms_uid'] == '1') { $str.=''; } else if($_SESSION['moms_type'] == "super_admin") { $str.=''; } else if($_SESSION['moms_type'] == "admin") { $str.=''; } ?> "; } $str.='
Issue Date NameNameName Received Date Received By Expected Date Scanned Date Scanned By Processed Date Processed By
'.$row['issue_date'].' '.$get_name['name_publication_en'].' '.$date_r.' '.$recd_by.' '.$date_e.' '.$cr_by.' '.$scn_pub.' '.$done_time.' '.$pro_pub.' '.$edit_link.'|'.$del_link.'
'.$row['issue_date'].' '.$get_name['name_publication_en'].' '.$date_r.' '.$recd_by.' '.$date_e.' '.$cr_by.' '.$scn_pub.' '.$done_time.' '.$pro_pub.' '.$del_link.'
'.$row['issue_date'].' '.$get_name['name_publication_en'].' '.$date_r.' '.$recd_by.' '.$date_e.' '.$cr_by.' '.$scn_pub.' '.$done_time.' '.$pro_pub.' '.$del_link.'
'.$row['issue_date'].' '.$get_name['name_publication_en'].' '.$date_r.' '.$recd_by.' '.$date_e.' '.$cr_by.' '.$scn_pub.' '.$done_time.' '.$pro_pub.' '.$edit_link.'
'.$row['issue_date'].' '.$get_name['name_publication_en'].' '.$date_r.' '.$recd_by.' '.$date_e.' '.$cr_by.' '.$scn_pub.' '.$done_time.' '.$pro_pub.'
No Record Found
'; echo $str; pagination($limit,$adjacent,$rows,$page); } function pagination($limit,$adjacents,$rows,$page){ if(!empty($_REQUEST['task'])){ $click = $_REQUEST[type]; } else { $click = 'All'; } $pagination=''; if ($page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1 $prev_=''; $first=''; $lastpage = ceil($rows/$limit); $next_=''; $last=''; if($lastpage > 1) { //previous button if ($page > 1) $prev_.= "previous"; else{ //$pagination.= "previous"; } //pages if ($lastpage < 5 + ($adjacents * 2)) //not enough pages to bother breaking it up { $first=''; for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "$counter"; else $pagination.= "$counter"; } $last=''; } elseif($lastpage > 3 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages $first=''; if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "$counter"; else $pagination.= "$counter"; } $last.= "Last"; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $first.= "First"; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "$counter"; else $pagination.= "$counter"; } $last.= "Last"; } //close to end; only hide early pages else { $first.= "First"; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "$counter"; else $pagination.= "$counter"; } $last=''; } } if ($page < $counter - 1) $next_.= "next"; else{ //$pagination.= "next"; } $pagination = "
".$first.$prev_.$pagination.$next_.$last; //next button $pagination.= "
\n"; } echo "
".$pagination; ?>
Result =