Guest User

paidstatus

a guest
Jan 4th, 2017
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. include 'home.php';
  4. $stmt = $user_home->runQuery("SELECT * FROM tbl_users");
  5. $stmt->execute(array(":uid" => $_SESSION['userSession']));
  6. $row = $stmt->fetch(PDO::FETCH_ASSOC);
  7. $stmt->execute();
  8. ?>
  9.  
  10. <style type="text/css">
  11. .paymentstatus{width:70%;margin: auto!important;}
  12. .inputpayment{/*width: 20%;clear:both;*/}
  13. </style>
  14.  
  15. <div class="paymentstatus">
  16. <form class="form-signin" method="post" enctype='multipart/form-data' action="update_paidstatus.php" id="" onsubmit="return validate(); ">
  17. <h2 class="form-signin-heading">Designer Payment Status</h2>
  18.  
  19. <table>
  20. <tr><td> Designer </td><td>
  21.  
  22. <select onchange="getOrderDetail(event);" name="designer_id" id="designer_id" >
  23. <option value="">Select Designer</option>
  24. <?php
  25. while($data = $stmt->fetch())
  26. {
  27. if($data['type']=="admin")continue;
  28. ?>
  29. <option value="<?php echo $data['userID'];?>">
  30. <?php
  31. echo $data['name'];
  32. ?>
  33. </option>
  34. <?php } ?>
  35. </select>
  36.  
  37. </td><td><p id="error_para1" ></p></td></tr>
  38.  
  39.  
  40. <tr><td>Order Number: </td><td>
  41.  
  42.  
  43. <div id="ordernumbers">
  44. <select name="designerorder_id" id="designerorder_id" class="designerorder_id" onchange='getProductDetail(this.value)'>
  45. <option value="">Select Order</option>
  46. </select>
  47. </div>
  48.  
  49. </td><td><p id="error_para2" ></p></td></tr>
  50.  
  51.  
  52.  
  53.  
  54. <tr><td>Product</td><td>
  55.  
  56.  
  57. <div id="productnumbers" name="dproduct_id" id="dproduct_id" >
  58. <select id="mySelect" >
  59. <option>Select Products</option>
  60. </select>
  61.  
  62. </div>
  63.  
  64.  
  65. </td><td><p id="error_para3" ></p></td> </tr>
  66.  
  67.  
  68.  
  69.  
  70.  
  71. <tr><td> Payment DueDate:</td> <td>
  72.  
  73. <input type="text" class="inputpayment" id="datepicker" placeholder="Duedate" id= "Duedate" name="dueDate" value="" />
  74.  
  75. </td><td><p id="error_para6" ></p></td></tr>
  76.  
  77.  
  78. </table>
  79.  
  80. <hr/>
  81.  
  82. <input type="hidden" name="dproduct_id" id="dproduct_id" value=""/>
  83.  
  84. <input class="btn btn-large btn-primary" name="btn-signup" type="submit" id="btnSubmit" value="Submit" />
  85. <input type="reset" class="btn btn-large btn-primary" id='button_reset' formnovalidate="formnovalidate" value="RESET"/>
  86.  
  87. </form>
  88. </div>
  89.  
  90. <link rel="stylesheet" href="http://sbdev2.kidsdial.com:81/php/site6/bootstrap/css/jquery-ui.css">
  91. <script src="http://sbdev2.kidsdial.com:81/php/site6/bootstrap/js/outthinking/jquery-ui.js"></script>
  92. <link href="http://sbdev2.kidsdial.com:81/php/site6/bootstrap/css/fSelect.css" rel="stylesheet">
  93. <script src="http://sbdev2.kidsdial.com:81/php/site6/bootstrap/js/outthinking/fSelect.js"></script>
  94.  
  95. <script type="text/javascript">
  96. function validate()
  97. {
  98. document.getElementById( "error_para1" ).innerHTML = "";
  99. document.getElementById( "error_para2" ).innerHTML = "";
  100. document.getElementById( "error_para3" ).innerHTML = "";
  101. document.getElementById( "error_para6" ).innerHTML = "";
  102. var error="";
  103.  
  104. var designer_id = document.getElementById( "designer_id" );
  105. if( designer_id.value == "" )
  106. {
  107. error = " Please Select Designer";
  108. document.getElementById( "error_para1" ).innerHTML = error;
  109. return false;
  110. }
  111.  
  112.  
  113.  
  114. var error="";
  115. var designerorder_id = document.getElementById( "designerorder_id" );
  116.  
  117. if( designerorder_id.value == "" )
  118. {
  119. error = " Please Select Order";
  120. document.getElementById( "error_para2" ).innerHTML = error;
  121. return false;
  122. }
  123.  
  124.  
  125. var error="";
  126. /*
  127. var dproduct_id = document.getElementById( "dproduct_id" );
  128.  
  129. if( dproduct_id.value == "" )
  130. {
  131. error = " Please Select Product";
  132. document.getElementById( "error_para3" ).innerHTML = error;
  133. return false;
  134. }
  135. */
  136.  
  137. var options = $('#dproduct_ids > option:selected');
  138. if(options.length == 0){
  139.  
  140. error = " Please Select Product";
  141. document.getElementById( "error_para3" ).innerHTML = error;
  142. return false;
  143. }
  144.  
  145. var error="";
  146. var Duedate = document.getElementById( "datepicker" );
  147. if(Duedate.value == "" )
  148. {
  149. error = " Please Select Date";
  150. document.getElementById( "error_para6" ).innerHTML = error;
  151. return false;
  152. }
  153. else
  154. {
  155. return true;
  156. }
  157.  
  158. }
  159.  
  160. $(document).ready(
  161.  
  162. /* This is the function that will get executed a
  163. fter the DOM is fully loaded */
  164. function () {
  165. $( "#datepicker" ).datepicker({
  166. changeMonth: true,//this option for allowing user to select month
  167. changeYear: true //this option for allowing user to select from year range
  168. });
  169. }
  170.  
  171. );
  172. function getOrderDetail(e)
  173. {
  174. var designerId=e.target.options[e.target.selectedIndex].value;
  175. var url="http://sbdev2.kidsdial.com:81/php/site6/designerpaidstatus.php?designer_id="+designerId+"&opration=2";
  176. var request = jQuery.ajax( {
  177. url: url ,
  178. type: 'POST',
  179. } );
  180.  
  181. request.done( function (result)
  182. {
  183. //document.getElementById('ordernumbers').innerHTML =result;
  184. $(".designerorder_id").html(result);
  185.  
  186. } );
  187. request.fail( function ( error )
  188. {
  189. console.dir(error);
  190. } );
  191. }
  192. function getProductDetail(e)
  193. {
  194. var productId = $(".designerorder_id option:selected").attr("class"); //$('option:selected', this).attr('class');
  195.  
  196. var finalstrig=productId.split(",");
  197.  
  198. var select='';
  199. select+='<select class="test" multiple="multiple" name="dproduct_ids" id="dproduct_ids">';
  200.  
  201. for(i=0;i<finalstrig.length;i++)
  202. {
  203. if(finalstrig[i]!=0)
  204. {
  205. select +='<option value="'+finalstrig[i]+'">'+finalstrig[i]+'</option>';
  206. }
  207. }
  208. select +='</select>';
  209. document.getElementById('productnumbers').innerHTML =select;
  210. (function($) {
  211. $(function() {
  212. $('.test').fSelect();
  213. });
  214. })(jQuery);
  215.  
  216. }
  217.  
  218. $(function(){
  219. $("#button_reset").click(function() {
  220. $("#productnumbers").html('<select id="mySelect"><option>Select Products</option></select>');
  221. });
  222. });
  223.  
  224. function selectValidate() {
  225. var check = false;
  226. $.each($('select'), function(index, data) {
  227. if (data.val() !== ''){
  228. check = true;
  229. }
  230. });
  231. return check;
  232. }
  233.  
  234.  
  235.  
  236. </script>
RAW Paste Data Copied