/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
- <?php
- include("../dbinfo.php");
- $clientid;
- $name;
- $sName;
- $startDate;
- $no=0;
- $flag_for_checking=false;
- if(array_key_exists('id',$_GET)&& $_GET['id']!=0){
- $clientid=$_GET['id'];
- $query_for_cheching_status=mysql_query("select deptYN from clientdetails where id='$clientid'");
- $row_for_status=mysql_fetch_array($query_for_cheching_status);
- $status=$row_for_status['deptYN'];
- if($status==1){
- $mysql_query=mysql_query("select * from cdeptmaster where clientId='$clientid' order by id desc");
- if(mysql_num_rows($mysql_query)>0){
- $flag_for_checking=true;
- $POST=mysql_fetch_array($mysql_query);
- $name=$POST['name'];
- $sName=$POST['sName'];
- $startDate=$POST['startDate'];
- }
- ?>
- <form class="form-horizontal" action="javascript:adddepartmentdetails()" id='adddepartmentdetails' >
- <fieldset>
- <table>
- <tbody>
- <tr>
- <td>
- <div class="control-group">
- <label class="control-label" for="inputName">Name</label>
- <div class="controls">
- <input type="text" id="inputName" placeholder="Name" name="name0" value="<?php if($flag_for_checking) echo $name?>">
- </div>
- </div>
- </td>
-
-
- <td>
- <div class="control-group">
- <label class="control-label" for="inputsName">Short Name</label>
- <div class="controls">
- <input type="text" id="inputsName" placeholder="Short Name" name="sname0" value="<?php if($flag_for_checking) echo $sName?>">
- </div>
- </div>
- </td>
-
- </tr>
- <tr>
-
- <td>
- <div class="control-group">
- <label class="control-label" for="inputSD">Start Date</label>
- <div class="controls">
- <input type="text" id="inputSD" placeholder="Start Date" name="startDate0" value="<?php if($flag_for_checking) echo $startDate?>">
- </div>
- </div>
- </td>
- </tr>
-
- <div id="more_department">
- <?php
- include("../dbinfo.php");
- include("../editable_forms/department.php");
- if(array_key_exists('id',$_GET) && $_GET['id']!=0){
- $clientid1=$_GET['id'];
- $noofrows=(mysql_query("select id from cdeptmaster where clientId='$clientid1' order by id desc"));
- $flag=1;
- if(mysql_num_rows($noofrows)>0){
- $row_for_id=mysql_fetch_array($noofrows);
- while($row_for_id=mysql_fetch_array($noofrows)){
- showform($row_for_id['id'],$flag);
- $flag++;
-
- }
-
- }
- }
- ?>
-
-
- </div>
- <tr>
- <td>
- </td>
- <td>
- </td>
-
- <td>
- <div class="control-group">
- <div class="controls">
- <label class="control-group">
- <a href="javascript:addmoredepartment()">+ Add more departments</a>
- <button type="submit" class="btn">Submit Details</button>
- </label>
- </div>
- </div>
-
- </td>
-
- </tr>
- </tbody>
- </table>
- </fieldset>
- </form>
- <?php
- }
- else {
- echo "Department Not Applicable for this company.<br> See General Details for more information.";
-
-
- }
- }
- else if(array_key_exists('id',$_GET) && $_GET['id']==0) {
- echo "Fill General Details First.";
-
-
- }
- ?>