function.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?
  2. function ico($name="",$url="", $txt=""){
  3. global $xpath;
  4. $ret="";
  5. //echo"----dupa|$name";
  6. if ($name){
  7. if ($url && $txt){
  8. $ret ="<img border=\"0\" src=\"$xpath/ico/$name.gif\" width=\"16\" align=\"absmiddle\" height=\"16\" alt=\"$txt\">";
  9. $ret .="<a href=\"$url\" > $txt</a>&nbsp;";
  10. } else if($url){
  11. $ret ="<a href=\"mod.php?mod=billing&wp=login&op=$op\" > ";
  12. $ret .="<img border=\"0\" src=\"$xpath/ico/$name.gif\" width=\"16\" align=\"absmiddle\" height=\"16\">";
  13. $ret .="</a>&nbsp;";
  14. }else if ($txt){
  15. $ret ="<img border=\"0\" src=\"$xpath/ico/$name.gif\" width=\"16\" align=\"absmiddle\" height=\"16\" alt=\"$txt\">&nbsp;";
  16. }else{
  17. $ret ="<img border=\"0\" src=\"$xpath/ico/$name.gif\" width=\"16\" align=\"absmiddle\" height=\"16\">&nbsp;";
  18. }
  19. }
  20. return $ret;
  21. }
  22. function isfile($name){
  23. $is=(@fclose(@fopen($name, "r")));
  24. return($is);
  25. }
  26. function is_user($perm=""){
  27. // $perm=explode(",", $perm);
  28. if ($perm=="admin" OR $perm=="adm"){
  29. $perm=1;
  30. }
  31. if ($_SESSION[u_id]>0 AND $_SESSION[login]==1){
  32. //echo"$_SESSION[u_id]==$_SESSION[u_perm]";
  33. if ($perm){
  34. // if (($_SESSION[u_perm]==$perm[1] AND $perm[1]) || ($_SESSION[u_perm]==$perm[2] AND $perm[2]) || ($_SESSION[u_perm]==$perm[3] AND $perm[3]) || ($_SESSION[u_perm]==$perm[4] AND $perm[4]) || ($_SESSION[u_perm]==$perm[5] AND $perm[5])){
  35. if ($_SESSION[u_perm]==$perm OR ($perm=='2' AND $_SESSION[u_perm]=='1')){
  36. return $_SESSION[u_id];
  37. }else{
  38. return 0;
  39. }
  40. }else{
  41. return $_SESSION[u_id];
  42. }
  43. }else{
  44. return 0;
  45. }
  46. }
  47. function upload($file,$path){
  48. }
  49. function OpenTable(){
  50. echo"<table border=\"0\" width=\"615\" cellspacing=\"0\" cellpadding=\"0\">\n";
  51. echo"<tr>\n";
  52. echo"<td width=\"100%\" valign=\"middle\" align=\"left\">";
  53. }
  54. function Close(){
  55. echo"</td>\n";
  56. echo"</tr>\n";
  57. echo"</table>";
  58. }
  59. function refreshclose(){
  60. ?>
  61. <script>
  62. <!--
  63. window.opener.location.reload();
  64. window.close();
  65. //-->
  66. </script>
  67. <?
  68. }
  69. function refresh(){
  70. ?>
  71. <script>
  72. <!--
  73. window.opener.location.reload();
  74. // window.close();
  75. //-->
  76. </script>
  77. <?
  78. }
  79. function redirect($where){
  80. ?>
  81. <script>
  82. <!--
  83. window.location='<? echo $where;?>';
  84. // window.close();
  85. //-->
  86. </script>
  87. <?
  88. }
  89. ?>