Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start(); // NEVER forget this!
- $con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error());
- mysql_select_db("webauth", $con);
- $myusername = $_SESSION['myusername'];
- //$result = mysql_query("SELECT * FROM user_pwd");
- $sql5 = "SELECT dept from `user_pwd` WHERE name = '$myusername'";
- $result5=mysql_query($sql5, $con);
- $row5=mysql_fetch_assoc($result5);
- // echo "<br />";
- $url3 = 'http://localhost:1090/WebEmpLoad.hal';
- $myvars3 = 'department='.$row5['dept'];
- mysql_close($con);
- $ch3 = curl_init( $url3 );
- curl_setopt( $ch3, CURLOPT_POST, 1);
- curl_setopt( $ch3, CURLOPT_POSTFIELDS, $myvars3);
- curl_setopt( $ch3, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt( $ch3, CURLOPT_HEADER, 0);
- curl_setopt( $ch3, CURLOPT_RETURNTRANSFER, 1);
- $response3 = curl_exec( $ch3 );
- //echo $response3;
- $arr = (explode(',',$response3,100));
- print_r(explode(',',$response3,-1));
- $Num = sizeof($arr);
- $rows = ($Num - 1)/2;
- echo $rows;
- echo "<table>";
- $col = "left";
- ?>
- <table align="center" id="dataTable">
- <tr class="header">
- <td />
- <td class="text ce6">Emp code</td>
- <td class="text ce6">Name</td>
- <td class="text ce6">Department codes</td>
- <td class="text ce7">1</td>
- <td class="text ce7">2</td>
- <td class="text ce7">3</td>
- <td class="text ce7">4</td>
- <td class="text ce7">5</td>
- <td class="text ce7">6</td>
- <td class="text ce7">7</td>
- <td class="text ce7">8</td>
- <td class="text ce7">9</td>
- <td class="text ce7">10</td>
- <td class="text ce7">11</td>
- <td class="text ce7">12</td>
- <td class="text ce7">13</td>
- <td class="text ce7">14</td>
- <td class="text ce7">15</td>
- <td class="text ce7">16</td>
- <td class="text ce7">17</td>
- <td class="text ce7">18</td>
- <td class="text ce7">19</td>
- <td class="text ce7">20</td>
- <td class="text ce7">21</td>
- <td class="text ce7">22</td>
- <td class="text ce7">23</td>
- <td class="text ce7">24</td>
- <td class="text ce7">25</td>
- <td class="text ce7">26</td>
- <td class="text ce7">27</td>
- <td class="text ce7">28</td>
- <td class="text ce7">29</td>
- <td class="text ce7">30</td>
- <td class="text ce7">31</td>
- </tr>
- <tbody>
- <tr>
- <TD><INPUT type="checkbox" name="chk"/></TD>
- <?php
- if (is_array($arr)) {
- foreach($arr as $arr){
- if($col == "left"){
- echo "<tr><td>$arr</td>";
- $col = "right";
- }else{
- echo "<td>$arr</td></tr>";
- $col = "left";
- }
- }
- }
- echo "</table>";
- ?>
- <td class="text ce2"><INPUT type="text" name="code" size = "12" value="<?php
- echo $arr;
- ?>"/></td>
- <td class="text ce2"><INPUT type="text" name="name" size = "60" value="<?php
- echo $arr;
- ?>"/></td>
- </tr>
Advertisement
Add Comment
Please, Sign In to add comment