PageRenderTime 81ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/mgmt/payment/slip.php

https://gitlab.com/msdusad/all_ones
PHP | 324 lines | 202 code | 58 blank | 64 comment | 24 complexity | 7363ea71578a9bef1e8de4df66f36c3c MD5 | raw file
  1. <?php session_start();
  2. if(!isset($_SESSION['username']))
  3. {
  4. header("location:index.php");
  5. }
  6. include("conn.php");
  7. include("header.php");
  8. $ms=$_GET['sl'];
  9. if(!isset($_SESSION['number']))
  10. {
  11. $inslipnos=mysql_query("SELECT * FROM slip;");
  12. while($sl=mysql_fetch_array($inslipnos)){
  13. $_SESSION['number'] = $sl['slipno'];
  14. }
  15. }else{
  16. $_SESSION['number'] = $_SESSION['number'] + 1;
  17. $inslipno=mysql_query("UPDATE slip SET slipno='{$_SESSION['number']}';");
  18. }
  19. ?>
  20. <style>
  21. tr,td,th{
  22. border:2px solid black;
  23. }
  24. </style>
  25. <script type="text/javascript">
  26. function printPage(id) {
  27. var printContents = document.getElementById(id).innerHTML;
  28. var originalContents = document.body.innerHTML;
  29. document.body.innerHTML = printContents;
  30. window.print();
  31. }
  32. </script>
  33. <script type="text/javascript">
  34. function val(){
  35. var em_name = document.msd.courseadd.value;
  36. if (em_name == "") {
  37. alert(" Fill Course Name");
  38. em_name.focus;
  39. return false;
  40. }
  41. var dp = document.msd.code.value;
  42. if (dp == "") {
  43. alert("Please fill Course Code");
  44. dp.focus;
  45. return false;
  46. }
  47. }
  48. </script>
  49. <style>
  50. @media print {
  51. #addcourse {
  52. margin: 0;
  53. border: initial;
  54. border-radius: initial;
  55. width: initial;
  56. min-height: initial;
  57. box-shadow: initial;
  58. background: initial;
  59. page-break-after: always;
  60. }
  61. }
  62. </style>
  63. <div style="clear:both;"></div>
  64. <div class="rightpanel" style="clear:both;">
  65. <div class="headerpanel">
  66. <a href="#" class="showmenu"></a>
  67. <div class="headerright">
  68. <div class="dropdown notification">
  69. </div><!--dropdown-->
  70. <div class="dropdown userinfo">
  71. <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">
  72. Welcome <b><?php echo $_SESSION['username']?></b>
  73. <b class="caret"></b></a>
  74. <ul class="dropdown-menu">
  75. <!--<li><a href="editprofile.html"><span class="icon-edit"></span> Edit Profile</a></li>
  76. <li><a href="#"><span class="icon-wrench"></span> Account Settings</a></li>
  77. <li><a href="#"><span class="icon-eye-open"></span> Privacy Settings</a></li>
  78. <li class="divider"></li>-->
  79. <li><a href="sign_out.php"><span class="icon-off"></span> Sign Out</a></li>
  80. </ul>
  81. </div><!--dropdown-->
  82. </div><!--headerright-->
  83. <!-- $pdf_from_file = $client->convertFile('/path/to/your/file.html');
  84. $pdf_from_html = $client->convertHtml('<b>bold</b> and <i>italic</i>'); -->
  85. </div><!--hea 600
  86. derpanel-->
  87. <div class="breadcrumbwidget">
  88. </div><!--breadcrumbs-->
  89. <div class="pagetitle">
  90. <h1 align="center">Payment Slip</h1>
  91. </div><!--pagetitle--><br><br>
  92. <input type="button" value="Print" onclick="printPage('addcourse');" align="right" style="margin-left:50px; width: 6em; height: 2em;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  93. <!-- <a href="mailslip.php?sid=<?php echo $ms;?> " > -->
  94. <a href="hide-show-code.php?ids=<?php echo $ms?>&slno=<?php echo $_SESSION['number'];?>"> Send On Email</a><br><br>
  95. <div style="margin:50px;color:#990000; margin-top:10px" name="addcourse" id="addcourse" >
  96. <center><img src="images2/111.jpg" height="30" width="90" ></center><br><br>
  97. <h2 align="center">Nex-G Payment Slip</h2> <br><br>
  98. <p>Sr. No. <?php echo $_SESSION['number'];?></p><br>
  99. <table class="table table-bordered" style="text-align:center;border:2px solid black;" cellspacing="5" cellpadding="6">
  100. <?php
  101. $ms=$_GET['sl'];
  102. $result=mysql_query("SELECT * FROM trregistration where id='$ms';");
  103. if($result){
  104. if ($result && mysql_num_rows($result)>0) {
  105. while($row=mysql_fetch_array($result)){
  106. $inst=$row['installment'];
  107. $fs=$row['inst_f_submited_fee'];
  108. $ss=$row['inst_s_submited_fee'];
  109. $ts=$row['inst_t_submited_fee'];
  110. $to=$row['email'];
  111. $name=$row['fname']." ".$row['lname'];
  112. $rgs=$row['reg_number'];
  113. $time=$row['fromduration']." To ".$row['toduration'];
  114. $co=$row['trcode'];
  115. $ins1=$row['inst_f_submited_fee']+$row['reg_amount'];
  116. $date1=$row['due_date1'];
  117. $narr1="Trainee Fees First Installment With Registration Fees";
  118. $ins2=$row['inst_s_submited_fee'];
  119. $date2=$row['inst_s_date'];
  120. $narr2=$row['narration_s_inst'];
  121. $ins3=$row['inst_t_submited_fee'];
  122. $date3=$row['inst_t_date'];
  123. $narr3=$row['narration_t_inst'];
  124. $du1=$row['trfees']-$ins1;
  125. $du2=$du1-$ins2;
  126. $du3=$du2-$ins3;
  127. $fee=$row['trfees'];
  128. $registration_date=$row['registration_date'];
  129. $registration_fee=$row['reg_amount'];
  130. $reg_narration="Registration Fees";
  131. //$du=$row['trfees']-$row['reg_amount']-$row['inst_f_submited_fee']-$row['inst_s_submited_fee']-$row['inst_t_submited_fee'];
  132. ?>
  133. <tr ><td >Trainee Name : <?php echo $name; ?></td><td>Registration Number : <?php echo $rgs;?></td></tr>
  134. <tr><td>Course Code : <?php echo $co; ?></td><td>Registration Date : <?php echo $registration_date; ?></td></tr>
  135. </table><br>
  136. <table class="table table-bordered" style="text-align:center;border:2px solid black;">
  137. <tr><td>Course Fees : <?php echo $fee; ?></td><td></td><td></td><td></td></tr>
  138. <tr><td>Date</td><td>Credit</td><td>Due Balance</td><td>Narration</td> </tr>
  139. <?php if($inst =='1'){
  140. if($fs!=''){
  141. ?>
  142. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  143. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du1; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  144. <?php }
  145. else{
  146. ?><tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr> <?php
  147. //echo "No Fees Submitted Yet";
  148. }
  149. }
  150. elseif($inst =='2'){
  151. if($fs !='' && $ss ==''){?>
  152. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  153. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du1; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  154. </table>
  155. <?php }
  156. elseif($fs !='' && $ss !='' ){?>
  157. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  158. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du2; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  159. <tr><td><?php echo $date2 ;?></td> <td><?php echo $ins2 ;?></td> <td><?php echo $du2; ?></td> <td><?php echo $narr2 ;?></td> </tr>
  160. <?php }
  161. elseif($fs =='' && $ss !=''){
  162. ?> <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  163. <tr><td><?php echo $date2 ;?></td> <td><?php echo $ins2 ;?></td> <td><?php echo $du2; ?></td> <td><?php echo $narr2 ;?></td> </tr>
  164. <?php
  165. }
  166. else{
  167. ?><tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr> <?php
  168. //echo "No Fees Submitted Yet";
  169. }
  170. }
  171. else{
  172. if($fs!='' && $ss =='' && $ts =='') {?>
  173. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  174. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du1; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  175. <?php }
  176. elseif( $fs!='' && $ss !='' && $ts == '') {?>
  177. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  178. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du1; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  179. <tr><td><?php echo $date2 ;?></td> <td><?php echo $ins2 ;?></td> <td><?php echo $du2; ?></td> <td><?php echo $narr2 ;?></td> </tr>
  180. <?php }
  181. elseif($fs!='' && $ss !='' && $ts != ''){ ?>
  182. <tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr>
  183. <tr><td><?php echo $date1 ; ?></td> <td><?php echo $ins1 ;?></td> <td><?php echo $du1; ?></td> <td><?php echo $narr1 ;?></td> </tr>
  184. <tr><td><?php echo $date2 ;?></td> <td><?php echo $ins2 ;?></td> <td><?php echo $du2; ?></td> <td><?php echo $narr2 ;?></td> </tr>
  185. <tr><td><?php echo $date3 ;?></td> <td><?php echo $ins3 ;?></td> <td><?php echo $du3; ?></td> <td><?php echo $narr3 ;?></td> </tr>
  186. <?php }
  187. else{
  188. ?><tr><td><?php echo $registration_date ; ?></td> <td><?php echo $registration_fee ;?></td> <td></td> <td><?php echo $reg_narration ;?></td> </tr> <?php
  189. //echo "No Fees submitted yet";
  190. }
  191. }
  192. //Code For Send Slip On email
  193. /* $sub="Nex-G Pay Slip";
  194. $bo=' <h2 style="margin-left:320px;">Nex-G Pay Slip</h2> <br><br>
  195. <table class="table table-bordered" style="text-align:center;" cellspacing="5" cellpadding="6">
  196. <h2 style="margin-left:320px;">Nex-G Pay Slip</h2> <br><br> <table class="table table-bordered" style="text-align:center;" border="1"><tr><td>Trainee Name : '.$name.' </td><td>Registration Number : '.$rgs.'</td></tr>
  197. <tr><td>Course Code : '.$co.' </td><td>Time Duratuion : '.$time.' </td></tr>
  198. </table><br>
  199. <table class="table table-bordered" style="text-align:center;" border="1">
  200. <tr><td>Course Fees : '.$fee.'</td></tr>
  201. <tr><td>Date</td><td>Credit</td><td>Due Balance</td><td>Narration</td> </tr>';
  202. if($inst =='1'){
  203. $bo.='<tr><td> '.$date1.'</td> <td>'.$ins1.'</td> <td><?php echo '.$du1.'</td> <td>'. $narr1.'</td> </tr>';
  204. }
  205. if($inst =='2'){
  206. if($ss ==''){
  207. $bo.='<tr><td>'.$date1.'</td> <td>'.$ins1.'</td> <td>'.$du1.'</td> <td>'.$narr1.'</td> </tr>
  208. </table>';
  209. }
  210. else{
  211. $bo.='<tr><td>'. $date1.' </td> <td> '.$ins1.' </td> <td> '.$du2.'</td> <td>'.$narr1.'</td> </tr>
  212. <tr><td> '.$date2 .'</td> <td>'. $ins2.'</td><td>'.$du2.'</td> <td> '.$narr2.'</td> </tr>';
  213. }
  214. }
  215. if($inst =='3'){
  216. if($ss =='' && $ts =='') {
  217. $bo.='<tr><td> '.$date1.' </td> <td> '.$ins1.' </td> <td> '.$du1.'</td> <td> '.$narr1 .'</td> </tr>';
  218. }
  219. elseif( $ts == '') {
  220. $bo.= '<tr><td> '.$date1.'</td> <td> '.$ins1.'</td> <td>'.$du1.'</td> <td>'.$narr1.' </td> </tr>
  221. <tr><td>'.$date2.' </td> <td> '.$ins2.'</td> <td> '.$du2.'</td> <td> '.$narr2 .'</td> </tr>';
  222. }
  223. else {
  224. $bo.='<tr><td>'.$date1.' </td> <td> '.$ins1 .'</td> <td>'.$du1.'</td> <td> '.$narr1 .'</td> </tr>
  225. <tr><td>'.$date2.'</td> <td> '.$ins2.'</td> <td>'.$du2.'</td> <td> '.$narr2.' </td> </tr>
  226. <tr><td> '.$date3.' </td> <td> '.$ins3.' </td> <td> '.$du3.'</td> <td>'.$narr3.' </td> </tr>';
  227. }
  228. }
  229. $bo.='</table>';
  230. $headerss = 'From: Nex-G<info@nexg.in>' . "\r\n" .
  231. 'Reply-To: info@nexg.in' . "\r\n" .
  232. 'X-Mailer: PHP/' . phpversion();
  233. $headerss.= "MIME-Version: 1.0\r\n";
  234. $headerss.= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  235. $headerss.= "X-Priority: 1\r\n";
  236. //$ms=mail($to,$sub,$bo,$headerss);
  237. */
  238. //.......................end hear
  239. }
  240. ?> </table>
  241. <br><br><br><br><br><br><p style="font-size:16px;margin-left:00px;"> Nex-G Exuberant Solution Pvt. Ltd.</p><br>
  242. <p style="font-size:16px;margin-left:00px;">Accounts</p>
  243. <?php
  244. }
  245. }
  246. else{ echo "error in query pass".mysql_error();}
  247. //mysql_connect("localhost","root","password","db");
  248. ?>
  249. </div>
  250. </div>
  251. <div class="clearfix"></div>
  252. <!--footer-->
  253. </div><!--mainwrapper-->
  254. </body>
  255. </html>