Пример #1
0
if (isset($_GET['catId']) && (int) $_GET['catId'] > 0) {
    $catId = (int) $_GET['catId'];
    $sql2 = " AND p.cat_id = {$catId}";
    $queryString = "catId={$catId}";
} else {
    $catId = 0;
    $sql2 = '';
    $queryString = '';
}
// for paging
// how many rows to show per page
$rowsPerPage = 5;
$sql = "SELECT pd_id, c.cat_id, cat_name, pd_name, pd_thumbnail\r\n        FROM tbl_product p, tbl_category c\r\n\t\tWHERE p.cat_id = c.cat_id {$sql2}\r\n\t\tORDER BY pd_name";
$result = dbQuery(getPagingQuery($sql, $rowsPerPage));
$pagingLink = getPagingLink($sql, $rowsPerPage, $queryString);
$categoryList = buildCategoryOptions($catId);
?>
 
<p>&nbsp;</p>
<form action="processProduct.php?action=addProduct" method="post"  name="frmListProduct" id="frmListProduct">
 <table width="100%" border="0" cellspacing="0" cellpadding="2" class="text">
  <tr>
   <td align="right">View products in : 
    <select name="cboCategory" class="box" id="cboCategory" onChange="viewProduct();">
     <option selected>All Category</option>
	<?php 
echo $categoryList;
?>
   </select>
 </td>
 </tr>
Пример #2
0
if (!defined('WEB_ROOT')) {
    exit;
}
// make sure a Course id exists
if (isset($_GET['CourseId']) && $_GET['CourseId'] > 0) {
    $CourseId = $_GET['CourseId'];
} else {
    // redirect to index.php if Course id is not present
    header('Location: index.php');
}
// get Course info
$sql = "SELECT name, description FROM courses WHERE course_id = {$detailCourseId}";
$result = mysql_query($sql) or die('Cannot get Course. ' . mysql_error());
$row = mysql_fetch_assoc($result);
extract($row);
$list = buildCategoryOptions($cat_id);
?>
 
<form action="processCourse.php?action=modifyCourse&CourseId=<?php 
echo $CourseId;
?>
" method="post" enctype="multipart/form-data" name="frmAddCourse" id="frmAddCourse">
 <p align="center" class="formTitle">Modify Course</p>
 
 <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
  <tr> 
   <td width="150" class="label">Category</td>
   <td class="content"> <select name="cboCategory" id="cboCategory" class="box">
     <option value="" selected>-- Choose Category --</option>
<?php 
echo $list;