Preview: topiclist.php
Size: 8.50 KB
/home/jambtst2015/public_html/giraffeng.com/admin/topiclist.php
<?php include("includes/head.php"); ?>
<?php include("includes/header.php"); ?>
<?php
if($_REQUEST['delete']=="del" && $_REQUEST['delete_id']!='')
{
mysql_query("delete from exam_topic where id='".$_REQUEST['delete_id']."'");
$delmsg="Topic details deleted successfully";
header('location:topiclist.php?success=5&page='.$_REQUEST['page'].'');
exit();
}
?>
<a href="topic_add.php" class="require" style="margin-bottom:5px;">Add Topic</a>
<script type="text/javascript" language="javascript">
function open_src()
{
if(document.getElementById("div_src").style.display=='none')
{
//document.getElementById("div_src").style.display='block';
$("#div_src").show("slow");
}
else
{
//document.getElementById("div_src").style.display='none';
$("#div_src").hide("slow");
}
}
$(document).ready(function(){
setTimeout(function(){
$(".mydiv").fadeOut("slow", function () {
$(".mydiv").remove("slow");
});
}, 4000);
});
</script>
<div class="container_bottom_section">
<?php if($delmsg!=''){ ?>
<p class="mydiv" style="color:#F00; float:left; font-family:Verdana, Geneva, sans-serif; font-size:13px; text-align:left;"><?php echo $delmsg; ?></p>
<?php } ?>
<?php if($_REQUEST['success']=='1'){ ?>
<p class="mydiv" style="color:#090; float:left; font-family:Verdana, Geneva, sans-serif; font-size:13px; text-align:left;">Topic Added Successfully</p>
<?php } ?>
<?php if($_REQUEST['success']=='2'){ ?>
<p class="mydiv" style="color:#090; float:left; font-family:Verdana, Geneva, sans-serif; font-size:13px; text-align:left;">Topic Details Updated Successfully</p>
<?php } ?>
<?php if($_REQUEST['success']=='4'){ ?>
<p class="mydiv" style="color:#090; float:left; font-family:Verdana, Geneva, sans-serif; font-size:13px; text-align:left;">Topic Transfered Successfully</p>
<?php } ?>
<?php if($_REQUEST['success']=='5'){ ?>
<p class="mydiv" style="color:#090; float:left; font-family:Verdana,Geneva,sans-serif;font-size:13px; text-align:left;">Topic Deleted Successfully.</p>
<?php } ?>
<a href="javascript:open_src();" class="require" style="margin-right:5px; margin-bottom:5px;"><i class="fa fa-search"></i> Search</a>
<?php if($level==1){ ?>
<?php /*?><a href="users_export_xls.php" class="require" style="margin-right:5px; margin-bottom:5px;">Export</a><?php */?>
<a href="userform.php" class="require org" style="margin-right:5px; margin-bottom:5px;"><i class="fa fa-plus"></i> Add User</a>
<?php } ?>
<div class="clear"></div>
<?php if(empty($_REQUEST['submit2'])){$_REQUEST['submit2']='';} ?>
<div class="search-box" style="padding:5px; <?php if($_REQUEST['submit2']=='') { ?>display:none;<?php } ?> border:1px solid #C4C4C4; margin-bottom:10px;" id="div_src">
<div class="require_add">
<h3 style="font-family:Arial, Helvetica, sans-serif; font-size:18px; float:left; color:#2597C9; padding-bottom:5px;"><i class="fa fa-search"></i> Search By</h3>
<div class="clear"></div>
</div>
<form name="myfrm" action="topiclist.php" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_search">
<tr>
<td colspan="8" height="10"></td>
</tr>
<tr>
<td width="10%" height="25" valign="top" class="require_table_search">Topic:</td>
<td colspan="4" align="left" valign="top">
<input type="text" name="name" class="textfield require_field" value="<?php echo $_REQUEST['name']; ?>" />
</td>
<td width="3%"> </td>
</tr>
<!--<tr>
<td height="25" valign="top" class="require_table_search">Email:</td>
<td colspan="4" align="left" valign="top">
<input type="text" name="email_id" class="textfield require_field" value="<?php //echo $_REQUEST['email_id']; ?>" />
</td>
<td> </td>
</tr>-->
<tr>
<!--<td height="25" valign="top" class="require_table_search">User Initial:</td>-->
<!-- <td align="left" valign="top">
<input name="user_initial" id="user_initial" type="text" class="validate[required] textfield require_field" value="<?php echo $_REQUEST['user_initial']; ?>" />
</td> -->
<td colspan="12">
<span style="float:right;margin: 0px 22px 0px 0px;">
<input name="submit2" type="submit" value="Search" class="require sm" style="margin-top:0px !important;" />
<a href="topiclist.php" style="text-decoration:none;" class="require org"> Show All
<!-- <input name="submit3" type="button" value="Show All" class="submit" style="margin-top:0px;" /> -->
</a>
</span>
</td>
</tr>
</table>
</form>
</div>
<table width="1100" border="1" cellspacing="0" cellpadding="0" bordercolor="#616161" style="border-collapse:collapse;" class="list-table">
<tr>
<td width="170" class="head_text">ID</td>
<td width="101" class="head_text">Name</td>
<td width="84" class="head_text">Subject</td>
<td width="62" class="head_text text-center">Action</td>
</tr>
<?php
if(empty($_REQUEST['order']))
{
$_REQUEST['order']='';
}
$qry_contact = "select * from exam_topic";
if($_REQUEST['name']!='')
{
$qry_contact .= " where name like '%".trim($_REQUEST['name']," ")."%'";
}
$qry_contact .= " order by id ".$oredr; //sorting by id //
//echo $qry_contact;
$_SESSION['sqlUser']='';
//$_SESSION['sqlUser'] = $qry_contact;
$sel_events=mysql_query($qry_contact);
////////////////////////////////Start pagination////////////////////////////////////
if(empty($_REQUEST['page'])) { $_REQUEST['page']=''; }
$page=$_REQUEST['page'];
if($page=="")
{
$page = 1;
}
if($_REQUEST['submit2']!='' && $page!=1)
{
$page = $page;
}
$max_results = 200;
$prev = ($page - 1);
$next = ($page + 1);
$from = (($page * $max_results) - $max_results);
$total_results = mysql_num_rows($sel_events);
$total_pages = ceil($total_results / $max_results);
$pagination = '';
if($page > 1)
{
$pagination .= "<a href=\"topiclist.php\" class=\"more_link_pagination_prev\">Previous</a>";
$pagination.=" ";
}
for($i = 1; $i <=$total_pages; $i++)
{
if(($page) == $i)
{
$pagination .= $i;
$pagination.=' ';
}
else
{
$pagination .= "<a href=\"topiclist.php?page=$i\" class=\"more_link_pagination\">$i</a>";
$pagination.=' ';
}
}
if($page < $total_pages)
{
$pagination .= "<a href=\"topiclist.php?page=$next\" class=\"more_link_pagination_prev\">Next</a>";
$pagination.=" ";
}
$qry_contact.=" limit $from,$max_results";
$qry_contact; //Limit print//
$result=mysql_query($qry_contact);
//print_r($qry_contact); //Display Result//
////////////////////////////////End pagination////////////////////////////////////
if(mysql_num_rows($result)>0)
{
$inc=1;
while($row_contact_details=mysql_fetch_array($result))
{
$id = $row_contact_details['id'];
if($subject_id = $row_contact_details['subject_id']){
$res = mysql_query("select * from exam_subject_master where id=".$subject_id."");
$ress = mysql_fetch_array($res);
//print_r($ress);
$subject_name = $ress['subject'];
}
$topic_name = $row_contact_details['name'];
?>
<tr>
<td class="head_text2">
<?php echo $id; ?>
</td>
<td class="head_text2">
<?php echo $topic_name; ?>
</td>
<td class="head_text2"><?php echo $subject_name; ?></td>
<td class="head_text2 text-center">
<a href="topic_edit.php?id=<?php echo $row_contact_details['id'];?>&page=<?php echo $page; ?>&name=<?=$_REQUEST['name']?>&email=<?=$_REQUEST['email']?>&username=<?=$_REQUEST['username']?>&order=<?=$_REQUEST['order']?>&userclass=<?=$_REQUEST['userclass']?>&status=<?=$_REQUEST['status']?>&rcv_reqs_email=<?=$_REQUEST['rcv_reqs_email']?>&submittals_emails=<?=$_REQUEST['submittals_emails']?>&rvc_hotlist_email=<?=$_REQUEST['rvc_hotlist_email']?>&submit2=<?=$_REQUEST['submit2']?>"><img src="images/edit.png" alt="Edit" userclass="Edit" /></a>
<a href="topiclist.php?delete=del&delete_id=<?php echo $row_contact_details['id'];?>&page=<?=$_REQUEST['page']?>&name=<?=$_REQUEST['name']?>" onclick="return confirm('Are you sure you want to delete this?');" style="text-decoration:none;"><img border="0" title="Delete" alt="Delete" src="images/1304761651_DeleteRed.png"></a>
</td>
</tr>
<?php } ?>
<tr>
<td colspan="11" class="tbl-footer pagination-nw" style="background-color:;"><?php echo $pagination; ?></td>
</tr>
<?php } else {?>
<tr>
<td colspan="11" class="head_text" style="background-color:#B2CEFC;">No Data found</td>
</tr>
<?php } ?>
</table>
<div class="clear"></div>
</div>
<?php include("includes/footer.php"); ?>
Directory Contents
Dirs: 17 × Files: 180