Advertisement
fazeela

foem

Mar 23rd, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.84 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4. session_start();
  5. $url='http://192.168.2.21:8080/WisManOnlineCenter_1.0/services/trial/getOrganizationHierarchy';
  6.         $ch=curl_init();
  7.         curl_setopt($ch, CURLOPT_URL, $url);
  8.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9.         curl_setopt($ch, CURLOPT_POST, true);
  10.         curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($useridofuser));
  11.         curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  12.         $response=  curl_exec($ch);
  13.        // echo('\n'."Server response : \n \n".$response);
  14.         curl_close($ch);
  15.         //parsing the json response from server
  16.         $jsonde="$response";
  17.         $_SESSION['json']=$jsonde;
  18. $org = array();
  19. $loc = array();
  20. $bui = array();
  21. $items = json_decode($response);
  22. foreach( $items as $each ){
  23. $loc[]=$each->location[0]->name;
  24. $bui[]=$each->location[0]->building[0];
  25. $org[]=$each->name;
  26. }
  27. ?>
  28.  
  29. <html>
  30. <head>
  31. <title>Login Form</title>
  32. <script>function run() {
  33.     document.getElementById("srt").value = document.getElementById("Ultra").value;
  34. }
  35.  
  36. function up() {
  37.  
  38.     //if (document.getElementById("srt").value != "") {
  39.         var dop = document.getElementById("srt").value;
  40.     //}
  41.     pop(dop);
  42.  
  43. }
  44.  
  45. function pop(val) {
  46.     alert(val);
  47. }
  48.  
  49. </script>
  50. </head>
  51. <body><center>
  52.         <div style="margin-top:10px">  
  53.         <h3>ADD OPERATOR</h3>
  54.         </div>
  55.             <form method="post" action="addoperator.php" >
  56.              <table border="0" >
  57.              <tr><td>Username</td>
  58.               <td><input type="text" name="userid"></td></tr>
  59.                     <tr><td>Password</td>
  60.                         <td><input name="password" type="password"></td></tr>
  61.                     <tr><td>Confirm Password</td>
  62.                         <td><input name="password1" type="password"></td></tr>
  63.                     <tr><td>Email</td>
  64.                         <td><input name="email" type="email"></td></tr>
  65.                     <tr><td>Organisation Name</td>
  66.                         <td>
  67.                         <select style="width: 155px" name="category_id">
  68.                         <option value="">Select</option>
  69.                         <?php foreach($org as $key=>$val){?>
  70.                         <option value="<?php echo $key; ?>"><?php echo $val;?></option>
  71. <?php
  72. }
  73. ?>                      </select></td></tr>
  74.                     <tr><td>Location</td>
  75.                         <td>
  76.                          <select style="width: 155px" name="category_id1">
  77.                          <option value="">Select</option>
  78.                          <?php foreach($loc as $key=>$val){?>
  79.                          <option value="<?php //echo $key; ?>"><?php echo $val; ?></option>
  80. <?php
  81. }
  82. ?>
  83.                          </select></td></tr>
  84.                     <tr><td>Building</td>
  85.                         <td>
  86.                         <select style="width: 155px" name="category_id2">
  87.                         <option value="">Select</option>
  88.                         <?php foreach($bui as $key=>$val){?>
  89.                         <option value="<?php //echo $key; ?>"><?php echo $val; ?></option>
  90. <?php
  91. }
  92. ?>
  93.                         </select></td></tr>
  94.                     <tr><td>Department</td>
  95.                         <td><input name="department" type="text"></td></tr>
  96. <?php
  97. $oneYearOn = date('Y-m-d',strtotime(date("Y-m-d", mktime()) . " + 7300 day"));
  98. //echo $oneYearOn;
  99. $oneYearOn1=date('Y-m-d',strtotime(date("Y-m-d", mktime()) . " + 40day"));
  100. //echo $oneYearOn1;
  101. ?>
  102.   <tr><td>Sub Category</td>
  103.   <td>
  104.       <select style="width:155px" name="subcategory" id="Ultra" onchange="run()">  <!--Call run() function-->
  105.      <option value="0">Select</option>
  106.      <option value="<?=$oneYearOn?>">Employee</option>
  107.      <option value="<?=$oneYearOn1?>">Temporary</option>
  108. </select>  
  109.   </td>
  110.   </tr> <tr><td>First Name</td>
  111.                         <td><input name="firstname" type="text"></td></tr>
  112.                     <tr><td>Last Name</td>
  113.                         <td><input name="lastname" type="text"></td></tr>
  114.                     <tr><td>Land Phone</td>
  115.                         <td><input name="landphone" type="number"></td></tr>
  116.                     <tr><td>Mobile</td>
  117.                         <td><input name="mobile" type="number"></td></tr>
  118.                     <tr><td>Expiry date</td>
  119.                         <td><input name="expirydate" type="text" id="srt" placeholder="get value on option select"><br></td></tr>
  120.                     <tr><td>Opcode</td>
  121.                         <td><input name="opcode" type="text"></td></tr>
  122.                     <tr><td>Image</label></td>
  123.                           <td><input type="file" name="image"></td></tr>
  124.                    
  125.                     <tr><td><input type="submit" value="Submit"/></td></tr>
  126.                 </table>
  127.             </form>
  128.         </center>
  129. </body>
  130. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement