/application/views/pages/admin/index.php
PHP | 134 lines | 124 code | 4 blank | 6 comment | 16 complexity | 89b059aec46092cbf7ad7d88d4210a98 MD5 | raw file
- <?php
- include('init.php');
- include_once(IFZROOT.'kohana.php');
- //This code is copyright (c) Internet Business Solutions SL, all rights reserved.
- //The contents of this file are protect under law as the intellectual property of Internet
- //Business Solutions SL. Any use, reproduction, disclosure or copying of any kind
- //without the express and written permission of Internet Business Solutions SL is forbidden.
- //Author: Vince Reid, vince@virtualred.net
- $success=0;
- if(@$storesessionvalue=="") $storesessionvalue="virtualstore";
- if(@$_SESSION["loggedon"] != $storesessionvalue && trim(@$_COOKIE["WRITECKL"])!=""){
- $config = RBI_Kohana::config('database.default_ifrogz');
- $config = $config['connection'];
- $db=mysql_connect($config['hostname'], $config['username'], $config['password']);
- mysql_select_db($config['database']) or die ('RBI connection failed.</td></tr></table></body></html>');
- $rbiSQL = 'SELECT *
- FROM employee
- WHERE username="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKL"]))).'" and password="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKP"]))).'"';
- $rs_rbi = mysql_query($rbiSQL);
- if(mysql_num_rows($rs_rbi) > 0) {
- @$_SESSION["loggedon"] = $storesessionvalue;
- }else{
- $success=2;
- }
- mysql_free_result($rs_rbi);
- include(APPPATH.'views/partials/admin/dbconnection.php');
- }
- if (($_SESSION['loggedon'] != $storesessionvalue && $success!=2) || @$disallowlogin==TRUE) {
- //echo Kohana::debug($_SESSION);
- exit();
- }
- $sSQL = "SELECT adminEmail,adminStoreURL,adminShipping,adminVersion,adminUser,adminPassword FROM admin WHERE adminID=1";
- $result = mysql_query($sSQL) or print(mysql_error());
- $rs = mysql_fetch_assoc($result);
- mysql_free_result($result);
- if (@$_GET["writeck"]=="yes") {
- print "<script src='/admin/savecookie.php?WRITECKL=" . $_SESSION['employee']['username'] . "&WRITECKP=" . $_SESSION['employee']['password'] . "'></script>";
- print "<meta http-equiv=\"Refresh\" content=\"3; URL=/admin/index.php\">";
- $success=1;
- } elseif (@$_GET["writeck"]=="no"){
- print "<script src='/admin/savecookie.php?DELCK=yes'></script>";
- print "<meta http-equiv=\"Refresh\" content=\"3; URL=/admin/index.php\">";
- $success=1;
- } elseif (@$_GET['forwarded'] == 'yes') {
- print "<meta http-equiv=\"Refresh\" content=\"2; URL=http://ifrogz.com\">";
- $forwarded = 1;
- }
- ?>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="" align="center">
- <tr>
- <td width="100%">
- <table width="<?php print $innertablewidth?>" border="0" cellspacing="0" cellpadding="3" bgcolor="">
- <tr>
- <td colspan="2" width="100%" align="center"><strong><?php print $yyChsLst?></strong><br /><font size="1">(<?php print $yyVers?>: <?php print $rs["adminVersion"]?>)</font><br />
- </td>
- </tr>
- <tr>
- <td colspan="2" width="100%" align="center"><strong>Welcome to iFrogz</strong><br /><br />
- </td>
- </tr>
- <?php if($success==1){ ?>
- <tr>
- <td colspan="2" width="100%" align="center"><p> </p><p> </p>
- <p><strong><?php print $yyOpSuc?></strong></p><p> </p>
- <p><font size="1"><?php print $yyNowFrd?><br /><br /><?php print $yyNoAuto?> <a href="/admin/index.php"><?php print $yyClkHer?></a>.</font></td>
- </tr>
- <?php }elseif($success==2){ ?>
- <tr>
- <td colspan="2" width="100%" align="center"><p> </p><p> </p>
- <p><strong><?php print $yyOpFai?></strong></p><p> </p>
- <p><?php print $yyCorCoo?> <?php print $yyCorLI?> <a href="/admin/login.php"><?php print $yyClkHer?></a>.</p></td>
- </tr>
- <?php
- } elseif (@$forwarded == 1) {
- ?>
- <tr>
- <td colspan="2" width="100%" align="center"><p> </p><p> </p>
- <p><strong>You are being forwarded to iFrogz.com</strong></p><p> </p>
- <p><?php print $yyNoAuto?> <a href="http://ifrogz.com"><?php print $yyClkHer?></a>.</font></td>
- </tr>
- <?php
- }else{ ?>
- <? if(isPermitted('admin')||isPermitted('it')||isPermitted('management')||isPermitted('customer service')||isPermitted('customer service admin')){?>
- <tr>
- <td valign="top" width="50%" align="left"> <a href="/admin/orders.php"><strong><?php print $yyVwOrd?> </strong></a><br />
-
- </td>
- <td valign="top" width="50%"><a href="<?php print helpbaseurl?>help.asp#orders" target="ttshelp"><strong><?php print $yyOnlHlp?></strong></a></td>
- </tr>
- <tr>
- <td valign="top" width="50%" align="left"> <a href="/admin/index.php?forwarded=yes"><strong>Place an Order</strong></a><br />
-
- </td>
- <td valign="top" width="50%"> </td>
- </tr>
- <?php
- if(Cookie::get('ifrogzuser', NULL) === NULL) {
- ?>
- <tr>
- <td colspan="2" style="text-align: center; font-weight: bold"><a href="/user/savecookie">Remember my login for 1 day.</a></td>
- </tr>
- <?php
- }else{
- ?>
- <tr>
- <td colspan="2" style="text-align: center; font-weight: bold"><a href="/user/deletecookie">Don't remember my login</a></td>
- </tr>
- <?php
- }
- } else if (isPermitted('hong kong')) {
- ?>
- <tr>
- <td colspan="2" style="text-align: center; font-weight: bold"><a href="/admin/index.php?writeck=no">Click here to delete your cookie.</a></td>
- </tr>
- <?php
- }else{ ?>
- <!--<tr>
- <td colspan="2"><?=$_SESSION['employee']['permissions']?></td>
- </tr>-->
- <?php
- }
- } ?>
- <tr>
- <td colspan="2" width="100%" align="left"><img src="/lib/images/misc/clearpixel.gif" width="300" height="5" alt="" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>