PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/public/css/complete_order.php

https://bitbucket.org/shehan_jay/invoice_mgt
PHP | 218 lines | 170 code | 42 blank | 6 comment | 31 complexity | 49c75fcb1d3899c090be2fa1b10a055c MD5 | raw file
Possible License(s): Unlicense, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause, Apache-2.0
  1. <?php
  2. $id = $this->session->userdata('id');
  3. $this->load->helper('date');
  4. $CI = & get_instance();
  5. $time_diff = $this->session->userdata('sesstimediff');
  6. $nowtime = strtotime(date('Y-m-d H:i:s'));
  7. ?>
  8. <script type="text/javascript">
  9. $('.more-details').hide();
  10. $(".view-all-btn-deals").on("click", function () {
  11. var deal = $(this).attr("data-id");
  12. // alert(deal);
  13. $('#remo'+deal).toggle();
  14. });
  15. $(".table-box.cmenq").one("click", function (event) {
  16. //alert("completeenq");
  17. var orderIds = $(this).attr('id');
  18. // alert(orderIds);
  19. $(this).find(".top-box").removeClass('new-message');
  20. $.post("<?php echo site_url(); ?>read_qus", {ord_id: orderIds,action :'en'},
  21. function (theResponse) {
  22. });
  23. });
  24. function send_msg(id) {
  25. var subject_id = $(id).parent().attr("id");
  26. var order_no = $(id).parent().attr("id");
  27. //alert(order_no);
  28. var user_qus = $('textarea#' + subject_id).val();
  29. $.post("<?php echo site_url(); ?>question_enq", {msg_user: user_qus, order_id: order_no,type:'en'},
  30. function (theResponse) {
  31. if (theResponse == 1) {
  32. $(".loading-sec").hide();
  33. $('#encmp'+ order_no).append('<span class="messanger"> <label><i class="fa fa-user"> </i><small>Me</small><bdi>(Sent on <b> Just now </b>)</bdi></label><p>' + user_qus + '</p></span>');
  34. $('textarea#' + subject_id).val("");
  35. }
  36. else {
  37. }
  38. });
  39. }
  40. $('.pending_').on("click", function () {
  41. $('#loader_lates').hide();
  42. var deal = $(this).attr("itemid");
  43. $.ajax({
  44. url: "<?php echo site_url(); ?>view_user_order_deals",
  45. type: "POST",
  46. data: "order_id=" + deal,
  47. success: function (response) {
  48. $("#pop_up_deal").html(response);
  49. }
  50. });
  51. });
  52. $('.del_cmp_enq').on("click", function () {
  53. $('#deletedads_my_enq').modal('show');
  54. var bt_del_ads = $(this).attr('data-id');
  55. // alert(bt_del_ads);
  56. $("#bt_del_myc_enq").val(bt_del_ads);
  57. });
  58. function del_myc_orde(id) {
  59. $('#deletedads_my_enq').modal('hide');
  60. $('#loader_lates').hide();
  61. $.post("<?php echo site_url(); ?>my_product_status", {'id' : id,'actions': 'DEL_ENQ'},
  62. function (theResponse) {
  63. $("#" + id).remove();
  64. $("#newmsg2").html(theResponse);
  65. $('.alertok').modal('show');
  66. });
  67. }
  68. </script>
  69. <?php
  70. $cen = mt_rand(100000, 999999);
  71. $url = 0;
  72. //echo '<pre>',print_r($cm_products),'</pre>';
  73. if (isset($cm_products) && $cm_products != '') {
  74. if (isset($last_order) && $last_order != null) {
  75. for ($k = $start; $k < $last_order; $k++) {
  76. $pro_user = $this->db_model->get_user_data($cm_products[$k]['u_id']);
  77. $url = "product_status?id=" . $cm_products[$k]['id'];
  78. $cen = mt_rand(100000, 999999);
  79. $encorder_id = $cm_products[$k]['id']+3
  80. ?>
  81. <div class="table-box cmenq" id="en_comp<?php echo $cen;?><?php echo $encorder_id; ?>"> <!-- table box -->
  82. <div class="top-box <?php if($cm_products[$k]['enq_read']==0){?>new-message<?php }?>" >
  83. <div class="expand-deal"> <strong> <a class="pending_" data-target="#view_Model" data-student="en_comp<?php echo $cen;?><?php echo $encorder_id; ?>" itemid="<?php echo $cm_products[$k]['id'];?>" data-toggle="modal"> <?php echo $cm_products[$k]['id']; echo $cm_products[$k]['pname']; ?></a></strong></div>
  84. <div class="expand-deal"> <?php echo date('d/m/Y', strtotime($cm_products[$k]['o_date'])); ?></div>
  85. <div class="expand-deal"> <?php echo date('d/m/Y', strtotime($cm_products[$k]['shipped'])); ?></div>
  86. <div class="expand-deal buttons">
  87. <?php if ($url != '0') { ?>
  88. <button class="btn btn-warning del_cmp_enq" data-id="en_comp<?php echo $cen;?><?php echo $encorder_id; ?>" itemid="<?php echo $cm_products[$k]['pro_ref_no']; ?>"><i class="fa fa-trash-o"></i></button>
  89. <?php } ?>
  90. <button class="btn btn-info view-all-btn-deals" data-id="<?php echo $cen;?><?php echo $encorder_id; ?>"> <i class="fa fa-search-plus"></i>
  91. </div>
  92. </div> <!-- top box -->
  93. <div class="more-details" id="remo<?php echo $cen;?><?php echo $encorder_id; ?>">
  94. <ul>
  95. <li> <label class="col-xs-4">Name</label>
  96. <label class="col-xs-8">:<?php
  97. if ($pro_user[0]['tbc_visible'] == 0) {
  98. $uniq_id = str_replace(' ', "", $pro_user[0]['company_name']) . '.' . $cm_products[$k]['u_id'];
  99. ?>
  100. <a href="<?php echo site_url(); ?>profile/<?php echo $uniq_id; ?> "><?php echo $pro_user[0]['company_name']; ?></a>
  101. <?php
  102. } else {
  103. echo $pro_user[0]['company_name'];
  104. }
  105. ?></label> </li>
  106. <li> <label class="col-xs-4">Price</label>
  107. <label class="col-xs-8">: <?php
  108. $discounted_price=explode('.', $cm_products[$k]['total']);
  109. if($discounted_price[1] != '00'){
  110. $disc_price= $cm_products[$k]['total'];
  111. }else{
  112. $disc_price= floor($cm_products[$k]['total']);
  113. }
  114. echo $currency . ' ' . $disc_price; ?></label> </li>
  115. <?php if ($pro_user[0]['user_tel'] != NULL) { ?>
  116. <li> <label class="col-xs-4">Telephone No </label>
  117. <label class="col-xs-8">: <?php echo $pro_user[0]['user_tel']; ?></label> </li>
  118. <?php } ?>
  119. <?php if ($cm_products[$k]['ask_q'] != null) { ?> <li> <label class="col-xs-4">Ask Question</label>
  120. <label class="col-xs-8">: <?php echo $currency . ' ' . $cm_products[$k]['ask_q']; ?></label> </li><?php } ?>
  121. <div class="body-msg fade in" style="display: block;">
  122. <!-- sender -->
  123. <?php
  124. $msg_list = $CI->db_model->get_question_list($cm_products[$k]['id'], $type = 'en');
  125. foreach ($msg_list as $msg_list) {
  126. ?>
  127. <span <?php if ($msg_list->sent_by == $id) { ?> class="messanger" <?php } else { ?> class="sender" <?php } ?>>
  128. <label>
  129. <i class="fa fa-user"></i>
  130. <small><?php
  131. if ($msg_list->sent_by == $id) {
  132. echo "Me";
  133. } else {
  134. echo $pro_user[0]['company_name'];
  135. }
  136. ?> </small>
  137. <bdi>(Sent on <b>
  138. <?php
  139. $time_diffr = $this->session->userdata('sesstimediff');
  140. $msgtime = strtotime($msg_list->send_time);
  141. echo $newDateTime = $this->db_model->tbc_timecon($msgtime, $time_diff);
  142. ?></b>)</bdi>
  143. </label>
  144. <p><?php echo $msg_list->message_body; ?></p>
  145. </span>
  146. <?php } ?> <!-- sender -->
  147. <div id="encmpenqqus_<?php echo $cen; ?><?php echo $encorder_id; ?>">
  148. </div>
  149. <!-- sender -->
  150. </div>
  151. <form name="send_msg_enq" id="enqqus_<?php echo $cen; ?><?php echo $encorder_id;?>" class="send_msg_enq" method="post">
  152. <span style="display: none;" id="loadingmsg" class="loading-sec">
  153. <div class="loading-message"></div>
  154. </span>
  155. <span class="error-msg err_on_msg" ></span>
  156. <textarea name="msg_qus" id="enqqus_<?php echo $cen; ?><?php echo $encorder_id;?>" class="form-control" value=""> </textarea>
  157. <button id="replyb" type="button" class="btn btn-sm pull-left primary" onclick="send_msg(this);">Reply</button>
  158. </form>
  159. </ul>
  160. </div>
  161. </div>
  162. <?php
  163. }
  164. }
  165. } else {
  166. $loader = 1;
  167. ?>
  168. <span class="no-search-results"> <i class="fa fa-exclamation-circle"></i> <h6>Sorry, No complete orders yet.</h6> </span>
  169. <?php
  170. }
  171. if ($loader == 0) {
  172. ?>
  173. <div class="load-more" id="loadmo_order_cmp<?php echo $last_order; ?>"><div class="top-box">
  174. <button type="button" class="load_all" onclick="get_load_order_cmp(<?php echo $last_order; ?>);">
  175. View more Complete Enquires</button></div></div>
  176. <?php } ?>