Location: PHPKode > projects > Arab Cart > arabCart/admincp/most.php
<?php
/*
  ArabCart, Free E-Commerce Solutions
  http://www.arabcart.info

  Copyright (c) 2005 Mhd Zaher Ghaibeh

  Released under the GNU General Public License
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
  USA.
*/


session_start();

if((!isset($admin))&&(!isset($upass)))

{

	echo('<html>

		<head>

		<meta http-equiv="Content-Type" content="text/html; charset='.charset.'">

		<link rel="stylesheet" href="../style/style.css" type="text/css">

		<meta http-equiv="Refresh" content="0; URL=../admincp/index.php">

		<title>Waite....</title>

		</head>

		<body>

		<br>

		<br>

		<br>

		<div align="center">

		<br><br>

		<table width="50%" border="1" class="border">

		<tr><td class="border">

		<table border="0" width="100%" id="table1" cellpadding="5" cellspacing="0">

		<tr>

		<td align="center">

		<b>Sorry you can\'t Assecc <br> Please waite While you Redirected to the Login Page<br> 

		waite .....</b>		

		</td>

		</tr>

		</table>

		</td></tr>

		</table>

		</div>

		</body>	

		</html>');

}

else

{

	include("../includes/lang-eng.php");

	include("../connections/connection.php");



	//added templates to deal with

	include("addtmpl.php");



	//add vars to the templates file



	if($op==0)

	{

		$template -> setAttribute("mostwanted", "visibility", "visible");

		$template -> AddVar("mostwanted","SID",$PHPSESSID);

		$template -> AddVar("mostwanted","ADDW",addprod);

		$template -> AddVar("mostwanted","VIEWW",viewprod);

	}

	else

		if($op==1)

		{

			$template -> setAttribute("addmostwanted", "visibility", "visible");

			$template -> AddVar("addmostwanted","PRODUCT-NAME",productname);

			$template -> AddVar("addmostwanted","SID",$PHPSESSID);

			$template -> AddVar("addmostwanted","ADD",add);

			$template -> AddVar("addmostwanted","PAGE",'addmost');



			$sql=mysql_query("select id , name from products order by id") or die(mysql_error());

			if(mysql_num_rows($sql)!=0)

			{

				while($row=mysql_fetch_object($sql))

				{		

					$template -> AddVar("product","PRO-NAME",$row->name);

					$template -> AddVar("product","PRODUCT-ID",$row->id);

					$template -> parseTemplate("product","a");

				}

			}

		}

	else

		if($op==2)

		{

			$template -> setAttribute("viewmostwanted", "visibility", "visible");

				$most=mysql_query("select mos.product_id , prod.name , mos.id from products prod , most_wanted mos where prod.id = mos.product_id order by mos.id DESC limit 0,5 ") or die(mysql_error());

			if(mysql_num_rows($most)!=0)

				{

					$template -> AddVar("viewmostwanted","PRO-NAME",productname);

					$template -> AddVar("viewmostwanted","SID",$PHPSESSID);

					$template -> AddVar("viewmostwanted","DELETE",del);



					while($row_most=mysql_fetch_object($most))

					{

						$template -> AddVar("viewmostelem","PRO-NAME-DB",$row_most->name);

						$template -> AddVar("viewmostelem","ID",$row_most->id);

						$template -> parseTemplate("viewmostelem","a");

					}

				}

			elseif(mysql_num_rows($most)==0)

			{

				$template -> AddVar("viewmostwanted","SORRY",sorrym);

			}

			

		}

	include("vars.php");



}

?>
Return current item: Arab Cart