title: Show results for checkbox selected items
body: <p>I am calling <strong>Api</strong> : <code>$url = 'https://plapi.ecomexpress.in/track_me/api/mawbd/?awb=awbnumber&amp;order=' . $orderrecords[$k]["order_id"] . '&amp;username=admin&amp;password=admin123';</code> and fetching <strong>Status</strong> results of all <strong>Order IDS</strong> &amp; displaying in php page when we refresh php page. </p>
  
  <p>But I dont want to Call APi everytime when we <strong>refresh</strong> page. But When i <strong>select</strong> Order IDs  through <strong>checkbox</strong>, than when i click on button "Show Status" , <strong>than only</strong> i want to Call Api &amp; update the Selected Order IDs <strong>status</strong> in web page.</p>
  
  <p><strong>Url Output</strong></p>
  
  <p><a href="https://i.stack.imgur.com/3E3y5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3E3y5.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ZZ0jQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZZ0jQ.png" alt="enter image description here"></a></p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  
             $tabindex=1;
            function checkecomstatus($orderid)
            {
              $data['username']='admin';
              $data['password']='ouhk78epe34csmed46d';
              $data['awb']=$orderid;
  
              $url = 'https://plapi.ecomexpress.in/track_me/api/mawbd/?awb=awbnumber&amp;order='.$orderid.'&amp;username=admin&amp;password=ouhk78epe34csmed46d';
              $ch = curl_init();                    
              curl_setopt($ch, CURLOPT_URL,$url);
              curl_setopt($ch, CURLOPT_POST, true);  
              curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
              curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);         
  
              $output = curl_exec ($ch); 
              curl_close($ch);
              $res = explode("\n",$output);
  
              if ( ! isset($res[13])) 
              {
                 $res[13] = null;
              }
              $status = str_replace('&lt;/field&gt;.','',$res[13]);
              $statusfinal = str_replace('&lt;field type="CharField" name="status"&gt;','',$status);
              if($statusfinal!='') 
              {
              $sqlecom = "UPDATE do_order set in_transit='".$statusfinal.".',tconformed_by='Ecom' where order_id=".$orderid;
              $db_handleecom = new DBController();
              $resultecom = $db_handleecom-&gt;executeUpdate($sqlecom);      
              }
  
              return $statusfinal;
            }
  
  ?&gt;                  
           &lt;p&gt;&lt;button type= "button" &gt;Show Status&lt;/button&gt;&lt;/p&gt;
            &lt;table class="tbl-qa" border="1"&gt;
             &lt;thead&gt;
              &lt;tr&gt;            
                &lt;th class="table-header"&gt;ID&lt;/th&gt;
                &lt;th class="table-header"&gt;ORDERID&lt;/th&gt;            
                &lt;th class="table-header"&gt;Status&lt;/th&gt;         
              &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody id="table-body"&gt;
            &lt;?php
  
            if(!empty($orderrecords)) 
            {
              foreach($orderrecords as $k=&gt;$v) 
              {?&gt;
                &lt;tr class="table-row" id="table-row-&lt;?php echo $orderrecords[$k]["id"]; ?&gt;" tabindex="&lt;?php echo $tabindex;?&gt;"&gt;
                  &lt;td&gt;&lt;input type="checkbox" onclick="assignorderids('&lt;?php echo $orderrecords[$k]["order_id"]; ?&gt;')" name="assigneeid" id="assigneeid-&lt;?php echo $orderrecords[$k]["order_id"]; ?&gt;" value="&lt;?php echo $orderrecords[$k]["order_id"]; ?&gt;"&gt;&lt;/td&gt;
  
                  &lt;td&gt;&lt;?php echo $orderrecords[$k]["order_id"]; ?&gt;&lt;/td&gt;
  
                 &lt;td&gt;&lt;?php echo checkecomstatus($orderrecords[$k]["order_id"]);?&gt;&lt;/td&gt;           
  
              &lt;/tr&gt;
              &lt;?php 
              $tabindex++;
              }
            }?&gt;
            &lt;/tbody&gt;
          &lt;/table&gt; 
          &lt;input type="hidden" name="ordercheckallIDs" id="ordercheckallIDs" value="&lt;?php echo $ordercheckall;?&gt;"/&gt; 
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>function assignallorderids()
    {
     var checkstatus=$("#checkall").is(":checked");
  
      if(checkstatus==true)
      {
        var id=document.getElementById("ordercheckallIDs").value;  
        document.getElementById("orderids").value=id;
        $("input:checkbox[name='checkassigneeid']").prop('checked',true); 
      } 
      else
      {
        $("input:checkbox[name='checkassigneeid']").prop('checked',false);  
        document.getElementById("orderids").value='';
      }    
    }
  
      function assignorderids(oid)
      {
         var checkstatus=$("#assigneeid-"+oid).is(":checked");       
          var morderId =document.getElementById("orderids").value;
          if(checkstatus==false)
          {
              var arrayorder = JSON.parse("[" + morderId + "]");
              document.getElementById("orderids").value='';
              for (var i = 0; i &lt; arrayorder.length; i++) {           
                  var orderstatusValue=arrayorder[i];
                  if(orderstatusValue!=oid){
                      if (document.getElementById("orderids").value=='')
                      {
                          document.getElementById("orderids").value=orderstatusValue; 
                      }
                      else
                      {
                          var newvalue=document.getElementById("orderids").value;
                          document.getElementById("orderids").value=newvalue+","+orderstatusValue;                        
                      }
                  }                       
              }
          }
          else
          {
              if(morderId=='')
              {
                  document.getElementById("orderids").value=oid;
              }
              else
              {
                  document.getElementById("orderids").value=morderId+","+oid;
              }
          }
      }
  </code></pre>