tpl_date_list.html * Date:October 2011 * Author:Steadroy Thompson * Description: This page collects all Press Release based on a Particular Month Year eg: November 2011 */ session_start(); include_once("classes/news.class.php"); include_once("classes/paginator.class.php"); include_once("classes/commonDB.class.php"); include_once("config.php"); include_once("connect.php"); $comobj = new commonDB(); $filePath = PROFILE_IMG_PATH; $result_s = mysql_query("SELECT * FROM images WHERE articleid = '$id'"); // get all images based on id if ($result_s && mysql_num_rows($result_s)) { $numrows = mysql_num_rows($result_s); $i=0; // set i to 0 used as a counter while ($row = mysql_fetch_assoc($result_s)) { $datas[$i] = $row['image']; // place image names in a array called dataas $datascap[$i] = $row['caption']; // place image captions in a array called datascap $i++; } } // =================images =============== $ids = $row['articleid']; $result_s = mysql_query("SELECT * FROM images WHERE articleid = '$ids'"); $rowf = mysql_fetch_assoc($result_s); $ids = $row['articleid']; $result_se = mysql_query("SELECT * FROM images WHERE articleid = '$ids'"); $rowf = mysql_fetch_assoc($result_se); $idsa =$row['userid']; $result_s = mysql_query("SELECT * FROM user WHERE userid = '$idsa'"); $rowe = mysql_fetch_assoc($result_s); print_r( $rowe); $comp = $rowe['company']; // sql to assist in deleting images and pdf //=================================================================== $newsObj = new news(); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $form_query = "SELECT DISTINCT industry.name FROM industry"; $form_result = mysql_query($form_query) or die(mysql_error()); // used to cretae dates $dates = array(); // create an array to store dates $res = mysql_query("SELECT * FROM article ORDER BY date ASC"); while($row=mysql_fetch_assoc($res)) { // Store the articles in an array, grouped by Months: $dates[date('F Y',strtotime($row['date']))][] = $row; } if(!empty($_REQUEST[tb1])) { $query = "SELECT COUNT(*) FROM article WHERE CONCAT(MONTHNAME(date),' ', YEAR(date)) = '$_REQUEST[tb1]' && release_date <= NOW() && articleallow = '1' "; $result = mysql_query($query); $num_rows = mysql_fetch_row($result); $pages = new Paginator; $pages->items_total = $num_rows[0]; $pages->mid_range = 2; // Number of pages to display. Must be odd and > 3 $pages->paginate(); // $pagenum = ceil($num_rows[0] / $pages->$default_ipp); $query = "SELECT * FROM article WHERE CONCAT(MONTHNAME(date),' ', YEAR(date)) = '$_REQUEST[tb1]' && release_date <= NOW() && articleallow = '1' ORDER BY DATE DESC $pages->limit"; $result = mysql_query($query); } else { } include('tpl_date_list.html'); ?>