Location: PHPKode > projects > ComicFlow > checklist.php
<?php

// Include needed files
include("./class.TemplatePower.inc.php");
include("./config/config.php");

// Create a new template object
$tpl = new TemplatePower("themes/$themes/tpl/checklist.tpl");

// Prepare the template
$tpl->prepare();

$tpl->assignGlobal("theme", $themes);
$tpl->assignGlobal("pmcurl", $siteurl);
$tpl->assignGlobal("sitetitle", $sitetitle);
$tpl->assignGlobal("imgfolder", "themes/$themes/img");
$tpl->assign("version", $version);

// MySQL Connection
mysql_connect($sql['host'],$sql['user'],$sql['pass']) or die("Unable to connect to SQL server");
mysql_select_db($sql['data']) or die("Unable to find DB");

	// Get the series name from the artist table
    $select = "SELECT * FROM pmc_artist WHERE uid = '". mysql_real_escape_string($_POST['check_name']) ."' AND type = 'Series'";
    $data = mysql_db_query($sql['data'], $select) or die("Select Failed!");
    $row = mysql_fetch_array($data);
    $name_uid = $row['uid'];
    $com_name = $row['name'];
    $volume = $row['volume'];
    $publisher = $row['publisher'];
    $year = $row['year'];
    
    $select = "SELECT * FROM pmc_artist WHERE uid = '$publisher'";
  	$data = mysql_db_query($sql['data'], $select) or die("Select publisher Failed!");
  	$row = mysql_fetch_array($data);
  	$publisher_uid = $row['name'];
  	
    $start = $_POST['check_start'];
	$ending = $_POST['check_end'];

	$comicname = $_POST['check_name'];
	
	$tpl->assign("check_publisher", $publisher_uid);
	$tpl->assign("check_name", $com_name);
	$tpl->assign("check_volume", $volume);
	$tpl->assign("check_year", $year);
	
	$dat = date("Y-m-d G-i-s");
	$query = "SELECT date_format('$dat','%W, %M %d, %Y')";
    $getdate = mysql_db_query($sql['data'], $query) or die("Select date user format Failed!");
    $row = mysql_fetch_array($getdate);
    $newdate = $row[0];
	
	$tpl->assign("check_date", $newdate);
	
	for ($i = $start; $i <= $ending; $i++) {
	
	// The MySQL command to run
	$select = "SELECT * FROM pmc_comic WHERE issue = $i and title = $name_uid";
	$data = mysql_db_query($sql['data'], $select) or die("Select Failed!");

	$row = mysql_fetch_array($data);
   
      // Get all the fields
      $issue = $row['issue'];
      
      $tpl->newBlock("check_list");
      
      if($issue == $i) {      	
      	$tpl->assign("check_num", "<b><strike>$i</strike></b>&nbsp;&nbsp;");
      } else {      	
      	$tpl->assign("check_num", "<font class=\"grey\"><i>$i</i></font>&nbsp;&nbsp;");
      }
   		
}

// Print the result
$tpl->printToScreen();

?>
Return current item: ComicFlow