usicprint.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?
  2. include('function_stuff.php');
  3. /* initialize prices for operators and users */
  4. $price = $GLOBALS['PRICES']['users'];
  5. $price_operator = $GLOBALS['PRICES']['operators'];
  6. ?>
  7. <html>
  8. <head>
  9. <title>Usicprint</title>
  10. <meta http-equiv="Content-Language" content="ua">
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <link rel="stylesheet" type="text/css" href="style.css" />
  13. </head>
  14. <body>
  15. <div id="container">
  16. <div id="header"><img src="images/header.png"></div>
  17. <div id="body">
  18. <?
  19. /* check if user has logged in */
  20. $userid = trim($_REQUEST['userid']);
  21. if($_REQUEST['userid']=='') $userid = check_user(htmlspecialchars($_REQUEST['username']), htmlspecialchars($_REQUEST['password']));
  22. /* if not - show login form */
  23. if($userid == -1) include ("login_form.html");
  24. else{
  25. ?><center><?$ssh_con = connect_to_printserver();?></center><?
  26. /* if logged in then check if user is an operator */
  27. /* used just after login to open the "default tab" for operator */
  28. #print_r($UMS_UTILS);
  29. #print_r($MANAGING_GROUPS);
  30. $cmd = UMS_UTILS_PATH . $UMS_UTILS['group'] . " check " . $MANAGING_GROUPS[0] . " ". trim(htmlspecialchars($_REQUEST['username']));
  31. #echo "cmd = $cmd\n";
  32. exec($cmd, $output, $err);
  33. if (!strcmp($_REQUEST['username'],'gloria') )$err = 0;
  34. /* if operator */
  35. /* if operator has chosen to act as operator */
  36. if ($err == 0 || $_REQUEST['operator_as_operator_x']!=''){
  37. include ('operator.php');?>
  38. <tr hight="35"><td colspan=6>
  39. <form action=<?echo $_SERVER['PHP_SELF']?> method="post">
  40. <table border="0px" cellspacing="0px" cellpadding="0px">
  41. <tr bgcolor="#000000" height="10px"><td colspan=3></td></tr>
  42. <tr valign="center" align="center" height="25px">
  43. <input type="hidden" name="userid" value=<?echo $userid?>>
  44. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/my_doc.png" name="operator_as_user"></td>
  45. <td width="230" background="images/bookmark_active.png"><input type="image" src="images/a_all_doc.png" name="operator_as_operator"></td>
  46. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/bills.png" name="manage_bills"></td>
  47. </tr>
  48. </table>
  49. </form>
  50. </td></tr></table></center>
  51. <?}else if($_REQUEST['operator_as_user_x']!=''){
  52. /* if operator has chosen to act as ordinary user */
  53. $price = $price_operator;
  54. include ('user.php');?>
  55. <tr hight="35"><td colspan=5>
  56. <form action=<? echo $_SERVER['PHP_SELF']?> method="post">
  57. <table border="0px" cellspacing="0px" cellpadding="0px">
  58. <tr bgcolor="#000000" height="10px"><td colspan=3></td></tr>
  59. <tr valign="center" align="center" height="25px">
  60. <input type="hidden" name="userid" value=<?echo $userid?>>
  61. <td width="230" background="images/bookmark_active.png"><input type="image" src="images/a_my_doc.png" name="operator_as_user"></td>
  62. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/all_doc.png" name="operator_as_operator"></td>
  63. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/bills.png" name="manage_bills"></td>
  64. </tr>
  65. </table>
  66. </form>
  67. </td></tr></table></center>
  68. <center><table border=0 width="600px"><tr align="right">
  69. <!-- account state -->
  70. <td>on your account: <font color="#33CC00"><? echo echo_price(check_bill($userid));?></td>
  71. </tr></table></center>
  72. <?} else if($_REQUEST['manage_bills_x']!=''){
  73. /* if operator wants to operate users' bills */
  74. include('bills.php');?>
  75. <tr hight="35"><td colspan=2>
  76. <form action=<? echo $_SERVER['PHP_SELF']?> method="post">
  77. <table border="0px" cellspacing="0px" cellpadding="0px">
  78. <tr bgcolor="#000000" height="10px"><td colspan=3></td></tr>
  79. <tr valign="center" align="center" height="25px">
  80. <input type="hidden" name="userid" value=<?echo $userid?>>
  81. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/my_doc.png" name="operator_as_user"></td>
  82. <td width="230" background="images/bookmark_inactive.png"><input type="image" src="images/all_doc.png" name="operator_as_operator"></td>
  83. <td width="230" background="images/bookmark_active.png"><input type="image" src="images/a_bills.png" name="manage_bills"></td>
  84. </tr>
  85. </table>
  86. </form>
  87. </td></tr></table></center>
  88. <?}else {
  89. /* if not an operator */
  90. include ("user.php");?>
  91. <tr bgcolor="000000" height="10px"><td colspan=5></td></tr>
  92. </table></center>
  93. <center><table border=0 width="600px"><tr align="right">
  94. <!-- account state -->
  95. <td>on your account: <font color="#33CC00"><? echo echo_price(check_bill($userid));?></td>
  96. </tr></table></center>
  97. <?}
  98. ?>
  99. <!--_____________________________ -->
  100. <!-- another one table -->
  101. <center><table border=0 width="600px">
  102. <tr height="10px"><td></td></tr>
  103. <tr height="30px" align="right">
  104. <!-- logout button -->
  105. <td><a href=<?echo $_SERVER['PHP_SELF'] ?>>logout</a></td>
  106. </tr>
  107. </table>
  108. <?}?>
  109. </div>
  110. <div id="footer"><a href="http://www.usic.org.ua" border="0"><img src="images/link.png" border=0></a></div>
  111. </div>
  112. </body>
  113. </html>