Initial commit

This commit is contained in:
melzubeir
2017-05-26 15:17:48 +04:00
commit 1f43248510
254 changed files with 72319 additions and 0 deletions
+305
View File
@@ -0,0 +1,305 @@
<?php
ob_start();
session_start();
include('includes/connect.php');
include('includes/conf.php');
$sql="SELECT * FROM publication_issue iss join publication pub ON iss.id_publication = pub.id_publication where 1 and iss.id_publication_issue = '420521' order by iss.id_publication";
$query = mysql_fetch_array(mysql_query($sql));
$cur_date = "";
$d = date('Y-m-d');
if ($query) {
//print_r($query);exit;
if($query['id_frequency'] == '1')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq1']);
if($d1 > $d2 || $query['email_freq1'] =="")
{
echo "1";
mysql_query("update publication_issue set email_freq1 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
else
if($query['id_frequency'] == '2')
{
$timestamp = strtotime(date('Y-m-d'));
$day = date('l', $timestamp);
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq2']);
if($d1 > $d2 || $query['email_freq2'] =="")
{
if($day == $query['expected_day'])
{
echo "2";
mysql_query("update publication_issue set email_freq2 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
//echo $day;
}
else
if($query['id_frequency'] == '3')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq3']);
if($d1 > $d2 || $query['email_freq3'] =="")
{
$timestamp = strtotime(date('Y-m-d'));
$day = date('l', $timestamp);
$days = explode(',',$query['expected_day']);
if(in_array($day,$days))
{
echo "3";
mysql_query("update publication_issue set email_freq3 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
}
else
if($query['id_frequency'] == '4')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq3']);
if($d1 > $d2 || $query['email_freq3'] =="")
{
$get_d = explode('-',$query['expected_day']);
$new_date = $get_d[2]."-".date('m-Y');
if($d == $new_date)
{
echo "4";
mysql_query("update publication_issue set email_freq4 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
}
else
if($query['id_frequency'] == '5')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq5']);
if($query['email_freq5'] =="")
{
if($d == $query['expected_date'])
{
$d = date('Y-m-d', strtotime("+2 months", strtotime($query['expected_date'])));
echo "5";
mysql_query("update publication_issue set email_freq5 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
else
{
if($d == $query['email_freq5'])
{
$d = date('Y-m-d', strtotime("+2 months", strtotime($query['email_freq5'])));
echo "5";
mysql_query("update publication_issue set email_freq5 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
mysql_query("update publication set email_freq5 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
else
if($query['id_frequency'] == '6')
{
// mysql_query("update publication set email_freq6 = '".$query['expected_day']."' where id_publication_issue = '".$query['id_publication_issue']."'");
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq6']);
if($query['email_freq6'] =="")
{
if($d == $query['expected_date'])
{
$d = date('Y-m-d', strtotime("+3 months", strtotime($query['expected_date'])));
echo "6";
mysql_query("update publication_issue set email_freq6 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
else
{
if($d == $query['email_freq6'])
{
$d = date('Y-m-d', strtotime("+3 months", strtotime($query['email_freq6'])));
echo "6";
mysql_query("update publication_issue set email_freq6 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
}
else
if($query['id_frequency'] == '7')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq7']);
if($query['email_freq7'] =="")
{
if($d == $query['expected_date'])
{
$d = date('Y-m-d', strtotime("+2 year", strtotime($query['expected_date'])));
echo "7";
mysql_query("update publication_issue set email_freq7 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
else
{
if($d == $query['email_freq7'])
{
$d = date('Y-m-d', strtotime("+2 year", strtotime($query['email_freq7'])));
echo "7";
mysql_query("update publication_issue set email_freq7 = '$d' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
}
else
if($query['id_frequency'] == '8')
{
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq3']);
if($d1 > $d2 || $query['email_freq3'] =="")
{
$get_d = explode('-',$query['expected_day']);
$new_date = $get_d[2]."-".$get_d[1]."-".date('Y');
if($d == $new_date)
{
echo "8";
}
}
}
else
if($query['id_frequency'] == '9')
{
$timestamp = strtotime(date('Y-m-d'));
$day = date('l', $timestamp);
$d1 = strtotime(date('Y-m-d'));
$d2 = strtotime($query['email_freq2']);
$inc = '0';
$upd = $d."_".$inc;
if($d1 > $d2 || $query['email_freq9'] =="")
{
if($query['email_freq9'] == "")
{
$dd = $d."_".$inc;
$exp = explode($dd);
}
else
{
$exp = explode($query['email_freq9']);
}
if($day == $query['expected_day'] && ($exp[1] % 2) == 0)
{
$inc = $exp[1] + 1;
$upd = $d."_".$inc;
echo "9";
mysql_query("update publication_issue set email_freq9 = '$upd' where id_publication_issue = '".$query['id_publication_issue']."'");
}
}
}
/* require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->From = $_SITENAME; //From Address -- CHANGE --
$mail->FromName = $_SITENAME; //From Name -- CHANGE --
$mail->AddAddress($query['email'], "User"); //To Address -- CHANGE --
$mail->AddBcc("sourabhs@custom-soft.com", "User"); //To Address -- CHANGE --
$mail->IsHTML(false); // set email format to HTML
$mail->Subject = "Notification:Your expected date crossed";
$mail->Body = "Hello ".$query['name_publication_en'].",
<br /><br />
This is to inform you that you have exceeded your expected date i.e. ".date('Y-m-d',strtotime($query['expected_date'])).".";
*/
}
?>
+213
View File
@@ -0,0 +1,213 @@
*{
margin:0;
padding:0;
}
body{
font-family:Arial, sans-serif;
font-size:14px;
background:#f4f4f4 url(../images/bg.gif) repeat top left;
color:#333;
text-shadow:1px 1px 1px #fff;
overflow-y:scroll;
}
h1{
font-size:56px;
}
h2{
font-size:24px;
padding:0px 0px 40px 0px;
color:#333;
text-align:center;
}
h2 span{
color:#ffa800;
}
a{
color:#777;
}
a:hover{
color:#222;
}
p{
padding:5px 0px;
}
.wrapper{
width:960px;
margin:20px auto;
min-height:550px;
}
.box{
width:49%;
}
.left{
float:left;
}
.right{
float:right;
}
.clear{
clear:both;
}
a.back{
color:#777;
position:fixed;
top:5px;
right:10px;
text-decoration:none;
}
/* Form Style */
.form_wrapper{
background:#fff;
border:1px solid #ddd;
margin:0 auto;
width:350px;
font-size:16px;
-moz-box-shadow:1px 1px 7px #ccc;
-webkit-box-shadow:1px 1px 7px #ccc;
box-shadow:1px 1px 7px #ccc;
}
.form_wrapper h3{
padding:20px 30px 20px 30px;
background-color:#444;
color:#fff;
font-size:25px;
border-bottom:1px solid #ddd;
}
.form_wrapper form{
display:none;
background:#fff;
}
.form_wrapper .column{
width:47%;
float:left;
}
form.active{
display:block;
}
form.login{
width:350px;
}
form.register{
width:550px;
}
form.forgot_password{
width:300px;
}
.form_wrapper a{
text-decoration:none;
color:#777;
font-size:12px;
}
.form_wrapper a:hover{
color:#000;
}
.form_wrapper label{
display:block;
padding:10px 30px 0px 30px;
margin:10px 0px 0px 0px;
}
.form_wrapper input[type="text"],
.form_wrapper input[type="password"]{
border: solid 1px #E5E5E5;
background: #FFFFFF;
margin: 5px 30px 0px 30px;
padding: 9px;
display:block;
font-size:16px;
width:76%;
background:
-webkit-gradient(
linear,
left top,
left 25,
from(#FFFFFF),
color-stop(4%, #EEEEEE),
to(#FFFFFF)
);
background:
-moz-linear-gradient(
top,
#FFFFFF,
#EEEEEE 1px,
#FFFFFF 25px
);
-moz-box-shadow: 0px 0px 8px #f0f0f0;
-webkit-box-shadow: 0px 0px 8px #f0f0f0;
box-shadow: 0px 0px 8px #f0f0f0;
}
.form_wrapper input[type="text"]:focus,
.form_wrapper input[type="password"]:focus{
background:#feffef;
}
.form_wrapper .bottom{
background-color:#444;
border-top:1px solid #ddd;
margin-top:20px;
clear:both;
color:#fff;
text-shadow:1px 1px 1px #000;
}
.form_wrapper .bottom a{
display:block;
clear:both;
padding:10px 30px;
text-align:right;
color:#ffa800;
text-shadow:1px 1px 1px #000;
}
.form_wrapper a.forgot{
float:right;
font-style:italic;
line-height:24px;
color:#ffa800;
text-shadow:1px 1px 1px #fff;
}
.form_wrapper a.forgot:hover{
color:#000;
}
.form_wrapper div.remember{
float:left;
width:140px;
margin:20px 0px 20px 30px;
font-size:11px;
}
.form_wrapper div.remember input{
float:left;
margin:2px 5px 0px 0px;
}
.form_wrapper span.error{
visibility:hidden;
color:red;
font-size:11px;
font-style:italic;
display:block;
margin:4px 30px;
}
.form_wrapper input[type="submit"] {
background: #e3e3e3;
border: 1px solid #ccc;
color: #333;
font-family: "Trebuchet MS", "Myriad Pro", sans-serif;
font-size: 14px;
font-weight: bold;
padding: 8px 0 9px;
text-align: center;
width: 150px;
cursor:pointer;
float:right;
margin:15px 20px 10px 10px;
text-shadow: 0px 1px 0px #fff;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: 0px 0px 2px #fff inset;
-webkit-box-shadow: 0px 0px 2px #fff inset;
box-shadow: 0px 0px 2px #fff inset;
}
.form_wrapper input[type="submit"]:hover {
background: #d9d9d9;
-moz-box-shadow: 0px 0px 2px #eaeaea inset;
-webkit-box-shadow: 0px 0px 2px #eaeaea inset;
box-shadow: 0px 0px 2px #eaeaea inset;
color: #222;
}
Binary file not shown.
+186
View File
@@ -0,0 +1,186 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Animated Form Switching with jQuery</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Expand, contract, animate forms with jQuery wihtout leaving the page" />
<meta name="keywords" content="expand, form, css3, jquery, animate, width, height, adapt, unobtrusive javascript"/>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/ChunkFive_400.font.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1',{ textShadow: '1px 1px #fff'});
Cufon.replace('h2',{ textShadow: '1px 1px #fff'});
Cufon.replace('h3',{ textShadow: '1px 1px #000'});
Cufon.replace('.back');
</script>
</head>
<body>
<div class="wrapper">
<h1>Animated Form Switching</h1>
<h2>Demo: click the <span>orange links</span> to see the form animating and switching</h2>
<div class="content">
<div id="form_wrapper" class="form_wrapper">
<form class="register">
<h3>Register</h3>
<div class="column">
<div>
<label>First Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Last Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Website:</label>
<input type="text" value="http://"/>
<span class="error">This is an error</span>
</div>
</div>
<div class="column">
<div>
<label>Username:</label>
<input type="text"/>
<span class="error">This is an error</span>
</div>
<div>
<label>Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password:</label>
<input type="password" />
<span class="error">This is an error</span>
</div>
</div>
<div class="bottom">
<div class="remember">
<input type="checkbox" />
<span>Send me updates</span>
</div>
<input type="submit" value="Register" />
<a href="index.html" rel="login" class="linkform">You have an account already? Log in here</a>
<div class="clear"></div>
</div>
</form>
<form class="login">
<h3>Login</h3>
<div>
<label>Username:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password: <a href="forgot_password.html" rel="forgot_password" class="forgot linkform">Forgot your password?</a></label>
<input type="password" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<div class="remember"><input type="checkbox" /><span>Keep me logged in</span></div>
<input type="submit" value="Login"></input>
<a href="register.html" rel="register" class="linkform">You don't have an account yet? Register here</a>
<div class="clear"></div>
</div>
</form>
<form class="forgot_password active">
<h3>Forgot Password</h3>
<div>
<label>Username or Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<input type="submit" value="Send reminder"></input>
<a href="index.html" rel="login" class="linkform">Suddenly remebered? Log in here</a>
<a href="register.html" rel="register" class="linkform">You don't have an account? Register here</a>
<div class="clear"></div>
</div>
</form>
</div>
<div class="clear"></div>
</div>
<a class="back" href="http://tympanus.net/codrops/2011/01/06/animated-form-switching/">back to the Codrops tutorial</a>
</div>
<!-- The JavaScript -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
//the form wrapper (includes all forms)
var $form_wrapper = $('#form_wrapper'),
//the current form is the one with class active
$currentForm = $form_wrapper.children('form.active'),
//the change form links
$linkform = $form_wrapper.find('.linkform');
//get width and height of each form and store them for later
$form_wrapper.children('form').each(function(i){
var $theForm = $(this);
//solve the inline display none problem when using fadeIn fadeOut
if(!$theForm.hasClass('active'))
$theForm.hide();
$theForm.data({
width : $theForm.width(),
height : $theForm.height()
});
});
//set width and height of wrapper (same of current form)
setWrapperWidth();
/*
clicking a link (change form event) in the form
makes the current form hide.
The wrapper animates its width and height to the
width and height of the new current form.
After the animation, the new form is shown
*/
$linkform.bind('click',function(e){
var $link = $(this);
var target = $link.attr('rel');
$currentForm.fadeOut(400,function(){
//remove class active from current form
$currentForm.removeClass('active');
//new current form
$currentForm= $form_wrapper.children('form.'+target);
//animate the wrapper
$form_wrapper.stop()
.animate({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
},500,function(){
//new form gets class active
$currentForm.addClass('active');
//show the new form
$currentForm.fadeIn(400);
});
});
e.preventDefault();
});
function setWrapperWidth(){
$form_wrapper.css({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
});
}
/*
for the demo we disabled the submit buttons
if you submit the form, you need to check the
which form was submited, and give the class active
to the form you want to show
*/
$form_wrapper.find('input[type="submit"]')
.click(function(e){
e.preventDefault();
});
});
</script>
</body>
</html>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

Binary file not shown.
+187
View File
@@ -0,0 +1,187 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Media Outlet Tracking</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Expand, contract, animate forms with jQuery wihtout leaving the page" />
<meta name="keywords" content="expand, form, css3, jquery, animate, width, height, adapt, unobtrusive javascript"/>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/ChunkFive_400.font.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1',{ textShadow: '1px 1px #fff'});
Cufon.replace('h2',{ textShadow: '1px 1px #fff'});
Cufon.replace('h3',{ textShadow: '1px 1px #000'});
Cufon.replace('.back');
</script>
</head>
<body>
<div class="wrapper">
<div class="content">
<h2>Media Outlet Tracking</h2>
<div id="form_wrapper" class="form_wrapper">
<form class="register">
<h3>Register</h3>
<div class="column">
<div>
<label>First Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Last Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Website:</label>
<input type="text" value="http://"/>
<span class="error">This is an error</span>
</div>
</div>
<div class="column">
<div>
<label>Username:</label>
<input type="text"/>
<span class="error">This is an error</span>
</div>
<div>
<label>Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password:</label>
<input type="password" />
<span class="error">This is an error</span>
</div>
</div>
<div class="bottom">
<div class="remember">
<input type="checkbox" />
<span>Send me updates</span>
</div>
<input type="submit" value="Register" />
<a href="index.html" rel="login" class="linkform">You have an account already? Log in here</a>
<div class="clear"></div>
</div>
</form>
<form class="login active">
<h3>Login</h3>
<div>
<label>Username:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password: <a href="forgot_password.html" rel="forgot_password" class="forgot linkform">Forgot your password?</a></label>
<input type="password" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<div class="remember"><input type="checkbox" /><span>Keep me logged in</span></div>
<input type="submit" value="Login"></input>
<!--<a href="register.html" rel="register" class="linkform">You don't have an account yet? Register here</a>-->
<div class="clear"></div>
</div>
</form>
<form class="forgot_password">
<h3>Forgot Password</h3>
<div>
<label>Username or Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<input type="submit" value="Send reminder"></input>
<a href="index.html" rel="login" class="linkform">Suddenly remebered? Log in here</a>
<!--<a href="register.html" rel="register" class="linkform">You don't have an account? Register here</a>-->
<div class="clear"></div>
</div>
</form>
</div>
<div class="clear"></div>
</div>
</div>
<!-- The JavaScript -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
//the form wrapper (includes all forms)
var $form_wrapper = $('#form_wrapper'),
//the current form is the one with class active
$currentForm = $form_wrapper.children('form.active'),
//the change form links
$linkform = $form_wrapper.find('.linkform');
//get width and height of each form and store them for later
$form_wrapper.children('form').each(function(i){
var $theForm = $(this);
//solve the inline display none problem when using fadeIn fadeOut
if(!$theForm.hasClass('active'))
$theForm.hide();
$theForm.data({
width : $theForm.width(),
height : $theForm.height()
});
});
//set width and height of wrapper (same of current form)
setWrapperWidth();
/*
clicking a link (change form event) in the form
makes the current form hide.
The wrapper animates its width and height to the
width and height of the new current form.
After the animation, the new form is shown
*/
$linkform.bind('click',function(e){
var $link = $(this);
var target = $link.attr('rel');
$currentForm.fadeOut(400,function(){
//remove class active from current form
$currentForm.removeClass('active');
//new current form
$currentForm= $form_wrapper.children('form.'+target);
//animate the wrapper
$form_wrapper.stop()
.animate({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
},500,function(){
//new form gets class active
$currentForm.addClass('active');
//show the new form
$currentForm.fadeIn(400);
});
});
e.preventDefault();
});
function setWrapperWidth(){
$form_wrapper.css({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
});
}
/*
for the demo we disabled the submit buttons
if you submit the form, you need to check the
which form was submited, and give the class active
to the form you want to show
*/
$form_wrapper.find('input[type="submit"]')
.click(function(e){
e.preventDefault();
});
});
</script>
</body>
</html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
+187
View File
@@ -0,0 +1,187 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Animated Form Switching with jQuery</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Expand, contract, animate forms with jQuery wihtout leaving the page" />
<meta name="keywords" content="expand, form, css3, jquery, animate, width, height, adapt, unobtrusive javascript"/>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/ChunkFive_400.font.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1',{ textShadow: '1px 1px #fff'});
Cufon.replace('h2',{ textShadow: '1px 1px #fff'});
Cufon.replace('h3',{ textShadow: '1px 1px #000'});
Cufon.replace('.back');
</script>
</head>
<body>
<div class="wrapper">
<h1>Animated Form Switching</h1>
<h2>Demo: click the <span>orange links</span> to see the form animating and switching</h2>
<div class="content">
<div id="form_wrapper" class="form_wrapper">
<form class="register active">
<h3>Register</h3>
<div class="column">
<div>
<label>First Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Last Name:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Website:</label>
<input type="text" value="http://"/>
<span class="error">This is an error</span>
</div>
</div>
<div class="column">
<div>
<label>Username:</label>
<input type="text"/>
<span class="error">This is an error</span>
</div>
<div>
<label>Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password:</label>
<input type="password" />
<span class="error">This is an error</span>
</div>
</div>
<div class="bottom">
<div class="remember">
<input type="checkbox" />
<span>Send me updates</span>
</div>
<input type="submit" value="Register" />
<a href="index.html" rel="login" class="linkform">You have an account already? Log in here</a>
<div class="clear"></div>
</div>
</form>
<form class="login">
<h3>Login</h3>
<div>
<label>Username:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div>
<label>Password: <a href="forgot_password.html" rel="forgot_password" class="forgot linkform">Forgot your password?</a></label>
<input type="password" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<div class="remember"><input type="checkbox" /><span>Keep me logged in</span></div>
<input type="submit" value="Login"></input>
<a href="register.html" rel="register" class="linkform">You don't have an account yet? Register here</a>
<div class="clear"></div>
</div>
</form>
<form class="forgot_password">
<h3>Forgot Password</h3>
<div>
<label>Username or Email:</label>
<input type="text" />
<span class="error">This is an error</span>
</div>
<div class="bottom">
<input type="submit" value="Send reminder"></input>
<a href="index.html" rel="login" class="linkform">Suddenly remebered? Log in here</a>
<a href="register.html" rel="register" class="linkform">You don't have an account? Register here</a>
<div class="clear"></div>
</div>
</form>
</div>
<div class="clear"></div>
</div>
<a class="back" href="http://tympanus.net/codrops/2011/01/06/animated-form-switching/">back to the Codrops tutorial</a>
</div>
<!-- The JavaScript -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
//the form wrapper (includes all forms)
var $form_wrapper = $('#form_wrapper'),
//the current form is the one with class active
$currentForm = $form_wrapper.children('form.active'),
//the change form links
$linkform = $form_wrapper.find('.linkform');
//get width and height of each form and store them for later
$form_wrapper.children('form').each(function(i){
var $theForm = $(this);
//solve the inline display none problem when using fadeIn fadeOut
if(!$theForm.hasClass('active'))
$theForm.hide();
$theForm.data({
width : $theForm.width(),
height : $theForm.height()
});
});
//set width and height of wrapper (same of current form)
setWrapperWidth();
/*
clicking a link (change form event) in the form
makes the current form hide.
The wrapper animates its width and height to the
width and height of the new current form.
After the animation, the new form is shown
*/
$linkform.bind('click',function(e){
var $link = $(this);
var target = $link.attr('rel');
$currentForm.fadeOut(400,function(){
//remove class active from current form
$currentForm.removeClass('active');
//new current form
$currentForm= $form_wrapper.children('form.'+target);
//animate the wrapper
$form_wrapper.stop()
.animate({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
},500,function(){
//new form gets class active
$currentForm.addClass('active');
//show the new form
$currentForm.fadeIn(400);
});
});
e.preventDefault();
});
function setWrapperWidth(){
$form_wrapper.css({
width : $currentForm.data('width') + 'px',
height : $currentForm.data('height') + 'px'
});
}
/*
for the demo we disabled the submit buttons
if you submit the form, you need to check the
which form was submited, and give the class active
to the form you want to show
*/
$form_wrapper.find('input[type="submit"]')
.click(function(e){
e.preventDefault();
});
});
</script>
</body>
</html>
BIN
View File
Binary file not shown.
+331
View File
@@ -0,0 +1,331 @@
<?php
ob_start();
session_start();
include('includes/connect.php');
include('includes/conf.php');
include('includes/head.php');
$task= $_REQUEST['task'];
$id=$_REQUEST['id'];
if(!empty($id))
{
$digital_media = mysql_query("SELECT * FROM publication WHERE id_publication='".$_REQUEST['id']."'");
$row = mysql_fetch_array($digital_media);
}
if($task=='view'){
?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'View ':''?>Broadcast Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">Status:</div>
<div class="col-md-5"><?=($row['active']=='1')?'Active':'Inactive'?></div>
<div class="col-md-2">
<?php if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Outlet:</div>
<div class="col-md-5"><?=$row['name_publication_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<?php
//Get Type details
$get_type=mysql_fetch_assoc(mysql_query("select * from publication_type where id_publication_type=".$row['id_publication_type']));
?>
<div class="col-md-12">
<div class="col-md-3">Type:</div>
<div class="col-md-5"><?=$get_type['name_publication_type_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Country details
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
?>
<div class="col-md-3">Country:</div>
<div class="col-md-5"><?=$country['name_country']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Language:</div>
<div class="col-md-5"><?=$languages['name']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Genre details
$Genre=mysql_fetch_assoc(mysql_query("select name_publication_genre from publication_genre where id_publication_genre=".$row['id_publication_genre']));
?>
<div class="col-md-3">Genre:</div>
<div class="col-md-5"><?=$Genre['name_publication_genre']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
$Publisher=mysql_fetch_assoc(mysql_query("select id_publisher,name_publisher_en from publisher where id_publisher=".$row['distribution']));
?>
<div class="col-md-3">Publisher:</div>
<div class="col-md-5"><?=$Publisher['name_publisher_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Owner:</div>
<div class="col-md-5"><?=$row['owner']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Add Rate ($):</div>
<div class="col-md-5"><?=$row['adrate_color']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">URL:</div>
<div class="col-md-5"><a href="<?=$row['url']?>" target="_blank"><?=$row['url']?></a></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Phone:</div>
<div class="col-md-5"><?=$row['telephone']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Email:</div>
<div class="col-md-5"><?=$row['email']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
</div>
</p>
</div>
</div>
<?php }else{?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'Edit ':''?>Broadcast Media Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<form action="" method="post" enctype="multipart/form-data" id="broad_frm">
<input type="hidden" name="id" value="<?=$row['id_publication']?>">
<input type="hidden" name="actionfunction" id="actionfunction" value="showData">
<input type="hidden" name="page" id="page" value="1">
<fieldset class="col-md-6">
&nbsp;
</fieldset>
<fieldset class="col-md-6">
<?php if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</fieldset>
<fieldset class="col-md-6">
<label>Status <span style="color:#FF0000">*</span></label>
<select name="status" id="broad_status">
<option value="">Status</option>
<option value="1" <? if($row['active']=='1')echo 'Selected'?>>Active</option>
<option value="0" <? if($row['active']=='0')echo 'Selected'?>>Inactive</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Name <span style="color:#FF0000">*</span></label>
<input type="text" name="mediaOutlet" id="broad_mediaOutlet" value="<?=$row['name_publication_en']?>" placeholder="Media Outlet Name">
</fieldset>
<fieldset class="col-md-6">
<label>Type <span style="color:#FF0000">*</span></label>
<?php
//Get Type details
$get_type=mysql_query("select * from publication_type where id_publication_type IN (4,5)");
?>
<select name="id_publication_type" id="id_publication_type">
<option value="">--Select Type--</option>
<?php while($getType=mysql_fetch_assoc($get_type)){?>
<option value="<?=$getType['id_publication_type']?>" <? if($row['id_publication_type']==$getType['id_publication_type'])echo 'Selected'?>><?=$getType['name_publication_type_en']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Country <span style="color:#FF0000">*</span></label>
<?php
//Get Country details
$country=mysql_query("select * from country ORDER BY name_country ASC");
?>
<select name="country_id" id="broad_country_id">
<option value="">Country</option>
<?php while($getCountry=mysql_fetch_assoc($country)){?>
<option value="<?=$getCountry['id_country']?>" <? if($row['country']==$getCountry['id_country'])echo 'Selected'?>><?=$getCountry['name_country']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Language <span style="color:#FF0000">*</span></label>
<select name="language_id" id="broad_language_id">
<option value="">--Select Language--</option>
<?php
foreach ($lang_arr as $lang)
{ ?>
<option value="<?=$lang?>" <? if($row['language']==$lang)echo 'Selected'?>><?=$lang?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Genre <span style="color:#FF0000">*</span></label>
<?php
$Genre=mysql_query("select * from publication_genre Order BY name_publication_genre ASC");
?>
<select name="id_publication_genre" id="broad_id_publication_genre">
<option value="">Media Outlet Genre</option>
<?php while($getGenre=mysql_fetch_assoc($Genre)){?>
<option value="<?=$getGenre['id_publication_genre']?>" <? if($row['id_publication_genre']==$getGenre['id_publication_genre'])echo 'Selected'?>><?=$getGenre['name_publication_genre']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Publisher <span style="color:#FF0000">*</span></label>
<?php
$Publisher=mysql_query("select id_publisher,name_publisher_en from publisher ORDER BY name_publisher_en ASC");
?>
<select name="id_publisher" id="broad_id_publisher">
<option value="">--Select Publisher--</option>
<?php while($getPublisher=mysql_fetch_assoc($Publisher)){?>
<option value="<?=$getPublisher['id_publisher']?>" <? if($row['distribution']==$getPublisher['id_publisher'])echo 'Selected'?>><?=$getPublisher['name_publisher_en']?></option>
<? }?>
</select>
</fieldset>
<? if(!empty($row['logo'])){?>
<fieldset class="col-md-6">
<label>Logo</label>
<input type="file" name="logo" placeholder="Logo" style="margin-bottom:0px; padding:2px !important;">
</fieldset>
<?php }else{?>
<fieldset class="col-md-6">
<label>Logo</label>
<input type="file" name="logo" placeholder="Logo" style="padding:2px !important;">
</fieldset>
<?php }?>
<fieldset class="col-md-6">
<label>Owner <span style="color:#FF0000">*</span></label>
<input type="text" name="owner" id="owner" value="<?=$row['owner']?>" placeholder="Owner">
</fieldset>
<fieldset class="col-md-6">
<label>Add Rate ($/sec) <span style="color:#FF0000">*</span></label>
<input type="text" onKeyPress="return isnum(event);" name="rate" id="broad_rate" value="<?=$row['adrate_color']?>" placeholder="Add Rate ($/sec)">
</fieldset>
<fieldset class="col-md-6">
<label>URL</label>
<input type="text" name="url" id="broad_url" value="<?=$row['url']?>" placeholder="URL">
</fieldset>
<fieldset class="col-md-6">
<label>Phone <span style="color:#FF0000">*</span></label>
<input type="text" name="telephone" id="broad_phone" onKeyPress="return isnum(event);" value="<?=$row['telephone']?>" placeholder="Phone" maxlength="15">
</fieldset>
<fieldset class="col-md-6">
<label>Email <span style="color:#FF0000">*</span></label>
<input type="text" name="email" id="broad_email" value="<?=$row['email']?>" placeholder="Email">
</fieldset>
<fieldset class="col-md-4">
<label>&nbsp;</label>
<?php if(!empty($id)){?>
<input type="button" name="<?=(!empty($id))?'broad_update':'broad_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="broad_validation('broad_update')">
<?php }else{ ?>
<input type="button" name="<?=(!empty($id))?'broad_update':'broad_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="broad_validation('broad_submit')">
<?php } ?>
</fieldset>
</form>
</div>
</p>
</div>
</div>
<?php }?>
+379
View File
@@ -0,0 +1,379 @@
<?php
ob_start();
session_start();
include('includes/connect.php');
include('includes/conf.php');
include('includes/head.php');
$task= $_REQUEST['task'];
$id=$_REQUEST['id'];
if(!empty($id))
{
$digital_media = mysql_query("SELECT * FROM publication WHERE id_publication='".$_REQUEST['id']."'");
$row = mysql_fetch_array($digital_media);
}
if($task=='view'){
?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'View ':''?>Digital Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">Status:</div>
<div class="col-md-5"><?=($row['active']=='1')?'Active':'Inactive'?></div>
<div class="col-md-2">
<?php if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Outlet:</div>
<div class="col-md-5"><?=$row['name_publication_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<?php
//Get Type details
$get_type=mysql_fetch_assoc(mysql_query("select * from publication_type where id_publication_type=".$row['id_publication_type']));
?>
<div class="col-md-12">
<div class="col-md-3">Type:</div>
<div class="col-md-5"><?=$get_type['name_publication_type_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Country details
$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 name='".$row['language']."'"));
?>
<div class="col-md-3">Country:</div>
<div class="col-md-5"><?=$country['name_country']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Language:</div>
<div class="col-md-5"><?=$row['name']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Genre details
$Genre=mysql_fetch_assoc(mysql_query("select name_publication_genre from publication_genre where id_publication_genre=".$row['id_publication_genre']));
?>
<div class="col-md-3">Genre:</div>
<div class="col-md-5"><?=$Genre['name_publication_genre']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Source Rank:</div>
<div class="col-md-5"><?=($row['source_rank']=='11')?'n/a':$row['source_rank']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Subscription:</div>
<div class="col-md-5"><?=$row['subscription']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
$Publisher=mysql_fetch_assoc(mysql_query("select id_publisher,name_publisher_en from publisher where id_publisher=".$row['distribution']));
?>
<div class="col-md-3">Publisher:</div>
<div class="col-md-5"><?=$Publisher['name_publisher_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Hits/Month:</div>
<div class="col-md-5"><?=$row['hits']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">URL:</div>
<div class="col-md-5"><a href="<?=$row['url']?>" target="_blank"><?=$row['url']?></a></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Phone:</div>
<div class="col-md-5"><?=$row['telephone']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Email:</div>
<div class="col-md-5"><?=$row['email']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
</div>
</p>
</div>
</div>
<? }else{?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'Edit ':''?>Digital Media Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<form method="post" name="digital_frm" id="digital_frm" enctype="multipart/form-data">
<input type="hidden" name="dig_frm_id" value="<?=$row['id_publication']?>">
<input type="hidden" name="actionfunction" id="actionfunction" value="showData">
<input type="hidden" name="page" id="page" value="1">
<fieldset class="col-md-6">
&nbsp;
</fieldset>
<fieldset class="col-md-6">
<?php if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</fieldset>
<fieldset class="col-md-6">
<label>Status <span style="color:#FF0000">*</span></label>
<select name="status" id="dig_status">
<option value="">Status</option>
<option value="1" <? if($row['active']=='1')echo 'Selected'?>>Active</option>
<option value="0" <? if($row['active']=='0')echo 'Selected'?>>Inactive</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Name <span style="color:#FF0000">*</span></label>
<input type="text" name="mediaOutlet" id="dig_mediaOutlet" value="<?=$row['name_publication_en']?>" placeholder="Media Outlet Name">
</fieldset>
<fieldset class="col-md-6">
<label>Type <span style="color:#FF0000">*</span></label>
<?php
//Get Type details
$get_type=mysql_query("select * from publication_type where id_publication_type IN (3,6,7,8,9)");
?>
<select name="id_publication_type" id="dig_type">
<option value="">--Select Type--</option>
<?php while($getType=mysql_fetch_assoc($get_type)){?>
<option value="<?=$getType['id_publication_type']?>" <? if($row['id_publication_type']==$getType['id_publication_type'])echo 'Selected'?>><?=$getType['name_publication_type_en']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Country <span style="color:#FF0000">*</span></label>
<?php
//Get Country details
$country=mysql_query("select * from country ORDER BY name_country ASC");
?>
<select name="country_id" id="dig_country_id">
<option value="">--Select Country--</option>
<?php while($getCountry=mysql_fetch_assoc($country)){?>
<option value="<?=$getCountry['id_country']?>" <? if($row['country']==$getCountry['id_country'])echo 'Selected'?>><?=$getCountry['name_country']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Language <span style="color:#FF0000">*</span></label>
<select name="language_id" id="dig_language_id">
<option value="">--Select Language--</option>
<?php foreach ($lang_arr as $lang){?>
<option value="<?=$lang?>" <? if($row['language']==$lang)echo 'Selected'?>><?=$lang?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Genre <span style="color:#FF0000">*</span></label>
<?php
$Genre=mysql_query("select * from publication_genre Order BY name_publication_genre ASC");
?>
<select name="id_publication_genre" id="dig_id_publication_genre">
<option value="">Media Outlet Genre</option>
<?php while($getGenre=mysql_fetch_assoc($Genre)){?>
<option value="<?=$getGenre['id_publication_genre']?>" <? if($row['id_publication_genre']==$getGenre['id_publication_genre'])echo 'Selected'?>><?=$getGenre['name_publication_genre']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Source Rank <span style="color:#FF0000">*</span></label>
<select name="source_rank" id="dig_source_rank">
<option value="">Source Rank</option>
<option value="1" <? if($row['source_rank']=='1')echo 'Selected'?>>1</option>
<option value="2" <? if($row['source_rank']=='2')echo 'Selected'?>>2</option>
<option value="3" <? if($row['source_rank']=='3')echo 'Selected'?>>3</option>
<option value="4" <? if($row['source_rank']=='4')echo 'Selected'?>>4</option>
<option value="5" <? if($row['source_rank']=='5')echo 'Selected'?>>5</option>
<option value="6" <? if($row['source_rank']=='6')echo 'Selected'?>>6</option>
<option value="7" <? if($row['source_rank']=='7')echo 'Selected'?>>7</option>
<option value="8" <? if($row['source_rank']=='8')echo 'Selected'?>>8</option>
<option value="9" <? if($row['source_rank']=='9')echo 'Selected'?>>9</option>
<option value="10" <? if($row['source_rank']=='10')echo 'Selected'?>>10</option>
<option value="11" <? if($row['source_rank']=='11')echo 'Selected'?>>n/a</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Subscription <span style="color:#FF0000">*</span></label>
<select name="subscription" id="dig_subscription">
<option value="">--Select Subscription--</option>
<option value="Free" <? if($row['subscription']=='Free')echo 'Selected'?>>Free</option>
<option value="Subscription" <? if($row['subscription']=='Subscription')echo 'Selected'?>>Subscription</option>
<option value="Partial" <? if($row['subscription']=='Partial')echo 'Selected'?>>Partial Subscription</option>
</select>
</fieldset>
<? if(!empty($row['logo'])){?>
<fieldset class="col-md-6">
<label>Logo</label>
<input type="file" name="logo" placeholder="Logo" style="margin-bottom:0px; padding:2px !important;">
</fieldset>
<?php }else{?>
<fieldset class="col-md-6">
<label>Logo</label>
<input type="file" name="logo" placeholder="Logo" style="padding:2px !important;">
</fieldset>
<?php }?>
<fieldset class="col-md-6">
<label>Publisher <span style="color:#FF0000">*</span></label>
<?php
$Publisher=mysql_query("select id_publisher,name_publisher_en from publisher ORDER BY name_publisher_en ASC");
?>
<select name="id_publisher" id="dig_id_publisher">
<option value="">--Select Publisher--</option>
<?php while($getPublisher=mysql_fetch_assoc($Publisher)){?>
<option value="<?=$getPublisher['id_publisher']?>" <? if($row['distribution']==$getPublisher['id_publisher'])echo 'Selected'?>><?=$getPublisher['name_publisher_en']?></option>
<? }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Hits/Month <span style="color:#FF0000">*</span></label>
<input type="text" onKeyPress="return isnum(event);" name="hits" id="dig_hits" value="<?=$row['hits']?>" placeholder="Hits/Month">
</fieldset>
<fieldset class="col-md-6">
<label>URL</label>
<input type="text" name="url" id="dig_url" value="<?=$row['url']?>" placeholder="URL">
</fieldset>
<fieldset class="col-md-6">
<label>Phone <span style="color:#FF0000">*</span></label>
<input type="text" name="phone" id="dig_phone" onKeyPress="return isnum(event);" value="<?=$row['telephone']?>" placeholder="Phone" maxlength="15">
</fieldset>
<fieldset class="col-md-6">
<label>Email <span style="color:#FF0000">*</span></label>
<input type="text" name="email" id="dig_email" value="<?=$row['email']?>" placeholder="Email">
</fieldset>
<fieldset class="col-md-6">
<label>Date Harvested <span style="color:#FF0000">*</span></label>
<input type="text" name="" readonly value="<?=!empty($row['modified_date'])?date('d-m-Y',strtotime($row['modified_date'])):date('d-m-Y')?>" placeholder="Date Harvested">
</fieldset>
<fieldset class="col-md-6">
<label>Time Harvested <span style="color:#FF0000">*</span></label>
<input type="text" name="" readonly value="<?=!empty($row['modified_date'])?date('H:i:s',strtotime($row['modified_date'])):date('H:i:s')?>" placeholder="Time Harvested">
</fieldset>
<fieldset class="col-md-4">
<label>&nbsp;</label>
<?php if(!empty($id)){?>
<input type="button" name="<?=(!empty($id))?'digital_update':'digital_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="digital_validation('digital_update')">
<?php }else{ ?>
<input type="button" name="<?=(!empty($id))?'digital_update':'digital_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="digital_validation('digital_submit')">
<?php } ?>
</fieldset>
</form>
</div>
</p>
</div>
</div>
<?php }?>
+390
View File
@@ -0,0 +1,390 @@
<?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');">&times;</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 Date:</div>
<div class="col-md-7"><?=date('d-m-Y',strtotime($row['issue_date']))?></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_users,username from users where id_users=".$row['created_by']));
?>
<div class="col-md-3">Scanned By:</div>
<div class="col-md-7"><?=$Scanned['username']?></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_users,username from users where id_users=".$row['done_by']));
?>
<div class="col-md-3">Processed By:</div>
<div class="col-md-7"><?=$Processed['username']?></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_issue_outlet").autocomplete({
source: issue
});
$as("#search_issue_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');">&times;</button>
<h4><?=!empty($id)?'Edit ':''?>Issue Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<form method="post" enctype="multipart/form-data" id="issue_frm">
<input type="hidden" name="id_publication_issue" value="<?=$row['id_publication_issue']?>">
<input type="hidden" name="actionfunction" id="actionfunction" value="showData">
<input type="hidden" name="page" id="page" value="1">
<fieldset class="col-md-12">
<label>Issue 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="issue_date" value="<?=$row['issue_date']?>" id="issue_date" style="margin:0">
<span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span>
</fieldset>
<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_issue_outlet" id="search_issue_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>
<?php
$get_rec = mysql_fetch_assoc(mysql_query("select * from users where id_users = '".$_SESSION['moms_uid']."'"));
?>
<input type="text" name="received_by" id="received_by" value="<?=$get_rec['username']?>" placeholder="Received By" >
</fieldset>
<?php if(!empty($id)){?>
<fieldset class="col-md-6">
<label>Scanned Date</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_users,username from users where id_users=".$row['created_by']));
}
if(!empty($Scanned['id_users'])){
?>
<fieldset class="col-md-6">
<label>Scanned By <span style="color:#FF0000">*</span></label>
<?php
$get_name=mysql_query("select id_users,username from users ORDER BY username ASC");
?>
<select name="scanned_by" id="scanned_by">
<option value="">Name</option>
<?php while($getName=mysql_fetch_assoc($get_name)){?>
<option value="<?=$getName['id_users']?>" <?php if($getName['id_users'] == $Scanned['id_users']){?> selected="selected"<?php } ?>><?=$getName['username']?></option>
<?php }?>
</select>
<span style="line-height:12px;">&nbsp;</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_users,username from users ORDER BY username ASC");
?>
<select name="scanned_by" id="scanned_by">
<option value="">Name</option>
<?php while($getName=mysql_fetch_assoc($get_name)){?>
<option value="<?=$getName['id_users']?>" ><?=$getName['username']?></option>
<?php }?>
</select>
<span style="line-height:12px;">&nbsp;</span>
</fieldset>
<?php }?>
<fieldset class="col-md-6" >
<label>Processed Date </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_users,username from users where id_users=".$row['done_by']));
}
if(!empty($Processed['id_users'])){
?>
<fieldset class="col-md-6">
<label>Processed By </label>
<?php
$get_name1=mysql_query("select id_users,username from users ORDER BY username ASC");
?>
<select name="processed_by" id="processed_by">
<option value="">Name</option>
<?php while($getName1=mysql_fetch_assoc($get_name1)){?>
<option value="<?=$getName1['id_users']?>" <?php if($getName1['id_users'] == $Processed['id_users']){?> selected="selected"<?php } ?>><?=$getName1['username']?></option>
<?php }?>
</select>
<span style="color:blue; line-height:12px;">&nbsp;</span>
</fieldset>
<?php }else{?>
<fieldset class="col-md-6">
<label>Processed By </label>
<?php
$get_name1=mysql_query("select id_users,username from users ORDER BY username ASC");
?>
<select name="processed_by" id="processed_by">
<option value="">Name</option>
<?php while($getName1=mysql_fetch_assoc($get_name1)){?>
<option value="<?=$getName1['id_users']?>" ><?=$getName1['username']?></option>
<?php }?>
</select>
<span style="color:blue; line-height:12px;">&nbsp;</span>
</fieldset>
<?php }?>
<?php } ?>
<fieldset class="col-md-4">
<?php if(!empty($id)){?>
<input type="button" name="<?=(!empty($id))?'issue_update':'issue_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onClick="validation_issue('issue_update')">
<?php }else{ ?>
<input type="button" name="<?=(!empty($id))?'issue_update':'issue_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onClick="validation_issue('issue_submit')">
<?php } ?>
</fieldset>
</form>
</div>
</p>
</div>
</div>
<?php }?>
+471
View File
@@ -0,0 +1,471 @@
<?php
ob_start();
session_start();
include('includes/connect.php');
include('includes/conf.php');
include('includes/head.php');
$task= $_REQUEST['task'];
$id=$_REQUEST['id'];
if(!empty($id))
{
$print_media = mysql_query("SELECT * FROM publication WHERE id_publication='".$_REQUEST['id']."'");
$row = mysql_fetch_array($print_media);
}
if($task=='view'){
?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<?php if(isset($_REQUEST['act']) && $_REQUEST['act'] == "view"){?>
<a href="index.php?pagename=publisher" charset="close" style="float:right;">&times;</a>
<?php }else{ ?>
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<?php } ?>
<h4><?=!empty($id)?'View ':''?>Print Media Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">Status:</div>
<div class="col-md-5"><?=($row['active']=='1')?'Active':'Inactive'?></div>
<div class="col-md-2">
<? if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Outlet:</div>
<div class="col-md-5"><?=$row['name_publication_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<?php
//Get Type details
$get_type=mysql_fetch_assoc(mysql_query("select * from publication_type where id_publication_type=".$row['id_publication_type']));
?>
<div class="col-md-12">
<div class="col-md-3">Type:</div>
<div class="col-md-5"><?=$get_type['name_publication_type_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Frequency:</div>
<?php
$frequency=mysql_fetch_assoc(mysql_query("select name_frequency from frequency where id_frequency=".$row['id_frequency'])); ?>
<div class="col-md-5"><?=$frequency['name_frequency']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<?php
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';
}?>
<div class="col-md-12">
<div class="col-md-3">Expected Date/Day:</div>
<div class="col-md-5"><?=$expected_date?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Country details
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['country']));
?>
<div class="col-md-3">Country:</div>
<div class="col-md-5"><?=$country['name_country']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Language:</div>
<div class="col-md-5"><?=$row['language']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Genre details
$Genre=mysql_fetch_assoc(mysql_query("select name_publication_genre from publication_genre where id_publication_genre=".$row['id_publication_genre']));
?>
<div class="col-md-3">Genre:</div>
<div class="col-md-5"><?=$Genre['name_publication_genre']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
$Publisher=mysql_fetch_assoc(mysql_query("select id_publisher,name_publisher_en from publisher where id_publisher=".$row['distribution']));
?>
<div class="col-md-3">Publisher:</div>
<div class="col-md-5"><?=$Publisher['name_publisher_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Delivery Method:</div>
<div class="col-md-5"><?=$row['del_method']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Circulation:</div>
<div class="col-md-5"><?=$row['circulation']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
$rate= explode("@",$row['rate_sheet']);
?>
<div class="col-md-3">Add Rate ($):</div>
<div class="col-md-5"><?=$row['adrate_color']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Rate Sheet:</div>
<div class="col-md-5">
<?
$filename = $row['id_publication'].".pdf";
$filepath = $_RATEPATH.$filename;
if(file_exists($filepath)){?>
<a href="<?php echo $_HOSTURL."adrates/".$filename;?>" target="_blank">View Rate Sheet</a>
<?php }else{echo 'n/a';}?>
</div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">URL:</div>
<div class="col-md-5"><a href="<?=$row['url']?>" target="_blank"><?=$row['url']?></a></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Phone:</div>
<div class="col-md-5"><?=$row['telephone']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Email:</div>
<div class="col-md-5"><?=$row['email']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
</div>
</p>
</div>
</div>
<?php }else{?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'Edit ':''?>Print Media Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<form action="" method="post" enctype="multipart/form-data" name="prin_frm1" id="print_frm1">
<input type="hidden" name="id_publication" id="id_publication" value="<?=$row['id_publication']?>">
<input type="hidden" name="actionfunction" id="actionfunction" value="showData">
<input type="hidden" name="page" id="page" value="1">
<fieldset class="col-md-6">
&nbsp;
</fieldset>
<fieldset class="col-md-6">
<?php if(!empty($row['logo'])){?>
<img src="<?=$row['logo']?>" width="80" height="60" align="right">
<?php }else{?>
<img src="images/no-image.png" width="80" height="60" align="right">
<?php }?>
</fieldset>
<fieldset class="col-md-6">
<label>Status <span style="color:#FF0000">*</span></label>
<select name="active" id="status">
<option value="">Status</option>
<option value="1" <? if($row['active']=='1')echo 'Selected'?>>Active</option>
<option value="0" <? if($row['active']=='0')echo 'Selected'?>>Inactive</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Name <span style="color:#FF0000">*</span></label>
<input type="text" name="name_publication_en" id="mediaOutlet" value="<?=$row['name_publication_en']?>" placeholder="Media Outlet Name">
</fieldset>
<fieldset class="col-md-6">
<label>Type <span style="color:#FF0000">*</span></label>
<?php
//Get Type details
$get_type=mysql_query("select * from publication_type where id_publication_type IN (1,2)");
?>
<select name="id_publication_type" id="type">
<option value="">--Select Type--</option>
<?php while($getType=mysql_fetch_assoc($get_type)){?>
<option value="<?=$getType['id_publication_type']?>" <? if($row['id_publication_type']==$getType['id_publication_type'])echo 'Selected'?>><?=$getType['name_publication_type_en']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Frequency <span style="color:#FF0000">*</span></label>
<?php
$frequency=mysql_query("select * from frequency ORDER BY name_frequency ASC");
?>
<select name="id_frequency" id="id_frequency" onChange="getFrequency(this.value)">
<option value="">--Select Frequency--</option>
<?php while($getFrequency=mysql_fetch_assoc($frequency)){?>
<option value="<?=$getFrequency['id_frequency']?>" <? if($row['id_frequency']==$getFrequency['id_frequency'])echo 'Selected'?>><?=$getFrequency['name_frequency']?></option>
<?php }?>
</select>
</fieldset>
<?php if(!empty($row["expected_date"]) && $row["expected_date"]!='0000-00-00'){?>
<fieldset class="col-md-6" id="frequent_day"><label>Expected Date <span style="color:#FF0000">*</span></label><input type="text" name="expected_date" id="expected_date" value="<?=(!empty($row["expected_date"]) && $row["expected_date"]!='0000-00-00')?date("Y-m-d",strtotime($row["expected_date"])):''?>" placeholder="Expected Date" style="margin:0"><span style="color:blue; line-height:12px;">Date format: yyyy-mm-dd </span></fieldset>
<?php }elseif($row['id_frequency']=='3'){
$row_expected= explode(",",$row["expected_day"]);
?>
<fieldset class="col-md-6" id="frequent_day">
<label>Expected Day <span style="color:#FF0000">*</span></label> <br /><input type="checkbox" name="expected_day[]" onclick="getExpected()" <? if($row_expected[0]=='Sunday' || trim($row_expected[1])=='Sunday'){echo 'checked';}else{echo 'disabled';}?> style="width:32px" id="expected_day" value="Sunday" > Sunday <input type="checkbox" style="width:32px" <? if($row_expected[0]=='Monday' || trim($row_expected[1])=='Monday'){echo 'checked';}else{echo 'disabled';}?> name="expected_day[]" onclick="getExpected()" id="expected_day" value="Monday" >Monday<input type="checkbox" name="expected_day[]" style="width:32px" id="expected_day" value="Tuesday" onclick="getExpected()" <? if($row_expected[0]=='Tuesday' || trim($row_expected[1])=='Tuesday'){echo 'checked';}else{echo 'disabled';}?>>Tuesday <input type="checkbox" style="width:32px" onclick="getExpected()" name="expected_day[]" id="expected_day" value="Wednesday" <? if($row_expected[0]=='Wednesday' || trim($row_expected[1])=='Wednesday'){echo 'checked';}else{echo 'disabled';}?> >Wednesday <input type="checkbox" style="width:32px" name="expected_day[]" id="expected_day" onclick="getExpected()" value="Thursday" <? if($row_expected[0]=='Thursday' || trim($row_expected[1])=='Thursday'){echo 'checked';}else{echo 'disabled';}?>>Thursday <input type="checkbox" style="width:32px" name="expected_day[]" id="expected_day" onclick="getExpected()" value="Friday" <? if($row_expected[0]=='Friday' || trim($row_expected[1])=='Friday'){echo 'checked';}else{echo 'disabled';}?>>Friday <input type="checkbox" onclick="getExpected()" style="width:32px" name="expected_day[]" id="expected_day" value="Saturday" <? if($row_expected[0]=='Saturday' || trim($row_expected[1])=='Saturday'){echo 'checked';}else{echo 'disabled';}?>>Saturday
</fieldset>
<?php }elseif(!empty($row["expected_day"])){?>
<fieldset class="col-md-6" id="frequent_day">
<label>Expected Day <span style="color:#FF0000">*</span></label>
<select name="expected_day" id="expected_day">
<option value="Sunday" <? if($row["expected_day"]=='Sunday')echo 'Selected'?>>Sunday</option>
<option value="Monday" <? if($row["expected_day"]=='Monday')echo 'Selected'?>>Monday</option>
<option value="Tuesday" <? if($row["expected_day"]=='Tuesday')echo 'Selected'?>>Tuesday</option>
<option value="Wednesday" <? if($row["expected_day"]=='Wednesday')echo 'Selected'?>>Wednesday</option>
<option value="Thursday" <? if($row["expected_day"]=='Thursday')echo 'Selected'?>>Thursday</option>
<option value="Friday" <? if($row["expected_day"]=='Friday')echo 'Selected'?>>Friday</option>
<option value="Saturday" <? if($row["expected_day"]=='Saturday')echo 'Selected'?>>Saturday</option>
</select>
</fieldset>
<?php }elseif($row['id_frequency']=='1'){?>
<fieldset class="col-md-6" id="frequent_day"><label>Expected Date <span style="color:#FF0000">*</span></label><br/><span style="color:blue; line-height:12px;">Not Applicable</span></fieldset>
<?php }else{?>
<fieldset class="col-md-6" id="frequent_day"></fieldset>
<? }?>
<fieldset class="col-md-6">
<label>Country <span style="color:#FF0000">*</span></label>
<?php
//Get Country details
$country=mysql_query("select * from country ORDER BY name_country ASC");
?>
<select name="country" id="id_country">
<option value="">--Select Country--</option>
<?php while($getCountry=mysql_fetch_assoc($country)){?>
<option value="<?=$getCountry['id_country']?>" <? if($row['country']==$getCountry['id_country'])echo 'Selected'?>><?=$getCountry['name_country']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Language <span style="color:#FF0000">*</span></label>
<select name="language" id="language_id">
<option value="">--Select Language--</option>
<?php
foreach ($lang_arr as $lang)
{?>
<option value="<?=$lang?>" <? if($row['language']==$lang)echo 'Selected'?>><?=$lang?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Media Outlet Genre <span style="color:#FF0000">*</span></label>
<?php
$Genre=mysql_query("select * from publication_genre Order BY name_publication_genre ASC");
?>
<select name="id_publication_genre" id="id_publication_genre">
<option value="">Media Outlet Genre</option>
<?php while($getGenre=mysql_fetch_assoc($Genre)){?>
<option value="<?=$getGenre['id_publication_genre']?>" <? if($row['id_publication_genre']==$getGenre['id_publication_genre'])echo 'Selected'?>><?=$getGenre['name_publication_genre']?></option>
<?php }?>
</select>
</fieldset>
<? if(!empty($row['logo'])){?>
<fieldset class="col-md-6">
<label>Logo </label>
<input type="file" name="logo" placeholder="Logo" style="margin-bottom:0px;
padding:2px !important;">
<? if(!empty($row['logo'])){?>
<? }else{echo 'n/a';}?>
</fieldset>
<? }else{?>
<fieldset class="col-md-6">
<label>Logo</label>
<input type="file" name="logo" placeholder="Logo" style="padding:2px !important;">
</fieldset>
<?php }?>
<fieldset class="col-md-6">
<label>Publisher <span style="color:#FF0000">*</span></label>
<?php
$Publisher=mysql_query("select id_publisher,name_publisher_en from publisher Order BY name_publisher_en ASC");
?>
<select name="distribution" id="id_publisher">
<option value="">--Select Publisher--</option>
<?php while($getPublisher=mysql_fetch_assoc($Publisher)){?>
<option value="<?=$getPublisher['id_publisher']?>" <? if($row['distribution']==$getPublisher['id_publisher'])echo 'Selected'?>><?=$getPublisher['name_publisher_en']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Delivery Method <span style="color:#FF0000">*</span></label>
<select name="del_method" id="del_method">
<option value="">--Select Delivery Method--</option>
<option value="Delivery" <? if($row['del_method']=='Delivery')echo 'Selected'?>>Delivery</option>
<option value="Collect" <? if($row['del_method']=='Collect')echo 'Selected'?>>Collect</option>
<option value="Download" <? if($row['del_method']=='Download')echo 'Selected'?>>Download</option>
<option value="Press Display" <? if($row['del_method']=='Press Display')echo 'Selected'?>>Press Display</option>
<option value="Distributor" <? if($row['del_method']=='Distributor')echo 'Selected'?>>Distributor</option>
<option value="Outlet" <? if($row['del_method']=='Outlet')echo 'Selected'?>>Outlet</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Circulation <span style="color:#FF0000">*</span></label>
<input type="text" onKeyPress="return isnum(event);" name="circulation" id="circulation" value="<?=$row['circulation']?>" placeholder="Circulation">
</fieldset>
<fieldset class="col-md-6">
<label>Add Rate ($) <span style="color:#FF0000">*</span></label>
<input type="text" name="adrate_bw" onKeyPress="return isnum(event);" id="ad_rate" value="<?=$row['adrate_color']?>" placeholder="Add Rate ($)">
</fieldset>
<?
$filename = $row['id_publication'].".pdf";
$filepath = $_RATEPATH.$filename;
if(file_exists($filepath)){?>
<fieldset class="col-md-6">
<label>Rate Sheet</label>
<input type="file" name="rate_sheet" id="rate_sheet" placeholder="Rate Sheet"style="margin-bottom:0px; padding:2px !important;">
<a href="<?php echo $_HOSTURL."adrates/".$filename;?>" target="_blank" style="margin-bottom:13px; float:left;">View Rate Sheet</a>
</fieldset>
<? }else{?>
<fieldset class="col-md-6">
<label>Rate Sheet</label>
<input type="file" name="rate_sheet" id="rate_sheet" placeholder="Rate Sheet" style="padding:2px !important;">
</fieldset>
<?php }?>
<fieldset class="col-md-6">
<label>URL</label>
<input type="text" name="url" id="url" value="<?=$row['url']?>" placeholder="URL">
</fieldset>
<fieldset class="col-md-6">
<label>Phone <span style="color:#FF0000">*</span></label>
<input type="text" name="telephone" id="phone" onKeyPress="return isnum(event);" value="<?=$row['telephone']?>" placeholder="Phone" maxlength="15">
</fieldset>
<fieldset class="col-md-6">
<label>Email <span style="color:#FF0000">*</span></label>
<input type="text" name="email" id="email" value="<?=$row['email']?>" placeholder="Email">
</fieldset>
<fieldset class="col-md-4">
<label>&nbsp;</label>
<?php if(!empty($id)){?>
<input type="button" name="<?=(!empty($id))?'update':'submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="validation('update')">
<?php }else{ ?>
<input type="button" name="<?=(!empty($id))?'update':'submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="validation('submit')">
<?php } ?>
</fieldset>
</form>
</div>
</p>
</div>
</div>
<?php }?>
+191
View File
@@ -0,0 +1,191 @@
<?php
ob_start();
session_start();
include('includes/connect.php');
include('includes/conf.php');
include('includes/head.php');
$task= $_REQUEST['task'];
$getid=explode('?_',$_REQUEST['id_publisher']);
$id= $getid[0];
if(!empty($id))
{
$publisher = mysql_query("SELECT * FROM publisher WHERE id_publisher='".$id."'");
$row = mysql_fetch_array($publisher);
}
if($task=='view'){
?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'View ':''?>Publisher Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">Status:</div>
<div class="col-md-5"><?=($row['status']=='A')?'Active':'Inactive'?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Name:</div>
<div class="col-md-5"><?=$row['name_publisher_en']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<?php
//Get Country details
$country=mysql_fetch_assoc(mysql_query("select name_country from country where id_country=".$row['id_country']));
?>
<div class="col-md-3">Country:</div>
<div class="col-md-5"><?=$country['name_country']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Phone:</div>
<div class="col-md-5"><?=$row['phone']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Email:</div>
<div class="col-md-5"><?=$row['email']?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Fax:</div>
<div class="col-md-5"><?=!empty($row['fax'])?$row['fax']:'N/A'?></div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="col-md-12">
<div class="col-md-3">Url:</div>
<div class="col-md-5"><a href="<?=$row['url']?>" target="_blank"><?=$row['url']?></a></div>
<div class="col-md-2">&nbsp;</div>
</div>
</div>
</p>
</div>
</div>
<? }else{?>
<div id="modal" class="modal-example-content">
<div class="modal-example-header">
<button type="button" class="close" onClick="$.fn.custombox('close');">&times;</button>
<h4><?=!empty($id)?'Edit ':''?>Publisher Details</h4>
</div>
<div class="modal-example-body">
<p>
<div class="row">
<form action="" method="post" id="publisher_frm" enctype="multipart/form-data">
<input type="hidden" name="id_publisher" value="<?=$row['id_publisher']?>">
<input type="hidden" name="actionfunction" id="actionfunction" value="showData">
<input type="hidden" name="page" id="page" value="1">
<fieldset class="col-md-6">
<label>Status <span style="color:#FF0000">*</span></label>
<select name="status" id="publisher_status">
<option value="">Status</option>
<option value="A" <? if($row['status']=='A')echo 'Selected'?>>Active</option>
<option value="I" <? if($row['status']=='I')echo 'Selected'?>>Inactive</option>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>Publisher Name <span style="color:#FF0000">*</span></label>
<input type="text" name="name_publisher_en" id="name_publisher_en" value="<?=$row['name_publisher_en']?>" placeholder="Publisher Name">
</fieldset>
<fieldset class="col-md-6">
<label>Country <span style="color:#FF0000">*</span></label>
<?php
//Get Country details
$country=mysql_query("select * from country ORDER BY name_country ASC");
?>
<select name="id_country" id="publisher_id_country">
<option value="">--Select Country--</option>
<?php while($getCountry=mysql_fetch_assoc($country)){?>
<option value="<?=$getCountry['id_country']?>" <? if($row['id_country']==$getCountry['id_country'])echo 'Selected'?>><?=$getCountry['name_country']?></option>
<?php }?>
</select>
</fieldset>
<fieldset class="col-md-6">
<label>URL</label>
<input type="text" name="url" id="publisher_url" value="<?=$row['url']?>" placeholder="URL">
</fieldset>
<fieldset class="col-md-6">
<label>Phone <span style="color:#FF0000">*</span></label>
<input type="text" name="phone" id="publisher_phone" onKeyPress="return isnum(event);" value="<?=$row['phone']?>" placeholder="Phone" maxlength="15">
</fieldset>
<fieldset class="col-md-6">
<label>Email <span style="color:#FF0000">*</span></label>
<input type="text" name="email" id="publisher_email" value="<?=$row['email']?>" placeholder="Email">
</fieldset>
<fieldset class="col-md-6">
<label>Fax </label>
<input type="text" name="fax" value="<?=$row['fax']?>" placeholder="fax">
</fieldset>
<fieldset class="col-md-4">
<label>&nbsp;</label>
<?php if(!empty($id)){?>
<input type="button" name="<?=(!empty($id))?'publisher_update':'publisher_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="publisher_validation('publisher_update')">
<?php }else{ ?>
<input type="button" name="<?=(!empty($id))?'publisher_update':'publisher_submit'?>" value="<?=(!empty($id))?'Update':'Submit'?>" id="submit" class="button" onclick="publisher_validation('publisher_submit')">
<?php } ?>
</fieldset>
</form>
</div>
</p>
</div>
</div>
<?php }?>
+425
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
?>
+453
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+350
View File
@@ -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');">&times;</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');">&times;</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;">&nbsp;</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;">&nbsp;</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;">&nbsp;</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;">&nbsp;</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 }?>
+447
View File
@@ -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
}
+369
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+588
View File
@@ -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
}
+409
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
?>
+414
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
?>
+446
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+418
View File
@@ -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
}
+368
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+578
View File
@@ -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
}
+578
View File
@@ -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
}
+419
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+21
View File
@@ -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']);
}
?>
+26
View File
@@ -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>';
}
?>
+389
View File
@@ -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
}
+28
View File
@@ -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);
?>
+366
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+120
View File
@@ -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>
+130
View File
@@ -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>
+572
View File
@@ -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
}
+130
View File
@@ -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>
+436
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
?>
+479
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+476
View File
@@ -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
}
+370
View File
@@ -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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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
}
+587
View File
@@ -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
}
BIN
View File
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
body {
/*font-size: 62.5%;
font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";*/
}
table {
font-size: 1em;
}
.demo-description {
clear: both;
padding: 12px;
font-size: 1.3em;
line-height: 1.4em;
}
.ui-draggable, .ui-droppable {
background-position: top;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.
+9597
View File
File diff suppressed because it is too large Load Diff
+732
View File
@@ -0,0 +1,732 @@
/*! jQuery UI - v1.10.3 - 2013-07-18
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.menu.css
* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0);
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-button {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
}
/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}
/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
}
/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-menu {
list-style: none;
padding: 2px;
margin: 0;
display: block;
outline: none;
}
.ui-menu .ui-menu {
margin-top: -3px;
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
padding: 0;
width: 100%;
/* support: IE10, see #8844 */
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
}
.ui-menu .ui-menu-divider {
margin: 5px -2px 5px -2px;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-menu-item a {
text-decoration: none;
display: block;
padding: 2px .4em;
line-height: 1.5;
min-height: 0; /* support: IE7 */
font-weight: normal;
}
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
.ui-menu .ui-state-disabled {
font-weight: normal;
margin: .4em 0 .2em;
line-height: 1.5;
}
.ui-menu .ui-state-disabled a {
cursor: default;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item a {
position: relative;
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: .2em;
left: .2em;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
position: static;
float: right;
}
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
font-size: 1.1em/*{fsDefault}*/;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
font-size: 1em;
}
.ui-widget-content {
border: 1px solid #aaaaaa/*{borderColorContent}*/;
background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
color: #222222/*{fcContent}*/;
}
.ui-widget-content a {
color: #222222/*{fcContent}*/;
}
.ui-widget-header {
border: 1px solid #aaaaaa/*{borderColorHeader}*/;
background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
color: #222222/*{fcHeader}*/;
font-weight: bold;
}
.ui-widget-header a {
color: #222222/*{fcHeader}*/;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #d3d3d3/*{borderColorDefault}*/;
background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #555555/*{fcDefault}*/;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #555555/*{fcDefault}*/;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #999999/*{borderColorHover}*/;
background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcHover}*/;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #212121/*{fcHover}*/;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #aaaaaa/*{borderColorActive}*/;
background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcActive}*/;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #212121/*{fcActive}*/;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #fcefa1/*{borderColorHighlight}*/;
background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
color: #363636/*{fcHighlight}*/;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #363636/*{fcHighlight}*/;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a/*{borderColorError}*/;
background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
color: #cd0a0a/*{fcError}*/;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #cd0a0a/*{fcError}*/;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #cd0a0a/*{fcError}*/;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70);
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35);
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 4px/*{cornerRadius}*/;
}
/* Overlays */
.ui-widget-overlay {
background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
opacity: .3/*{opacityOverlay}*/;
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/;
}
.ui-widget-shadow {
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
padding: 8px/*{thicknessShadow}*/;
background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
opacity: .3/*{opacityShadow}*/;
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/;
border-radius: 8px/*{cornerRadiusShadow}*/;
}
+12
View File
@@ -0,0 +1,12 @@
/*!
* jQuery UI CSS Framework 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming
*/
@import "jquery.ui.base.css";
@import "jquery.ui.theme.css";
+16
View File
@@ -0,0 +1,16 @@
/*!
* jQuery UI Autocomplete 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
+610
View File
@@ -0,0 +1,610 @@
/*!
* jQuery UI Autocomplete 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/autocomplete/
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.position.js
* jquery.ui.menu.js
*/
(function( $, undefined ) {
// used to prevent race conditions with remote data sources
var requestIndex = 0;
$.widget( "ui.autocomplete", {
version: "1.10.3",
defaultElement: "<input>",
options: {
appendTo: null,
autoFocus: false,
delay: 300,
minLength: 1,
position: {
my: "left top",
at: "left bottom",
collision: "none"
},
source: null,
// callbacks
change: null,
close: null,
focus: null,
open: null,
response: null,
search: null,
select: null
},
pending: 0,
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
// so we use the suppressKeyPressRepeat flag to avoid handling keypress
// events when we know the keydown event was used to modify the
// search term. #7799
var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
nodeName = this.element[0].nodeName.toLowerCase(),
isTextarea = nodeName === "textarea",
isInput = nodeName === "input";
this.isMultiLine =
// Textareas are always multi-line
isTextarea ? true :
// Inputs are always single-line, even if inside a contentEditable element
// IE also treats inputs as contentEditable
isInput ? false :
// All other element types are determined by whether or not they're contentEditable
this.element.attr( "isContentEditable" );
this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
this.isNewMenu = true;
this.element
.addClass( "ui-autocomplete-input" )
.attr( "autocomplete", "off" );
this._on( this.element, {
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.attr( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
suppressKeyPressRepeat = true;
return;
}
suppressKeyPress = false;
suppressInput = false;
suppressKeyPressRepeat = false;
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
suppressKeyPress = true;
this._move( "previousPage", event );
break;
case keyCode.PAGE_DOWN:
suppressKeyPress = true;
this._move( "nextPage", event );
break;
case keyCode.UP:
suppressKeyPress = true;
this._keyEvent( "previous", event );
break;
case keyCode.DOWN:
suppressKeyPress = true;
this._keyEvent( "next", event );
break;
case keyCode.ENTER:
case keyCode.NUMPAD_ENTER:
// when menu is open and has focus
if ( this.menu.active ) {
// #6055 - Opera still allows the keypress to occur
// which causes forms to submit
suppressKeyPress = true;
event.preventDefault();
this.menu.select( event );
}
break;
case keyCode.TAB:
if ( this.menu.active ) {
this.menu.select( event );
}
break;
case keyCode.ESCAPE:
if ( this.menu.element.is( ":visible" ) ) {
this._value( this.term );
this.close( event );
// Different browsers have different default behavior for escape
// Single press can mean undo or clear
// Double press in IE means clear the whole form
event.preventDefault();
}
break;
default:
suppressKeyPressRepeat = true;
// search timeout should be triggered before the input value is changed
this._searchTimeout( event );
break;
}
},
keypress: function( event ) {
if ( suppressKeyPress ) {
suppressKeyPress = false;
if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
event.preventDefault();
}
return;
}
if ( suppressKeyPressRepeat ) {
return;
}
// replicate some key handlers to allow them to repeat in Firefox and Opera
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
this._move( "previousPage", event );
break;
case keyCode.PAGE_DOWN:
this._move( "nextPage", event );
break;
case keyCode.UP:
this._keyEvent( "previous", event );
break;
case keyCode.DOWN:
this._keyEvent( "next", event );
break;
}
},
input: function( event ) {
if ( suppressInput ) {
suppressInput = false;
event.preventDefault();
return;
}
this._searchTimeout( event );
},
focus: function() {
this.selectedItem = null;
this.previous = this._value();
},
blur: function( event ) {
if ( this.cancelBlur ) {
delete this.cancelBlur;
return;
}
clearTimeout( this.searching );
this.close( event );
this._change( event );
}
});
this._initSource();
this.menu = $( "<ul>" )
.addClass( "ui-autocomplete ui-front" )
.appendTo( this._appendTo() )
.menu({
// disable ARIA support, the live region takes care of that
role: null
})
.hide()
.data( "ui-menu" );
this._on( this.menu.element, {
mousedown: function( event ) {
// prevent moving focus out of the text field
event.preventDefault();
// IE doesn't prevent moving focus even with event.preventDefault()
// so we set a flag to know when we should ignore the blur event
this.cancelBlur = true;
this._delay(function() {
delete this.cancelBlur;
});
// clicking on the scrollbar causes focus to shift to the body
// but we can't detect a mouseup or a click immediately afterward
// so we have to track the next mousedown and close the menu if
// the user clicks somewhere outside of the autocomplete
var menuElement = this.menu.element[ 0 ];
if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
this._delay(function() {
var that = this;
this.document.one( "mousedown", function( event ) {
if ( event.target !== that.element[ 0 ] &&
event.target !== menuElement &&
!$.contains( menuElement, event.target ) ) {
that.close();
}
});
});
}
},
menufocus: function( event, ui ) {
// support: Firefox
// Prevent accidental activation of menu items in Firefox (#7024 #9118)
if ( this.isNewMenu ) {
this.isNewMenu = false;
if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
this.menu.blur();
this.document.one( "mousemove", function() {
$( event.target ).trigger( event.originalEvent );
});
return;
}
}
var item = ui.item.data( "ui-autocomplete-item" );
if ( false !== this._trigger( "focus", event, { item: item } ) ) {
// use value to match what will end up in the input, if it was a key event
if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
this._value( item.value );
}
} else {
// Normally the input is populated with the item's value as the
// menu is navigated, causing screen readers to notice a change and
// announce the item. Since the focus event was canceled, this doesn't
// happen, so we update the live region so that screen readers can
// still notice the change and announce it.
this.liveRegion.text( item.value );
}
},
menuselect: function( event, ui ) {
var item = ui.item.data( "ui-autocomplete-item" ),
previous = this.previous;
// only trigger when focus was lost (click on menu)
if ( this.element[0] !== this.document[0].activeElement ) {
this.element.focus();
this.previous = previous;
// #6109 - IE triggers two focus events and the second
// is asynchronous, so we need to reset the previous
// term synchronously and asynchronously :-(
this._delay(function() {
this.previous = previous;
this.selectedItem = item;
});
}
if ( false !== this._trigger( "select", event, { item: item } ) ) {
this._value( item.value );
}
// reset the term after the select event
// this allows custom select handling to work properly
this.term = this._value();
this.close( event );
this.selectedItem = item;
}
});
this.liveRegion = $( "<span>", {
role: "status",
"aria-live": "polite"
})
.addClass( "ui-helper-hidden-accessible" )
.insertBefore( this.element );
// turning off autocomplete prevents the browser from remembering the
// value when navigating through history, so we re-enable autocomplete
// if the page is unloaded before the widget is destroyed. #7790
this._on( this.window, {
beforeunload: function() {
this.element.removeAttr( "autocomplete" );
}
});
},
_destroy: function() {
clearTimeout( this.searching );
this.element
.removeClass( "ui-autocomplete-input" )
.removeAttr( "autocomplete" );
this.menu.element.remove();
this.liveRegion.remove();
},
_setOption: function( key, value ) {
this._super( key, value );
if ( key === "source" ) {
this._initSource();
}
if ( key === "appendTo" ) {
this.menu.element.appendTo( this._appendTo() );
}
if ( key === "disabled" && value && this.xhr ) {
this.xhr.abort();
}
},
_appendTo: function() {
var element = this.options.appendTo;
if ( element ) {
element = element.jquery || element.nodeType ?
$( element ) :
this.document.find( element ).eq( 0 );
}
if ( !element ) {
element = this.element.closest( ".ui-front" );
}
if ( !element.length ) {
element = this.document[0].body;
}
return element;
},
_initSource: function() {
var array, url,
that = this;
if ( $.isArray(this.options.source) ) {
array = this.options.source;
this.source = function( request, response ) {
response( $.ui.autocomplete.filter( array, request.term ) );
};
} else if ( typeof this.options.source === "string" ) {
url = this.options.source;
this.source = function( request, response ) {
if ( that.xhr ) {
that.xhr.abort();
}
that.xhr = $.ajax({
url: url,
data: request,
dataType: "json",
success: function( data ) {
response( data );
},
error: function() {
response( [] );
}
});
};
} else {
this.source = this.options.source;
}
},
_searchTimeout: function( event ) {
clearTimeout( this.searching );
this.searching = this._delay(function() {
// only search if the value has changed
if ( this.term !== this._value() ) {
this.selectedItem = null;
this.search( null, event );
}
}, this.options.delay );
},
search: function( value, event ) {
value = value != null ? value : this._value();
// always save the actual value, not the one passed as an argument
this.term = this._value();
if ( value.length < this.options.minLength ) {
return this.close( event );
}
if ( this._trigger( "search", event ) === false ) {
return;
}
return this._search( value );
},
_search: function( value ) {
this.pending++;
this.element.addClass( "ui-autocomplete-loading" );
this.cancelSearch = false;
this.source( { term: value }, this._response() );
},
_response: function() {
var that = this,
index = ++requestIndex;
return function( content ) {
if ( index === requestIndex ) {
that.__response( content );
}
that.pending--;
if ( !that.pending ) {
that.element.removeClass( "ui-autocomplete-loading" );
}
};
},
__response: function( content ) {
if ( content ) {
content = this._normalize( content );
}
this._trigger( "response", null, { content: content } );
if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
this._suggest( content );
this._trigger( "open" );
} else {
// use ._close() instead of .close() so we don't cancel future searches
this._close();
}
},
close: function( event ) {
this.cancelSearch = true;
this._close( event );
},
_close: function( event ) {
if ( this.menu.element.is( ":visible" ) ) {
this.menu.element.hide();
this.menu.blur();
this.isNewMenu = true;
this._trigger( "close", event );
}
},
_change: function( event ) {
if ( this.previous !== this._value() ) {
this._trigger( "change", event, { item: this.selectedItem } );
}
},
_normalize: function( items ) {
// assume all items have the right format when the first item is complete
if ( items.length && items[0].label && items[0].value ) {
return items;
}
return $.map( items, function( item ) {
if ( typeof item === "string" ) {
return {
label: item,
value: item
};
}
return $.extend({
label: item.label || item.value,
value: item.value || item.label
}, item );
});
},
_suggest: function( items ) {
var ul = this.menu.element.empty();
this._renderMenu( ul, items );
this.isNewMenu = true;
this.menu.refresh();
// size and position menu
ul.show();
this._resizeMenu();
ul.position( $.extend({
of: this.element
}, this.options.position ));
if ( this.options.autoFocus ) {
this.menu.next();
}
},
_resizeMenu: function() {
var ul = this.menu.element;
ul.outerWidth( Math.max(
// Firefox wraps long text (possibly a rounding bug)
// so we add 1px to avoid the wrapping (#7513)
ul.width( "" ).outerWidth() + 1,
this.element.outerWidth()
) );
},
_renderMenu: function( ul, items ) {
var that = this;
$.each( items, function( index, item ) {
that._renderItemData( ul, item );
});
},
_renderItemData: function( ul, item ) {
return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
},
_renderItem: function( ul, item ) {
return $( "<li>" )
.append( $( "<a>" ).text( item.label ) )
.appendTo( ul );
},
_move: function( direction, event ) {
if ( !this.menu.element.is( ":visible" ) ) {
this.search( null, event );
return;
}
if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
this.menu.isLastItem() && /^next/.test( direction ) ) {
this._value( this.term );
this.menu.blur();
return;
}
this.menu[ direction ]( event );
},
widget: function() {
return this.menu.element;
},
_value: function() {
return this.valueMethod.apply( this.element, arguments );
},
_keyEvent: function( keyEvent, event ) {
if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
this._move( keyEvent, event );
// prevents moving cursor to beginning/end of the text field in some browsers
event.preventDefault();
}
}
});
$.extend( $.ui.autocomplete, {
escapeRegex: function( value ) {
return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
},
filter: function(array, term) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
return $.grep( array, function(value) {
return matcher.test( value.label || value.value || value );
});
}
});
// live region extension, adding a `messages` option
// NOTE: This is an experimental API. We are still investigating
// a full solution for string manipulation and internationalization.
$.widget( "ui.autocomplete", $.ui.autocomplete, {
options: {
messages: {
noResults: "No search results.",
results: function( amount ) {
return amount + ( amount > 1 ? " results are" : " result is" ) +
" available, use up and down arrow keys to navigate.";
}
}
},
__response: function( content ) {
var message;
this._superApply( arguments );
if ( this.options.disabled || this.cancelSearch ) {
return;
}
if ( content && content.length ) {
message = this.options.messages.results( content.length );
} else {
message = this.options.messages.noResults;
}
this.liveRegion.text( message );
}
});
}( jQuery ));
+21
View File
@@ -0,0 +1,21 @@
/*!
* jQuery UI CSS Framework 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming
*/
@import url("jquery.ui.core.css");
@import url("jquery.ui.autocomplete.css");
@import url("jquery.ui.button.css");
@import url("jquery.ui.datepicker.css");
@import url("jquery.ui.menu.css");
@import url("jquery.ui.resizable.css");
@import url("jquery.ui.selectable.css");
@import url("jquery.ui.spinner.css");
@import url("jquery.ui.tabs.css");
+114
View File
@@ -0,0 +1,114 @@
/*!
* jQuery UI Button 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
}
/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}
/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
}
/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
+93
View File
@@ -0,0 +1,93 @@
/*!
* jQuery UI CSS Framework 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0);
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
+320
View File
@@ -0,0 +1,320 @@
/*!
* jQuery UI Core 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
(function( $, undefined ) {
var uuid = 0,
runiqueId = /^ui-id-\d+$/;
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
$.extend( $.ui, {
version: "1.10.3",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
}
});
// plugins
$.fn.extend({
focus: (function( orig ) {
return function( delay, fn ) {
return typeof delay === "number" ?
this.each(function() {
var elem = this;
setTimeout(function() {
$( elem ).focus();
if ( fn ) {
fn.call( elem );
}
}, delay );
}) :
orig.apply( this, arguments );
};
})( $.fn.focus ),
scrollParent: function() {
var scrollParent;
if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
scrollParent = this.parents().filter(function() {
return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
}).eq(0);
} else {
scrollParent = this.parents().filter(function() {
return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
}).eq(0);
}
return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
},
zIndex: function( zIndex ) {
if ( zIndex !== undefined ) {
return this.css( "zIndex", zIndex );
}
if ( this.length ) {
var elem = $( this[ 0 ] ), position, value;
while ( elem.length && elem[ 0 ] !== document ) {
// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this function consistent across browsers
// WebKit always returns auto if the element is positioned
position = elem.css( "position" );
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
// IE returns 0 when zIndex is not specified
// other browsers return a string
// we ignore the case of nested elements with an explicit value of 0
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
value = parseInt( elem.css( "zIndex" ), 10 );
if ( !isNaN( value ) && value !== 0 ) {
return value;
}
}
elem = elem.parent();
}
}
return 0;
},
uniqueId: function() {
return this.each(function() {
if ( !this.id ) {
this.id = "ui-id-" + (++uuid);
}
});
},
removeUniqueId: function() {
return this.each(function() {
if ( runiqueId.test( this.id ) ) {
$( this ).removeAttr( "id" );
}
});
}
});
// selectors
function focusable( element, isTabIndexNotNaN ) {
var map, mapName, img,
nodeName = element.nodeName.toLowerCase();
if ( "area" === nodeName ) {
map = element.parentNode;
mapName = map.name;
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
return false;
}
img = $( "img[usemap=#" + mapName + "]" )[0];
return !!img && visible( img );
}
return ( /input|select|textarea|button|object/.test( nodeName ) ?
!element.disabled :
"a" === nodeName ?
element.href || isTabIndexNotNaN :
isTabIndexNotNaN) &&
// the element and all of its ancestors must be visible
visible( element );
}
function visible( element ) {
return $.expr.filters.visible( element ) &&
!$( element ).parents().addBack().filter(function() {
return $.css( this, "visibility" ) === "hidden";
}).length;
}
$.extend( $.expr[ ":" ], {
data: $.expr.createPseudo ?
$.expr.createPseudo(function( dataName ) {
return function( elem ) {
return !!$.data( elem, dataName );
};
}) :
// support: jQuery <1.8
function( elem, i, match ) {
return !!$.data( elem, match[ 3 ] );
},
focusable: function( element ) {
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
},
tabbable: function( element ) {
var tabIndex = $.attr( element, "tabindex" ),
isTabIndexNaN = isNaN( tabIndex );
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
}
});
// support: jQuery <1.8
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
$.each( [ "Width", "Height" ], function( i, name ) {
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
type = name.toLowerCase(),
orig = {
innerWidth: $.fn.innerWidth,
innerHeight: $.fn.innerHeight,
outerWidth: $.fn.outerWidth,
outerHeight: $.fn.outerHeight
};
function reduce( elem, size, border, margin ) {
$.each( side, function() {
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
if ( border ) {
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
}
if ( margin ) {
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
}
});
return size;
}
$.fn[ "inner" + name ] = function( size ) {
if ( size === undefined ) {
return orig[ "inner" + name ].call( this );
}
return this.each(function() {
$( this ).css( type, reduce( this, size ) + "px" );
});
};
$.fn[ "outer" + name] = function( size, margin ) {
if ( typeof size !== "number" ) {
return orig[ "outer" + name ].call( this, size );
}
return this.each(function() {
$( this).css( type, reduce( this, size, true, margin ) + "px" );
});
};
});
}
// support: jQuery <1.8
if ( !$.fn.addBack ) {
$.fn.addBack = function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter( selector )
);
};
}
// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
$.fn.removeData = (function( removeData ) {
return function( key ) {
if ( arguments.length ) {
return removeData.call( this, $.camelCase( key ) );
} else {
return removeData.call( this );
}
};
})( $.fn.removeData );
}
// deprecated
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
$.support.selectstart = "onselectstart" in document.createElement( "div" );
$.fn.extend({
disableSelection: function() {
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
".ui-disableSelection", function( event ) {
event.preventDefault();
});
},
enableSelection: function() {
return this.unbind( ".ui-disableSelection" );
}
});
$.extend( $.ui, {
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
plugin: {
add: function( module, option, set ) {
var i,
proto = $.ui[ module ].prototype;
for ( i in set ) {
proto.plugins[ i ] = proto.plugins[ i ] || [];
proto.plugins[ i ].push( [ option, set[ i ] ] );
}
},
call: function( instance, name, args ) {
var i,
set = instance.plugins[ name ];
if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
return;
}
for ( i = 0; i < set.length; i++ ) {
if ( instance.options[ set[ i ][ 0 ] ] ) {
set[ i ][ 1 ].apply( instance.element, args );
}
}
}
},
// only used by resizable
hasScroll: function( el, a ) {
//If overflow is hidden, the element might have extra content, but the user wants to hide it
if ( $( el ).css( "overflow" ) === "hidden") {
return false;
}
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
has = false;
if ( el[ scroll ] > 0 ) {
return true;
}
// TODO: determine which cases actually cause this to happen
// if the element doesn't have the scroll set, see if it's possible to
// set the scroll
el[ scroll ] = 1;
has = ( el[ scroll ] > 0 );
el[ scroll ] = 0;
return has;
}
});
})( jQuery );
+178
View File
@@ -0,0 +1,178 @@
/*!
* jQuery UI Datepicker 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month-year {
width: 100%;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 49%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
/*!
* jQuery UI Menu 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style: none;
padding: 2px;
margin: 0;
display: block;
outline: none;
}
.ui-menu .ui-menu {
margin-top: -3px;
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
padding: 0;
width: 100%;
/* support: IE10, see #8844 */
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
}
.ui-menu .ui-menu-divider {
margin: 5px -2px 5px -2px;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-menu-item a {
text-decoration: none;
display: block;
padding: 2px .4em;
line-height: 1.5;
min-height: 0; /* support: IE7 */
font-weight: normal;
}
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
.ui-menu .ui-state-disabled {
font-weight: normal;
margin: .4em 0 .2em;
line-height: 1.5;
}
.ui-menu .ui-state-disabled a {
cursor: default;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item a {
position: relative;
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: .2em;
left: .2em;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
position: static;
float: right;
}
+621
View File
@@ -0,0 +1,621 @@
/*!
* jQuery UI Menu 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/menu/
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.position.js
*/
(function( $, undefined ) {
$.widget( "ui.menu", {
version: "1.10.3",
defaultElement: "<ul>",
delay: 300,
options: {
icons: {
submenu: "ui-icon-carat-1-e"
},
menus: "ul",
position: {
my: "left top",
at: "right top"
},
role: "menu",
// callbacks
blur: null,
focus: null,
select: null
},
_create: function() {
this.activeMenu = this.element;
// flag used to prevent firing of the click handler
// as the event bubbles up through nested menus
this.mouseHandled = false;
this.element
.uniqueId()
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
.attr({
role: this.options.role,
tabIndex: 0
})
// need to catch all clicks on disabled menu
// not possible through _on
.bind( "click" + this.eventNamespace, $.proxy(function( event ) {
if ( this.options.disabled ) {
event.preventDefault();
}
}, this ));
if ( this.options.disabled ) {
this.element
.addClass( "ui-state-disabled" )
.attr( "aria-disabled", "true" );
}
this._on({
// Prevent focus from sticking to links inside menu after clicking
// them (focus should always stay on UL during navigation).
"mousedown .ui-menu-item > a": function( event ) {
event.preventDefault();
},
"click .ui-state-disabled > a": function( event ) {
event.preventDefault();
},
"click .ui-menu-item:has(a)": function( event ) {
var target = $( event.target ).closest( ".ui-menu-item" );
if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
this.mouseHandled = true;
this.select( event );
// Open submenu on click
if ( target.has( ".ui-menu" ).length ) {
this.expand( event );
} else if ( !this.element.is( ":focus" ) ) {
// Redirect focus to the menu
this.element.trigger( "focus", [ true ] );
// If the active item is on the top level, let it stay active.
// Otherwise, blur the active item since it is no longer visible.
if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
clearTimeout( this.timer );
}
}
}
},
"mouseenter .ui-menu-item": function( event ) {
var target = $( event.currentTarget );
// Remove ui-state-active class from siblings of the newly focused menu item
// to avoid a jump caused by adjacent elements both having a class with a border
target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
this.focus( event, target );
},
mouseleave: "collapseAll",
"mouseleave .ui-menu": "collapseAll",
focus: function( event, keepActiveItem ) {
// If there's already an active item, keep it active
// If not, activate the first item
var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 );
if ( !keepActiveItem ) {
this.focus( event, item );
}
},
blur: function( event ) {
this._delay(function() {
if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
this.collapseAll( event );
}
});
},
keydown: "_keydown"
});
this.refresh();
// Clicks outside of a menu collapse any open menus
this._on( this.document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
this.collapseAll( event );
}
// Reset the mouseHandled flag
this.mouseHandled = false;
}
});
},
_destroy: function() {
// Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
.find( ".ui-menu" ).addBack()
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
.removeAttr( "role" )
.removeAttr( "tabIndex" )
.removeAttr( "aria-labelledby" )
.removeAttr( "aria-expanded" )
.removeAttr( "aria-hidden" )
.removeAttr( "aria-disabled" )
.removeUniqueId()
.show();
// Destroy menu items
this.element.find( ".ui-menu-item" )
.removeClass( "ui-menu-item" )
.removeAttr( "role" )
.removeAttr( "aria-disabled" )
.children( "a" )
.removeUniqueId()
.removeClass( "ui-corner-all ui-state-hover" )
.removeAttr( "tabIndex" )
.removeAttr( "role" )
.removeAttr( "aria-haspopup" )
.children().each( function() {
var elem = $( this );
if ( elem.data( "ui-menu-submenu-carat" ) ) {
elem.remove();
}
});
// Destroy menu dividers
this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
},
_keydown: function( event ) {
/*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
function escape( value ) {
return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
}
switch ( event.keyCode ) {
case $.ui.keyCode.PAGE_UP:
this.previousPage( event );
break;
case $.ui.keyCode.PAGE_DOWN:
this.nextPage( event );
break;
case $.ui.keyCode.HOME:
this._move( "first", "first", event );
break;
case $.ui.keyCode.END:
this._move( "last", "last", event );
break;
case $.ui.keyCode.UP:
this.previous( event );
break;
case $.ui.keyCode.DOWN:
this.next( event );
break;
case $.ui.keyCode.LEFT:
this.collapse( event );
break;
case $.ui.keyCode.RIGHT:
if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
this.expand( event );
}
break;
case $.ui.keyCode.ENTER:
case $.ui.keyCode.SPACE:
this._activate( event );
break;
case $.ui.keyCode.ESCAPE:
this.collapse( event );
break;
default:
preventDefault = false;
prev = this.previousFilter || "";
character = String.fromCharCode( event.keyCode );
skip = false;
clearTimeout( this.filterTimer );
if ( character === prev ) {
skip = true;
} else {
character = prev + character;
}
regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
return regex.test( $( this ).children( "a" ).text() );
});
match = skip && match.index( this.active.next() ) !== -1 ?
this.active.nextAll( ".ui-menu-item" ) :
match;
// If no matches on the current filter, reset to the last character pressed
// to move down the menu to the first item that starts with that character
if ( !match.length ) {
character = String.fromCharCode( event.keyCode );
regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
return regex.test( $( this ).children( "a" ).text() );
});
}
if ( match.length ) {
this.focus( event, match );
if ( match.length > 1 ) {
this.previousFilter = character;
this.filterTimer = this._delay(function() {
delete this.previousFilter;
}, 1000 );
} else {
delete this.previousFilter;
}
} else {
delete this.previousFilter;
}
}
if ( preventDefault ) {
event.preventDefault();
}
},
_activate: function( event ) {
if ( !this.active.is( ".ui-state-disabled" ) ) {
if ( this.active.children( "a[aria-haspopup='true']" ).length ) {
this.expand( event );
} else {
this.select( event );
}
}
},
refresh: function() {
var menus,
icon = this.options.icons.submenu,
submenus = this.element.find( this.options.menus );
// Initialize nested menus
submenus.filter( ":not(.ui-menu)" )
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.hide()
.attr({
role: this.options.role,
"aria-hidden": "true",
"aria-expanded": "false"
})
.each(function() {
var menu = $( this ),
item = menu.prev( "a" ),
submenuCarat = $( "<span>" )
.addClass( "ui-menu-icon ui-icon " + icon )
.data( "ui-menu-submenu-carat", true );
item
.attr( "aria-haspopup", "true" )
.prepend( submenuCarat );
menu.attr( "aria-labelledby", item.attr( "id" ) );
});
menus = submenus.add( this.element );
// Don't refresh list items that are already adapted
menus.children( ":not(.ui-menu-item):has(a)" )
.addClass( "ui-menu-item" )
.attr( "role", "presentation" )
.children( "a" )
.uniqueId()
.addClass( "ui-corner-all" )
.attr({
tabIndex: -1,
role: this._itemRole()
});
// Initialize unlinked menu-items containing spaces and/or dashes only as dividers
menus.children( ":not(.ui-menu-item)" ).each(function() {
var item = $( this );
// hyphen, em dash, en dash
if ( !/[^\-\u2014\u2013\s]/.test( item.text() ) ) {
item.addClass( "ui-widget-content ui-menu-divider" );
}
});
// Add aria-disabled attribute to any disabled menu item
menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
// If the active item has been removed, blur the menu
if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
this.blur();
}
},
_itemRole: function() {
return {
menu: "menuitem",
listbox: "option"
}[ this.options.role ];
},
_setOption: function( key, value ) {
if ( key === "icons" ) {
this.element.find( ".ui-menu-icon" )
.removeClass( this.options.icons.submenu )
.addClass( value.submenu );
}
this._super( key, value );
},
focus: function( event, item ) {
var nested, focused;
this.blur( event, event && event.type === "focus" );
this._scrollIntoView( item );
this.active = item.first();
focused = this.active.children( "a" ).addClass( "ui-state-focus" );
// Only update aria-activedescendant if there's a role
// otherwise we assume focus is managed elsewhere
if ( this.options.role ) {
this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
}
// Highlight active parent menu item, if any
this.active
.parent()
.closest( ".ui-menu-item" )
.children( "a:first" )
.addClass( "ui-state-active" );
if ( event && event.type === "keydown" ) {
this._close();
} else {
this.timer = this._delay(function() {
this._close();
}, this.delay );
}
nested = item.children( ".ui-menu" );
if ( nested.length && ( /^mouse/.test( event.type ) ) ) {
this._startOpening(nested);
}
this.activeMenu = item.parent();
this._trigger( "focus", event, { item: item } );
},
_scrollIntoView: function( item ) {
var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
if ( this._hasScroll() ) {
borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
scroll = this.activeMenu.scrollTop();
elementHeight = this.activeMenu.height();
itemHeight = item.height();
if ( offset < 0 ) {
this.activeMenu.scrollTop( scroll + offset );
} else if ( offset + itemHeight > elementHeight ) {
this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
}
}
},
blur: function( event, fromFocus ) {
if ( !fromFocus ) {
clearTimeout( this.timer );
}
if ( !this.active ) {
return;
}
this.active.children( "a" ).removeClass( "ui-state-focus" );
this.active = null;
this._trigger( "blur", event, { item: this.active } );
},
_startOpening: function( submenu ) {
clearTimeout( this.timer );
// Don't open if already open fixes a Firefox bug that caused a .5 pixel
// shift in the submenu position when mousing over the carat icon
if ( submenu.attr( "aria-hidden" ) !== "true" ) {
return;
}
this.timer = this._delay(function() {
this._close();
this._open( submenu );
}, this.delay );
},
_open: function( submenu ) {
var position = $.extend({
of: this.active
}, this.options.position );
clearTimeout( this.timer );
this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
.hide()
.attr( "aria-hidden", "true" );
submenu
.show()
.removeAttr( "aria-hidden" )
.attr( "aria-expanded", "true" )
.position( position );
},
collapseAll: function( event, all ) {
clearTimeout( this.timer );
this.timer = this._delay(function() {
// If we were passed an event, look for the submenu that contains the event
var currentMenu = all ? this.element :
$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
if ( !currentMenu.length ) {
currentMenu = this.element;
}
this._close( currentMenu );
this.blur( event );
this.activeMenu = currentMenu;
}, this.delay );
},
// With no arguments, closes the currently active menu - if nothing is active
// it closes all menus. If passed an argument, it will search for menus BELOW
_close: function( startMenu ) {
if ( !startMenu ) {
startMenu = this.active ? this.active.parent() : this.element;
}
startMenu
.find( ".ui-menu" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" )
.end()
.find( "a.ui-state-active" )
.removeClass( "ui-state-active" );
},
collapse: function( event ) {
var newItem = this.active &&
this.active.parent().closest( ".ui-menu-item", this.element );
if ( newItem && newItem.length ) {
this._close();
this.focus( event, newItem );
}
},
expand: function( event ) {
var newItem = this.active &&
this.active
.children( ".ui-menu " )
.children( ".ui-menu-item" )
.first();
if ( newItem && newItem.length ) {
this._open( newItem.parent() );
// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
this._delay(function() {
this.focus( event, newItem );
});
}
},
next: function( event ) {
this._move( "next", "first", event );
},
previous: function( event ) {
this._move( "prev", "last", event );
},
isFirstItem: function() {
return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
},
isLastItem: function() {
return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
},
_move: function( direction, filter, event ) {
var next;
if ( this.active ) {
if ( direction === "first" || direction === "last" ) {
next = this.active
[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
.eq( -1 );
} else {
next = this.active
[ direction + "All" ]( ".ui-menu-item" )
.eq( 0 );
}
}
if ( !next || !next.length || !this.active ) {
next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();
}
this.focus( event, next );
},
nextPage: function( event ) {
var item, base, height;
if ( !this.active ) {
this.next( event );
return;
}
if ( this.isLastItem() ) {
return;
}
if ( this._hasScroll() ) {
base = this.active.offset().top;
height = this.element.height();
this.active.nextAll( ".ui-menu-item" ).each(function() {
item = $( this );
return item.offset().top - base - height < 0;
});
this.focus( event, item );
} else {
this.focus( event, this.activeMenu.children( ".ui-menu-item" )
[ !this.active ? "first" : "last" ]() );
}
},
previousPage: function( event ) {
var item, base, height;
if ( !this.active ) {
this.next( event );
return;
}
if ( this.isFirstItem() ) {
return;
}
if ( this._hasScroll() ) {
base = this.active.offset().top;
height = this.element.height();
this.active.prevAll( ".ui-menu-item" ).each(function() {
item = $( this );
return item.offset().top - base + height > 0;
});
this.focus( event, item );
} else {
this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
}
},
_hasScroll: function() {
return this.element.outerHeight() < this.element.attr( "scrollHeight" );
},
select: function( event ) {
// TODO: It should never be possible to not have an active item at this
// point, but the tests don't trigger mouseenter before click.
this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
var ui = { item: this.active };
if ( !this.active.has( ".ui-menu" ).length ) {
this.collapseAll( event, true );
}
this._trigger( "select", event, ui );
}
});
}( jQuery ));
+497
View File
@@ -0,0 +1,497 @@
/*!
* jQuery UI Position 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/position/
*/
(function( $, undefined ) {
$.ui = $.ui || {};
var cachedScrollbarWidth,
max = Math.max,
abs = Math.abs,
round = Math.round,
rhorizontal = /left|center|right/,
rvertical = /top|center|bottom/,
roffset = /[\+\-]\d+(\.[\d]+)?%?/,
rposition = /^\w+/,
rpercent = /%$/,
_position = $.fn.position;
function getOffsets( offsets, width, height ) {
return [
parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
];
}
function parseCss( element, property ) {
return parseInt( $.css( element, property ), 10 ) || 0;
}
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
height: elem.height(),
offset: { top: 0, left: 0 }
};
}
if ( $.isWindow( raw ) ) {
return {
width: elem.width(),
height: elem.height(),
offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
};
}
if ( raw.preventDefault ) {
return {
width: 0,
height: 0,
offset: { top: raw.pageY, left: raw.pageX }
};
}
return {
width: elem.outerWidth(),
height: elem.outerHeight(),
offset: elem.offset()
};
}
$.position = {
scrollbarWidth: function() {
if ( cachedScrollbarWidth !== undefined ) {
return cachedScrollbarWidth;
}
var w1, w2,
div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
innerDiv = div.children()[0];
$( "body" ).append( div );
w1 = innerDiv.offsetWidth;
div.css( "overflow", "scroll" );
w2 = innerDiv.offsetWidth;
if ( w1 === w2 ) {
w2 = div[0].clientWidth;
}
div.remove();
return (cachedScrollbarWidth = w1 - w2);
},
getScrollInfo: function( within ) {
var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),
overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),
hasOverflowX = overflowX === "scroll" ||
( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
hasOverflowY = overflowY === "scroll" ||
( overflowY === "auto" && within.height < within.element[0].scrollHeight );
return {
width: hasOverflowY ? $.position.scrollbarWidth() : 0,
height: hasOverflowX ? $.position.scrollbarWidth() : 0
};
},
getWithinInfo: function( element ) {
var withinElement = $( element || window ),
isWindow = $.isWindow( withinElement[0] );
return {
element: withinElement,
isWindow: isWindow,
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
width: isWindow ? withinElement.width() : withinElement.outerWidth(),
height: isWindow ? withinElement.height() : withinElement.outerHeight()
};
}
};
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
// make a copy, we don't want to modify arguments
options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
target = $( options.of ),
within = $.position.getWithinInfo( options.within ),
scrollInfo = $.position.getScrollInfo( within ),
collision = ( options.collision || "flip" ).split( " " ),
offsets = {};
dimensions = getDimensions( target );
if ( target[0].preventDefault ) {
// force left top to allow flipping
options.at = "left top";
}
targetWidth = dimensions.width;
targetHeight = dimensions.height;
targetOffset = dimensions.offset;
// clone to reuse original targetOffset later
basePosition = $.extend( {}, targetOffset );
// force my and at to have valid horizontal and vertical positions
// if a value is missing or invalid, it will be converted to center
$.each( [ "my", "at" ], function() {
var pos = ( options[ this ] || "" ).split( " " ),
horizontalOffset,
verticalOffset;
if ( pos.length === 1) {
pos = rhorizontal.test( pos[ 0 ] ) ?
pos.concat( [ "center" ] ) :
rvertical.test( pos[ 0 ] ) ?
[ "center" ].concat( pos ) :
[ "center", "center" ];
}
pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
// calculate offsets
horizontalOffset = roffset.exec( pos[ 0 ] );
verticalOffset = roffset.exec( pos[ 1 ] );
offsets[ this ] = [
horizontalOffset ? horizontalOffset[ 0 ] : 0,
verticalOffset ? verticalOffset[ 0 ] : 0
];
// reduce to just the positions without the offsets
options[ this ] = [
rposition.exec( pos[ 0 ] )[ 0 ],
rposition.exec( pos[ 1 ] )[ 0 ]
];
});
// normalize collision option
if ( collision.length === 1 ) {
collision[ 1 ] = collision[ 0 ];
}
if ( options.at[ 0 ] === "right" ) {
basePosition.left += targetWidth;
} else if ( options.at[ 0 ] === "center" ) {
basePosition.left += targetWidth / 2;
}
if ( options.at[ 1 ] === "bottom" ) {
basePosition.top += targetHeight;
} else if ( options.at[ 1 ] === "center" ) {
basePosition.top += targetHeight / 2;
}
atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
basePosition.left += atOffset[ 0 ];
basePosition.top += atOffset[ 1 ];
return this.each(function() {
var collisionPosition, using,
elem = $( this ),
elemWidth = elem.outerWidth(),
elemHeight = elem.outerHeight(),
marginLeft = parseCss( this, "marginLeft" ),
marginTop = parseCss( this, "marginTop" ),
collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
position = $.extend( {}, basePosition ),
myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
if ( options.my[ 0 ] === "right" ) {
position.left -= elemWidth;
} else if ( options.my[ 0 ] === "center" ) {
position.left -= elemWidth / 2;
}
if ( options.my[ 1 ] === "bottom" ) {
position.top -= elemHeight;
} else if ( options.my[ 1 ] === "center" ) {
position.top -= elemHeight / 2;
}
position.left += myOffset[ 0 ];
position.top += myOffset[ 1 ];
// if the browser doesn't support fractions, then round for consistent results
if ( !$.support.offsetFractions ) {
position.left = round( position.left );
position.top = round( position.top );
}
collisionPosition = {
marginLeft: marginLeft,
marginTop: marginTop
};
$.each( [ "left", "top" ], function( i, dir ) {
if ( $.ui.position[ collision[ i ] ] ) {
$.ui.position[ collision[ i ] ][ dir ]( position, {
targetWidth: targetWidth,
targetHeight: targetHeight,
elemWidth: elemWidth,
elemHeight: elemHeight,
collisionPosition: collisionPosition,
collisionWidth: collisionWidth,
collisionHeight: collisionHeight,
offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
my: options.my,
at: options.at,
within: within,
elem : elem
});
}
});
if ( options.using ) {
// adds feedback as second argument to using callback, if present
using = function( props ) {
var left = targetOffset.left - position.left,
right = left + targetWidth - elemWidth,
top = targetOffset.top - position.top,
bottom = top + targetHeight - elemHeight,
feedback = {
target: {
element: target,
left: targetOffset.left,
top: targetOffset.top,
width: targetWidth,
height: targetHeight
},
element: {
element: elem,
left: position.left,
top: position.top,
width: elemWidth,
height: elemHeight
},
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
};
if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
feedback.horizontal = "center";
}
if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
feedback.vertical = "middle";
}
if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
feedback.important = "horizontal";
} else {
feedback.important = "vertical";
}
options.using.call( this, props, feedback );
};
}
elem.offset( $.extend( position, { using: using } ) );
});
};
$.ui.position = {
fit: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = withinOffset - collisionPosLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
newOverRight;
// element is wider than within
if ( data.collisionWidth > outerWidth ) {
// element is initially over the left side of within
if ( overLeft > 0 && overRight <= 0 ) {
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
position.left += overLeft - newOverRight;
// element is initially over right side of within
} else if ( overRight > 0 && overLeft <= 0 ) {
position.left = withinOffset;
// element is initially over both left and right sides of within
} else {
if ( overLeft > overRight ) {
position.left = withinOffset + outerWidth - data.collisionWidth;
} else {
position.left = withinOffset;
}
}
// too far left -> align with left edge
} else if ( overLeft > 0 ) {
position.left += overLeft;
// too far right -> align with right edge
} else if ( overRight > 0 ) {
position.left -= overRight;
// adjust based on position and margin
} else {
position.left = max( position.left - collisionPosLeft, position.left );
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = withinOffset - collisionPosTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
newOverBottom;
// element is taller than within
if ( data.collisionHeight > outerHeight ) {
// element is initially over the top of within
if ( overTop > 0 && overBottom <= 0 ) {
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
position.top += overTop - newOverBottom;
// element is initially over bottom of within
} else if ( overBottom > 0 && overTop <= 0 ) {
position.top = withinOffset;
// element is initially over both top and bottom of within
} else {
if ( overTop > overBottom ) {
position.top = withinOffset + outerHeight - data.collisionHeight;
} else {
position.top = withinOffset;
}
}
// too far up -> align with top
} else if ( overTop > 0 ) {
position.top += overTop;
// too far down -> align with bottom edge
} else if ( overBottom > 0 ) {
position.top -= overBottom;
// adjust based on position and margin
} else {
position.top = max( position.top - collisionPosTop, position.top );
}
}
},
flip: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = collisionPosLeft - offsetLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
myOffset = data.my[ 0 ] === "left" ?
-data.elemWidth :
data.my[ 0 ] === "right" ?
data.elemWidth :
0,
atOffset = data.at[ 0 ] === "left" ?
data.targetWidth :
data.at[ 0 ] === "right" ?
-data.targetWidth :
0,
offset = -2 * data.offset[ 0 ],
newOverRight,
newOverLeft;
if ( overLeft < 0 ) {
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
position.left += myOffset + atOffset + offset;
}
}
else if ( overRight > 0 ) {
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
position.left += myOffset + atOffset + offset;
}
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = collisionPosTop - offsetTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
top = data.my[ 1 ] === "top",
myOffset = top ?
-data.elemHeight :
data.my[ 1 ] === "bottom" ?
data.elemHeight :
0,
atOffset = data.at[ 1 ] === "top" ?
data.targetHeight :
data.at[ 1 ] === "bottom" ?
-data.targetHeight :
0,
offset = -2 * data.offset[ 1 ],
newOverTop,
newOverBottom;
if ( overTop < 0 ) {
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
position.top += myOffset + atOffset + offset;
}
}
else if ( overBottom > 0 ) {
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
position.top += myOffset + atOffset + offset;
}
}
}
},
flipfit: {
left: function() {
$.ui.position.flip.left.apply( this, arguments );
$.ui.position.fit.left.apply( this, arguments );
},
top: function() {
$.ui.position.flip.top.apply( this, arguments );
$.ui.position.fit.top.apply( this, arguments );
}
}
};
// fraction support test
(function () {
var testElement, testElementParent, testElementStyle, offsetLeft, i,
body = document.getElementsByTagName( "body" )[ 0 ],
div = document.createElement( "div" );
//Create a "fake body" for testing based on method used in jQuery.support
testElement = document.createElement( body ? "div" : "body" );
testElementStyle = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0,
background: "none"
};
if ( body ) {
$.extend( testElementStyle, {
position: "absolute",
left: "-1000px",
top: "-1000px"
});
}
for ( i in testElementStyle ) {
testElement.style[ i ] = testElementStyle[ i ];
}
testElement.appendChild( div );
testElementParent = body || document.documentElement;
testElementParent.insertBefore( testElement, testElementParent.firstChild );
div.style.cssText = "position: absolute; left: 10.7432222px;";
offsetLeft = $( div ).offset().left;
$.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
})();
}( jQuery ) );
+78
View File
@@ -0,0 +1,78 @@
/*!
* jQuery UI Resizable 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
+15
View File
@@ -0,0 +1,15 @@
/*!
* jQuery UI Selectable 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
+407
View File
@@ -0,0 +1,407 @@
/*!
* jQuery UI CSS Framework 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/
*/
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
font-size: 1.1em/*{fsDefault}*/;
z-index:999999999;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
font-size: 1em;
}
.ui-widget-content {
border: 1px solid #aaaaaa/*{borderColorContent}*/;
background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
color: #222222/*{fcContent}*/;
}
.ui-widget-content a {
color: #222222/*{fcContent}*/;
}
.ui-widget-header {
border: 1px solid #aaaaaa/*{borderColorHeader}*/;
background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
color: #222222/*{fcHeader}*/;
font-weight: bold;
}
.ui-widget-header a {
color: #222222/*{fcHeader}*/;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #d3d3d3/*{borderColorDefault}*/;
background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #555555/*{fcDefault}*/;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #555555/*{fcDefault}*/;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #999999/*{borderColorHover}*/;
background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcHover}*/;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #212121/*{fcHover}*/;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #aaaaaa/*{borderColorActive}*/;
background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcActive}*/;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #212121/*{fcActive}*/;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #fcefa1/*{borderColorHighlight}*/;
background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
color: #363636/*{fcHighlight}*/;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #363636/*{fcHighlight}*/;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a/*{borderColorError}*/;
background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
color: #cd0a0a/*{fcError}*/;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #cd0a0a/*{fcError}*/;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #cd0a0a/*{fcError}*/;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70);
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35);
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 4px/*{cornerRadius}*/;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 4px/*{cornerRadius}*/;
}
/* Overlays */
.ui-widget-overlay {
background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
opacity: .3/*{opacityOverlay}*/;
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/;
}
.ui-widget-shadow {
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
padding: 8px/*{thicknessShadow}*/;
background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
opacity: .3/*{opacityShadow}*/;
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/;
border-radius: 8px/*{cornerRadiusShadow}*/;
}
+521
View File
@@ -0,0 +1,521 @@
/*!
* jQuery UI Widget 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
(function( $, undefined ) {
var uuid = 0,
slice = Array.prototype.slice,
_cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
try {
$( elem ).triggerHandler( "remove" );
// http://bugs.jquery.com/ticket/8235
} catch( e ) {}
}
_cleanData( elems );
};
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
// extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
// copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
// track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
$.each( prototype, function( prop, value ) {
if ( !$.isFunction( value ) ) {
proxiedPrototype[ prop ] = value;
return;
}
proxiedPrototype[ prop ] = (function() {
var _super = function() {
return base.prototype[ prop ].apply( this, arguments );
},
_superApply = function( args ) {
return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,
__superApply = this._superApply,
returnValue;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
constructor.prototype = $.widget.extend( basePrototype, {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
// If this widget is being redefined then we need to find all widgets that
// are inheriting from it and redefine all of them so that they inherit from
// the new version of this widget. We're essentially trying to replace one
// level in the prototype chain.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
});
// remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
base._childConstructors.push( constructor );
}
$.widget.bridge( name, constructor );
};
$.widget.extend = function( target ) {
var input = slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length,
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
// Copy everything else by reference
} else {
target[ key ] = value;
}
}
}
}
return target;
};
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.widget.extend.apply( null, [ options ].concat(args) ) :
options;
if ( isMethodCall ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
methodValue;
return false;
}
});
} else {
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} )._init();
} else {
$.data( this, fullName, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if ( element !== this ) {
$.data( element, this.widgetFullName, this );
this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
}
}
});
this.document = $( element.style ?
// element within the document
element.ownerDocument :
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
// 1.9 BC for #7810
// TODO remove dual storage
.removeData( this.widgetName )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
.unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
if ( parts.length ) {
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
for ( i = 0; i < parts.length - 1; i++ ) {
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( value === undefined ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( value === undefined ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;
}
}
this._setOptions( options );
return this;
},
_setOptions: function( options ) {
var key;
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
.attr( "aria-disabled", value );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
return this;
},
enable: function() {
return this._setOption( "disabled", false );
},
disable: function() {
return this._setOption( "disabled", true );
},
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
// accept selectors, DOM elements
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
( instance.options.disabled === true ||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^(\w+)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
})( jQuery );
+30
View File
@@ -0,0 +1,30 @@
<?php
ob_start(); session_start();
include_once("../../../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 (get_magic_quotes_gpc()) $q = stripslashes($q);
$query=mysql_query("select * from tbl_customers where concat(first_name,' ',last_name) like '%".$q."%' or email like '%".$q."%' or mobile_number like '%".$q."%' or landline_number like '%".$q."%'");
$result = array();
while($res_cust=mysql_fetch_array($query))
{
$customer=$res_cust['id'].' '.$res_cust['first_name'].' '.$res_cust['last_name'];
//$customer=$res_cust['first_name'].' '.$res_cust['last_name'];
array_push($result,$customer);
}
// json_encode is available in PHP 5.2 and above, or you can install a PECL module in earlier versions
echo json_encode($result);
?>
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
<?php
$connection = mysql_connect('localhost','root','root') or die(mysql_error());
$database = mysql_select_db('test_csv') or die(mysql_error());
?>
+97
View File
@@ -0,0 +1,97 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Autocomplete search </title>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$(function(){
$(".search").keyup(function()
{
var searchid = $(this).val();
var dataString = 'search='+ searchid;
if(searchid!='')
{
$.ajax({
type: "POST",
url: "search.php",
data: dataString,
cache: false,
success: function(html)
{
$("#result").html(html).show();
}
});
}else{return false;}return false;
});
jQuery("#result").live("click",function(e){
var $clicked = $(e.target);
var $name = $clicked.find('.name').html();
var decoded = $("<div/>").html($name).text();
$('#searchid').val(decoded);
});
jQuery(document).live("click", function(e) {
var $clicked = $(e.target);
if (! $clicked.hasClass("search")){
jQuery("#result").fadeOut();
}
});
$('#searchid').click(function(){
jQuery("#result").fadeIn();
});
});
</script>
<style type="text/css">
body{
font-family:Tahoma, Geneva, sans-serif;
font-size:16px;
}
.content{
width:900px;
margin:0 auto;
}
#searchid
{
width:300px;
border:solid 1px #000;
padding:10px;
font-size:14px;
}
#result
{
position:absolute;
width:300px;
padding:10px;
display:none;
margin-top:-1px;
border-top:0px;
overflow:hidden;
border:1px #CCC solid;
background-color: white;
}
.show
{
padding:10px;
border-bottom:1px #999 dashed;
font-size:15px;
height:50px;
}
.show:hover
{
background:#4c66a4;
color:#FFF;
cursor:pointer;
}
</style>
</head>
<body>
<div class="content">
<input type="text" class="search" id="searchid" />&nbsp; &nbsp; <br />
<div id="result">
</div>
</div>
</body>
</html>
File diff suppressed because one or more lines are too long
+21
View File
@@ -0,0 +1,21 @@
<?php
include('db.php');
if($_POST)
{
$q=$_POST['search'];
$sql_res=mysql_query("select id,name from autocomplete where name like '%$q%' order by id LIMIT 5");
while($row=mysql_fetch_array($sql_res))
{
$username=$row['name'];
$b_username=$q;
$final_username = str_ireplace($q, $b_username, $username);
?>
<span class="name"><?php echo $final_username; ?></span>&nbsp;<br/><br/>
</div>
<?php
}
}
?>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Autocomplete</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<?php
mysql_connect("Localhost","root","root");
mysql_select_db("test_csv");
$sql="select name from user_info";
$result=mysql_query($sql);
?>
<script>
$(function() {
var availableTags = [
<?php
while($row=mysql_fetch_assoc($result))
{
echo'"';
echo $row['name'];
echo'",';
}
?>
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
$(function() {
var available = [
<?php
$sql="select email from user_info";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result))
{
echo'"';
echo $row['email'];
echo'",';
}
?>
];
$( "#mytag" ).autocomplete({
source: available
});
});
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">User Names: </label>
<input id="tags">
</div>
<br>
<br>
<br>
&nbsp;&nbsp;<div class="ui-widget">
<label for="mytag">E-Mail: </label>
<input id="mytag">
</div>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
<?php
echo "val=".$_REQUEST['name_hid'];
?>
+19
View File
@@ -0,0 +1,19 @@
if($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] == 3790)
// if($_SESSION['moms_uid'] == '1')
{
}
else
if($_SESSION['moms_type'] == "super_admin")
{
}
else
if($_SESSION['moms_type'] == "admin")
{
}
+19
View File
@@ -0,0 +1,19 @@
// if($_SESSION['moms_uid'] == '1' OR $_SESSION['moms_uid'] == 3790)
if($_SESSION['moms_uid'] == '1')
{
}
else
if($_SESSION['moms_type'] == "super_admin")
{
}
else
if($_SESSION['moms_type'] == "admin")
{
}
+2809
View File
File diff suppressed because it is too large Load Diff
+5027
View File
File diff suppressed because it is too large Load Diff
+183
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
/*! normalize.css v1.1.2 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:0 0 0.5em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
+213
View File
@@ -0,0 +1,213 @@
*{
margin:0;
padding:0;
}
body{
font-family:Arial, sans-serif;
font-size:14px;
background:#f4f4f4 url(../images/bg.gif) repeat top left;
color:#333;
text-shadow:1px 1px 1px #fff;
overflow-y:scroll;
}
h1{
font-size:56px;
}
h2{
font-size:24px;
padding:0px 0px 40px 0px;
color:#333;
text-align:center;
}
h2 span{
color:#ffa800;
}
a{
color:#777;
}
a:hover{
color:#222;
}
p{
padding:5px 0px;
}
.wrapper{
width:960px;
margin:20px auto;
min-height:550px;
}
.box{
width:49%;
}
.left{
float:left;
}
.right{
float:right;
}
.clear{
clear:both;
}
a.back{
color:#777;
position:fixed;
top:5px;
right:10px;
text-decoration:none;
}
/* Form Style */
.form_wrapper{
background:#fff;
border:1px solid #ddd;
margin:0 auto;
width:350px;
font-size:16px;
-moz-box-shadow:1px 1px 7px #ccc;
-webkit-box-shadow:1px 1px 7px #ccc;
box-shadow:1px 1px 7px #ccc;
}
.form_wrapper h3{
padding:20px 30px 20px 30px;
background-color:#444;
color:#fff;
font-size:25px;
border-bottom:1px solid #ddd;
}
.form_wrapper form{
display:none;
background:#fff;
}
.form_wrapper .column{
width:47%;
float:left;
}
form.active{
display:block;
}
form.login{
width:350px;
}
form.register{
width:550px;
}
form.forgot_password{
width:300px;
}
.form_wrapper a{
text-decoration:none;
color:#777;
font-size:12px;
}
.form_wrapper a:hover{
color:#000;
}
.form_wrapper label{
display:block;
padding:10px 30px 0px 30px;
margin:10px 0px 0px 0px;
}
.form_wrapper input[type="text"],
.form_wrapper input[type="password"]{
border: solid 1px #E5E5E5;
background: #FFFFFF;
margin: 5px 30px 0px 30px;
padding: 9px;
display:block;
font-size:16px;
width:76%;
background:
-webkit-gradient(
linear,
left top,
left 25,
from(#FFFFFF),
color-stop(4%, #EEEEEE),
to(#FFFFFF)
);
background:
-moz-linear-gradient(
top,
#FFFFFF,
#EEEEEE 1px,
#FFFFFF 25px
);
-moz-box-shadow: 0px 0px 8px #f0f0f0;
-webkit-box-shadow: 0px 0px 8px #f0f0f0;
box-shadow: 0px 0px 8px #f0f0f0;
}
.form_wrapper input[type="text"]:focus,
.form_wrapper input[type="password"]:focus{
background:#feffef;
}
.form_wrapper .bottom{
background-color:#444;
border-top:1px solid #ddd;
margin-top:20px;
clear:both;
color:#fff;
text-shadow:1px 1px 1px #000;
}
.form_wrapper .bottom a{
display:block;
clear:both;
padding:10px 30px;
text-align:right;
color:#ffa800;
text-shadow:1px 1px 1px #000;
}
.form_wrapper a.forgot{
float:right;
font-style:italic;
line-height:24px;
color:#ffa800;
text-shadow:1px 1px 1px #fff;
}
.form_wrapper a.forgot:hover{
color:#000;
}
.form_wrapper div.remember{
float:left;
width:140px;
margin:20px 0px 20px 30px;
font-size:11px;
}
.form_wrapper div.remember input{
float:left;
margin:2px 5px 0px 0px;
}
.form_wrapper span.error{
visibility:hidden;
color:red;
font-size:11px;
font-style:italic;
display:block;
margin:4px 30px;
}
.form_wrapper input[type="submit"] {
background: #e3e3e3;
border: 1px solid #ccc;
color: #333;
font-family: "Trebuchet MS", "Myriad Pro", sans-serif;
font-size: 14px;
font-weight: bold;
padding: 8px 0 9px;
text-align: center;
width: 150px;
cursor:pointer;
float:right;
margin:15px 20px 10px 10px;
text-shadow: 0px 1px 0px #fff;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: 0px 0px 2px #fff inset;
-webkit-box-shadow: 0px 0px 2px #fff inset;
box-shadow: 0px 0px 2px #fff inset;
}
.form_wrapper input[type="submit"]:hover {
background: #d9d9d9;
-moz-box-shadow: 0px 0px 2px #eaeaea inset;
-webkit-box-shadow: 0px 0px 2px #eaeaea inset;
box-shadow: 0px 0px 2px #eaeaea inset;
color: #222;
}
+214
View File
@@ -0,0 +1,214 @@
/*
Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Site : www.buildinternet.com/project/supersized
Author : Sam Dunn
Company : One Mighty Roar (www.onemightyroar.com)
License : MIT License / GPL License
*/
* {
margin: 0;
padding: 0;
}
body {
background: #111;
height: 100%;
}
img {
border: none;
}
#supersized-loader {
position: absolute;
top: 50%;
left: 50%;
z-index: 0;
width: 60px;
height: 60px;
margin: -30px 0 0 -30px;
text-indent: -999em;
background: url(../images/progress.gif) no-repeat center center;
}
#supersized {
display: block;
position: fixed;
left: 0;
top: 0;
overflow: hidden;
z-index: -999;
width: 100%;
min-height: 100%;
padding: 0 !important;
margin: 0 !important;
}
#supersized img {
width: auto;
height: auto;
position: relative;
display: none;
outline: none;
border: none;
padding: 0 !important;
margin: 0 !important;
}
#supersized.speed img {
-ms-interpolation-mode: nearest-neighbor;
image-rendering: -moz-crisp-edges;
}
/*Speed*/
#supersized.quality img {
-ms-interpolation-mode: bicubic;
image-rendering: optimizeQuality;
}
/*Quality*/
#supersized li {
display: block;
list-style: none;
z-index: -30;
position: fixed;
overflow: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#supersized a {
width: 100%;
height: 100%;
display: block;
}
#supersized li.prevslide {
z-index: -20;
}
#supersized li.activeslide {
z-index: -10;
}
#supersized li.image-loading {
background: #111111 url(../images/progress.gif) no-repeat center center;
width: 100%;
height: 100%;
}
#supersized li.image-loading img {
visibility: hidden;
}
#supersized li.prevslide img, #supersized li.activeslide img {
display: inline;
}
#lightbox {
cursor: pointer;
position: fixed;
width: 100%;
height: 100%;
z-index: 9999;
top: 0;
left: 0;
background: black;
/* IE Fallback (Solid Colour) */
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIElEQVQ4T2NkYGDYDMRkA8ZRAxhGw4BhNAyA+WAYpAMAIFgLQfO9BoEAAAAASUVORK5CYII=);
background: rgba(0, 0, 0, 0.7);
-webkit-filter: none !important;
}
#lightbox img {
display: block;
position: absolute;
border: 5px solid #fff;
box-shadow: 0 0 20px #000;
border-radius: 1px;
}
body.blurred > * {
-webkit-filter: blur(2px);
-webkit-transform: translate3d(0, 0, 0);
}
.lightbox-loading {
background: url(../images/progress.gif) center center no-repeat;
width: 31px;
height: 31px;
margin: -16px 0 0 -16px;
position: absolute;
top: 48%;
left: 50%;
}
.lightbox-caption {
display: none;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
z-index: 1000;
background: #000;
background: rgba(0, 0, 0, 0.7);
}
.lightbox-caption p {
margin: 0 auto;
max-width: 70%;
display: inline-block;
*display: inline;
*zoom: 1;
padding: 10px;
color: #fff;
font-size: 12px;
line-height: 18px;
}
.lightbox-button {
position: absolute;
z-index: 9999;
background: no-repeat center center;
width: 32px;
height: 32px;
opacity: 0.4;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
transition: all 0.3s;
}
.lightbox-button:hover,
.lightbox-button:focus {
opacity: 1;
-webkit-transform: scale(1.4);
-moz-transform: scale(1.4);
-ms-transform: scale(1.4);
transform: scale(1.4);
}
.lightbox-close {
right: 10px;
top: 10px;
background-image: url("../images/close.png");
}
.lightbox-next {
right: 10px;
top: 48%;
background-image: url("../images/next.png");
}
.lightbox-previous {
left: 10px;
top: 48%;
background-image: url("../images/previous.png");
}
File diff suppressed because it is too large Load Diff
+161
View File
@@ -0,0 +1,161 @@
.tooltip {
display: inline;
position: relative;
z-index: 999;
float:right;
padding:3px 13px 0 0;
}
/* Trigger text */
.tooltip-item {
font-size:15px;
font-style:italic;
cursor: pointer;
display: inline-block;
font-weight: 700;
padding: 0 0 0 10px;
line-height:24px;
color:#fff;
}
/* Gap filler */
.tooltip-item::after {
content: '';
position: absolute;
width: 360px;
height: 20px;
bottom: 100%;
left: 50%;
pointer-events: none;
/*-webkit-transform: translateX(-50%);
transform: translateX(-50%);*/
}
.tooltip:hover .tooltip-item::after {
pointer-events: auto;
}
/* Tooltip */
.tooltip-content {
background: rgba(0,0,0,0.5) !important;
position: absolute;
z-index: 9999;
width: 230px;
left: -167%;
margin: 0 0 20px -180px;
bottom: -807%;
text-align: left;
font-size: 0.800em;
line-height: 1.4;
box-shadow: -5px -5px 15px rgba(48,54,61,0.2);
background: #2a3035;
opacity: 0;
cursor: default;
pointer-events: none;
padding:6px;
border-radius:5px;
}
.tooltip-effect-1 .tooltip-content {
-webkit-transform: translate3d(0,-10px,0);
transform: translate3d(0,-10px,0);
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
}
.tooltip-effect-2 .tooltip-content {
-webkit-transform-origin: 50% calc(100% + 10px);
transform-origin: 50% calc(100% + 10px);
-webkit-transform: perspective(1000px) rotate3d(1,0,0,45deg);
transform: perspective(1000px) rotate3d(1,0,0,45deg);
-webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
transition: opacity 0.2s, transform 0.2s;
}
.tooltip-effect-3 .tooltip-content {
-webkit-transform: translate3d(0,10px,0) rotate3d(1,1,0,25deg);
transform: translate3d(0,10px,0) rotate3d(1,1,0,25deg);
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
}
.tooltip-effect-4 .tooltip-content {
-webkit-transform-origin: 50% 100%;
transform-origin: 50% 100%;
-webkit-transform: scale3d(0.7,0.3,1);
transform: scale3d(0.7,0.3,1);
-webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
transition: opacity 0.2s, transform 0.2s;
}
.tooltip-effect-5 .tooltip-content {
background: rgba(0,0,0,0.6);
width: 279px;
font-size:12px;
margin-left: -255px;
border-radius:6px;
margin-top:100px;
-webkit-transform-origin: 50% calc(100% + 6em);
transform-origin: 50% calc(100% + 6em);
-webkit-transform: rotate3d(0,0,1,15deg);
transform: rotate3d(0,0,1,15deg);
-webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
transition: opacity 0.2s, transform 0.2s;
-webkit-transition-timing-function: ease, cubic-bezier(.17,.67,.4,1.39);
transition-timing-function: ease, cubic-bezier(.17,.67,.4,1.39);
}
.tooltip:hover .tooltip-content {
pointer-events: auto;
opacity: 1;
-webkit-transform: translate3d(0,0,0) rotate3d(0,0,0,0);
transform: translate3d(0,0,0) rotate3d(0,0,0,0);
}
.tooltip.tooltip-effect-2:hover .tooltip-content {
-webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg);
transform: perspective(1000px) rotate3d(1,0,0,0deg);
}
/* Arrow */
.tooltip-content::after {
content: '';
top: 100%;
left: 50%;
border: solid transparent;
height: 0;
width: 0;
position: absolute;
pointer-events: none;
margin-left: -10px;
}
/* Tooltip content*/
.tooltip-content img {
position: relative;
height: 170px;
display: block;
float: left;
margin-right: 1em;
}
.tooltip-text {
font-size: 10px;
line-height: 1.35;
display: block;
padding: 1.31em 1.21em 1.21em 1.31em;
color: #fff;
}
.tooltip-effect-5 .tooltip-text {
padding: 1.4em;
}
.tooltip-text a {
font-weight: bold;
}
BIN
View File
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More