PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/application/views/pages/admin/index.php

https://bitbucket.org/chadsaun/ifrogz-panel
PHP | 134 lines | 124 code | 4 blank | 6 comment | 16 complexity | 89b059aec46092cbf7ad7d88d4210a98 MD5 | raw file
  1. <?php
  2. include('init.php');
  3. include_once(IFZROOT.'kohana.php');
  4. //This code is copyright (c) Internet Business Solutions SL, all rights reserved.
  5. //The contents of this file are protect under law as the intellectual property of Internet
  6. //Business Solutions SL. Any use, reproduction, disclosure or copying of any kind
  7. //without the express and written permission of Internet Business Solutions SL is forbidden.
  8. //Author: Vince Reid, vince@virtualred.net
  9. $success=0;
  10. if(@$storesessionvalue=="") $storesessionvalue="virtualstore";
  11. if(@$_SESSION["loggedon"] != $storesessionvalue && trim(@$_COOKIE["WRITECKL"])!=""){
  12. $config = RBI_Kohana::config('database.default_ifrogz');
  13. $config = $config['connection'];
  14. $db=mysql_connect($config['hostname'], $config['username'], $config['password']);
  15. mysql_select_db($config['database']) or die ('RBI connection failed.</td></tr></table></body></html>');
  16. $rbiSQL = 'SELECT *
  17. FROM employee
  18. WHERE username="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKL"]))).'" and password="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKP"]))).'"';
  19. $rs_rbi = mysql_query($rbiSQL);
  20. if(mysql_num_rows($rs_rbi) > 0) {
  21. @$_SESSION["loggedon"] = $storesessionvalue;
  22. }else{
  23. $success=2;
  24. }
  25. mysql_free_result($rs_rbi);
  26. include(APPPATH.'views/partials/admin/dbconnection.php');
  27. }
  28. if (($_SESSION['loggedon'] != $storesessionvalue && $success!=2) || @$disallowlogin==TRUE) {
  29. //echo Kohana::debug($_SESSION);
  30. exit();
  31. }
  32. $sSQL = "SELECT adminEmail,adminStoreURL,adminShipping,adminVersion,adminUser,adminPassword FROM admin WHERE adminID=1";
  33. $result = mysql_query($sSQL) or print(mysql_error());
  34. $rs = mysql_fetch_assoc($result);
  35. mysql_free_result($result);
  36. if (@$_GET["writeck"]=="yes") {
  37. print "<script src='/admin/savecookie.php?WRITECKL=" . $_SESSION['employee']['username'] . "&WRITECKP=" . $_SESSION['employee']['password'] . "'></script>";
  38. print "<meta http-equiv=\"Refresh\" content=\"3; URL=/admin/index.php\">";
  39. $success=1;
  40. } elseif (@$_GET["writeck"]=="no"){
  41. print "<script src='/admin/savecookie.php?DELCK=yes'></script>";
  42. print "<meta http-equiv=\"Refresh\" content=\"3; URL=/admin/index.php\">";
  43. $success=1;
  44. } elseif (@$_GET['forwarded'] == 'yes') {
  45. print "<meta http-equiv=\"Refresh\" content=\"2; URL=http://ifrogz.com\">";
  46. $forwarded = 1;
  47. }
  48. ?>
  49. <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="" align="center">
  50. <tr>
  51. <td width="100%">
  52. <table width="<?php print $innertablewidth?>" border="0" cellspacing="0" cellpadding="3" bgcolor="">
  53. <tr>
  54. <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 />&nbsp;
  55. </td>
  56. </tr>
  57. <tr>
  58. <td colspan="2" width="100%" align="center"><strong>Welcome to iFrogz</strong><br /><br />&nbsp;
  59. </td>
  60. </tr>
  61. <?php if($success==1){ ?>
  62. <tr>
  63. <td colspan="2" width="100%" align="center"><p>&nbsp;</p><p>&nbsp;</p>
  64. <p><strong><?php print $yyOpSuc?></strong></p><p>&nbsp;</p>
  65. <p><font size="1"><?php print $yyNowFrd?><br /><br /><?php print $yyNoAuto?> <a href="/admin/index.php"><?php print $yyClkHer?></a>.</font></td>
  66. </tr>
  67. <?php }elseif($success==2){ ?>
  68. <tr>
  69. <td colspan="2" width="100%" align="center"><p>&nbsp;</p><p>&nbsp;</p>
  70. <p><strong><?php print $yyOpFai?></strong></p><p>&nbsp;</p>
  71. <p><?php print $yyCorCoo?> <?php print $yyCorLI?> <a href="/admin/login.php"><?php print $yyClkHer?></a>.</p></td>
  72. </tr>
  73. <?php
  74. } elseif (@$forwarded == 1) {
  75. ?>
  76. <tr>
  77. <td colspan="2" width="100%" align="center"><p>&nbsp;</p><p>&nbsp;</p>
  78. <p><strong>You are being forwarded to iFrogz.com</strong></p><p>&nbsp;</p>
  79. <p><?php print $yyNoAuto?> <a href="http://ifrogz.com"><?php print $yyClkHer?></a>.</font></td>
  80. </tr>
  81. <?php
  82. }else{ ?>
  83. <? if(isPermitted('admin')||isPermitted('it')||isPermitted('management')||isPermitted('customer service')||isPermitted('customer service admin')){?>
  84. <tr>
  85. <td valign="top" width="50%" align="left">&nbsp;&nbsp;<a href="/admin/orders.php"><strong><?php print $yyVwOrd?> </strong></a><br />
  86. &nbsp;
  87. </td>
  88. <td valign="top" width="50%"><a href="<?php print helpbaseurl?>help.asp#orders" target="ttshelp"><strong><?php print $yyOnlHlp?></strong></a></td>
  89. </tr>
  90. <tr>
  91. <td valign="top" width="50%" align="left">&nbsp;&nbsp;<a href="/admin/index.php?forwarded=yes"><strong>Place an Order</strong></a><br />
  92. &nbsp;
  93. </td>
  94. <td valign="top" width="50%">&nbsp;</td>
  95. </tr>
  96. <?php
  97. if(Cookie::get('ifrogzuser', NULL) === NULL) {
  98. ?>
  99. <tr>
  100. <td colspan="2" style="text-align: center; font-weight: bold"><a href="/user/savecookie">Remember my login for 1 day.</a></td>
  101. </tr>
  102. <?php
  103. }else{
  104. ?>
  105. <tr>
  106. <td colspan="2" style="text-align: center; font-weight: bold"><a href="/user/deletecookie">Don't remember my login</a></td>
  107. </tr>
  108. <?php
  109. }
  110. } else if (isPermitted('hong kong')) {
  111. ?>
  112. <tr>
  113. <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>
  114. </tr>
  115. <?php
  116. }else{ ?>
  117. <!--<tr>
  118. <td colspan="2"><?=$_SESSION['employee']['permissions']?></td>
  119. </tr>-->
  120. <?php
  121. }
  122. } ?>
  123. <tr>
  124. <td colspan="2" width="100%" align="left"><img src="/lib/images/misc/clearpixel.gif" width="300" height="5" alt="" />
  125. </td>
  126. </tr>
  127. </table>
  128. </td>
  129. </tr>
  130. </table>