Initial commit
This commit is contained in:
@@ -0,0 +1,425 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
$ins_user=mysql_query("INSERT INTO publication(`active`,`name_publication_en`,`name_publication_ar`,`id_publication_type`,`country`,`language`,`id_publication_genre`,`logo`,`distribution`,`url`,`telephone`,`email`,`created`,`modified`,`created_by`,`owner`,`adrate_color`) VALUES ('".$status."','".$mediaOutlet."','".$mediaOutlet."','".$id_publication_type."','".$country_id."','".$language_id."','".$id_publication_genre."','".$logo."','".$id_publisher."','".$url."','".$telephone."','".$email."','".date('Y-m-d H:i:s')."','".date('Y-m-d H:i:s')."','admin','".$owner."','".$rate."')");
|
||||
|
||||
|
||||
|
||||
$p_id = mysql_insert_id();
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $p_id.".".$add_file[1];
|
||||
$logo="momslogo/broad/".$name;
|
||||
$dblogo="../momslogo/broad/".$name;
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$dblogo);
|
||||
|
||||
mysql_query("update publication set logo = '".$logo."' where id_publication = '".$p_id."'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_broad_status] == '0' || $_REQUEST[search_broad_status] == '1'){
|
||||
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_broad_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_broad_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_broad_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_type])){
|
||||
if($_REQUEST[search_broad_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_broad_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_broad_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_broad_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_broad_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM publication where 1 and id_publication_type IN (4,5) $sqls"));
|
||||
//$sql= $sql.$sqls;
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record inserted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while($row = mysql_fetch_assoc($data))
|
||||
|
||||
{ //Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
$edit_link = '<a href="add_broadcast.php?task=edit&id='.$row['id_publication'].'" class="slit"><img src="images/Edit_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication'].',1)"><img src="images/Delete_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$i++;}}
|
||||
else{
|
||||
$str .='<tr><td colspan="6">No Record Found</td></tr>';
|
||||
}
|
||||
|
||||
$str .= '</table></div>';
|
||||
|
||||
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,453 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ins_user=mysql_query("INSERT INTO publication(`active`,`name_publication_en`,`name_publication_ar`,`id_publication_type`,`country`,`language`,`id_publication_genre`,`logo`,`distribution`,`url`,`telephone`,`email`,`created`,`modified`,`created_by`,`subscription`,`hits`,`source_rank`) VALUES ('".$status."','".$mediaOutlet."','".$mediaOutlet."','".$id_publication_type."','".$country_id."','".$language_id."','".$id_publication_genre."','".$logo."','".$dig_id_publisher."','".$url."','".$telephone."','".$email."','".date('Y-m-d H:i:s')."','".date('Y-m-d H:i:s')."','admin','".$subscription."','".$hits."','".$source_rank."')");
|
||||
|
||||
|
||||
|
||||
$p_id = mysql_insert_id();
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $p_id.".".$add_file[1];
|
||||
$logo="momslogo/digital/".$name;
|
||||
$dblogo="../momslogo/digital/".$name;
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$dblogo);
|
||||
|
||||
mysql_query("update publication set logo = '".$logo."' where id_publication = '".$p_id."'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_digit_status] == '0' || $_REQUEST[search_digit_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_digit_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_digit_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_digit_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_type])){
|
||||
if($_REQUEST[search_digit_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_digit_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_digit_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digital_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_digital_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls";
|
||||
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record inserted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
|
||||
//Get Language details
|
||||
//$languages=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language']));
|
||||
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$act = 'digital_delete';
|
||||
|
||||
$edit_link = "<a href='add_digital_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",2)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
|
||||
$dt = date('d-m-Y',strtotime($row['modified']));
|
||||
$tme = date('H:i:s',strtotime($row['modified']));
|
||||
|
||||
if($row['source_rank'] == '1')
|
||||
{
|
||||
$rank = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$rank = $row['source_rank'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('includes/conf.php');
|
||||
|
||||
|
||||
|
||||
//include('includes/head.php');
|
||||
$task= $_REQUEST['task'];
|
||||
$getid=explode('?_',$_REQUEST['id']);
|
||||
$id= $getid[0];
|
||||
if(!empty($id))
|
||||
{
|
||||
$Issues = mysql_query("SELECT * FROM publication_issue WHERE id_publication_issue='".$id."'");
|
||||
$row = mysql_fetch_array($Issues);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($row['id_publication'])){
|
||||
$sql = mysql_fetch_array(mysql_query("SELECT id_frequency FROM publication where id_publication=".$row['id_publication']));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($sql['id_frequency']==1){//Daily
|
||||
$received_date= date('Y-m-d',strtotime("+1 day"));
|
||||
}elseif($sql['id_frequency']==2){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+1 week"));
|
||||
}elseif($sql['id_frequency']==3){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+3 day"));
|
||||
}elseif($sql['id_frequency']==4){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+1 month"));
|
||||
}elseif($sql['id_frequency']==5){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+3 month"));
|
||||
}elseif($sql['id_frequency']==6){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+6 month"));
|
||||
}elseif($sql['id_frequency']==7){//Weekly
|
||||
$received_date= date('Y-m-d',strtotime("+1 year"));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if($task=='view'){
|
||||
?>
|
||||
|
||||
|
||||
<div id="modal" class="modal-example-content">
|
||||
<div class="modal-example-header">
|
||||
<button type="button" class="close" onClick="$.fn.custombox('close');">×</button>
|
||||
<h4><?=!empty($id)?'View ':''?>Issue Details</h4>
|
||||
</div>
|
||||
<div class="modal-example-body">
|
||||
<p>
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Issue #:</div>
|
||||
<div class="col-md-7"><?=$row['id_issue']?></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
|
||||
//Get Country details
|
||||
$Name=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en,expected_date from publication where id_publication=".$row['id_publication']));
|
||||
|
||||
?>
|
||||
<div class="col-md-3">Name:</div>
|
||||
<div class="col-md-7"><?=$Name['name_publication_en']?></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Received Date:</div>
|
||||
<div class="col-md-7"><?=date('d-m-Y',strtotime($row['received_date']))?></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Received By:</div>
|
||||
<div class="col-md-7"><?=$row['received_by']?></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Expected Date:</div>
|
||||
<div class="col-md-7"><?=(!empty($Name['expected_date']) && $Name['expected_date']!='0000-00-00 00:00:00')?date('d-m-Y',strtotime($Name['expected_date'])):''?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Scanned Date:</div>
|
||||
<div class="col-md-7"><?=(!empty($row['created']) && $row['created']!='0000-00-00 00:00:00')?date('d-m-Y',strtotime($row['created'])):'';?></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<?php
|
||||
//Get Scanned by
|
||||
$Scanned=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en from publication where id_publication=".$row['created_by']));
|
||||
?>
|
||||
|
||||
<div class="col-md-3">Scanned By:</div>
|
||||
<div class="col-md-7"><?=$Scanned['name_publication_en']?></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">Processed Date:</div>
|
||||
<div class="col-md-7"><?=!empty($row['done_time'])?date('d-m-Y',strtotime($row['done_time'])):''?></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
//Get Processed by
|
||||
$Processed=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en from publication where id_publication=".$row['done_by']));
|
||||
?>
|
||||
<div class="col-md-3">Processed By:</div>
|
||||
<div class="col-md-7"><?=$Processed['name_publication_en']?></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php }else{?>
|
||||
<style>
|
||||
.ui-autocomplete { z-index:2147483647 !important; }
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var issue = [
|
||||
<?php
|
||||
$sql_r=mysql_query("select name_publication_en from publication ORDER BY name_publication_en ASC");
|
||||
while($row_r=mysql_fetch_assoc($sql_r))
|
||||
{
|
||||
echo'"';
|
||||
echo $row_r['name_publication_en'];
|
||||
echo'",';
|
||||
}
|
||||
?>
|
||||
];
|
||||
$as("#search_broad_outlet").autocomplete({
|
||||
source: issue
|
||||
|
||||
});
|
||||
|
||||
$as("#search_broad_outlet").autocomplete( "option", "appendTo", ".eventInsForm" );
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="modal" class="modal-example-content">
|
||||
<div class="modal-example-header">
|
||||
<button type="button" class="close" onClick="$.fn.custombox('close');">×</button>
|
||||
<h4><?=!empty($id)?'Edit ':''?>Issue Details</h4>
|
||||
</div>
|
||||
<div class="modal-example-body">
|
||||
<p>
|
||||
<div class="row">
|
||||
<form action="" method="post" onSubmit="return validation_issue()" enctype="multipart/form-data">
|
||||
<input type="hidden" name="id_publication_issue" value="<?=$row['id_publication_issue']?>">
|
||||
|
||||
<fieldset class="col-md-12">
|
||||
<label>Name <span style="color:#FF0000">*</span></label>
|
||||
<?php
|
||||
$get_name=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en from publication where id_publication = '".$row['id_publication']."'"));
|
||||
//echo "select id_publication,name_publication_en from publication id = '".$row['id_publication']."'";
|
||||
?>
|
||||
<!--<select name="id_publication" id="id_publication_issue" onchange="getreceive(this.value)">
|
||||
<option value="">--Select Name--</option>
|
||||
<?php while($getName=mysql_fetch_assoc($get_name)){?>
|
||||
<option value="<?=$getName['id_publication']?>" <? if($row['id_publication']==$getName['id_publication'])echo 'Selected'?>><?=$getName['name_publication_en']?></option>
|
||||
<?php }?>
|
||||
</select>-->
|
||||
<input type="text" name="search_broad_outlet" id="search_broad_outlet" Placeholder="Media Outlet Name" onBlur="getreceive(this.value)" value="<?=$get_name['name_publication_en']?>">
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
|
||||
<fieldset class="col-md-12" style="margin-bottom:14px;">
|
||||
<?php
|
||||
if(!empty($row['id_publication'])){
|
||||
$get_name=mysql_fetch_assoc(mysql_query("select expected_date,expected_day from publication where id_publication=".$row['id_publication']));
|
||||
}
|
||||
?>
|
||||
<?php if(trim($get_name['expected_date']) != "")
|
||||
{ ?>
|
||||
<label id="exp">Expected Date <span style="color:#FF0000">*</span></label><br />
|
||||
<?php }
|
||||
else
|
||||
{ ?>
|
||||
<label id="exp">Expected Days <span style="color:#FF0000">*</span></label><br />
|
||||
<?php }?>
|
||||
|
||||
|
||||
<input type="text" class="form_input" readonly="" name="expected_date" value="<?php if(trim($get_name['expected_date']) != "")
|
||||
{
|
||||
echo trim($get_name['expected_date']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo trim($get_name['expected_day']);
|
||||
}?>" id="expected_date" style="margin:0">
|
||||
<span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
<fieldset class="col-md-6">
|
||||
<label>Received Date <span style="color:#FF0000">*</span></label><br />
|
||||
<!--<div id="ReceivedDate" style="float:left" class="input-group date" data-date-format="yyyy-mm-dd">
|
||||
<input class="form-control" type="text" name="created" id="received_date" value="<?=$received_date?>" id="created_date" placeholder="Received Date" readonly />
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
|
||||
</div>-->
|
||||
<input type="text" class="form_input" name="received_date" value="<?=$row['received_date']?>" id="received_date" style="margin:0">
|
||||
<span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
<fieldset class="col-md-6">
|
||||
<label>Received By <span style="color:#FF0000">*</span></label>
|
||||
<input type="text" name="received_by" id="received_by" value="<?=!empty($row['received_by'])?$row['received_by']:ucfirst($_SESSION['moms_uname'])?>" placeholder="Received By" >
|
||||
</fieldset>
|
||||
|
||||
<?php if(!empty($id)){?>
|
||||
<fieldset class="col-md-6">
|
||||
<label>Scanned Date <span style="color:#FF0000">*</span></label><br />
|
||||
|
||||
<input type="text" class="form_input" name="created" value="<?=(!empty($row['created']) && $row['created']!='0000-00-00 00:00:00')?date('Y-m-d',strtotime($row['created'])):'';?>" id="scanned_date" style="margin:0">
|
||||
<span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
//Get Scanned by
|
||||
|
||||
if(!empty($row['created_by'])){
|
||||
|
||||
$Scanned=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en from publication where id_publication=".$row['created_by']));
|
||||
|
||||
|
||||
|
||||
}
|
||||
if(!empty($Scanned['id_publication'])){
|
||||
?>
|
||||
<fieldset class="col-md-6">
|
||||
<label>Scanned By <span style="color:#FF0000">*</span></label>
|
||||
<input type="text" readonly="" id="scanned_by" value="<?=$Scanned['name_publication_en']?>" placeholder="Scanned By" >
|
||||
<input type="hidden" name="scanned_by" value="<?=$Scanned['id_publication']?>" placeholder="Scanned By" >
|
||||
<span style="color:blue; line-height:12px;"> </span>
|
||||
</fieldset>
|
||||
<?php }else{?>
|
||||
|
||||
<fieldset class="col-md-6">
|
||||
<label>Scanned By <span style="color:#FF0000">*</span></label>
|
||||
<?php
|
||||
$get_name=mysql_query("select id_publication,name_publication_en from publication ORDER BY name_publication_en ASC");
|
||||
?>
|
||||
<select name="scanned_by" id="scanned_by">
|
||||
<option value="">Name</option>
|
||||
<?php while($getName=mysql_fetch_assoc($get_name)){?>
|
||||
<option value="<?=$getName['id_publication']?>" ><?=$getName['name_publication_en']?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<span style="line-height:12px;"> </span>
|
||||
</fieldset>
|
||||
|
||||
<?php }?>
|
||||
|
||||
|
||||
<fieldset class="col-md-6" >
|
||||
<label>Processed Date <span style="color:#FF0000">*</span></label>
|
||||
<!--<div id="processedDate" style="float:left" class="input-group date" data-date-format="yyyy-mm-dd">
|
||||
<input class="form-control" type="text" name="processed_date" id="processed_date" placeholder="Processed Date" readonly value="<?=!empty($row['done_time'])?date('Y-m-d',strtotime($row['done_time'])):''?>" />
|
||||
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
|
||||
</div>-->
|
||||
<input type="text" class="form_input" name="done_time" value="<?=!empty($row['done_time'])?date('Y-m-d',strtotime($row['done_time'])):''?>" id="processed_date" style="margin:0">
|
||||
<span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
|
||||
//Get Processed by
|
||||
if(!empty($row['done_by'])){
|
||||
$Processed=mysql_fetch_assoc(mysql_query("select id_publication,name_publication_en from publication where id_publication=".$row['done_by']));
|
||||
}
|
||||
if(!empty($Processed['id_publication'])){
|
||||
?>
|
||||
<fieldset class="col-md-6">
|
||||
<label>Processed By <span style="color:#FF0000">*</span></label>
|
||||
<input type="text" name="processed_by" value="<?=$Processed['name_publication_en']?>" placeholder="Processed By" >
|
||||
<input type="hidden" name="processed_by" id="processed_by" value="<?=$Processed['id_publication']?>">
|
||||
<span style="color:blue; line-height:12px;"> </span>
|
||||
</fieldset>
|
||||
|
||||
<?php }else{?>
|
||||
|
||||
<fieldset class="col-md-6">
|
||||
<label>Processed By <span style="color:#FF0000">*</span></label>
|
||||
<?php
|
||||
$get_name=mysql_query("select id_publication,name_publication_en from publication ORDER BY name_publication_en ASC");
|
||||
?>
|
||||
<select name="processed_by" id="processed_by">
|
||||
<option value="">Name</option>
|
||||
<?php while($getName=mysql_fetch_assoc($get_name)){?>
|
||||
<option value="<?=$getName['id_publication']?>" ><?=$getName['name_publication_en']?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<span style="color:blue; line-height:12px;"> </span>
|
||||
</fieldset>
|
||||
|
||||
<?php }?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<fieldset class="col-md-4">
|
||||
<input type="submit" name="<?=(!empty($id))?'issue_update':'issue_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button">
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }?>
|
||||
@@ -0,0 +1,447 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
include('../includes/conf.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$expectedday='';
|
||||
if($id_frequency==3){
|
||||
|
||||
for($i=0;$i<count($expected_day);$i++){
|
||||
|
||||
if(count($expected_day)==$i+1)
|
||||
$expectedday.= $expected_day[$i];
|
||||
else
|
||||
$expectedday.= $expected_day[$i].",";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{$expectedday= $expected_day;}
|
||||
|
||||
$ins_user=mysql_query("INSERT INTO publication(`active`,`name_publication_en`,`name_publication_ar`,`id_publication_type`,`id_frequency`,`country`,`language`,`id_publication_genre`,`logo`,`circulation`,`distribution`,`del_method`,`adrate_color`,`rate_sheet`,`url`,`telephone`,`email`,`created`,`modified`,`created_by`,`expected_date`,`expected_day`) VALUES ('".$active."','".$name_publication_en."','".$name_publication_en."','".$id_publication_type."','".$id_frequency."','".$country."','".$language."','".$id_publication_genre."','".$logo."','".$circulation."','".$distribution."','".$del_method."','".$adrate_bw."','".$rate_sheet."','".$url."','".$telephone."','".$email."','".date('Y-m-d H:i:s')."','".date('Y-m-d H:i:s')."','admin','".$expected_date."','".$expectedday."')");
|
||||
|
||||
$p_id = mysql_insert_id();
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $p_id.".".$add_file[1];
|
||||
$logo="momslogo/print/".$name;
|
||||
$dblogo="../momslogo/print/".$name;
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$dblogo);
|
||||
|
||||
mysql_query("update publication set logo = '".$logo."' where id_publication = '".$p_id."'");
|
||||
}
|
||||
|
||||
if(($_FILES['rate_sheet']['name'])!="")
|
||||
{
|
||||
|
||||
|
||||
$add_file=explode('.',$_FILES['rate_sheet']['name']);
|
||||
$name = $p_id.".".$add_file[1];
|
||||
$rate_sheet = $_RATEPATH.$name;
|
||||
|
||||
|
||||
|
||||
move_uploaded_file($_FILES["rate_sheet"]["tmp_name"],$rate_sheet);
|
||||
|
||||
mysql_query("update publication set rate_sheet = '".$rate_sheet."' where id_publication = '".$p_id."'");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST['task'])){
|
||||
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_status] == '0' || $_REQUEST[search_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_type])){
|
||||
if($_REQUEST[search_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_print_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_print_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record inserted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
//Get frequency name
|
||||
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency']));
|
||||
|
||||
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
//Get Type details
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
$delivery_method= !empty($row['del_method'])?$row['del_method']:'N/A';
|
||||
|
||||
if(!empty($row['expected_date']) && $row['expected_date']!='0000-00-00'){
|
||||
$expected_date= date('d-m-Y',strtotime($row['expected_date']));
|
||||
}
|
||||
elseif(!empty($row['expected_day'])){
|
||||
$expected_date= $row['expected_day'];
|
||||
}else{
|
||||
$expected_date= 'N/A';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_print_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",0)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."|".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."</td></tr>";
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td></tr>";
|
||||
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='6'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
$ins_user=mysql_query("INSERT INTO publisher(`status`,`name_publisher_en`,`name_publisher_ar`,`id_country`,`url`,`phone`,`email`,`created`,`modified`,`created_by`,`fax`) VALUES ('".$status."','".$name_publisher_en."','".$name_publisher_en."','".$id_country."','".$url."','".$phone."','".$email."','".date('Y-m-d H:i:s')."','".date('Y-m-d H:i:s')."','".$_SESSION['moms_uid']."','".$fax."')");
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publisher where 1";
|
||||
$sqls='';
|
||||
if(!empty($_REQUEST[search_publisher_status])){
|
||||
|
||||
$sqls.=" AND status='".$_REQUEST[search_publisher_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher_country])){
|
||||
|
||||
$sqls.=" AND id_country ='".$_REQUEST[search_publisher_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND id_publisher ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls ORDER BY id_publisher DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record inserted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['id_country']));
|
||||
|
||||
|
||||
|
||||
if($row['status']=='A')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_publisher.php?task=edit&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publisher'].",4)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
$view_link = "<a href='add_publisher.php?task=view&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/view_2.png' width='20' height='20'></a>";
|
||||
|
||||
|
||||
if(empty($row['url']))
|
||||
{
|
||||
$url = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $row['url'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"><a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,588 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
$Issue_id = mysql_fetch_array(mysql_query("SELECT id_issue FROM publication_issue ORDER BY id_issue DESC LIMIT 0,1"));
|
||||
|
||||
$get_id = mysql_fetch_assoc(mysql_query("select * FROM publication where name_publication_en='".$_REQUEST['search_issue_outlet']."'"));
|
||||
|
||||
|
||||
|
||||
$ins_user=mysql_query("INSERT INTO publication_issue(`id_publication`,`issue_date`,`received_date`,`received_by`,`created`,`created_by`,`done_time`,`done_by`,`id_issue`) VALUES ('".$get_id['id_publication']."','".$issue_date."','".$received_date."','".$_SESSION['moms_uid']."',now(),'".$scanned_by."','".$done_time."','".$processed_by."','".$Issue_id['id_issue']."')");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1";
|
||||
$sqls='';
|
||||
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_issue_status]=='0' || $_REQUEST[search_issue_status]=='1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_issue_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_issue_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_issue_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_type])){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_issue_type]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_issue_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_outlet])){
|
||||
|
||||
$sqls.=" AND pub.name_publication_en ='".$_REQUEST[search_issue_outlet]."'";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_REQUEST[issue_from_date]) && !empty($_REQUEST[issue_to_date])){
|
||||
|
||||
if($_REQUEST[search_date_type]=='expected_date'){
|
||||
|
||||
$sqls.=" AND ".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}elseif(!empty($_REQUEST[search_date_type])){
|
||||
|
||||
$sqls.=" AND iss.".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}else
|
||||
if($_REQUEST[issue_from_date] == $_REQUEST[issue_to_date])
|
||||
{
|
||||
$sqls.=" AND issue_date = '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls.=" AND issue_date between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC";
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT *,iss.created,iss.id_issue,iss.created_by FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record inserted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{ $str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = '<a href="add_issue.php?task=edit&id='.$row['id_publication_issue'].'" class="slit"><img src="images/Edit_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication_issue'].',3)"><img src="images/Delete_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='12'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"issue_search('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"issue_search('1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"issue_search('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,409 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_broad_status] == '0' || $_REQUEST[search_broad_status] == '1'){
|
||||
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_broad_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_broad_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_broad_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_type])){
|
||||
if($_REQUEST[search_broad_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_broad_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_broad_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_broad_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_broad_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM publication where 1 and id_publication_type IN (4,5) $sqls"));
|
||||
//$sql= $sql.$sqls;
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while($row = mysql_fetch_assoc($data))
|
||||
|
||||
{ //Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
$edit_link = '<a href="add_broadcast.php?task=edit&id='.$row['id_publication'].'" class="slit"><img src="images/Edit_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication'].',1)"><img src="images/Delete_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$i++;}}
|
||||
else{
|
||||
$str .='<tr><td colspan="6">No Record Found</td></tr>';
|
||||
}
|
||||
|
||||
$str .= '</table></div>';
|
||||
|
||||
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,414 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
$Broadmedia=mysql_fetch_assoc(mysql_query("select logo from publication where id_publication=".$_REQUEST['id']));
|
||||
|
||||
unset($Broadmedia['logo']);
|
||||
|
||||
$sql_update = mysql_query("delete from publication WHERE `id_publication`='".$_REQUEST['id']."'");
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_broad_status] == '0' || $_REQUEST[search_broad_status] == '1'){
|
||||
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_broad_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_broad_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_broad_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_type])){
|
||||
if($_REQUEST[search_broad_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_broad_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_broad_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_broad_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_broad_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM publication where 1 and id_publication_type IN (4,5) $sqls"));
|
||||
//$sql= $sql.$sqls;
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while($row = mysql_fetch_assoc($data))
|
||||
|
||||
{ //Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
$edit_link = '<a href="add_broadcast.php?task=edit&id='.$row['id_publication'].'" class="slit"><img src="images/Edit_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication'].',1)"><img src="images/Delete_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$i++;}}
|
||||
else{
|
||||
$str .='<tr><td colspan="6">No Record Found</td></tr>';
|
||||
}
|
||||
|
||||
$str .= '</table></div>';
|
||||
|
||||
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,446 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$Digitalmedia=mysql_fetch_assoc(mysql_query("select logo from publication where id_publication=".$_REQUEST['id']));
|
||||
|
||||
unset($Digitalmedia['logo']);
|
||||
|
||||
|
||||
$sql_update = mysql_query("delete from publication WHERE `id_publication`='".$_REQUEST['id']."'");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_digit_status] == '0' || $_REQUEST[search_digit_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_digit_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_digit_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_digit_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_type])){
|
||||
if($_REQUEST[search_digit_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_digit_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_digit_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digital_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_digital_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls";
|
||||
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
|
||||
//Get Language details
|
||||
//$languages=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language']));
|
||||
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$act = 'digital_delete';
|
||||
|
||||
$edit_link = "<a href='add_digital_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",2)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
|
||||
$dt = date('d-m-Y',strtotime($row['modified']));
|
||||
$tme = date('H:i:s',strtotime($row['modified']));
|
||||
|
||||
if($row['source_rank'] == '1')
|
||||
{
|
||||
$rank = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$rank = $row['source_rank'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,418 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
include('../includes/conf.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
$Printmedia=mysql_fetch_assoc(mysql_query("select logo,rate_sheet from publication where id_publication=".$_REQUEST['id']));
|
||||
|
||||
unset($Printmedia['logo']);
|
||||
unset($Printmedia['rate']);
|
||||
|
||||
|
||||
|
||||
$sql_update = mysql_query("delete from publication WHERE `id_publication`='".$_REQUEST['id']."'");
|
||||
|
||||
$msg='del_succ';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST['task'])){
|
||||
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_status] == '0' || $_REQUEST[search_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_type])){
|
||||
if($_REQUEST[search_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_print_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_print_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
//Get frequency name
|
||||
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency']));
|
||||
|
||||
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
//Get Type details
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
$delivery_method= !empty($row['del_method'])?$row['del_method']:'N/A';
|
||||
|
||||
if(!empty($row['expected_date']) && $row['expected_date']!='0000-00-00'){
|
||||
$expected_date= date('d-m-Y',strtotime($row['expected_date']));
|
||||
}
|
||||
elseif(!empty($row['expected_day'])){
|
||||
$expected_date= $row['expected_day'];
|
||||
}else{
|
||||
$expected_date= 'N/A';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_print_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",0)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."|".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."</td></tr>";
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td></tr>";
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='6'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
mysql_query("delete from publisher WHERE `id_publisher`='".$_REQUEST['id']."'");
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publisher where 1";
|
||||
$sqls='';
|
||||
if(!empty($_REQUEST[search_publisher_status])){
|
||||
|
||||
$sqls.=" AND status='".$_REQUEST[search_publisher_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher_country])){
|
||||
|
||||
$sqls.=" AND id_country ='".$_REQUEST[search_publisher_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND id_publisher ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls ORDER BY id_publisher DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['id_country']));
|
||||
|
||||
|
||||
|
||||
if($row['status']=='A')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_publisher.php?task=edit&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publisher'].",4)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
$view_link = "<a href='add_publisher.php?task=view&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/view_2.png' width='20' height='20'></a>";
|
||||
|
||||
|
||||
if(empty($row['url']))
|
||||
{
|
||||
$url = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $row['url'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"><a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,578 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
$sql_update = mysql_query("delete from publication_issue WHERE `id_publication_issue`='".$_REQUEST['id']."'");
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1";
|
||||
$sqls='';
|
||||
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_issue_status]=='0' || $_REQUEST[search_issue_status]=='1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_issue_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_issue_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_issue_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_type])){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_issue_type]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_issue_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_outlet])){
|
||||
|
||||
$sqls.=" AND pub.name_publication_en ='".$_REQUEST[search_issue_outlet]."'";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_REQUEST[issue_from_date]) && !empty($_REQUEST[issue_to_date])){
|
||||
|
||||
if($_REQUEST[search_date_type]=='expected_date'){
|
||||
|
||||
$sqls.=" AND ".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}elseif(!empty($_REQUEST[search_date_type])){
|
||||
|
||||
$sqls.=" AND iss.".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}else
|
||||
if($_REQUEST[issue_from_date] == $_REQUEST[issue_to_date])
|
||||
{
|
||||
$sqls.=" AND issue_date = '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls.=" AND issue_date between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC";
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT *,iss.created,iss.id_issue,iss.created_by FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if( ($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] = 3790) && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if( ($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] = 3790) && $_SESSION['moms_type'] == "admin")
|
||||
{ $str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] = 3790)
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = '<a href="add_issue.php?task=edit&id='.$row['id_publication_issue'].'" class="slit"><img src="images/Edit_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication_issue'].',3)"><img src="images/Delete_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='12'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"issue_search('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"issue_search('1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"issue_search('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,578 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
$sql_update = mysql_query("delete from publication_issue WHERE `id_publication_issue`='".$_REQUEST['id']."'");
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1";
|
||||
$sqls='';
|
||||
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_issue_status]=='0' || $_REQUEST[search_issue_status]=='1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_issue_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_issue_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_issue_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_type])){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_issue_type]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_issue_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_outlet])){
|
||||
|
||||
$sqls.=" AND pub.name_publication_en ='".$_REQUEST[search_issue_outlet]."'";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_REQUEST[issue_from_date]) && !empty($_REQUEST[issue_to_date])){
|
||||
|
||||
if($_REQUEST[search_date_type]=='expected_date'){
|
||||
|
||||
$sqls.=" AND ".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}elseif(!empty($_REQUEST[search_date_type])){
|
||||
|
||||
$sqls.=" AND iss.".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}else
|
||||
if($_REQUEST[issue_from_date] == $_REQUEST[issue_to_date])
|
||||
{
|
||||
$sqls.=" AND issue_date = '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls.=" AND issue_date between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC";
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT *,iss.created,iss.id_issue,iss.created_by FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record deleted succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if( ($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] = 3790) && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{ $str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = '<a href="add_issue.php?task=edit&id='.$row['id_publication_issue'].'" class="slit"><img src="images/Edit_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication_issue'].',3)"><img src="images/Delete_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='12'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"issue_search('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"issue_search('1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"issue_search('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_digit_status] == '0' || $_REQUEST[search_digit_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_digit_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_digit_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_digit_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_type])){
|
||||
if($_REQUEST[search_digit_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_digit_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_digit_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digital_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_digital_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls";
|
||||
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
|
||||
//Get Language details
|
||||
//$languages=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language']));
|
||||
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$act = 'digital_delete';
|
||||
|
||||
$edit_link = "<a href='add_digital_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",2)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
|
||||
$dt = date('d-m-Y',strtotime($row['modified']));
|
||||
$tme = date('H:i:s',strtotime($row['modified']));
|
||||
|
||||
if($row['source_rank'] == '1')
|
||||
{
|
||||
$rank = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$rank = $row['source_rank'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('../includes/connect.php');
|
||||
|
||||
|
||||
|
||||
$sql = mysql_fetch_assoc(mysql_query("SELECT expected_date,expected_day FROM publication where name_publication_en='".$_REQUEST['id_publication']."'"));
|
||||
|
||||
|
||||
if(trim($sql['expected_date']) != "")
|
||||
{
|
||||
echo "Expected Date_".trim($sql['expected_date']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Expected Days_".trim($sql['expected_day']);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('../includes/connect.php');
|
||||
|
||||
if($_REQUEST['frequency']==2 || $_REQUEST['frequency']==9){
|
||||
|
||||
echo '<label>Expected Day <span style="color:#FF0000">*</span></label><select name="expected_day" id="expected_day"><option value="Sunday">Sunday</option><option value="Monday">Monday</option><option value="Tuesday">Tuesday</option><option value="Wednesday">Wednesday</option><option value="Thursday">Thursday</option><option value="Friday">Friday</option><option value="Saturday">Saturday</option></select>';
|
||||
|
||||
|
||||
}elseif($_REQUEST['frequency']==3){
|
||||
echo '<label>Expected Day <span style="color:#FF0000">*</span></label> <br /><input type="checkbox" name="expected_day[]" onclick="getExpected()" style="width:32px;height:15px;" id="expected_day" value="Sunday" > Sunday <input type="checkbox" style="width:32px;height:15px;" name="expected_day[]" onclick="getExpected()" id="expected_day" value="Monday" >Monday<input type="checkbox" name="expected_day[]" style="width:32px;height:15px;" onclick="getExpected()" id="expected_day" value="Tuesday" >Tuesday <input type="checkbox" style="width:32px;height:15px;" name="expected_day[]" onclick="getExpected()" id="expected_day" value="Wednesday" >Wednesday <input type="checkbox" style="width:32px;height:15px;" name="expected_day[]" id="expected_day" value="Thursday" onclick="getExpected()" >Thursday <input type="checkbox" style="width:32px;height:15px;" name="expected_day[]" id="expected_day" value="Friday" onclick="getExpected()">Friday <input type="checkbox" style="width:32px;height:15px;" name="expected_day[]" id="expected_day" value="Saturday" onclick="getExpected()">Saturday';
|
||||
|
||||
}
|
||||
elseif($_REQUEST['frequency']!=1 ){
|
||||
|
||||
echo '<label>Expected Date <span style="color:#FF0000">*</span></label><input type="text" name="expected_date" id="expected_date" value="" placeholder="Expected Date" style="margin:0"><span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>';
|
||||
}else{
|
||||
echo '<label>Expected Date <span style="color:#FF0000">*</span></label><br/><span style="color:blue; line-height:12px;">Not Applicable</span>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,389 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST['task'])){
|
||||
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_status] == '0' || $_REQUEST[search_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_type])){
|
||||
if($_REQUEST[search_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_print_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_print_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
//Get frequency name
|
||||
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency']));
|
||||
|
||||
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
//Get Type details
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
$delivery_method= !empty($row['del_method'])?$row['del_method']:'N/A';
|
||||
|
||||
if(!empty($row['expected_date']) && $row['expected_date']!='0000-00-00'){
|
||||
$expected_date= date('d-m-Y',strtotime($row['expected_date']));
|
||||
}
|
||||
elseif(!empty($row['expected_day'])){
|
||||
$expected_date= $row['expected_day'];
|
||||
}else{
|
||||
$expected_date= 'N/A';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_print_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",0)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."|".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."</td></tr>";
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td></tr>";
|
||||
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='6'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
ob_start(); session_start();
|
||||
|
||||
include("includes/connect.php");
|
||||
|
||||
//sleep( 3 );
|
||||
// no term passed - just exit early with no response
|
||||
if (empty($_GET['term'])) exit ;
|
||||
$q = strtolower($_GET["term"]);
|
||||
// remove slashes if they were magically added
|
||||
|
||||
if($q)
|
||||
{
|
||||
$query=mysql_query("select id,mediaOutlet from tbl_broad_media mediaOutlet LIKE '%".$q."%' ORDER BY mediaOutlet ASC ");
|
||||
//echo "select distinct(cate_name) from tbl_category where status = 'A' and cate_name LIKE '%".$q."%'";
|
||||
$result = array();
|
||||
while($res_cust=mysql_fetch_array($query))
|
||||
{
|
||||
$customer=$res_cust['mediaOutlet'];
|
||||
array_push($result,$customer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo json_encode($result);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,366 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publisher where 1";
|
||||
$sqls='';
|
||||
if(!empty($_REQUEST[search_publisher_status])){
|
||||
|
||||
$sqls.=" AND status='".$_REQUEST[search_publisher_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher_country])){
|
||||
|
||||
$sqls.=" AND id_country ='".$_REQUEST[search_publisher_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND id_publisher ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls ORDER BY id_publisher DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['id_country']));
|
||||
|
||||
|
||||
|
||||
if($row['status']=='A')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_publisher.php?task=edit&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publisher'].",4)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
$view_link = "<a href='add_publisher.php?task=view&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/view_2.png' width='20' height='20'></a>";
|
||||
|
||||
|
||||
if(empty($row['url']))
|
||||
{
|
||||
$url = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $row['url'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"><a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('../includes/connect.php');
|
||||
include('../includes/conf.php');
|
||||
|
||||
$type=$_REQUEST["type"];
|
||||
|
||||
extract($_POST);
|
||||
|
||||
if(!empty($task)){
|
||||
$sql = "SELECT * FROM tbl_broad_media where 1";
|
||||
$sqls='';
|
||||
if(!empty($search_broad_status)){
|
||||
|
||||
$sqls.=" AND status='".$search_broad_status."'";
|
||||
}
|
||||
if(!empty($search_broad_country)){
|
||||
|
||||
$sqls.=" AND id_country ='".$search_broad_country."'";
|
||||
}
|
||||
if(!empty($search_broad_language)){
|
||||
|
||||
$sqls.=" AND language_id='".$search_broad_language."'";
|
||||
}
|
||||
if(!empty($search_broad_type)){
|
||||
|
||||
$sqls.=" AND type='".$search_broad_type."'";
|
||||
}
|
||||
if(!empty($search_broad_publisher)){
|
||||
|
||||
$sqls.=" AND id_publisher='".$search_broad_publisher."'";
|
||||
}
|
||||
|
||||
if(!empty($search_broad_genre)){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$search_broad_genre."'";
|
||||
}
|
||||
if(!empty($search_broad_outlet)){
|
||||
|
||||
$sqls.=" AND mediaOutlet ='".$search_broad_outlet."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM tbl_broad_media where 1 $sqls"));
|
||||
$sql= $sql.$sqls;
|
||||
|
||||
}else{
|
||||
|
||||
$sql = "SELECT * FROM tbl_broad_media";
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM tbl_broad_media"));
|
||||
}
|
||||
$sql= $sql." ORDER BY id DESC";
|
||||
$result = mysql_query($sql);
|
||||
?>
|
||||
|
||||
<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-hover">
|
||||
<?
|
||||
|
||||
if(mysql_num_rows($result)>0){
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country_id']));
|
||||
|
||||
//Get Language details
|
||||
$language=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language_id']));
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<? if($row['status']=='A'){?>
|
||||
<img src="images/greencircle.png" width="14" height="14">
|
||||
<?php }else{?>
|
||||
<img src="images/redcircle.png" width="14" height="14">
|
||||
<?php }?><?=$row['mediaOutlet']?> </td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px"><?=$row['type']?></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px"><?=$country['name_country']?></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px"><?=$language['name']?></td>
|
||||
<td class="text-left"style="text-align:center">
|
||||
<a href="add_broadcast.php?task=edit&id=<?=$row['id']?>" class="slit">Edit</a>
|
||||
| <a href="add_broadcast.php?task=view&id=<?=$row['id']?>" class="slit">View</a>
|
||||
| <a href="javascript:void(0)" onClick="confirm_delete('<?=$row['id']?>','broad_delete')">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php $i++;}}else{ echo '<tr><td colspan="6">No Record Found</td></tr>';}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="result_r">Result = <?=$sql_count['total']?></div>
|
||||
</div>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('../includes/connect.php');
|
||||
include('../includes/conf.php');
|
||||
|
||||
$task=$_REQUEST["task"];
|
||||
|
||||
extract($_POST);
|
||||
|
||||
if(!empty($task)){
|
||||
$sql = "SELECT * FROM tbl_digital_media where 1";
|
||||
$sqls='';
|
||||
if(!empty($search_digit_status)){
|
||||
|
||||
$sqls.=" AND status='".$search_digit_status."'";
|
||||
}
|
||||
if(!empty($search_digit_country)){
|
||||
|
||||
$sqls.=" AND id_country ='".$search_digit_country."'";
|
||||
}
|
||||
if(!empty($search_digit_language)){
|
||||
|
||||
$sqls.=" AND language_id='".$search_digit_language."'";
|
||||
}
|
||||
if(!empty($search_digit_type)){
|
||||
|
||||
$sqls.=" AND type='".$search_digit_type."'";
|
||||
}
|
||||
if(!empty($search_digital_outlet)){
|
||||
|
||||
$sqls.=" AND id ='".$search_digital_outlet."'";
|
||||
}
|
||||
if(!empty($search_publisher)){
|
||||
|
||||
$sqls.=" AND id_publisher ='".$search_publisher."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM tbl_digital_media where 1 $sqls"));
|
||||
$sql= $sql.$sqls;
|
||||
|
||||
}else{
|
||||
|
||||
$sql = "SELECT * FROM tbl_digital_media";
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM tbl_digital_media"));
|
||||
}
|
||||
|
||||
$result = mysql_query($sql);
|
||||
?>
|
||||
<div class="row" style="overflow:auto;">
|
||||
|
||||
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-left">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-hover">
|
||||
<?
|
||||
|
||||
if(mysql_num_rows($result)>0){
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country_id']));
|
||||
|
||||
|
||||
//Get Language details
|
||||
$languages=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language_id']));
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<? if($row['status']=='A'){?>
|
||||
<img src="images/greencircle.png" width="14" height="14">
|
||||
<?php }else{?>
|
||||
<img src="images/redcircle.png" width="14" height="14">
|
||||
<?php }?> <?=$row['mediaOutlet']?>
|
||||
</td>
|
||||
<td class="text-left"><?=$row['type']?></td>
|
||||
<td class="text-left"><?=$languages['name']?></td>
|
||||
<td class="text-left"><?=$country['name_country']?></td>
|
||||
<td class="text-left" style="text-align:center"><?=($row['source_rank']=='11')?'N/A':$row['source_rank']?></td>
|
||||
<td class="text-left"><?=date('d-m-Y',strtotime($row['modified_date']))?></td>
|
||||
<td class="text-left"><?=date('H:i:s',strtotime($row['modified_date']))?></td>
|
||||
<td class="text-left"style="text-align:center">
|
||||
<a href="add_digital_media.php?task=edit&id=<?=$row['id']?>" class="slit">Edit</a>
|
||||
| <a href="add_digital_media.php?task=view&id=<?=$row['id']?>" class="slit">View</a>
|
||||
| <a href="javascript:void(0)" onClick="confirm_delete('<?=$row['id']?>','digital_delete')">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php $i++;}}else{ echo '<tr><td colspan="9">No Record Found</td></tr>';}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="result_r">Result = <?=$sql_count['total']?></div>
|
||||
</div>
|
||||
@@ -0,0 +1,572 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1";
|
||||
$sqls='';
|
||||
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_issue_status]=='0' || $_REQUEST[search_issue_status]=='1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_issue_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_issue_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_issue_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_type])){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_issue_type]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_issue_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_outlet])){
|
||||
|
||||
$sqls.=" AND pub.name_publication_en ='".$_REQUEST[search_issue_outlet]."'";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_REQUEST[issue_from_date]) && !empty($_REQUEST[issue_to_date])){
|
||||
|
||||
if($_REQUEST[search_date_type]=='expected_date'){
|
||||
|
||||
$sqls.=" AND ".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}elseif(!empty($_REQUEST[search_date_type])){
|
||||
|
||||
$sqls.=" AND iss.".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}else
|
||||
if($_REQUEST[issue_from_date] == $_REQUEST[issue_to_date])
|
||||
{
|
||||
$sqls.=" AND issue_date = '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls.=" AND issue_date between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC";
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT *,iss.created,iss.id_issue,iss.created_by FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{ $str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = '<a href="add_issue.php?task=edit&id='.$row['id_publication_issue'].'" class="slit"><img src="images/Edit_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication_issue'].',3)"><img src="images/Delete_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='12'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"issue_search('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"issue_search('1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"issue_search('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include('../includes/connect.php');
|
||||
|
||||
$task=$_REQUEST["task"];
|
||||
|
||||
|
||||
extract($_POST);
|
||||
if(!empty($task)){
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
|
||||
if($search_status=='0' || $search_status=='1'){
|
||||
|
||||
$sqls.=" AND active='".$search_status."'";
|
||||
}
|
||||
if(!empty($search_country)){
|
||||
|
||||
$sqls.=" AND country ='".$search_country."'";
|
||||
}
|
||||
if(!empty($search_language)){
|
||||
|
||||
$sqls.=" AND language='".$search_language."'";
|
||||
}
|
||||
if(!empty($search_type)){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$search_type."'";
|
||||
}
|
||||
if(!empty($search_frequency)){
|
||||
|
||||
$sqls.=" AND id_frequency='".$search_frequency."'";
|
||||
}
|
||||
if(!empty($search_outlet)){
|
||||
|
||||
$sqls.=" AND id_publication ='".$search_outlet."'";
|
||||
}
|
||||
if(!empty($search_print_publisher)){
|
||||
|
||||
$sqls.=" AND distribution ='".$search_print_publisher."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM publication where 1 $sqls"));
|
||||
|
||||
$sql= $sql.$sqls." LIMIT 0,10";
|
||||
|
||||
}else{
|
||||
|
||||
$sql = "SELECT * FROM publication LIMIT 0,10";
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM (
|
||||
SELECT id_publication FROM publication LIMIT 0, 10
|
||||
) publication"));
|
||||
}
|
||||
|
||||
$result = mysql_query($sql);
|
||||
?>
|
||||
|
||||
<div class="row" style="overflow:auto;">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left"style="text-align:center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-hover">
|
||||
<?
|
||||
|
||||
if(mysql_num_rows($result)>0){
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
|
||||
{ //Get frequency name
|
||||
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency']));
|
||||
|
||||
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
//Get Type details
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<? if($row['active']=='1'){?>
|
||||
<img src="images/greencircle.png" width="14" height="14">
|
||||
<?php }else{?>
|
||||
<img src="images/redcircle.png" width="14" height="14">
|
||||
<?php }?><?=$row['name_publication_en']?>
|
||||
</td>
|
||||
<td class="text-left"><?=$get_type['name_publication_type_en']?></td>
|
||||
<td class="text-left"><?=$frequency['name_frequency']?></td>
|
||||
<td class="text-left"><?=$country['name_country']?></td>
|
||||
<td class="text-left"style="text-align:center">
|
||||
|
||||
<a href="add_print_media.php?task=edit&id=<?=$row['id_publication']?>" class="slit">Edit</a> <?php }else{?>
|
||||
| <a href="add_print_media.php?task=view&id=<?=$row['id_publication']?>" class="slit">View</a>
|
||||
| <a href="javascript:void(0)" onClick="confirm_delete('<?=$row['id_publication']?>','delete')">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php $i++;}}else{ echo '<tr><td colspan="6">No Record Found</td></tr>';}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="result_r">Result = <?=$sql_count['total']?></div>
|
||||
</div>
|
||||
@@ -0,0 +1,436 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
extract($_POST);
|
||||
|
||||
$Printmedia=mysql_query("select logo from publication where id_publication=".$_POST['id']);
|
||||
$getMedia=mysql_fetch_assoc($Printmedia);
|
||||
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $_POST['id'].".".$add_file[1];
|
||||
$logo="momslogo/broad/".$name;
|
||||
$dblogo="../momslogo/broad/".$name;
|
||||
unset($getMedia['logo']);
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$dblogo);
|
||||
}else{
|
||||
$logo=$getMedia['logo'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
$sql_update = mysql_query("UPDATE publication SET `active` = '".$status."',`name_publication_en` = '".$mediaOutlet."',`name_publication_ar` = '".$mediaOutlet."', `id_publication_type` = '".$id_publication_type."',`country` = '".$country_id."', `language` = '".$language_id."',`id_publication_genre` = '".$id_publication_genre."',`logo` = '".$logo."',`url` = '".$url."',`telephone` = '".$telephone."',`email` = '".$email."',`modified` = '".date('Y-m-d H:i:s')."',`distribution` = '".$id_publisher."', `owner` = '".$owner."',`adrate_color` = '".$rate."' WHERE `id_publication`='".$_POST['id']."'");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_broad_status] == '0' || $_REQUEST[search_broad_status] == '1'){
|
||||
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_broad_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_broad_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_broad_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_type])){
|
||||
if($_REQUEST[search_broad_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_broad_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_broad_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_broad_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_broad_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_broad_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
$sql_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as total FROM publication where 1 and id_publication_type IN (4,5) $sqls"));
|
||||
//$sql= $sql.$sqls;
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (4,5) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record updated succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str = '<div style="overflow:auto; margin-left:0px;" class="row">
|
||||
<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while($row = mysql_fetch_assoc($data))
|
||||
|
||||
{ //Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
$edit_link = '<a href="add_broadcast.php?task=edit&id='.$row['id_publication'].'" class="slit"><img src="images/Edit_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication'].',1)"><img src="images/Delete_2.png" width="18" height="18"></a>';
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
<td class="text-left">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str .= '<tr>
|
||||
<td class="text-left" style="text-align:left">
|
||||
<img src="'.$img.'" width="14" height="14"> <a href="add_broadcast.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:9px">'.$country['name_country'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$i++;}}
|
||||
else{
|
||||
$str .='<tr><td colspan="6">No Record Found</td></tr>';
|
||||
}
|
||||
|
||||
$str .= '</table></div>';
|
||||
|
||||
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"broad_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,479 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extract($_POST);
|
||||
|
||||
$Printmedia=mysql_query("select logo from publication where id_publication='".$_REQUEST['dig_frm_id']."'");
|
||||
|
||||
|
||||
$getMedia=mysql_fetch_assoc($Printmedia);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
|
||||
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $_REQUEST['dig_frm_id'].".".$add_file[1];
|
||||
$logo_db="../momslogo/digital/".$name;
|
||||
$logo="momslogo/digital/".$name;
|
||||
unset($getMedia['logo']);
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$logo_db);
|
||||
}else{
|
||||
|
||||
|
||||
$logo=$getMedia['logo'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$sql_update = mysql_query("UPDATE publication SET `active` = '".$status."',`name_publication_en` = '".$mediaOutlet."',`name_publication_ar` = '".$mediaOutlet."', `id_publication_type` = '".$id_publication_type."',`country` = '".$country_id."', `language` = '".$language_id."',`id_publication_genre` = '".$id_publication_genre."',`subscription` = '".$subscription."',`hits` = '".$hits."',`source_rank` = '".$source_rank."',`logo` = '".$logo."',`url` = '".$url."',`telephone` = '".$phone."',`email` = '".$email."',`modified` = '".date('Y-m-d H:i:s')."',`distribution` = '".$id_publisher."' WHERE `id_publication`='".$_REQUEST['dig_frm_id']."'");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
if($_REQUEST[search_digit_status] == '0' || $_REQUEST[search_digit_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_digit_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_digit_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_digit_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_type])){
|
||||
if($_REQUEST[search_digit_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_digit_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_digit_genre])){
|
||||
|
||||
$sqls.=" AND id_publication_genre='".$_REQUEST[search_digit_genre]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_digital_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_digital_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls";
|
||||
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (3,6,7,8,9) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record updated succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Rank</th>
|
||||
<th class="text-left">Date Harvested</th>
|
||||
<th class="text-left">Time Harvested</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
|
||||
//Get Language details
|
||||
//$languages=mysql_fetch_assoc(mysql_query("select name from tbl_languages where id=".$row['language']));
|
||||
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$act = 'digital_delete';
|
||||
|
||||
$edit_link = "<a href='add_digital_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",2)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
|
||||
$dt = date('d-m-Y',strtotime($row['modified']));
|
||||
$tme = date('H:i:s',strtotime($row['modified']));
|
||||
|
||||
if($row['source_rank'] == '1')
|
||||
{
|
||||
$rank = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$rank = $row['source_rank'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
<td class="text-left" style="text-align:center">'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="add_digital_media.php?task=view&id='.$row['id_publication'].'" class="slit">'.$row['name_publication_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$get_type['name_publication_type_en'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$row['language'].'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:center">'.$rank.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$dt.'</td>
|
||||
<td class="text-left" style="text-align:left; padding-left:8px">'.$tme.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"digital_filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
include('../includes/conf.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
extract($_POST);
|
||||
|
||||
$Printmedia=mysql_query("select logo,rate_sheet from publication where id_publication=".$id_publication);
|
||||
|
||||
$getMedia=mysql_fetch_assoc($Printmedia);
|
||||
|
||||
if(($_FILES['logo']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['logo']['name']);
|
||||
$name = $_POST['id_publication'].".".$add_file[1];
|
||||
$logo="momslogo/print/".$name;
|
||||
$dblogo="../momslogo/print/".$name;
|
||||
unset($getMedia['logo']);
|
||||
|
||||
move_uploaded_file($_FILES["logo"]["tmp_name"],$dblogo);
|
||||
}else{
|
||||
$logo=$getMedia['logo'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!empty($expected_date))
|
||||
$expected_day='';
|
||||
if(!empty($expected_day))
|
||||
$expected_date='';
|
||||
|
||||
$expectedday='';
|
||||
if($id_frequency==3){
|
||||
|
||||
for($i=0;$i<count($expected_day);$i++){
|
||||
|
||||
if(count($expected_day)==$i+1)
|
||||
$expectedday.= $expected_day[$i];
|
||||
else
|
||||
$expectedday.= $expected_day[$i].", ";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{$expectedday= $expected_day;}
|
||||
|
||||
|
||||
$sql_update = mysql_query("UPDATE publication SET `active` = '".$active."',`name_publication_en` = '".$name_publication_en."',`name_publication_ar` = '".$name_publication_en."', `id_publication_type` = '".$id_publication_type."',`id_frequency` = '".$id_frequency."',`country` = '".$country."', `language` = '".$language."',`id_publication_genre` = '".$id_publication_genre."',`logo` = '".$logo."',`circulation` = '".$circulation."', `distribution` = '".$distribution."',`del_method` = '".$del_method."',`adrate_color` = '".$adrate_bw."', `rate_sheet` = '".$rate_sheet."',`url` = '".$url."',`telephone` = '".$telephone."',`email` = '".$email."',`modified` = '".date('Y-m-d H:i:s')."',`created` = 'admin',`expected_date` = '".$expected_date."',`expected_day` = '".$expectedday."' WHERE `id_publication`='".$_POST['id_publication']."'");
|
||||
|
||||
if(($_FILES['rate_sheet']['name'])!="")
|
||||
{
|
||||
$add_file=explode('.',$_FILES['rate_sheet']['name']);
|
||||
|
||||
|
||||
$name = $_POST['id_publication'].".".$add_file[1];
|
||||
$rate_sheet = $_RATEPATH.$name;
|
||||
|
||||
|
||||
|
||||
unset($getMedia['rate_sheet']);
|
||||
move_uploaded_file($_FILES["rate_sheet"]["tmp_name"],$rate_sheet);
|
||||
mysql_query("update publication set rate_sheet = '".$rate_sheet."' where id_publication = '".$_POST['id_publication']."'");
|
||||
|
||||
|
||||
}else{
|
||||
$rate_sheet=$getMedia['rate_sheet'];
|
||||
mysql_query("update publication set rate_sheet = '".$rate_sheet."' where id_publication = '".$_POST['id_publication']."'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST['task'])){
|
||||
|
||||
|
||||
$sql = "SELECT * FROM publication where 1";
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_status] == '0' || $_REQUEST[search_status] == '1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_type])){
|
||||
if($_REQUEST[search_type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[type])){
|
||||
if($_REQUEST[type]!='All'){
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[type]."'";
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST[search_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_outlet])){
|
||||
|
||||
$sqls.=" AND name_publication_en ='".$_REQUEST[search_outlet]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_print_publisher])){
|
||||
|
||||
$sqls.=" AND distribution ='".$_REQUEST[search_print_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publication where 1 and id_publication_type IN (1,2) $sqls ORDER BY id_publication DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record updated succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0px;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Type</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Delivery Method</th>
|
||||
<th class="text-left">Expected Date/Day</th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
//Get frequency name
|
||||
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency']));
|
||||
|
||||
|
||||
//Get Country details
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
|
||||
|
||||
//Get Type details
|
||||
|
||||
|
||||
$get_type=mysql_fetch_assoc(mysql_query("select name_publication_type_en from publication_type where id_publication_type=".$row['id_publication_type']));
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
if($row['active']=='1')
|
||||
{
|
||||
$status = "Active";
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = "Inactive";
|
||||
}
|
||||
$delivery_method= !empty($row['del_method'])?$row['del_method']:'N/A';
|
||||
|
||||
if(!empty($row['expected_date']) && $row['expected_date']!='0000-00-00'){
|
||||
$expected_date= date('d-m-Y',strtotime($row['expected_date']));
|
||||
}
|
||||
elseif(!empty($row['expected_day'])){
|
||||
$expected_date= $row['expected_day'];
|
||||
}else{
|
||||
$expected_date= 'N/A';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_print_media.php?task=edit&id=".$row['id_publication']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publication'].",0)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."|".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$del_link."</td></tr>";
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'>".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td><td class='text-left' style='text-align:center'>".$edit_link."</td></tr>";
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.="<tr><td class='text-left' style='text-align:left'><img src='$img' width='14' height='14'><a href='add_print_media.php?task=view&id=".$row['id_publication']."' id='".$row['id_publication']."' class='slit'> ".$row['name_publication_en']."</a></td><td class='text-left' style='text-align:left; padding-left:10px'>".$get_type['name_publication_type_en']."</td>
|
||||
<td class='text-left' style='text-align:left; padding-left:10px'>".$frequency['name_frequency']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$country['name_country']."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$delivery_method."</td><td class='text-left' style='text-align:left; padding-left:10px'>".$expected_date."</td></tr>";
|
||||
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='6'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"filter_type('$click','$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"filter_type('$click','$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"filter_type('$click','$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,370 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
$sql_update = mysql_query("UPDATE publisher SET `status` = '".$status."',`name_publisher_en` = '".$name_publisher_en."',`name_publisher_ar` = '".$name_publisher_ar."',`id_country` = '".$id_country."', `url` = '".$url."',`phone` = '".$phone."',`email` = '".$email."',`fax` = '".$fax."',`modified` = '".date('Y-m-d H:i:s')."' WHERE `id_publisher`='".$_POST['id_publisher']."'");
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT * FROM publisher where 1";
|
||||
$sqls='';
|
||||
if(!empty($_REQUEST[search_publisher_status])){
|
||||
|
||||
$sqls.=" AND status='".$_REQUEST[search_publisher_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher_country])){
|
||||
|
||||
$sqls.=" AND id_country ='".$_REQUEST[search_publisher_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_publisher])){
|
||||
|
||||
$sqls.=" AND id_publisher ='".$_REQUEST[search_publisher]."'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT * FROM publisher where 1 $sqls ORDER BY id_publisher DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record updated succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<div style="overflow:auto; margin-left:0;" class="row"><table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Name</th>
|
||||
<th class="text-left">Country</th>
|
||||
<th class="text-left">Email</th>
|
||||
<th class="text-left">Telephone</th>
|
||||
<th class="text-left">URL</th>
|
||||
<th class="text-center">Action<span style="color:#22b5d4">Action</span></th>
|
||||
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($data)>0){
|
||||
while( $row = mysql_fetch_array($data)){
|
||||
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['id_country']));
|
||||
|
||||
|
||||
|
||||
if($row['status']=='A')
|
||||
{
|
||||
$img = "images/greencircle.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$img = "images/redcircle.png";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$edit_link = "<a href='add_publisher.php?task=edit&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/Edit_2.png' width='18' height='18'></a>";
|
||||
|
||||
|
||||
$del_link = "<a href='javascript:void(0)' onClick='confirm_delete(".$row['id_publisher'].",4)'><img src='images/Delete_2.png' width='18' height='18'></a>";
|
||||
|
||||
$view_link = "<a href='add_publisher.php?task=view&id_publisher=".$row['id_publisher']."' class='slit'><img src='images/view_2.png' width='20' height='20'></a>";
|
||||
|
||||
|
||||
if(empty($row['url']))
|
||||
{
|
||||
$url = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $row['url'];
|
||||
}
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$del_link.'</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"><a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'|'.$edit_link.'</td></tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr><td class="text-left" style="text-align:left"><img src="'.$img.'" width="14" height="14"> <a href="view_media.php?id_publisher='.$row['id_publisher'].'" class="slit">'
|
||||
.$row['name_publisher_en'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['email'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$row['phone'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$url.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$view_link.'</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='9'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table></div>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"publisher_filter_type('$click','1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"publisher_filter_type('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"publisher_filter_type('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,587 @@
|
||||
<?php
|
||||
ob_start();
|
||||
session_start();
|
||||
$limit = 10;
|
||||
$adjacent = 3;
|
||||
include('../includes/connect.php');
|
||||
$task=$_REQUEST["task"];
|
||||
extract($_POST);
|
||||
|
||||
|
||||
|
||||
|
||||
$get_id = mysql_fetch_assoc(mysql_query("select * FROM publication where name_publication_en='".$_REQUEST['search_issue_outlet']."'"));
|
||||
|
||||
|
||||
$sql_update = mysql_query("UPDATE publication_issue SET `id_publication` = '".$get_id['id_publication']."',`received_date` = '".$received_date."',`received_by` = '".$_SESSION['moms_uid']."',`created` = '".$created."',`created_by` = '".$scanned_by."',`done_time` = '".$done_time."',`done_by` = '".$processed_by."',`issue_date` = '".$issue_date."' WHERE `id_publication_issue`='".$_POST['id_publication_issue']."'");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['actionfunction']) && $_REQUEST['actionfunction']!=''){
|
||||
$actionfunction = $_REQUEST['actionfunction'];
|
||||
|
||||
call_user_func($actionfunction,$_REQUEST,$con,$limit,$adjacent);
|
||||
}
|
||||
function showData($data,$con,$limit,$adjacent){
|
||||
|
||||
|
||||
if(!empty($_REQUEST[task])){
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1";
|
||||
$sqls='';
|
||||
|
||||
$sqls='';
|
||||
|
||||
if($_REQUEST[search_issue_status]=='0' || $_REQUEST[search_issue_status]=='1'){
|
||||
|
||||
$sqls.=" AND active='".$_REQUEST[search_issue_status]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_country])){
|
||||
|
||||
$sqls.=" AND country ='".$_REQUEST[search_issue_country]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_language])){
|
||||
|
||||
$sqls.=" AND language='".$_REQUEST[search_issue_language]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_type])){
|
||||
|
||||
$sqls.=" AND id_publication_type='".$_REQUEST[search_issue_type]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_frequency])){
|
||||
|
||||
$sqls.=" AND id_frequency='".$_REQUEST[search_issue_frequency]."'";
|
||||
}
|
||||
if(!empty($_REQUEST[search_issue_outlet])){
|
||||
|
||||
$sqls.=" AND pub.name_publication_en ='".$_REQUEST[search_issue_outlet]."'";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_REQUEST[issue_from_date]) && !empty($_REQUEST[issue_to_date])){
|
||||
|
||||
if($_REQUEST[search_date_type]=='expected_date'){
|
||||
|
||||
$sqls.=" AND ".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}elseif(!empty($_REQUEST[search_date_type])){
|
||||
|
||||
$sqls.=" AND iss.".$_REQUEST[search_date_type]." between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
|
||||
}else
|
||||
if($_REQUEST[issue_from_date] == $_REQUEST[issue_to_date])
|
||||
{
|
||||
$sqls.=" AND issue_date = '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls.=" AND issue_date between '".date('Y-m-d',strtotime($_REQUEST[issue_from_date]))."' and '".date('Y-m-d',strtotime($_REQUEST[issue_to_date]))."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$page = $data['page'];
|
||||
if($page==1){
|
||||
$start = 0;
|
||||
}
|
||||
else{
|
||||
$start = ($page-1)*$limit;
|
||||
}
|
||||
$sql = "SELECT *,iss.created FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created";
|
||||
|
||||
$rows = mysql_query($sql);
|
||||
$rows = mysql_num_rows($rows);
|
||||
//$c = mysql_num_rows($rows);
|
||||
|
||||
$sql = "SELECT *,iss.created,iss.id_issue,iss.created_by FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 $sqls order by iss.created DESC limit $start,$limit";
|
||||
//echo $sql;
|
||||
$data = mysql_query($sql);
|
||||
|
||||
echo "<h3 style='color:green;' align='center'> Record updated succesfully.</h3>";
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{ $str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
|
||||
}
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
<th class="text-center" style="width:85px">Action</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str='<table class="table-fill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Issue Date</th>
|
||||
<th class="text-left">Name<span style="color:#22b5d4;">NameName</span></th>
|
||||
<!--<th class="text-left">Type</th>
|
||||
<th class="text-left">Language</th>
|
||||
<th class="text-left">Frequency</th>
|
||||
<th class="text-left">Country</th>-->
|
||||
<th class="text-left">Received Date</th>
|
||||
<th class="text-left">Received By</th>
|
||||
<th class="text-left">Expected Date</th>
|
||||
<th class="text-left">Scanned Date</th>
|
||||
<th class="text-left">Scanned By</th>
|
||||
<th class="text-left">Processed Date</th>
|
||||
<th class="text-left">Processed By</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = '<a href="add_issue.php?task=edit&id='.$row['id_publication_issue'].'" class="slit"><img src="images/Edit_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
$del_link = '<a href="javascript:void(0)" onClick="confirm_delete('.$row['id_publication_issue'].',3)"><img src="images/Delete_2.png" width="16" height="15"></a>';
|
||||
|
||||
|
||||
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'|'.$del_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1' && $_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_uid'] == '1')
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$del_link.'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "super_admin")
|
||||
{
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
<td class="text-left"style="text-align:center">'.$edit_link.'</td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
if($_SESSION['moms_type'] == "admin")
|
||||
{
|
||||
|
||||
$str.='<tr>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;"><a href="add_issue.php?task=view&id='.$row['id_publication_issue'].'" class="slit">'.$row['issue_date'].'</a></td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['name_publication_en'].'</td>
|
||||
<!--<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_type['name_publication_type_en'].'</td>
|
||||
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$get_name['language'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$frequency['name_frequency'].'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$country['name_country'].'</td>-->
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_r.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$recd_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$date_e.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$cr_by.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$scn_pub.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$done_time.'</td>
|
||||
<td class="text-left" style="text-align:left;padding-left:10px;">'.$pro_pub.'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('.slit').on('click', function ( e ) {
|
||||
$.fn.custombox( this, {
|
||||
effect: 'slit'
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
$str .= "<tr><td colspan='12'>No Record Found</td></tr>";
|
||||
}
|
||||
$str.='</table>';
|
||||
|
||||
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_.= "<a class='page-numbers' onclick=\"issue_search('$prev')\" style='cursor:pointer'>previous</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">previous</span>";
|
||||
}
|
||||
|
||||
//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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$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.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
|
||||
//in middle; hide some front and some back
|
||||
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
|
||||
{
|
||||
$first.= "<a class='page-numbers' href=\"?page=1\">First</a>";
|
||||
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last.= "<a class='page-numbers' onclick=\"issue_search('$lastpage')\" style='cursor:pointer'>Last</a>";
|
||||
}
|
||||
//close to end; only hide early pages
|
||||
else
|
||||
{
|
||||
$first.= "<a class='page-numbers' onclick=\"issue_search('1')\" style='cursor:pointer'>First</a>";
|
||||
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
|
||||
{
|
||||
if ($counter == $page)
|
||||
$pagination.= "<span class=\"active\"><a>$counter</a></span>";
|
||||
else
|
||||
$pagination.= "<a class='page-numbers' onclick=\"issue_search('$counter')\" style='cursor:pointer'>$counter</a>";
|
||||
}
|
||||
$last='';
|
||||
}
|
||||
|
||||
}
|
||||
if ($page < $counter - 1)
|
||||
$next_.= "<a class='page-numbers' onclick=\"issue_search('$next')\" style='cursor:pointer'>next</a>";
|
||||
else{
|
||||
//$pagination.= "<span class=\"disabled\">next</span>";
|
||||
}
|
||||
$pagination = "<div class=\"pagination\">".$first.$prev_.$pagination.$next_.$last;
|
||||
//next button
|
||||
|
||||
$pagination.= "</div>\n";
|
||||
}
|
||||
|
||||
echo "<br>".$pagination;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="result_r">Result = <?=$rows?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user