Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('db.php');
- define('SESSION_TIMEOUT_LENGTH',216000); //set to 1 hour
- define('MYSQL_DATE_FORMAT',"'%b %d, %Y'");
- //echo current(explode(".",basename($SCRIPT_NAME)));
- if(current(explode(".",basename($SCRIPT_NAME))) != 'product_details' && current(explode(".",basename($SCRIPT_NAME))) != 'login' && current(explode(".",basename($SCRIPT_NAME))) != 'show_inventory' && current(explode(".",basename($SCRIPT_NAME))) != 'reset_password' && current(explode(".",basename($SCRIPT_NAME))) != 'new_arrivals' && current(explode(".",basename($SCRIPT_NAME))) != 'new_arrivalsX' && current(explode(".",basename($SCRIPT_NAME))) != 'search'){
- session_start(); //calling session
- chk_sess();
- }
- class objSession {
- var $uName;
- var $fName;
- var $uType;
- var $uLevel;
- var $uID;
- var $authenticated;
- var $exp_time;
- function objSession() {
- }
- function get_uName() {
- return $this->uName;
- }
- function set_uName($value) {
- $this->uName = $value;
- }
- function get_fName() {
- return $this->fName;
- }
- function set_fName($value) {
- $this->fName = $value;
- }
- function get_uLevel() {
- return $this->uLevel;
- }
- function set_uID($value) {
- $this->uID = $value;
- }
- function get_uID() {
- return $this->uID;
- }
- function set_uLevel($value) {
- $this->uLevel = $value;
- }
- function authenticated() {
- return $this->authenticated;
- }
- function authenticate($value) {
- $this->authenticated = $value;
- }
- function expired() {
- return (time()>$this->exp_time);
- }
- function get_expTime() {
- return $this->exp_time;
- }
- function set_exp_time() {
- $this->exp_time = time() + SESSION_TIMEOUT_LENGTH;
- }
- }
- function login($uName, $pswd) {
- //global $sess; //use the globally defined session var
- //check user name & password
- $objDB = new Database();
- $objDB->query("SELECT users.* FROM users WHERE users.user_name='$uName' AND users.user_pass = PASSWORD('$pswd') AND active = 'Y'");
- if ($objDB->numRows()) {//user found set uLevel and uType Return true
- session_start();
- $sess = new objSession();
- $_SESSION['sess'] = $sess; //add sess to the session
- //$sess = new sess(); //spawn the class
- $_SESSION['sess']->authenticate(1); //authorize
- $_SESSION['sess']->set_exp_time(); //set login timeout
- $_SESSION['sess']->set_uName($objDB->getField(0,"user_name"));
- $_SESSION['sess']->set_uID($objDB->getField(0,"id"));
- $_SESSION['sess']->set_uLevel($objDB->getField(0,"user_level"));
- $objDB->query( "UPDATE users SET last_login = NOW() WHERE id =".$_SESSION["sess"]->get_uID() );
- header("Location:inventory.php");
- }
- else
- header("Location:index.php?msg=Bad+Login");
- return 0; //no record returned
- }
- function chk_sess() {
- //global $sess; //use the globally defined session var
- if (!isset($_SESSION['sess'])) { //is the session open?
- unset($_SESSION['sess']);
- session_destroy();
- header("Location:index.php?msg=Session+not+found");
- echo "error code no session";
- do_login("Please Login");
- showError(3);
- return 0;
- }
- else
- if (!$_SESSION['sess']->authenticated()) { //has the session been authenticated? (not really needed)
- unset($_SESSION['sess']);
- session_destroy();
- echo "auth fail";
- header("Location:index.php?msg=Failed+to+authorize+session");
- showError(2);
- return 0;
- }
- else
- if ($_SESSION['sess']->expired()) { //has the session expired?
- unset($_SESSION['sess']);
- session_destroy();
- header("Location:index.php?msg=Session+Expired");
- showError(3);
- echo "error code session expired<br>".time()."<br>".$sess->get_expTime();
- do_login("Session Expired");
- return 0;
- }
- else {
- $_SESSION['sess']->set_exp_time(); //session is ok and update expire time.
- return 1;
- }
- }
- function showError($id) {
- switch($id) {
- case 1: $errStr = 'Error Connecting to Database';
- case 2: $errStr = 'Error Querying Database';
- }
- echo $errStr;
- //there's an error so kill the session
- @$old_user = $_SESSION['sess']->get_uName();
- @$_SESSION['sess']->authenticate(0);
- @$res_unreg = session_unregister("sess");
- @session_unset();
- @$res_dest = session_destroy();
- }
- function chkFrm(&$err,&$pValues) {
- $errColor= 'error';
- foreach( $_POST as $key => $value) {
- switch ($key[0]) {
- case 't':
- $value=trim($value);
- if (empty($value)) { $errStr.= 'fill in the form!!<br>';
- $err[$key]=$errColor;
- } //else $err[$i]='';
- $pValues[$key] = $value;
- break;
- case 'p':
- $value=trim($value);
- if (empty($value)) { $errStr.= 'fill in the form!!<br>';
- $err[$key]=$errColor;
- } //else $err[$i]='';
- $tmp = 'r_'.substr($key,2);
- if (trim($_POST[$tmp])!=$value) {$errStr.= 'fill in the form!!<br>';
- $err[$tmp]=$errColor;$err[$key]=$errColor;
- }
- $pValues[$key] = $value;
- break;
- case 'r':
- $value=trim($value);
- if (empty($value)) { $errStr.= 'fill in the form!!<br>';
- $err[$key]=$errColor;
- } //else $err[$i]='';
- $pValues[$key] = $value;
- break;
- case 'f':
- if (!is_numeric($value)) { $errStr.= 'fill in the form with a number<br>';
- $err[$key]=$errColor;}
- //else $err[$i]='';
- $pValues[$key] = stripslashes($value);
- break;
- case 'i':
- if (!is_numeric($value)){ $errStr.= 'fill in the form with an integer<br>';
- $err[$key]=$errColor;}
- //else $err[$i]='';
- $pValues[$key] = stripslashes($value);
- break;
- default:
- //$err[$i]='';
- $pValues[$key] = stripslashes($value);
- }
- //echo $key .' = '.$value.' '.$i.' = '.$err[$i].'<br>';
- }
- if (empty($err)) {
- return 1;
- } else {
- return 0;
- }
- }
- function createQueryFromArray(&$arrayValues) {
- foreach($arrayValues as $key=>$value) {
- $query .= $query ? ' , ':'';
- if(substr($key,1,1)=='_') {
- $query.=substr($key,2);
- }
- $query .= " = '".addslashes($value)."'";
- }
- return $query;
- }
- function make_password($length,$strength=0) {
- $vowels = 'aeiouy';
- $consonants = 'bdghjlmnpqrstvwxz';
- if ($strength & 1) {
- $consonants .= 'BDGHJLMNPQRSTVWXZ';
- }
- if ($strength & 2) {
- $vowels .= "AEIOUY";
- }
- if ($strength & 4) {
- $consonants .= '0123456789';
- }
- if ($strength & 8) {
- $consonants .= '@#$%^';
- }
- $password = '';
- $alt = time() % 2;
- srand(time());
- for ($i = 0; $i < $length; $i++) {
- if ($alt == 1) {
- $password .= $consonants[(rand() % strlen($consonants))];
- $alt = 0;
- } else {
- $password .= $vowels[(rand() % strlen($vowels))];
- $alt = 1;
- }
- }
- return $password;
- }
- function determinePrice($price,$por,$fullText=0) {
- if($por=='Y') {
- $field = $fullText?'Price on request':'POR';
- } else {
- $field = '$'.number_format(stripslashes($price), 2, '.', ',');
- }
- return $field;
- }
- function getCallout($catID,&$objDB) {
- if(is_numeric($catID)) {
- $query = "SELECT call_out FROM categories WHERE id = $catID LIMIT 1";
- $objDB->query($query);
- $output = $objDB->getField();
- } else {
- $query = "SELECT * FROM new_arrival_callout";
- $objDB->query($query);
- $output = $objDB->getField();
- }
- $output = empty($output) ? '':$output;
- return stripslashes($output);
- }
- function getCategories(&$objDB) {
- $query = "SELECT id,name,call_out FROM categories ORDER BY display_order";
- $objDB->query($query);
- return $objDB->getRows();
- }
- function createCategoriesPulldown($fieldName,$fieldValue,&$objDB) {
- $query="SELECT id,name FROM categories ORDER BY id";
- $objDB->query($query);
- $output='';
- while($row = $objDB->getRow()) {
- $output.='<option value="'.$row['id'].'"';
- if($row['id'] == $fieldValue) {
- $output.=' selected ';
- }
- $output.='>'.stripslashes($row['name']).'</option>';
- }
- return '<select name="'.$fieldName.'" onchange="loadForm(this.form)"><option></option>'.$output.'</select>';
- }
- function createSubNav($catID,&$objDB) {
- $query = "SELECT id,name,display_order FROM subcategories WHERE catID = $catID ORDER BY display_order";
- $objDB->query($query);
- if($objDB->numRows()) {
- while($row = $objDB->getRow()) {
- $output .='<div><a href="show_inventory.php?catID='.$catID.'&subcatID='.$row['id'].'" '.((!isset($_GET['subcatID']) && $row['display_order']==1)?' class="subnavcurrent" ':($_GET['subcatID']==$row['id']?' class="subnavcurrent"':'')).'>'.stripslashes($row['name']).'</a></div>';
- }
- }
- return $output;
- }
- function getSubCatName($id,$subCatID='',&$objDB) {
- if(is_numeric($id)) {
- if(is_numeric($subCatID)) {
- $query = "SELECT name FROM subcategories WHERE id = $subCatID";
- $objDB->query($query);
- } else {
- $query = "SELECT name FROM subcategories WHERE catID = $id AND display_order=1";
- $objDB->query($query);
- }
- return stripslashes($objDB->getField());
- }
- }
- function handleSortClause() {
- switch($_GET['sort']) {
- case 'mo':
- $sort = 'model,author';
- break;
- case 'x':
- $sort = 'gauge,caliber';
- break;
- default:
- $sort = 'manufacturer,title';
- break;
- }
- return $sort;
- }
- function isTableClosed($text) {
- $temp = substr($text,-2,1);
- //echo $temp;
- if($temp) {
- switch($temp) {
- case '3':
- case '4':
- case 'e':
- case '"':
- return 1;
- break;
- default:
- return 0;
- break;
- }
- } else {
- return 1;
- }
- }
- function createArrivalItemList($items,$full=1,$new=0,$prefix='',$images='',$showtable=0) {
- $displayFields = array(1=>array('*manufacturer','*model','gauge','note','barrel_length','choke1','choke2','condition'),
- 2=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 3=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 4=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 5=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 6=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 7=>array('*manufacturer','*model','caliber','note','contents','condition'),
- 8=>array('*manufacturer','*model','note','condition'),
- 9=>array('*manufacturer','*model','note','condition'),
- 10=>array('*title','author','pages','binding','notes','condition'),
- 11=>array('*manufacturer','*model','note','condition'),
- 12=>array('*manufacturer','*model','note','condition'),
- 13=>array('*manufacturer','*model','caliber','note','barrel_length','condition','ffl'),
- 14=>array('*manufacturer','*model','caliber','note','barrel_length','condition','ffl'));
- $currentSubCategory ='';
- $currentCat = '';
- $currentDate ='';
- if (is_array($items)) {
- //print_r($items);
- $currentSubCategory = $items[0]['sub_cat'];
- $currentCat = '';
- $currentDate = '';
- $newDate ='';
- //$output = '<table border="'.$showtable.'" width="740">';
- foreach($items as $row) {
- if($new) {
- if(($currentDate != $row['add_date']) && !$prefix) {
- $output.=!isTableClosed($output)?'</table>':'';
- $output.='<h3 align="center" style="clear:both;">'.$row['add_date'].'</h3>';
- $currentDate = $row['add_date'];
- $output.='<h4 align="center" style="clear:both;">'.$row['category'].'</h4>';
- $output.='<table border="'.$showtable.'" width="740">';
- $currentCat = $row['category'];
- }
- if($currentCat != $row['category']) {
- $output.=!isTableClosed($output)?'</table>':'';
- $output.='<h4 align="center" style="clear:both;">'.$prefix.$row['category'].'</h4>';
- $output.='<table border="'.$showtable.'" width="740">';
- $currentCat = $row['category'];
- }
- }
- if(stripslashes($row['subcategory']) != $currentSubCategory) {
- $output.='<a name="'.$currentSubCategory.'"></a><h4 style="clear:both;"><font face="Arial, Helvetica, sans-serif" size="3"><b><u>'.$currentSubCategory.'</u></b></font></h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- $currentSubCategory = stripslashes($row['sub_cat']);
- $tmp='';
- }
- //$tmp ='';
- $output.='<tr>';
- if($new && $row['has_images']=='Y'&& is_array($images)) {
- $output.='<td><a href="product_details.php?itemID='.$row['itemID'].'"><img src="../'.$images[$row['itemID']].'" border="0"/></a></td>';
- }
- $output.='<td>';
- for($i=0;$i<count($displayFields[$row['catID']]);$i++) {
- if($displayFields[$row['catID']][$i]{0}=='*') {
- $output.='<strong>'.$row[substr($displayFields[$row['catID']][$i],1)].'</strong> ';
- } else {
- $output.=$row[$displayFields[$row['catID']][$i]].' ';
- }
- }
- $output.=determinePrice($row['retail'],$row['por'],1);
- $output.=' ';
- if($row['has_images']=='Y' && $full) {
- $output.='<br><a href="product_details.php?itemID='.$row['itemID'].'">see photos</a> ' ;
- }
- $output.='Item# '.$row['item_num'].' <a href="mailto:info@collectorsfirearms.com?subject='.$row['item_num'].'">Request Info</a><br/>';
- $output.='</td></tr>';
- //$output .= '<p style="clear:both;">'.$tmp.'</p>';
- }
- }
- if(!empty($tmp)) {
- $output.='<h4 align="center" style="clear:both;">'.$prefix.$currentCat.'</h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- }
- if($new) {
- // $output='<h3 align="center" style="clear:both;">'.$newDate.'</h3>'."\n$output";
- }
- return $output.'</table>';
- }
- function createItemList($items,$full=1,$new=0,$prefix='',$images='',$showtable=0) {
- $displayFields = array(1=>array('*manufacturer','*model','gauge','note','barrel_length','choke1','choke2','condition'),
- 2=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 3=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 4=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 5=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 6=>array('*manufacturer','*model','caliber','note','barrel_length','condition'),
- 7=>array('*manufacturer','*model','caliber','note','contents','condition'),
- 8=>array('*manufacturer','*model','note','condition'),
- 9=>array('*manufacturer','*model','note','condition'),
- 10=>array('*title','author','pages','binding','notes','condition'),
- 11=>array('*manufacturer','*model','note','condition'),
- 12=>array('*manufacturer','*model','note','condition'),
- 13=>array('*manufacturer','*model','caliber','note','barrel_length','condition','ffl'),
- 14=>array('*manufacturer','*model','caliber','note','barrel_length','condition','ffl'));
- $currentSubCategory ='';
- $currentCat = '';
- $currentDate ='';
- if (is_array($items)) {
- // print_r($items);
- $currentSubCategory = $items[0]['sub_cat'];
- $currentCat = $items[0]['category'];
- $currentDate = '';
- $newDate = $currentDate;
- foreach($items as $row) {
- if($new) {
- if(($currentDate != $row['add_date']) && !$prefix) {
- $output.='<h3 align="center" style="clear:both;">'.$currentDate.'</h3>';
- if(!empty($tmp)) {
- $output.='<h4 align="center" style="clear:both;">'.$prefix.$currentCat.'</h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- $currentCat = $row['category'];
- $tmp='';
- }
- $currentDate = $row['add_date'];
- //$currentCat='';
- }
- if($currentCat != $row['category']) {
- $output.='<h4 align="center" style="clear:both;">'.$prefix.$currentCat.'</h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- $tmp='';
- $currentCat = $row['category'];
- }
- }
- if(stripslashes($row['subcategory']) != $currentSubCategory) {
- $output.='<a name="'.$currentSubCategory.'"></a><h4 style="clear:both;"><font face="Arial, Helvetica, sans-serif" size="3"><b><u>'.$currentSubCategory.'</u></b></font></h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- $currentSubCategory = stripslashes($row['sub_cat']);
- $tmp='';
- }
- //$tmp ='';
- $tmp.='<tr>';
- if($new && $row['has_images']=='Y'&& is_array($images)) {
- $tmp.='<td><a href="product_details.php?itemID='.$row['itemID'].'"><img src="../'.$images[$row['itemID']].'" border="0"/></a></td>';
- }
- $tmp.='<td>';
- for($i=0;$i<count($displayFields[$row['catID']]);$i++) {
- if($displayFields[$row['catID']][$i]{0}=='*') {
- $tmp.='<strong>'.$row[substr($displayFields[$row['catID']][$i],1)].'</strong> ';
- } else {
- $tmp.=$row[$displayFields[$row['catID']][$i]].' ';
- }
- }
- $tmp.=determinePrice($row['retail'],$row['por'],1);
- $tmp.=' ';
- if($row['has_images']=='Y' && $full) {
- $tmp.='<br><a href="product_details.php?itemID='.$row['itemID'].'">see photos</a> ' ;
- }
- $tmp.='Item# '.$row['item_num'].' <a href="mailto:info@collectorsfirearms.com?subject='.$row['item_num'].'">Request Info</a><br/>';
- $tmp.='</td></tr>';
- //$output .= '<p style="clear:both;">'.$tmp.'</p>';
- }
- }
- if(!empty($tmp)) {
- $output.='<h4 align="center" style="clear:both;">'.$prefix.$currentCat.'</h4>';
- $output.='<table border="'.$showtable.'" width="740">'.$tmp.'</table>';
- }
- if($new) {
- // $output='<h3 align="center" style="clear:both;">'.$newDate.'</h3>'."\n$output";
- }
- return $output;
- }
- function getImageList($itemID,&$objDB) {
- if(is_array($itemID)) {
- $whereClause = implode(',',$itemID);
- } else {
- $whereClause = $itemID;
- }
- $query = "SELECT
- itemID,
- REPLACE(path,'/','/tn_') AS image
- FROM images
- WHERE itemID in ($whereClause)
- ORDER BY itemID,id";
- $objDB->query($query);
- if($objDB->numRows()) {
- $currentID = -1;
- while($row=$objDB->getRow()) {
- if($row['itemID']!= $currentID) {
- $images[$row['itemID']] = $row['image'];
- $currentID = $row['itemID'];
- }
- }
- }
- //$images = $objDB->getRows();
- return $images;
- }
- function createArrivalsList(&$objDB,$showImage=1) {
- //get the featured items
- $query = " SELECT i.id AS itemID,
- c.name as `category`,
- i.*,
- IFNULL(i.notes,'') AS note,
- DATE_FORMAT(i.creation_date,".MYSQL_DATE_FORMAT.") AS add_date
- FROM items i
- LEFT JOIN categories c ON c.id = i.catID
- LEFT JOIN subcategories s ON s.id = i.subcatID
- WHERE (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(i.creation_date) < 1814400) AND s.display_order = 1
- ORDER BY c.display_order,i.creation_date DESC";
- $objDB->query($query);
- $items = $objDB->getRows();
- if($objDB->numRows()) {
- if($showImage) {
- for($i=0; $i<count($items); $i++) {
- $imageID[] = $items[$i]['itemID'];
- }
- $imageList = getImageList($imageID,$objDB);
- } else {
- $imageList ='';
- }
- $display = createArrivalItemList($items,1,1,'Featured ',$imageList,1);
- }
- //get the rest
- $query = " SELECT i.id AS itemID,
- c.name as `category`,
- i.*,
- IFNULL(i.notes,'') AS note,
- DATE_FORMAT(i.creation_date,".MYSQL_DATE_FORMAT.") AS add_date,
- DATE_FORMAT(i.creation_date,'%Y%m%d') as `sort_date`
- FROM items i
- LEFT JOIN categories c ON c.id = i.catID
- LEFT JOIN subcategories s ON s.id = i.subcatID
- WHERE (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(i.creation_date) < 1814400) AND s.display_order != 1
- ORDER BY sort_date DESC, c.display_order";
- $objDB->query($query);
- $items = $objDB->getRows();
- if($objDB->numRows()) {
- if($showImage) {
- for($i=0;$i<count($items);$i++) {
- $imageID[] = $items[$i]['itemID'];
- }
- $imageList = getImageList($imageID,$objDB);
- } else {
- $imageList ='';
- }
- $display .= createArrivalItemList($items,1,1,'',$imageList,1);
- }
- //$display='<h3 align="center" style="clear:both;">'.$items[0]['add_date'].'</h3>'."\n$display";
- return $display;
- }
- function findItems(&$objDB,$searchString) {
- $searchString = '%'.mysql_escape_string($searchString).'%';
- $query = "SELECT c.name,
- s.name,
- i.*,
- i.id AS itemID,
- IFNULL(i.notes,'') AS note
- FROM items i
- LEFT JOIN categories c ON c.id = i.catID
- LEFT JOIN subcategories s ON s.id = i.subcatID
- WHERE
- c.name LIKE '$searchString' OR
- s.name LIKE '$searchString' OR
- i.item_num LIKE '$searchString' OR
- i.serial_num LIKE '$searchString' OR
- i.manufacturer LIKE '$searchString' OR
- i.model LIKE '$searchString' OR
- i.gauge LIKE '$searchString' OR
- i.caliber LIKE '$searchString' OR
- i.barrel_length LIKE '$searchString' OR
- i.choke1 LIKE '$searchString' OR
- i.choke2 LIKE '$searchString' OR
- i.ffl LIKE '$searchString' OR
- i.contents LIKE '$searchString' OR
- i.title LIKE '$searchString' OR
- i.author LIKE '$searchString' OR
- i.pages LIKE '$searchString' OR
- i.binding LIKE '$searchString' OR
- i.condition LIKE '$searchString' OR
- i.notes LIKE '$searchString'";
- $objDB->query($query);
- $items = $objDB->getRows();
- return createItemList($items);
- }
- function getItemDisplayDetails(&$objDB,$itemID) {
- if(is_numeric($itemID)) {
- $query = "SELECT i.*,
- IFNULL(i.notes,'') AS note
- FROM items i
- WHERE i.id = $itemID";
- $objDB->query($query);
- $i = $objDB->getRows();
- $itemDetails = createItemList($i,0);
- return $itemDetails;
- }
- }
- function createInventoryList(&$objDB,$catID,$subCat=0) {
- if($subCat ==0) {
- $subCatClause = ' AND subcategories.display_order = 1';
- } else {
- $subCatClause =" AND i.subcatID = $subCat";
- }
- $query = "SELECT
- i.catID,
- i.id as itemID,
- subcategories.name AS subcategory,
- i.*,
- IFNULL(i.notes,'') AS note
- FROM items i
- LEFT JOIN subcategories ON subcategories.id = i.subcatID
- WHERE
- i.catID = $catID $subCatClause
- ORDER BY subcategories.display_order,".handleSortClause().", i.manufacturer,i.model,i.gauge,i.caliber";
- $objDB->query($query);
- $items = $objDB->getRows();
- $displayList = createItemList($items);
- return $displayList;
- }
- function getLastUpdateDate($catID,&$objDB) {
- $query = "SELECT DATE_FORMAT(creation_date,'%W %M %D %Y') AS item_date FROM items i WHERE i.catID = $catID ORDER BY creation_date DESC LIMIT 1";
- $objDB->query($query);
- if($objDB->numRows()) {
- return '<p align="center">Last updated on '.$objDB->getField().'</p>';
- }
- }
- function getProductDetails($itemID,&$objDB) {
- $query = "SELECT * FROM items WHERE id = $itemID";
- $objDB->query($query);
- $items = $objDB->getRows();
- return createItemList($items,0);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement