<?php

// +----------------------------------------------------------------------+
// | BookMaster System                                              |
// +----------------------------------------------------------------------+
// | Copyright (c) 2009 Research Publishing Services. All Rights Reserved.|
// +----------------------------------------------------------------------+
// | It is subject to the license of Research Publishing Services as in   |
// | license.txt   							  							  |
// +----------------------------------------------------------------------+


session_start();
include "conf.php";

$doi=$_GET['doi'];




//$sql="select * from eproc_dtl where doi ='".$doi."'";

$sql="select * from journal_dtl where doi ='".$doi."'";


	$result = mysql_query($sql);




			if(!mysql_affected_rows())
				{

				} else {
					$sno=1;
					echo"<html>";
					echo"<head>";
					echo"<title>Journal</title>";
					echo"<link href='../style.css' rel='stylesheet' type='text/css' />";
					echo"<link href='rpsweb.css' rel='stylesheet' type='text/css' />";
					echo"<script src='Scripts/AC_RunActiveContent.js' type='text/javascript'></script>";
					echo"<script type='text/javascript'>



  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-24473854-1']);

  _gaq.push(['_trackPageview']);



  (function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  })();



</script></head>";
					echo"<body>";


					echo"<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
					  echo"<tr>";
					    echo"<td><table width='778' border='0' align='center' cellpadding='0' cellspacing='0'>";
					      echo"<tr>";
					        echo"<td><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
					          echo"<tr>";
					            echo"<td width='61%'><img src='../images/logo.gif' /></td>";
					            echo"<td width='39%' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='2'>";
					                echo"<tr>";
					                  echo"<td><table width='15%' border='0' align='right' cellpadding='3' cellspacing='0'>";
					                      echo"<tr>";
					                        echo"<td><a href='../index.htm'><img src='../images/home_icon.gif' border='0' /></a></td>";
					                        echo"<td><a href='../contactus.php'><img src='../images/contactus_icon.gif' border='0' /></a></td>";
					                      echo"</tr>";
					                  echo"</table></td>";
					                echo"</tr>";
					                echo"<tr>";
					                  echo"<td>&nbsp;</td>";
					                echo"</tr>";
					                echo"<tr>";
					                  echo"<td height='30' valign='bottom'>&nbsp;</td>";
					                echo"</tr>";
					            echo"</table></td>";
					          echo"</tr>";
					        echo"</table></td>";
					      echo"</tr>";
					      echo"<tr>";
					        echo"<td><table width='100%' border='0' cellspacing='0' cellpadding='0'>";
					          echo"<tr>";
					            echo"<td width='32%' class='line-bg'>&nbsp;</td>";
					            echo"<td width='68%'><table width='100%' border='0' align='right' cellpadding='0' cellspacing='0'>";
					                echo"<tr>";
					                  echo"<td class='curver_left'>&nbsp;</td>";
					                  echo"<td bgcolor='#0062A7'><div align='center'><span class='toplinks'><a href='../aboutus.htm'>About Us</a> | <a href='../proceedings/rps_eproceedings.html'>eProceedings</a> | <a href='../books/rps_books.html' >Books</a> | <a href='../journals/rps_journals.html'>Journals</a> | <a href='../services.htm'>Services</a> | <a href='../testimonials.htm'>Testimonials</a> | <a href='../contactus.php'>Contact Us</a></span></td>";
					                  echo"<td class='curver_right'>&nbsp;</td>";
					                echo"</tr>";
					            echo"</table></td>";
					          echo"</tr>";
					        echo"</table></td>";
					      echo"</tr>";
					      echo"<tr>";
					        echo"<td>&nbsp;</td>";
					      echo"</tr>";
					      echo"<tr>";

					      echo"</tr>";
					      echo"<tr>";
					        echo"<td class='spacer'></td>";
					      echo"</tr>";
					      echo"<tr>";
					        echo"<td><table width='771' border='0' align='center' cellpadding='4' cellspacing='0'>";



					//echo"<center>";
					//echo"<form name='test' action='' method='post'>";
					echo"<br>";



					echo"<table><tr><td valign='top' style='text-align:left' class='content_text'>Dear Sir/Madam,</td></tr>";

					echo"<tr><td valign='top' style='text-align:left' class='content_text'>Access to the full-text article is avaliable at <b>US$29.90 per article</b>.</td></tr>";

					echo"<tr><td valign='top' style='text-align:left' class='content_text'><i>By purchasing this article I have agreed to the <a href='terms.html' style='text-decoration:underline' target='_blank'>Terms &amp; Conditions</a> and <a href='privacy.html' style='text-decoration:underline' target='_blank'>Privacy Policy</a>. </i></td></tr></table>";

					echo"<br>";
					echo"<table border='0'>";

					while($row = mysql_fetch_array($result)){

					$aut1fn=$row['aut1_firstname'];
					$aut1mn=$row['aut1_midname'];
					$aut1sn=$row['aut1_surname'];
					$caut1n=trim($aut1fn.' '.$aut1mn.' '.$aut1sn);


					$aut2fn=$row['aut2_firstname'];
					$aut2mn=$row['aut2_midname'];
					$aut2sn=$row['aut2_surname'];
					$caut2n=trim($aut2fn.' '.$aut2mn.' '.$aut2sn);


					$aut3fn=$row['aut3_firstname'];
					$aut3mn=$row['aut3_midname'];
					$aut3sn=$row['aut3_surname'];
					$caut3n=trim($aut3fn.' '.$aut3mn.' '.$aut3sn);




					$aut4fn=$row['aut4_firstname'];
					$aut4mn=$row['aut4_midname'];
					$aut4sn=$row['aut4_surname'];
					$caut4n=trim($aut4fn.' '.$aut4mn.' '.$aut4sn);



					$aut5fn=$row['aut5_firstname'];
					$aut5mn=$row['aut5_midname'];
					$aut5sn=$row['aut5_surname'];
					$caut5n=trim($aut5fn.' '.$aut5mn.' '.$aut5sn);


					$aut6fn=$row['aut6_firstname'];
					$aut6mn=$row['aut6_midname'];
					$aut6sn=$row['aut6_surname'];
					$caut6n=trim($aut6fn.' '.$aut6mn.' '.$aut6sn);


					$aautfn=$row['aaut_firstname'];
					$aautmn=$row['aaut_midname'];
					$aautsn=$row['aaut_surname'];
					$caautn=trim($aautfn.' '.$aautmn.' '.$aautsn);

/*
					str.replace(/^[,\s]+|[,\s]+$/g, '').replace(/,[,\s]*,/g, ',');



					if($caut1n=="" && $caut2n=="" && $caut3n=="" && $caut4n=="" && $caut5n=="" && $caut6n=="" && $caautn=="")
					{
					$author="";
					}


					elseif($caut1n!=" " && ($caut2n==" " || $caut3n==" " || $caut4n==" " || $caut5n==" " || $caut6n==" " || $caautn==" "))
					{
					$author="$caut1n";
					}

					elseif($caut1n!=" " && $caut2n!=" " && ($caut3n==" " || $caut4n==" " || $caut5n==" " || $caut6n==" " || $caautn==" "))
					{
					$author="$caut1n and $caut2n";
					}

					elseif($caut1n!=" " && $caut2n!=" " && $caut3n!=" " && ($caut4n==" " || $caut5n==" " || $caut6n==" " || $caautn==" "))
					{
					$author="$caut1n, $caut2n and $caut3n";
					}
					elseif($caut1n!=" " && $caut2n!=" " && $caut3n!=" " && $caut4n!=" " && ($caut5n==" " || $caut6n==" " || $caautn==" "))
					{
					$author="$caut1n, $caut2n, $caut3n, $caut4n";
					}

					elseif($caut1n!=" " && $caut2n!=" " && $caut3n!=" " && $caut4n!=" " && $caut5n!=" " && ($caut6n==" " || $caautn==" "))
					{
					$author="$caut1n, $caut2n, $caut3n, $caut4n and $caut5n";
					}

					elseif($caut1n!=" " && $caut2n!=" " && $caut3n!=" " && $caut4n!=" " && $caut5n!=" " && $caut6n!=" " && ($caautn==" "))
					{
					$author="$caut1n, $caut2n, $caut3n, $caut4n, $caut5n and $caut6n";
					}


					elseif($caut1n!=" " && $caut2n!=" " && $caut3n!=" " && $caut4n!=" " && $caut5n!=" " && $caut6n!=" " && $caautn!=" ")
					{
					$author="$caut1n, $caut2n, $caut3n, $caut4n, $caut5n, $caut6n, $caautn";
					}



*/


					$totauthors = $caut1n.', '.$caut2n.', '.$caut3n.', '.$caut4n.', '.$caut5n.', '.$caut6n.', '.$caautn;

	/*
	echo"$totauthors";


					$totauthors=ereg_replace(" ", ",", $totauthors);
					$wordlist=explode(",", $totauthors);
					print_r($wordlist);

*/



					$pattern = "/(\w+),  /i";

					$replacement = "${1}, ";


					$finalaut = preg_replace($pattern, $replacement, $totauthors);


					$finalaut = rtrim($finalaut, ', ');




					//echo"$finalaut";

					echo"<tr><td valign='top' class='content_text'><font color='#cf4b17'><b>DOI</b></font> </td><td valign='top'>&nbsp;</td><td valign='top' align='left' class='content_text'>10.3850/$row[doi]</td></tr>";
					echo"<tr><td valign='top' class='content_text'><font color='#cf4b17'><b>Article </b></font></td><td valign='top'>&nbsp;</td><td valign='top' align='left' class='content_text'>$row[p_title] </td></tr>";
					//echo"<tr><td valign='top' class='content_text'><font color='#cf4b17'><b>Author(s) </b></font></td><td valign='top'>&nbsp;</td><td valign='top' align='left' class='content_text'>$row[aut1_firstname] $row[aut1_midname] $row[aut1_surname], $row[aut2_firstname] $row[aut2_midname] $row[aut2_surname], $row[aut3_firstname] $row[aut3_midname] $row[aut3_surname], $row[aut4_firstname] $row[aut4_midname] $row[aut4_surname], $row[aut5_firstname] $row[aut5_midname] $row[aut5_surname], $row[aut6_firstname] $row[aut6_midname] $row[aut6_surname], $row[aaut_firstname] $row[aaut_midname] $row[aaut_surname]</td></tr>";




					echo"<tr><td valign='top' class='content_text'><font color='#cf4b17'><b>Author(s) </b></font></td><td valign='top'>&nbsp;</td><td valign='top' align='left' class='content_text'>$finalaut</td></tr>";
					/*

					$cisbn=$row['isbn'];


					$sql1="select * from conf_dtl where isbn=$cisbn";

				$result1 = mysql_query($sql1);
				while($row1 = mysql_fetch_array($result1)){

				echo"<tr><td valign='top' class='content_text'> <font color='#cf4b17'><b>Source </b></font></td><td valign='top'>&nbsp;</td><td valign='top' align='left' class='content_text'><a href='/proceedings/$cisbn.html' style='text-decoration:underline'><b>$row1[c_title]</b></a>(pp $row[pprange_start]-$row[pprange_end]) </td></tr>";
				}



				$sno++;
				*/

				echo"</table>";

				echo"<table><tr><td valign='middle' class='content_text' style='text-align:left'><font color='#cf4b17'><b>Accepted Credit Cards</b></font></td>
				<td valign='top' >
				<a href='#' onclick='javascript:window.open('https://www.paypal.com/sg/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');'><img  src='https://www.paypal.com/en_US/HK/i/bnr/horizontal_solution_global_hk.gif' border='0' alt='PayPal'></a>
				</td></tr></table>";
				echo"<table width='100%'><tr><td valign='top' align='left' width='100%'>";
				echo"<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
				//echo"<input type='image' src='../../images/btn_add2cart.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'>";

				echo"<input type='submit' name='submit' value='BuyArticleNow' alt='PayPal - The safer, easier way to pay online!'>";

				echo"<br><br><br><br>";
				echo"<a href='javascript:history.go(-1)' style='text-decoration:underline'><b>Back to abstract page</b></a>";
				echo"<input type='hidden' name='add' value='1'>";
				echo"<input type='hidden' name='cmd' value='_cart'>";
				echo"<input type='hidden' name='business' value='sankaran@rpsonline.com.sg'>";
				echo"<input type='hidden' name='item_name' value='", $row['p_title'],"'>";
				echo"<input type='hidden' name='item_number' value='", $row['doi'], "'>";
				echo"<input type='hidden' name='amount' value='", $row['price'], "'>";
				echo"<input type='hidden' name='no_shipping' value='0'>";
				echo"<input type='hidden' name='return' value='http://www.rpsonline.com.sg/proceedings/rps_eproceedings.html'>";
				echo"<input type='hidden' name='cancel_return' value='http://www.rpsonline.com.sg/proceedings/rps_eproceedings.html'>";
				echo"<input type='hidden' name='currency_code' value='USD'>";
				echo"<input type='hidden' name='lc' value='SG'>";
				echo"<input type='hidden' name='bn' value='PP-ShopCartBF'><br><br>";
				echo"</form>";
				echo"</td></tr></table>";
				echo"<tr>";
        		echo"<td height='25' class='line-bg welcome_text'><div align='right'>Copyright &copy; 2009 Research Publishing Services. All Rights Reserved.</div></td>";
      			echo"</tr>	";
				echo"</table></td></tr>";
				echo"</body>";
				echo"</html>";


}



}






?>





<!--


<html>
<head>
<title>ICTB eproceedings</title><script type="text/javascript">



  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-24473854-1']);

  _gaq.push(['_trackPageview']);



  (function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  })();



</script></head>



<body>
<center>
<form name="personal_dtl" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" onSubmit="return validation()" >



<p align="center">Subcribed User: <a href="../protected_docs/0101/S179392402009000088.pdf"><img src="../../../images/pdf-logo.jpg" border="0" /><br><b>Full PDF (1,168KB)</b></a></p>

</form>


<table width="60%"><tr><td valign="top" align="center" width="100%">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
UnSubcribed User: <input type="image" src="images/btn_add2cart.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="sankaran@rpsonline.com.sg">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="item_number" value="978-981-05-9611-8">
<input type="hidden" name="amount" value="60.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="return" value="http://www.rpsonline.com.sg/books/rps_publications.html">
<input type="hidden" name="cancel_return" value="http://www.rpsonline.com.sg/books/rps_publications.html">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="SG">
<input type="hidden" name="bn" value="PP-ShopCartBF"><br><br>

</form>

</td></tr></table>

</center>
</body>
</html>
-->