Preview: courses-list.php
Size: 44.15 KB
/home/godevadmin/public_html/admin/courses-list.php
<?php
session_start();
include("../include/config.php");
include("../include/functions.php");
validate_admin();
?>
<!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>
<title><?php echo SITE_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css">
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<script>
function checkall(objForm)
{
len = objForm.elements.length;
var i=0;
for( i=0 ; i<len ; i++){
if (objForm.elements[i].type=='checkbox')
objForm.elements[i].checked=objForm.check_all.checked;
}
}
function del_prompt(frmobj,comb)
{
if(frmobj.tab.value == 1){
var tab = 1;
}else if(frmobj.tab.value == 2){
var tab = 2;
}else if(frmobj.tab.value == 3){
var tab = 3;
}else{
var tab = 4;
}
if(comb=='Delete'){
if(confirm ("Are you sure you want to delete record(s)"))
{
frmobj.action = "courses-del.php";
frmobj.what.value="Delete";
frmobj.tab.value = tab;
frmobj.submit();
}
else{
return false;
}
}
else if(comb=='Deactivate'){
frmobj.action = "courses-del.php";
frmobj.what.value="Deactivate";
frmobj.tab.value = tab;
frmobj.submit();
}
else if(comb=='Activate'){
frmobj.action = "courses-del.php";
frmobj.what.value="Activate";
frmobj.tab.value = tab;
frmobj.submit();
}
}
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php include("header.php") ?>
<tr>
<td align="right" class="paddRtLt70" valign="top">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<ul class="nav nav-tabs" role="tablist" id="tab-button">
<li class="nav-item">
<a class="nav-link active " data-refTab="tabs-1" data-toggle="tab" href="#tabs-1" role="tab">Recipe Course</a>
</li>
<li class="nav-item">
<a class="nav-link" data-refTab="tabs-2" data-toggle="tab" href="#tabs-2" role="tab">Recipe Prepration</a>
</li>
<li class="nav-item">
<a class="nav-link" data-refTab="tabs-3" data-toggle="tab" href="#tabs-3" role="tab">Recipe Holiday</a>
</li>
<li class="nav-item">
<a class="nav-link" data-refTab="tabs-4" data-toggle="tab" href="#tabs-4" role="tab">Recipe Additional</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active chefActive" id="tabs-1" role="tabpanel">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" class="headingbg bodr text14">
<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Recipe Courses
<span style="float:right; padding-right:10px;">
<input type="button" name="add" value="Add Recipe Courses" class="button" onclick="location.href='courses-addf.php?recipe=1'" /></span>
</td>
</tr>
</table>
<form name="frm" method="post" action="press-del.php" enctype="multipart/form-data">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr">
<table width="100%" cellpadding="0" cellspacing="0">
<?php if($_SESSION['sess_msg']){ ?>
<tr>
<td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td>
</tr>
<?php }?>
<tr>
<td align="left">
<?php
$where='';
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=15;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='id';
if(isset($_GET['order_by'])) $order_by=$_GET['order_by'];
$order_by2='desc';
if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2'];
$sql=$obj->Query("select * from tbl_chef_course where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("select * from tbl_chef_course where 1=1 $where order by $order_by $order_by2",$debug=-1);
$reccnt=$obj->numRows($sql2);
if($reccnt==0)
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td>
<td width="15%" align="left" bgcolor="#e7efef" class="padd5"><strong> Heading</strong> <?php echo sort_arrows('id') ?></td>
<td width="9%" align="center" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td>
<td width="6%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td>
<td width="11%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td>
</tr>
<?php
$i=0;
while($line=$obj->fetchNextObject($sql))
{
$i++;
if($i%2==0)
{
$bgcolor = "#f6f6f6";
}
else
{
$bgcolor = "";
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5"><?php echo stripslashes($line->name);?></td>
<td align="center" valign="middle" class="padd5">
<?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</td>
<td align="center" valign="middle" class="padd5">
<a href="courses-addf.php?recipe=1&id=<?php echo $line->id;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a>
</td>
<td align="center" valign="middle" class="padd5">
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" />
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="11" align="right"> </td>
</tr>
<tr>
<td valign="top" colspan="11" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11">
<input type="hidden" name="what" value="what" />
<input type="hidden" name="tab" value="1"/>
<input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" />
</td>
</tr>
</table>
<?php }?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div class="tab-pane chefActive" id="tabs-2" role="tabpanel">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="headingbg bodr text14">
<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Recipe Prepration
<span style="float:right; padding-right:10px;">
<input type="button" name="add" value="Add Recipe Prepration" class="button" onclick="location.href='courses-addf.php?recipe=2'" /></span>
</td>
</tr>
</table>
<form name="frm" method="post" action="press-del.php" enctype="multipart/form-data">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr">
<table width="100%" cellpadding="0" cellspacing="0">
<?php if($_SESSION['sess_msg']){ ?>
<tr>
<td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td>
</tr>
<?php }?>
<tr>
<td align="left">
<?php
$where='';
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=15;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='id';
if(isset($_GET['order_by'])) $order_by=$_GET['order_by'];
$order_by2='desc';
if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2'];
$sql=$obj->Query("select * from tbl_chef_prep where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("select * from tbl_chef_prep where 1=1 $where order by $order_by $order_by2",$debug=-1);
$reccnt=$obj->numRows($sql2);
if($reccnt==0)
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td>
<td width="15%" align="left" bgcolor="#e7efef" class="padd5"><strong> Heading</strong> <?php echo sort_arrows('id') ?></td>
<td width="9%" align="center" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td>
<td width="6%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td>
<td width="11%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td>
</tr>
<?php
$i=0;
while($line=$obj->fetchNextObject($sql))
{
$i++;
if($i%2==0)
{
$bgcolor = "#f6f6f6";
}
else
{
$bgcolor = "";
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5"><?php echo stripslashes($line->name);?></td>
<td align="center" valign="middle" class="padd5">
<?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</td>
<td align="center" valign="middle" class="padd5">
<a href="courses-addf.php?recipe=2&id=<?php echo $line->id;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a>
</td>
<td align="center" valign="middle" class="padd5">
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" />
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="11" align="right"> </td>
</tr>
<tr>
<td valign="top" colspan="11" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> <input type="hidden" name="what" value="what" />
<input type="hidden" name="tab" value="2"/>
<input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" />
</td>
</tr>
</table>
<?php }?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div class="tab-pane chefActive" id="tabs-3" role="tabpanel">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" class="headingbg bodr text14">
<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Recipe Holiday
<span style="float:right; padding-right:10px;">
<input type="button" name="add" value="Add Recipe Holiday" class="button" onclick="location.href='courses-addf.php?recipe=3'" /></span>
</td>
</tr>
</table>
<form name="frm" method="post" action="press-del.php" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr">
<table width="100%" cellpadding="0" cellspacing="0">
<?php if($_SESSION['sess_msg']){ ?>
<tr>
<td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td>
</tr>
<?php }?>
<tr>
<td align="left">
<?php
$where='';
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=15;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='id';
if(isset($_GET['order_by'])) $order_by=$_GET['order_by'];
$order_by2='desc';
if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2'];
$sql=$obj->Query("select * from tbl_chef_holiday where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("select * from tbl_chef_holiday where 1=1 $where order by $order_by $order_by2",$debug=-1);
$reccnt=$obj->numRows($sql2);
if($reccnt==0)
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td>
<td width="15%" align="left" bgcolor="#e7efef" class="padd5"><strong> Heading</strong> <?php echo sort_arrows('id') ?></td>
<td width="9%" align="center" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td>
<td width="6%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td>
<td width="11%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td>
</tr>
<?php
$i=0;
while($line=$obj->fetchNextObject($sql))
{
$i++;
if($i%2==0)
{
$bgcolor = "#f6f6f6";
}
else
{
$bgcolor = "";
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5"><?php echo stripslashes($line->name);?></td>
<td align="center" valign="middle" class="padd5">
<?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</td>
<td align="center" valign="middle" class="padd5">
<a href="courses-addf.php?recipe=3&id=<?php echo $line->id;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a>
</td>
<td align="center" valign="middle" class="padd5">
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" />
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="11" align="right"> </td>
</tr>
<tr>
<td valign="top" colspan="11" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> <input type="hidden" name="what" value="what" />
<input type="hidden" name="tab" value="3"/>
<input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" />
</td>
</tr>
</table>
<?php }?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div class="tab-pane chefActive" id="tabs-4" role="tabpanel">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" class="headingbg bodr text14">
<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Recipe Additional
<span style="float:right; padding-right:10px;">
<input type="button" name="add" value="Add Recipe Additional" class="button" onclick="location.href='courses-addf.php?recipe=4'" /></span>
</td>
</tr>
</table>
<form name="frm" method="post" action="press-del.php" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr">
<table width="100%" cellpadding="0" cellspacing="0">
<?php if($_SESSION['sess_msg']){ ?>
<tr>
<td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td>
</tr>
<?php }?>
<tr>
<td align="left">
<?php
$where='';
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=15;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='id';
if(isset($_GET['order_by'])) $order_by=$_GET['order_by'];
$order_by2='desc';
if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2'];
$sql=$obj->Query("select * from tbl_chef_additional where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("select * from tbl_chef_additional where 1=1 $where order by $order_by $order_by2",$debug=-1);
$reccnt=$obj->numRows($sql2);
if($reccnt==0)
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="11%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td>
<td width="15%" align="left" bgcolor="#e7efef" class="padd5"><strong> Heading</strong> <?php echo sort_arrows('id') ?></td>
<td width="9%" align="center" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td>
<td width="6%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td>
<td width="11%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td>
</tr>
<?php
$i=0;
while($line=$obj->fetchNextObject($sql))
{
$i++;
if($i%2==0)
{
$bgcolor = "#f6f6f6";
}
else
{
$bgcolor = "";
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5"><?php echo stripslashes($line->name);?></td>
<td align="center" valign="middle" class="padd5">
<?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</td>
<td align="center" valign="middle" class="padd5">
<a href="courses-addf.php?recipe=4&id=<?php echo $line->id;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a>
</td>
<td align="center" valign="middle" class="padd5">
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" />
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="11" align="right"> </td>
</tr>
<tr>
<td valign="top" colspan="11" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="11"> <input type="hidden" name="what" value="what" />
<input type="hidden" name="tab" value="4"/>
<input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" />
</td>
</tr>
</table>
<?php }?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
</div>
</td>
</tr>
<?php include('footer.php'); ?>
<script>
$('.nav-link').click(function(e){
e.preventDefault();
$('.nav-link').removeClass('active');
$('.chefActive').removeClass('active');
$(this).addClass('active');
var tbhref= $(this).attr('data-refTab');
$("#"+tbhref).addClass('active');
console.log($("#"+tbhref).addClass('active'));
});
</script>
</table>
</body>
</html>
Directory Contents
Dirs: 10 × Files: 414