data - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.

Press F11 to switch to fullscreen mode


Your result can be seen below.

Result of php executing





Full code of data.php

  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.   <title>1st Step:Incoming Lead Detail</title>
  6.   <meta charset="UTF-8" />
  7.   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  8.   <link rel="stylesheet" href="css/bootstrap.min.css" />
  9.   <link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
  10.   <link rel="stylesheet" href="css/datepicker.css" />
  11.   <link rel="stylesheet" href="css/unicorn.main.css" />
  12.   <link rel="stylesheet" href="css/select2.css" />
  13.   <!--<link rel="stylesheet" href="css/unicorn.grey.css" class="skin-color" /> -->
  14.  
  15. </head>
  16.  
  17. <body>
  18.  
  19.   <div class="span20" id="uscontent">
  20.     <div class="widget-box">
  21.       <div class="widget-title">
  22.         <span class="icon">
  23.                                 <class="icon-th-list"></i>
  24.                                 </span>
  25.         <h5>Create New Lead</h5>
  26.       </div>
  27.       <div class="widget-content">
  28.         <form id='form_add_member' name='form_add_member'>
  29.           <table>
  30.             <tr id="hidethis">
  31.  
  32.               <td>
  33.                 <label class="control-label">Country*</label>
  34.               </td>
  35.               <td style="padding: 8px;">
  36.                 <div class="controls">
  37.  
  38.                   <select name="country" id="country" width="200" style="width: 200px">
  39.                   </select>
  40.                 </div>
  41.               </td>
  42.  
  43.             </tr>
  44.             <tr>
  45.  
  46.               <td>
  47.                 <label class="control-label">Contact*</label>
  48.               </td>
  49.  
  50.               <td style="padding: 8px;">
  51.                 <div class="controls">
  52.                   <input type="text" id="phone" name="phone" required="required" onchange="getMember();" />
  53.                 </div>
  54.               </td>
  55.               <td style="padding: 8px;">
  56.                 <div class="controls">
  57.                   <input type="hidden" name="code" width="100" id="code" style="width:100px" />
  58.  
  59.                 </div>
  60.               </td>
  61.  
  62.             </tr>
  63.  
  64.             <tr>
  65.               <td>
  66.                 <label class="control-label">Donor First Name*</label>
  67.               </td>
  68.               <td style="padding: 8px;">
  69.                 <div class="controls">
  70.                   <input type="text" id="fname" name="fname" required="required" />
  71.                 </div>
  72.               </td>
  73.  
  74.               <td>
  75.                 <label class="control-label">Middle Name</label>
  76.               </td>
  77.               <td style="padding: 8px;">
  78.                 <div class="controls">
  79.                   <input type="text" id="mname" name="mname" />
  80.                 </div>
  81.               </td>
  82.  
  83.               <td>
  84.                 <label class="control-label">Last Name</label>
  85.               </td>
  86.               <td style="padding: 8px;">
  87.                 <div class="controls">
  88.                   <input type="text" id="lname" name="lname" />
  89.                 </div>
  90.               </td>
  91.  
  92.             </tr>
  93.             <tr>
  94.  
  95.               <td>
  96.                 <label class="control-label">PostCode*</label>
  97.               </td>
  98.               <td style="padding: 8px;">
  99.                 <div class="controls">
  100.                   <input type="text" id="PostCode" name="PostCode" required="required" />
  101.                 </div>
  102.               </td>
  103.               <td>
  104.                 <label class="control-label">City*</label>
  105.               </td>
  106.               <td style="padding: 8px;">
  107.                 <div class="controls">
  108.                   <input type="text" id="City" name="City" required="required" />
  109.                 </div>
  110.               </td>
  111.             </tr>
  112.             <tr>
  113.  
  114.               <td>
  115.                 <label class="control-label">House No*</label>
  116.               </td>
  117.               <td style="padding: 8px;">
  118.                 <div class="controls">
  119.                   <input type="text" id="House_No" name="House_No" required="required" />
  120.                 </div>
  121.               </td>
  122.  
  123.               <td>
  124.                 <label class="control-label">House Name*</label>
  125.               </td>
  126.               <td style="padding: 8px;">
  127.                 <div class="controls">
  128.                   <input type="text" id="House_Name" name="House_Name" required="required" />
  129.                 </div>
  130.               </td>
  131.             </tr>
  132.             <tr>
  133.               <td>
  134.                 <label class="control-label">Adress Line 1*</label>
  135.               </td>
  136.               <td style="padding: 8px;">
  137.                 <div class="controls">
  138.                   <input type="text" id="Adress_Line1" name="Adress_Line1" required="required" />
  139.                 </div>
  140.               </td>
  141.               <td>
  142.                 <label class="control-label">Adress Line 2</label>
  143.               </td>
  144.               <td style="padding: 8px;">
  145.                 <div class="controls">
  146.                   <input type="text" id="Adress_Line2" name="Adress_Line2" />
  147.                 </div>
  148.               </td>
  149.               <td style="padding: 8px;">
  150.                 <div class="controls">
  151.                   <input type="hidden" id="address" name="address" />
  152.                 </div>
  153.               </td>
  154.  
  155.             </tr>
  156.  
  157.             <tr>
  158.               <td>
  159.                 <label class="control-label">Donor Email</label>
  160.               </td>
  161.               <td valign="top" style="padding: 8px;">
  162.                 <div class="controls">
  163.                   <input type="text" id="email" name="email" />
  164.                 </div>
  165.               </td>
  166.  
  167.               <td>
  168.                 <label class="control-label">Alternate Number</label>
  169.               </td>
  170.               <td valign="top" style="padding: 8px;">
  171.                 <div class="controls">
  172.                   <input type="text" name="phonealt" width="100%" id="phonealt" style="width:200px" />
  173.  
  174.                 </div>
  175.             </tr>
  176.  
  177.             <tr>
  178.               </td>
  179.               <td>
  180.                 <label class="control-label">Sewa Type*</label>
  181.               </td>
  182.               <td style="padding: 8px;">
  183.                 <div class="controls">
  184.                   <select name="type_sewa" id="type_sewa" required="required" width="200" style="width: 200px">
  185.                     <option>Select</option>
  186.                     <option value="CS">Child Sponsorship</option>
  187.                     <option value="RS">Room Sewa</option>
  188.                     <option value="O">Others</option>
  189.                     <option value="CSR">Child Sponsorship Recurring</option>
  190.                     <option value="RSR">RoomSewa Recurring</option>
  191.                     <option value="OR">Others-Recurring</option>
  192.                     <option value="TAT">TAT</option>
  193.                     <option value="TATR">TAT Recurring</option>
  194.                   </select>
  195.                 </div>
  196.               </td>
  197.               <td>
  198.                 <label class="control-label">Reference*</label>
  199.               </td>
  200.               <td style="padding: 8px;">
  201.                 <div class="controls">
  202.                   <select name="reference" id="reference" required="required" width="200" style="width: 200px">
  203.                     <option></option>
  204.                     <option value="Social Media">Social Media</option>
  205.                     <option value="Direct Contact">Direct Contact</option>
  206.                     <option value="BaruSahib Visit">Baru Sahib Visit</option>
  207.                     <option value="Guru Ki Kashi Visit">Guru Ki Kashi Visit</option>
  208.                   </select>
  209.                 </div>
  210.               </td>
  211.  
  212.             </tr>
  213.             <tr>
  214.  
  215.               <td>
  216.                 <label class="control-label">Gift Declaration Signed*</label>
  217.               </td>
  218.               <td style="padding: 8px;">
  219.                 <div class="controls">
  220.                   <select name="Gift_Declaration_Signed" id="Gift_Declaration_Signed" required="required" width="200" style="width: 200px">
  221.  
  222.                     <option value="Yes">Yes</option>
  223.                     <option value="No">No</option>
  224.  
  225.                   </select>
  226.                 </div>
  227.               </td>
  228.               <td>
  229.                 <label class="control-label">Bank Reference</label>
  230.               </td>
  231.  
  232.               <td style="padding: 8px;">
  233.                 <div class="controls">
  234.                   <select name="Bank_Reference" id="Bank_Reference" required="required" width="200" style="width: 200px">
  235.                     <option>Select</option>
  236.                     <option value="ETSAccount">ETSAccount</option>
  237.                     <option value="General">General</option>
  238.  
  239.                   </select>
  240.                 </div>
  241.               </td>
  242.  
  243.               <td>
  244.                 <label class="control-label">BankDetails</label>
  245.               </td>
  246.               <td style="padding: 8px;">
  247.                 <div class="controls">
  248.                   <input type="text" id="BankDetails" name="BankDetails" />
  249.                 </div>
  250.               </td>
  251.             </tr>
  252.           </table>
  253.           <table>
  254.             <tr>
  255.               <td>
  256.                 <label class="control-label">Donor CallerName</label>
  257.               </td>
  258.               <td style="padding: 8px;">
  259.                 <div class="controls">
  260.                   <select name="cname" id="cname" width="200" style="width: 200px">
  261.  
  262.                   </select>
  263.                 </div>
  264.               </td>
  265.               <td>
  266.                 <label class="control-label">Call Date</label>
  267.               </td>
  268.               <td style="padding: 8px;">
  269.                 <div class="controls">
  270.                   <input type="date" data-date-format="yyyy-mm-dd" name="caller_date" id="caller_date" />
  271.                 </div>
  272.               </td>
  273.           </table>
  274.           <table>
  275.             </tr>
  276.             <tr>
  277.               <td>
  278.                 <label class="control-label">Caller Details</label>
  279.               </td>
  280.               <td style="padding: 8px;">
  281.                 <div class="controls">
  282.                   <div class="controls">
  283.                     <textarea name="address1" id="address1"></textarea>
  284.                   </div>
  285.               </td>
  286.  
  287.               <td>
  288.                 <label class="control-label">Special Remarks</label>
  289.               </td>
  290.               <td style="padding: 8px;">
  291.                 <div class="controls">
  292.                   <div class="controls">
  293.                     <textarea name="address2" id="address2"></textarea>
  294.                   </div>
  295.               </td>
  296.  
  297.             </tr>
  298.           </table>
  299.           <table>
  300.             <td>
  301.               <label id="lbl_rec_flag" class="control-label"> Recurring Payment:</label>
  302.             </td>
  303.             <td style="padding: 8px;">
  304.               <div class="controls">
  305.                 <input type="text" name="recurring_flag" id="recurring_flag" readonly />
  306.               </div>
  307.             </td>
  308.             <td>
  309.               <label id="lbl_Frequency" class="control-label">Frequency</label>
  310.             </td>
  311.             <td style="padding: 8px;">
  312.               <div class="controls">
  313.                 <input type="text" name="Frequency" id="Frequency" readonly />
  314.               </div>
  315.             </td>
  316.           </table>
  317.           <table>
  318.             <tr>
  319.               <td>
  320.                 <label id="lbl_jd5" class="control-label">Due Date</label>
  321.               </td>
  322.               <td style="padding: 8px;">
  323.                 <div class="controls">
  324.                   <input type="text" data-date-format="yyyy-mm-dd" class="datepicker" name="duedate" id="duedate" />
  325.                 </div>
  326.               </td>
  327.  
  328.             </tr>
  329.             <tr style="width: 100px" ;>
  330.               <td>
  331.                 <label class="control-label">Followup Reqd</label>
  332.               </td>
  333.               <td align="left">
  334.                 <INPUT TYPE="radio" NAME="Followup" VALUE="Yes" CHECKED id="self" onClick="validateDays();" />Yes</td>
  335.               <td>
  336.                 <INPUT TYPE="radio" NAME="Followup" VALUE="No" id="gender" onClick="validateDays();">No</td>
  337.               <tr>
  338.                 <td>
  339.                   <label id="lbl_jd3" class="control-label">Followup Date</label>
  340.                 </td>
  341.                 <td style="padding: 8px;">
  342.                   <div class="controls">
  343.                     <input type="date" data-date-format="yyyy-mm-dd" name="foll_date" id="foll_date" />
  344.                   </div>
  345.                 </td>
  346.  
  347.                 <td style="padding: 8px;">
  348.                   <div class="controls">
  349.                     <div class="controls">
  350.                       <textarea name="address3" id="address3"></textarea>
  351.                     </div>
  352.                 </td>
  353.  
  354.                 <input type="hidden" id="memberid" name="memberid" />
  355.               </tr>
  356.             </tr>
  357.  
  358.           </table>
  359.           <p align="right">* The input is mandatory.</p>
  360.           <div class="form-actions" align="center">
  361.             <input type="button" class="btn btn-primary" value="Update Incoming Lead" id="add" onclick="addUser(this.form);"></input>
  362.             <!--<button class="btn btn-primary" onclick="addMember(this.form);">Add Member</button> -->
  363.             <button type="reset" class="btn btn-primary">Cancel</button>
  364.           </div>
  365.           <div id='status' name='status'>
  366.  
  367.           </div>
  368.         </form>
  369.         </div>
  370.         </div>
  371.         </div>
  372.  
  373. </body>
  374.  
  375. <div class="span12" id="searchcontent">
  376.   <div class="widget-box">
  377.     <div class="widget-title">
  378.       <span class="icon">
  379.                                                                         <class="icon-th-list"></i>
  380.                                                                 </span>
  381.       <h5>Payment History</h5>
  382.     </div>
  383.     <div class="widget-content">
  384.  
  385.     </div>
  386.   </div>
  387. </div>
  388. <script src="js/jquery.min.js"></script>
  389. <!--<script src="js/jquery.ui.custom.js"></script> -->
  390. <script src="js/bootstrap.min.js"></script>
  391. <script src="js/bootstrap-colorpicker.js"></script>
  392. <script src="js/bootstrap-datepicker.js"></script>
  393. <script src="js/jquery.uniform.js"></script>
  394. <script src="js/select2.min.js"></script>
  395. <script src="js/unicorn.js"></script>
  396. <script src="js/unicorn.form_common.js"></script>
  397. <script type="text/javascript">
  398.   $(document).ready(function() {
  399.     $('#address3').hide();
  400.     //$('#code').load('/cms_int1/php/get_code.php');
  401.     //$('#country').load('/cms_int1/php/get_country_intl.php');
  402.     $('#country').load('/cms_int1/php/get_country_user.php');
  403.     //$('#countrie').load('/cms_int1/php/get_countrie_user.php');
  404.     $('#cname').load('/cms_int1/php/getcname1.php');
  405.     $('#lbl_jd3').show();
  406.     $("#uid").focus();
  407.     $('#lbl_jd3').show();
  408.     $('#foll_date').show();
  409.     $('#address3').show();
  410.     var url = window.location.search.substring(1);
  411.     var jmemberid = url.split('=');
  412.     //alert (jmemberid[1]);
  413.     $('#memberid').val(jmemberid[1]);
  414.     $('#memberid').prop('readonly', true);
  415.     //$('#code1').val(jmemberid[1]);
  416.     //$('#code1').prop('readonly', true);
  417.     $('#phone1').val(jmemberid[1]);
  418.     $('#phone1').prop('readonly', true);
  419.     $.ajax({
  420.       url: '/cms_int1/php/get_member.php',
  421.       dataType: 'json', //json data type
  422.       data: {
  423.         memberid: jmemberid[1]
  424.       },
  425.       success: function(response) {
  426.         //alert('success');
  427.         displaydata(response);
  428.       },
  429.       error: function(xhr, status, error) {
  430.         var err = eval("(" + xhr.responseText + ")");
  431.         alert(xhr.responseText);
  432.         alert(err.Message);
  433.         alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
  434.       }
  435.     });
  436.     $.ajax({
  437.       url: '/cms_int1/php/donorpaymenthistory.php',
  438.       dataType: 'html', //json data type
  439.       data: {
  440.         memberid: jmemberid[1]
  441.       },
  442.       beforeSend: function() {
  443.         $('#wait').show();
  444.       },
  445.       success: function(response) {
  446.         $('#wait').hide();
  447.         $('#searchcontent .widget-content').html(response);
  448.       },
  449.       error: function(xhr, status, error) {
  450.         alert(xhr.responseText);
  451.         var err = eval("(" + xhr.responseText + ")");
  452.         alert(err.Message);
  453.       }
  454.     });
  455.   });
  456.  
  457.   function displaydata(response) {
  458.     if (response[0].phone == null) {
  459.       alert('No Results Found');
  460.       $('#foll_date').prop('readonly', false);
  461.       $('#phone').prop('readonly', false);
  462.       $('#Followup').hide();
  463.       $('#lbl_jd3a').hide();
  464.       $('#lbl_jdd3').hide();
  465.       $('#foll_date1').hide();
  466.       $('#lbl_jdd2').hide();
  467.       $('#foll_date2').hide();
  468.       $('#lbl_jdd1').hide();
  469.       $('#foll_date3').hide();
  470.       $('#lbl_jdc').hide();
  471.       $('#address3').hide();
  472.       $('#lbl_jdd4').hide();
  473.       $('#foll_date4').hide();
  474.       $('#lbl_jdd5').hide();
  475.       $('#foll_date5').hide();
  476.       $('#lbl_jdccccc').hide();
  477.       $('#lbl_jdcccc').hide();
  478.       $('#lbl_jdccc').hide();
  479.       $('#lbl_jdcc').hide();
  480.       $('#lbl_jdc').hide();
  481.       $('#address3').hide();
  482.       $('#address4').hide();
  483.       $('#address6').hide();
  484.       $('#address7').hide();
  485.       $('#address5').hide();
  486.     } else {
  487.       //  alert(response[0].cname);
  488.       //  $('#fname').val(response[0].fname);
  489.       $('#phone').val(response[0].phone);
  490.       $('#address1').val(response[0].address1);
  491.       $('#address').val(response[0].address);
  492.       $('#address2').val(response[0].address2);
  493.       //$('#address3').val(response[0].address3);
  494.       $('#address4').val(response[0].address4);
  495.       $('#address5').val(response[0].address5);
  496.       $('#phonealt').val(response[0].phonealt);
  497.       $('#address6').val(response[0].address6);
  498.       $('#address7').val(response[0].address7);
  499.       $('#foll_date').val(response[0].foll_date);
  500.       //$('#foll_date1').val(response[0].foll_date1);
  501.       $('#foll_date2').val(response[0].foll_date2);
  502.       $('#foll_date3').val(response[0].foll_date3);
  503.       $('#foll_date4').val(response[0].foll_date4);
  504.       $('#foll_date5').val(response[0].foll_date5);
  505.       $('#recurring_flag').val(response[0].recurring_flag);
  506.       $('#Frequency').val(response[0].mode);
  507.       $('#caller_date').val(response[0].caller_date);
  508.       $('#Followup').val(response[0].Followup);
  509.       $('#code').val(response[0].code);
  510.       $('#duedate').val(response[0].duedate);
  511.       $('#email').val(response[0].email);
  512.       $('#altemail').val(response[0].altemail);
  513.       $('#fname').val(response[0].First_Name);
  514.       //  $('#cname').val(response[0].cname);
  515.       $('#s2id_cname').select2('val', response[0].cname);
  516.       $('#mname').val(response[0].Middle_Name);
  517.       $('#lname').val(response[0].Last_Name);
  518.       $('#Tittle').val(response[0].Tittle);
  519.       $('#House_No').val(response[0].House_No);
  520.       $('#House_Name').val(response[0].House_Name);
  521.       $('#Adress_Line1').val(response[0].Adress_Line1);
  522.       $('#Adress_Line2').val(response[0].Adress_Line2);
  523.       $('#City').val(response[0].City);
  524.       $('#PostCode').val(response[0].PostCode);
  525.       //  $('#Gift_Declaration_Signed').val(response[0].Gift_Declaration_Signed);
  526.       //$('#Bank_Reference').val(response[0].Bank_Reference);
  527.       $('#type_sewa').val(response[0].type_sewa).trigger('change');
  528.       $('#s2id_country1').select2('val', response[0].country);
  529.       $('#s2id_country').select2('val', response[0].country);
  530.       $('#s2id_reference').select2('val', response[0].reference);
  531.       $('#s2id_Bank_Reference').select2('val', response[0].Bank_Reference);
  532.       //$('#country1').val(response[0].country).trigger('change');
  533.       //$('#reference').val(response[0].reference).trigger('change');
  534.       $('#fname1').val(response[0].fname);
  535.       $('#phone2').val(response[0].phone);
  536.       $('#1address1').val(response[0].address1);
  537.       $('#1address').val(response[0].address);
  538.       $('#1address2').val(response[0].address2);
  539.       $('#1address3').val(response[0].address3);
  540.       $('#foll_1date').val(response[0].foll_date);
  541.       $('#foll_1date1').val(response[0].foll_date1);
  542.       $('#foll_1date2').val(response[0].foll_date2);
  543.       $('#foll_1date3').val(response[0].foll_date3);
  544.       $('#1Followup').val(response[0].Followup);
  545.       $('#code2').val(response[0].code);
  546.       $('#email1').val(response[0].email);
  547.       //$('#code').val(response[0].code);
  548.       $('#type_sewa1').val(response[0].type_sewa);
  549.       $('#country11').val(response[0].country);
  550.       $('#address2').prop('readonly', true);
  551.       //  $('#s2id_BankDetails').select2('val',response[0].BankDetails);
  552.       $('#s2id_Gift_Declaration_Signed').select2('val', response[0].Gift_Declaration_Signed);
  553.       $('#BankDetails').val(response[0].BankDetails);
  554.       if (response[0].Followup == 'Yes') {
  555.         $('#lbl_jdd3').show();
  556.         $('#foll_date1').show();
  557.         $('#lbl_jdd2').show();
  558.         $('#foll_date2').show();
  559.         $('#lbl_jdd1').show();
  560.         $('#foll_date3').show();
  561.         $('#lbl_jdd4').show();
  562.         $('#foll_date4').show();
  563.         $('#lbl_jdd5').show();
  564.         $('#foll_date5').show();
  565.         $('#lbl_jdccccc').show();
  566.         $('#lbl_jdcccc').show();
  567.         $('#lbl_jdccc').show();
  568.         $('#lbl_jdcc').show();
  569.         $('#lbl_jdc').show();
  570.         $('#address3').show();
  571.         $('#address4').show();
  572.         $('#address6').show();
  573.         $('#address7').show();
  574.         $('#address5').show();
  575.         $('#Followup').show();
  576.         $('#lbl_jd3a').show();
  577.         $('#lbl_jdd3').show();
  578.         $('#foll_date1').show();
  579.         $('#lbl_jdd2').show();
  580.         $('#foll_date2').show();
  581.         $('#lbl_jdd1').show();
  582.         $('#foll_date3').show();
  583.         $('#lbl_jdc').show();
  584.       } else {
  585.         $('#lbl_jd3a').hide();
  586.         $('#lbl_jdd3').hide();
  587.         $('#foll_date1').hide();
  588.         $('#lbl_jdd2').hide();
  589.         $('#foll_date2').hide();
  590.         $('#lbl_jdd1').hide();
  591.         $('#foll_date3').hide();
  592.         $('#lbl_jdc').hide();
  593.         $('#lbl_jdd4').hide();
  594.         $('#foll_date4').hide();
  595.         $('#lbl_jdd5').hide();
  596.         $('#foll_date5').hide();
  597.         $('#lbl_jdccccc').hide();
  598.         $('#lbl_jdcccc').hide();
  599.         $('#lbl_jdccc').hide();
  600.         $('#lbl_jdcc').hide();
  601.         $('#lbl_jdc').hide();
  602.         $('#address3').hide();
  603.         $('#address4').hide();
  604.         $('#address6').hide();
  605.         $('#address7').hide();
  606.         $('#address5').hide();
  607.       }
  608.       //$('#code').val(response[0].code);
  609.     }
  610.   }
  611.  
  612.   function validateDays() {
  613.     if (document.getElementById('self').checked) {
  614.       //alert('cggx2333');
  615.       $('#lbl_jd3').show();
  616.       //  document.getElementById("foll_date").disabled = false;
  617.       $('#foll_date').show();
  618.       //  $('#foll_date').prop('readonly', false);
  619.       $('#address3').show();
  620.     } else if (document.getElementById('gender').checked) {
  621.       //alert('cggx');
  622.       $('#address3').hide();
  623.       $('#lbl_jd3').hide();
  624.       $('#foll_date').hide();
  625.       $('#address3').hide();
  626.       //$('#foll_date').prop('readonly', true);
  627.     }
  628.   }
  629.  
  630.   function loadcode() {
  631.     var country = document.getElementById("country").value;
  632.     //alert(country);
  633.     $.ajax({
  634.       url: '/cms_int1/php/getcode.php',
  635.       dataType: 'json', //json data type
  636.       type: 'GET',
  637.       data: {
  638.         country: country
  639.       },
  640.       success: function(response) {
  641.         //alert(response[0].code);
  642.         $('#code').val(response[0].code);
  643.       },
  644.       error: function(response) {
  645.         $('#status').html("<font color=\"red\">" + response + "</font>");
  646.       }
  647.     });
  648.     //alert(colname);
  649.     //$('#code').load('/cms_int1/php/get_code.php?country='+country);
  650.   }
  651.  
  652.   function getMember() {
  653.     //alert('success');
  654.     var jphone = document.getElementById("phone").value;
  655.     var jcode = document.getElementById("code").value;
  656.     //alert(jphone);alert(jcode);
  657.     $.ajax({
  658.       url: '/cms_int1/php/get_phone.php',
  659.       dataType: 'json', //json data type
  660.       data: {
  661.         phone: jphone,
  662.         code: jcode
  663.       },
  664.       success: function(response) {
  665.         if (response[0].phone === null) {
  666.           //alert ('NO RECORD FOUND !');
  667.         } else {
  668.           //alert(response[0].phone);
  669.           alert('Lead already exists');
  670.         }
  671.       },
  672.       error: function(response) {
  673.         errordata(response);
  674.       }
  675.     });
  676.   }
  677.  
  678.   function addUser(form) {
  679.     var jphone = form.phone.value;
  680.     var jemail = form.email.value;
  681.     var jfname = form.fname.value;
  682.     var jaddress = form.address.value;
  683.     var jaddress1 = form.address1.value;
  684.     var jaddress2 = form.address2.value;
  685.     var jaddress3 = form.address3.value;
  686.     var jtype_sewa = form.type_sewa.value;
  687.     var jcountry = form.country.value;
  688.     var jFollowup = $('input:radio[name=Followup]:checked').val();
  689.     var jfoll_date = form.foll_date.value;
  690.     var jcode = form.code.value;
  691.     var jcname = form.cname.value;
  692.     var jphonealt = form.phonealt.value;
  693.     var jreference = form.reference.value;
  694.     var jcaller_date = form.caller_date.value;
  695.     var jmname = form.mname.value;
  696.     var jlname = form.lname.value;
  697.     var jHouse_No = form.House_No.value;
  698.     var jHouse_Name = form.House_Name.value;
  699.     var jAdress_Line1 = form.Adress_Line1.value;
  700.     var jAdress_Line2 = form.Adress_Line2.value;
  701.     var jCity = form.City.value;
  702.     var jGift_Declaration_Signed = form.Gift_Declaration_Signed.value;
  703.     var jBank_Reference = form.Bank_Reference.value;
  704.     //      alert(jcname);
  705.     var jPostCode = form.PostCode.value;
  706.     var jBankDetails = form.BankDetails.value;
  707.     var jmemberid = form.memberid.value;
  708.     var jduedate = form.duedate.value;
  709.     document.getElementById("add").disabled = true;
  710.     $.ajax({
  711.       url: '/cms_int1/php/update_lead.php',
  712.       dataType: 'html', //json data type
  713.       type: 'POST',
  714.       data: {
  715.         phone: jphone,
  716.         email: jemail,
  717.         fname: jfname,
  718.         address: jaddress,
  719.         address1: jaddress1,
  720.         address2: jaddress2,
  721.         type_sewa: jtype_sewa,
  722.         country: jcountry,
  723.         Followup: jFollowup,
  724.         foll_date: jfoll_date,
  725.         code: jcode,
  726.         cname: jcname,
  727.         phonealt: jphonealt,
  728.         reference: jreference,
  729.         caller_date: jcaller_date,
  730.         mname: jmname,
  731.         lname: jlname,
  732.         House_No: jHouse_No,
  733.         House_Name: jHouse_Name,
  734.         Adress_Line1: jAdress_Line1,
  735.         Adress_Line2: jAdress_Line2,
  736.         City: jCity,
  737.         Gift_Declaration_Signed: jGift_Declaration_Signed,
  738.         Bank_Reference: jBank_Reference,
  739.         PostCode: jPostCode,
  740.         BankDetails: jBankDetails,
  741.         memberid: jmemberid,
  742.         address3: jaddress3,
  743.         duedate: jduedate
  744.       },
  745.       success: function(response) {
  746.         //alert('succcesssssssssss');
  747.         $('#status').html("<font color=\"green\" style=\"font-size:20px;\">" + response + "</font>");
  748.         //window.location.reload(true);
  749.         return false;
  750.       },
  751.       error: function(response) {
  752.         alert('failure');
  753.         $('#status').html("<font color=\"red\">" + response + "</font>");
  754.       }
  755.     });
  756.   }
  757. </script>
  758.  
  759. </html>
File Description
  • data
  • PHP Code
  • 16 Aug-2019
  • 25.92 Kb
You can Share it: