/software/take_company_details/department.php

https://bitbucket.org/devenbhooshan/paysewa · PHP · 135 lines · 103 code · 32 blank · 0 comment · 15 complexity · d081f7a75812f1eef66172c73dcb628f MD5 · raw file

  1. <?php
  2. include("../dbinfo.php");
  3. $clientid;
  4. $name;
  5. $sName;
  6. $startDate;
  7. $no=0;
  8. $flag_for_checking=false;
  9. if(array_key_exists('id',$_GET)&& $_GET['id']!=0){
  10. $clientid=$_GET['id'];
  11. $query_for_cheching_status=mysql_query("select deptYN from clientdetails where id='$clientid'");
  12. $row_for_status=mysql_fetch_array($query_for_cheching_status);
  13. $status=$row_for_status['deptYN'];
  14. if($status==1){
  15. $mysql_query=mysql_query("select * from cdeptmaster where clientId='$clientid' order by id desc");
  16. if(mysql_num_rows($mysql_query)>0){
  17. $flag_for_checking=true;
  18. $POST=mysql_fetch_array($mysql_query);
  19. $name=$POST['name'];
  20. $sName=$POST['sName'];
  21. $startDate=$POST['startDate'];
  22. }
  23. ?>
  24. <form class="form-horizontal" action="javascript:adddepartmentdetails()" id='adddepartmentdetails' >
  25. <fieldset>
  26. <table>
  27. <tbody>
  28. <tr>
  29. <td>
  30. <div class="control-group">
  31. <label class="control-label" for="inputName">Name</label>
  32. <div class="controls">
  33. <input type="text" id="inputName" placeholder="Name" name="name0" value="<?php if($flag_for_checking) echo $name?>">
  34. </div>
  35. </div>
  36. </td>
  37. <td>
  38. <div class="control-group">
  39. <label class="control-label" for="inputsName">Short Name</label>
  40. <div class="controls">
  41. <input type="text" id="inputsName" placeholder="Short Name" name="sname0" value="<?php if($flag_for_checking) echo $sName?>">
  42. </div>
  43. </div>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td>
  48. <div class="control-group">
  49. <label class="control-label" for="inputSD">Start Date</label>
  50. <div class="controls">
  51. <input type="text" id="inputSD" placeholder="Start Date" name="startDate0" value="<?php if($flag_for_checking) echo $startDate?>">
  52. </div>
  53. </div>
  54. </td>
  55. </tr>
  56. <div id="more_department">
  57. <?php
  58. include("../dbinfo.php");
  59. include("../editable_forms/department.php");
  60. if(array_key_exists('id',$_GET) && $_GET['id']!=0){
  61. $clientid1=$_GET['id'];
  62. $noofrows=(mysql_query("select id from cdeptmaster where clientId='$clientid1' order by id desc"));
  63. $flag=1;
  64. if(mysql_num_rows($noofrows)>0){
  65. $row_for_id=mysql_fetch_array($noofrows);
  66. while($row_for_id=mysql_fetch_array($noofrows)){
  67. showform($row_for_id['id'],$flag);
  68. $flag++;
  69. }
  70. }
  71. }
  72. ?>
  73. </div>
  74. <tr>
  75. <td>
  76. </td>
  77. <td>
  78. </td>
  79. <td>
  80. <div class="control-group">
  81. <div class="controls">
  82. <label class="control-group">
  83. <a href="javascript:addmoredepartment()">+ Add more departments</a>
  84. <button type="submit" class="btn">Submit Details</button>
  85. </label>
  86. </div>
  87. </div>
  88. </td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. </fieldset>
  93. </form>
  94. <?php
  95. }
  96. else {
  97. echo "Department Not Applicable for this company.<br> See General Details for more information.";
  98. }
  99. }
  100. else if(array_key_exists('id',$_GET) && $_GET['id']==0) {
  101. echo "Fill General Details First.";
  102. }
  103. ?>