<?php 
 session_start(); 
 ob_start();
 include("../../pidbco/pidbjoin.php");
 $sujpath="./";
?>
<!DOCTYPE html>
<html>
  <head>
   <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Projects</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/skins/_all-skins.min.css">
    <link rel="stylesheet" type="text/css" href="tcal.css" />
    <style>
.loader {
  margin-top: 18%;
  margin-left: 45%;
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #3498db;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
}

/* Safari */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.background-light
{
  max-height: 100%;
  min-height: 100%;
  height: 100%;
  width: 100%;
  position: fixed;
  z-index: 99999;
  background-color: rgba(0,0,0,0.4);
}
</style>
    <script type="text/javascript" src="tcal.js"></script>
      
    <script>
    function add_new_order(){
      $("#retdiv").show();
             var ocompny    = $('#ocompny').val();
             var rbranch    = $('#rbranch').val();
             var orderty    = $('#orderty').val();
             var ocustomer  = $('#ocustomer').val();
             var ordramnt   = $('#ordramnt').val();
             var disamount  = $('#disamount').val();
             var netamount  = $('#netamount').val();
             var ordate     = $('#ordate').val();
             var compltdate = $('#compltdate').val();
             var bill_head  = $('#bill_head').val();
             var order_status = $('#order_status').val();
             var total    = $('#total').val();
             var ordertax = $('#ordertax').val();
             var orderbdo = $('#orderbdo').val();
             
             var ddomain = $('#ddomain').val();
             var downer = $('#downer').val();
             var dprovider = $('#dprovider').val();
             var dregdate = $('#dregdate').val();
             var drenewel = $('#drenewel').val();
             var dintimatn = $('#dexp').val();
             
             var damount = $('#damount').val();
             var dtax = $('#dtax').val();
             var dredirectn = $('#dredirectn').val();
             var duser = $('#duser').val();
             var dpass = $('#dpass').val();
             var daccess = $('#daccess').val();
             var dremarks = $('#dremarks').val();
             var damount =$('#damount').val();
             var gstno=$('#gstno').val();
             var dom_credentl = $('#dom_credentl').val();
          
             
             
             var sercomp = $('#sercomp').val();
             var opertsystm = $('#opertsystm').val();
             var servalc = $('#servalc').val();
             var srstartdat = $('#srstartdat').val();
             var srenddate = $('#srenddate').val();
             var sramount = $('#sramount').val();
             var srtax = $('#srtax').val();
             var srremarks = $('#srremarks').val();
             var srowner = $('#srowner').val();
             var sr_credentl = $('#sr_credentl').val();             
             var srspace = $('#srspace').val();
               
             
             
             var alcalc = $('#alcalc').val();
             var alcprovided = $('#alcprovided').val();
             var alcstart = $('#alcstart').val();
             var alcend = $('#alcend').val();
             var alcamount = $('#alcamount').val();
             var alctax = $('#alctax').val();
             var alcremarks = $('#alcremarks').val();
             
             var smsdomain = $('#smsdomain').val();
             var smsaccess = $('#smsaccess').val();
             var smscount =  $('#smscount').val();
             var smsperrat = $('#smsperrat').val();
             var smsrenewel = $('#smsrenewel').val();
             var smsamount = $('#smsamount').val();
             var smsserv_prov = $('#smsserv_prov').val();
             var smsserderid = $('#smsserderid').val();
             var smstype = $('#smstype').val();
             var smsutility = $('#smsutility').val();
             var smsmanaged = $('#smsmanaged').val();
             var smsmainadm = $('#smsmainadm').val();
             var smsmainuser = $('#smsmainuser').val();
             var smsmainpass = $('#smsmainpass').val();
             var smscust = $('#smscust').val();
             var smscustuser = $('#smscustuser').val();
             var smscustpass = $('#smscustpass').val();
             
             
             var emdomain = $('#emdomain').val();
             var emservice = $('#emservice').val();
             var emcount = $('#emcount').val();
             var emcost = $('#emcost').val();
             var emtax = $('#emtax').val();
             var emexpiry = $('#emexpiry').val();
             var emtype = $('#emtype').val();
             var emrenewel = $('#emrenewel').val();
             var emmanaged = $('#emmanaged').val();
             var emdetails = $('#emdetails').val();
             
             var seodomain = $('#seodomain').val();
             var seosergment = $('#seosergment').val();
             var seoresult1 = $('#seoresult1').val();
             var seoresult2 = $('#seoresult2').val();
             var seoresult3 = $('#seoresult3').val();
             var seoengine = $('#seoengine').val();
             var seoamount = $('#seoamount').val();
             var seokeyword = $('#seokeyword').val();
             
             var amcdomain = $('#amcdomain').val();
             var amcamount = $('#amcamount').val();
             var amcsdate = $('#amcsdate').val();
             var amcedate = $('#amcedate').val();
             var amc_per = $('#amc_per').val();
             var hidvall = $('#orderid11').val();

             if($("#custsmssent").is(':checked'))
                 var custsmssent =1;
             else
                 var custsmssent =0;
             
                     
             if((ocompny == '') || (ocompny==null)){
                alert("Select Company");   	
             } else if((rbranch == '') || (rbranch == null)){
             	alert("Select Branch");
             } else if((orderty == '') || (orderty == null)){
             	alert("Select Order Type");
             } else if((ocustomer == '') || (ocustomer == null)){
             	alert("Select Customer");
             } else if(ordramnt == ''){
             	alert("Enter Order Amount");
             } else if(ordate == ''){
             	alert("Enter Order Date");
             } else if(orderbdo == ''){
             	alert("Select BDO");
             } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_orders: 1,
                          ocompny       : ocompny,
                          rbranch       : rbranch,
                          orderty       : orderty,
                          ocustomer     : ocustomer,
                          ordramnt      : ordramnt,
                          disamount     : disamount,
                          netamount     : netamount,
                          ordate        : ordate,
                          compltdate    : compltdate,
                          ordertax      : ordertax,
                          orderbdo      : orderbdo,
                          bill_head     : bill_head,
                          total         : total,
                          order_status  : order_status,
                          
                          ddomain    : ddomain,
                          downer     : downer,
                          dprovider  : dprovider,
                          dregdate   : dregdate,
                          drenewel   : drenewel,
                          dintimatn  : dintimatn,
                          damount    : damount,
                          dtax       : dtax,
                          dredirectn : dredirectn,
                          duser     : duser,
                          dpass     : dpass,
                          daccess   : daccess,
                          dremarks  : dremarks,
                          dom_credentl : dom_credentl,
                          damount      : damount,
                          gstno        : gstno,
                          
                          sercomp     : sercomp,
                          opertsystm  : opertsystm,
                          servalc     : servalc,
                          srstartdat  : srstartdat,
                          srenddate   : srenddate,
                          sramount    : sramount,
                          srtax       : srtax,
                          srremarks   : srremarks,
                          srowner     : srowner,
                          sr_credentl : sr_credentl,
                          srspace     : srspace,
                          
                          alcalc        : alcalc,
                          alcprovided   : alcprovided,
                          alcstart      : alcstart,
                          alcend        : alcend,
                          alcamount     : alcamount,
                          alctax        : alctax,
                          alcremarks    : alcremarks,
                          hidvall     : hidvall,
                          smsdomain     : smsdomain,
                          smsaccess     : smsaccess,
                          smscount      : smscount,
                          smsperrat     : smsperrat,
                          smsrenewel    : smsrenewel,
                          smsamount     : smsamount,
                          smsserv_prov  : smsserv_prov,
                          smsserderid   : smsserderid,
                          smstype       : smstype,
                          smsutility    : smsutility,
                          smsmanaged    : smsmanaged,
                          smsmainadm    : smsmainadm,
                          smsmainuser   : smsmainuser,
                          smsmainpass   : smsmainpass,
                          smscust       : smscust,
                          smscustuser   : smscustuser, 
                          smscustpass   : smscustpass,
                          
                          emdomain       : emdomain,
                          emservice      : emservice,
                          emcount        : emcount,
                          emcost         : emcost,
                          emtax          : emtax,
                          emexpiry       : emexpiry,
                          emtype         : emtype,
                          emrenewel      : emrenewel,
                          emmanaged      : emmanaged,
                          emdetails      : emdetails,
                          
                          seodomain      : seodomain,
                          seosergment    : seosergment,
                          seoresult1     : seoresult1,
                          seoresult2     : seoresult2,
                          seoresult3     : seoresult3,
                          seoengine      : seoengine,
                          seoamount      : seoamount,
                          seokeyword     : seokeyword,


                          amcdomain      : amcdomain,
                          amcamount      : amcamount,
                          amcsdate       : amcsdate,
                          amcedate       : amcedate,
                          amc_per        : amc_per,
                          
                          custsmssent   : custsmssent                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                        setTimeout(function(){
                     	   	$('#ocompny').val('');
                           	$('#rbranch').val('');
                           	$('#orderty').val('');
                           	$('#ocustomer').val('');
                           	$('#ordramnt').val('');
                           	$('#disamount').val('');
                           	$('#netamount').val('');
                           	$('#ordate').val('');
                           	$('#compltdate').val('');
                           	$('#bill_head').val('');
                            $('#total').val('');
                           	
                           	$('#ordertax').val('');
                           	$('#orderbdo').val('');
                           	                           	
                           	$('#ddomain').val('');
                           	$('#downer').val('');
                           	$('#dprovider').val('');
                           	$('#dregdate').val('');
                           	$('#drenewel').val('');
                           	$('#dexp').val('');
                           	$('#damount').val('');
                           	$('#dtax').val('');
                           	$('#dredirectn').val('');
                           	$('#duser').val('');
                           	$('#dpass').val('');
                           	$('#daccess').val('');
                           	$('#dremarks').val('');
                           	$('#dom_credentl').val('');
                            $('#damount').val('');
                            $('#gstno').val('');
                           	
                           	$('#sercomp').val('');
                           	$('#opertsystm').val('');
                           	$('#servalc').val('');
                           	$('#srstartdat').val('');
                           	$('#srenddate').val('');
                           	$('#sramount').val('');
                           	$('#srtax').val('');
                           	$('#srremarks').val('');
                           	$('#srowner').val('');
                           	$('#sr_credentl').val('');
                           	$('#srspace').val('');
                           	
                           	$('#alcalc').val('');
                           	$('#alcprovided').val('');
                           	$('#alcstart').val('');
                           	$('#alcend').val('');
                           	$('#alcamount').val('');
                           	$('#alctax').val('');
                           	$('#alcremarks').val('');
                           	
                           	
                           	$('#smsdomain').val('');
                           	$('#smsaccess').val('');
                           	$('#smscount').val('');
                           	$('#smsperrat').val('');
                           	$('#smsrenewel').val('');
                           	$('#smsamount').val('');
                           	$('#smsserv_prov').val('');
                           	$('#smsserderid').val('');
                           	$('#smstype').val('');
                           	$('#smsutility').val('');
                           	$('#smsmanaged').val('');
                           	$('#smsmainadm').val('');
                           	$('#smsmainuser').val('');
                           	$('#smsmainpass').val('');
                           	$('#smscust').val('');
                           	$('#smscustuser').val('');
                           	$('#smscustpass').val('');
                           	
                           	
                           	$('#emdomain').val('');
                           	$('#emservice').val('');
                           	$('#emcount').val('');
                           	$('#emcost').val('');
                           	$('#emtax').val('');
                           	$('#emexpiry').val('');
                           	$('#emtype').val('');
                           	$('#emrenewel').val('');
                           	$('#emmanaged').val('');
                           	$('#emdetails').val('');
                           	
                           	$('#seodomain').val('');
                           	$('#seosergment').val('');
                           	$('#seoresult1').val('');
                           	$('#seoresult2').val('');
                           	$('#seoresult3').val('');
                           	$('#seoengine').val('');
                           	$('#seoamount').val('');
                           	$('#seokeyword').val('');
                            $('#orderid11').val('');
                           	   window.location.href='orders.php';                         	
                           	/*$("#marketingdiv123").load("orders.php #marketingdiv123"); */  
                            datat2();
                            document.getElementById('domain_det').style.display='none';
                            document.getElementById('alc_det').style.display='none';
                            document.getElementById('server_del').style.display='none';
                            document.getElementById('amc_det').style.display='none';
                            document.getElementById('sms_del').style.display='none';
                            document.getElementById('email_del').style.display='none';
                            document.getElementById('seo_del').style.display='none';
                            $("#retdiv").hide();
                            }, 3000);
                      }
                   }); 
    	    }
     }


    	
    	
   function edit_new_order()
   {
    $("#retdiv").show();
             var ocompny = $('#ocompny').val();
             var rbranch = $('#rbranch').val();
             var orderty = $('#orderty').val();
             var ocustomer = $('#ocustomer').val();
             var ordramnt = $('#ordramnt').val();
             var disamount = $('#disamount').val();
             var netamount = $('#netamount').val();
             var ordate = $('#ordate').val();
             var compltdate = $('#compltdate').val();
             var ordertax = $('#ordertax').val();
             var orderbdo = $('#orderbdo').val();
             var bill_head = $('#bill_head').val();      
             var order_status = $('#order_status').val();       
             var total    = $('#total').val();

             var ddomain = $('#ddomain').val();
             var downer = $('#downer').val();
             var dprovider = $('#dprovider').val();
             var dregdate = $('#dregdate').val();
             var drenewel = $('#drenewel').val();
             var dintimatn = $('#dexp').val();
             var damount = $('#damount').val();
             var dtax = $('#dtax').val();
             var dredirectn = $('#dredirectn').val();
             var duser = $('#duser').val();
             var dpass = $('#dpass').val();
             var daccess = $('#daccess').val();
             var dremarks = $('#dremarks').val();
             var dom_credentl = $('#dom_credentl').val();
             var damount=$('#damount').val();
             var gstno=$('#gstno').val();
             
             var sercomp     = $('#sercomp').val();
             var opertsystm  = $('#opertsystm').val();
             var servalc     = $('#servalc').val();
             var srstartdat  = $('#srstartdat').val();
             var srenddate   = $('#srenddate').val();
             var sramount    = $('#sramount').val();
             var srtax       = $('#srtax').val();
             var srremarks   = $('#srremarks').val();
             var srowner     = $('#srowner').val();
             var sr_credentl = $('#sr_credentl').val();
             var srspace     = $('#srspace').val();
             
             var alcalc = $('#alcalc').val();
             var alcprovided = $('#alcprovided').val();
             var alcstart = $('#alcstart').val();
             var alcend = $('#alcend').val();
             var alcamount = $('#alcamount').val();
             var alctax = $('#alctax').val();
             var alcremarks = $('#alcremarks').val();
          
             var smsdomain = $('#smsdomain').val();
             var smsaccess = $('#smsaccess').val();
             var smscount =  $('#smscount').val();
             var smsperrat = $('#smsperrat').val();
             var smsrenewel = $('#smsrenewel').val();
             var smsamount = $('#smsamount').val();
             var smsserv_prov = $('#smsserv_prov').val();
             var smsserderid = $('#smsserderid').val();
             var smstype = $('#smstype').val();
             var smsutility = $('#smsutility').val();
             var smsmanaged = $('#smsmanaged').val();
             var smsmainadm = $('#smsmainadm').val();
             var smsmainuser = $('#smsmainuser').val();
             var smsmainpass = $('#smsmainpass').val();
             var smscust = $('#smscust').val();
             var smscustuser = $('#smscustuser').val();
             var smscustpass = $('#smscustpass').val();
             
              var emdomain = $('#emdomain').val();
             var emservice = $('#emservice').val();
             var emcount = $('#emcount').val();
             var emcost = $('#emcost').val();
             var emtax = $('#emtax').val();
             var emexpiry = $('#emexpiry').val();
             var emtype = $('#emtype').val();
             var emrenewel = $('#emrenewel').val();
             var emmanaged = $('#emmanaged').val();
             var emdetails = $('#emdetails').val();
             
             var seodomain = $('#seodomain').val();
             var seosergment = $('#seosergment').val();
             var seoresult1 = $('#seoresult1').val();
             var seoresult2 = $('#seoresult2').val();
             var seoresult3 = $('#seoresult3').val();
             var seoengine = $('#seoengine').val();
             var seoamount = $('#seoamount').val();
             var seokeyword = $('#seokeyword').val();

             var amcdomain = $('#amcdomain').val();
             var amcamount = $('#amcamount').val();
             var amcsdate = $('#amcsdate').val();
             var amcedate = $('#amcedate').val();
             var amc_per = $('#amc_per').val();
             
             var hidvall = $('#hidvall').val();             
             
             if(ocompny == ''){
                alert("Enter The Company");   	
             } else if(orderty == ''){
             	alert("Select Order Type");
             } else if(ocustomer == ''){
             	alert("Select Customer");
             } else if(ordramnt == ''){
             	alert("Enter Order Amount");
             } else if(ordate == ''){
             	alert("Enter Order Date");
             } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          edit_new_orders : 1,
                          ocompny       : ocompny,
                          rbranch       : rbranch,
                          orderty       : orderty,
                          ocustomer     : ocustomer,
                          ordramnt      : ordramnt,
                          disamount     : disamount,
                          netamount     : netamount,
                          ordate        : ordate,
                          compltdate    : compltdate,
                          ordertax      : ordertax,
                          orderbdo      : orderbdo,
                          bill_head     : bill_head,
                          order_status  : order_status,
                          total         : total,
                          
                          ddomain    : ddomain,
                          downer     : downer,
                          dprovider  : dprovider,
                          dregdate   : dregdate,
                          drenewel   : drenewel,
                          dintimatn  : dintimatn,
                          damount    : damount,
                          dtax       : dtax,
                          dredirectn : dredirectn,
                          duser     : duser,
                          dpass     : dpass,
                          daccess   : daccess,
                          dremarks  : dremarks,
                          dom_credentl : dom_credentl,
                          damount     : damount,
                          gstno      :gstno,
                          
                          sercomp  : sercomp,
                          opertsystm : opertsystm,
                          servalc   : servalc,
                          srstartdat : srstartdat,
                          srenddate  : srenddate,
                          sramount  : sramount,
                          srtax  : srtax,
                          srremarks   : srremarks,
                          srowner     : srowner,
                          sr_credentl : sr_credentl,
                          srspace     : srspace,
                          
                          alcalc        : alcalc,
                          alcprovided   : alcprovided,
                          alcstart      : alcstart,
                          alcend        : alcend,
                          alcamount     : alcamount,
                          alctax        : alctax,
                          alcremarks    : alcremarks,
                          hidvall     : hidvall,
                          
                           smsdomain     : smsdomain,
                          smsaccess     : smsaccess,
                          smscount      : smscount,
                          smsperrat     : smsperrat,
                          smsrenewel    : smsrenewel,
                          smsamount     : smsamount,
                          smsserv_prov  : smsserv_prov,
                          smsserderid   : smsserderid,
                          smstype      : smstype,
                          smsutility    : smsutility,
                          smsmanaged    : smsmanaged,
                          smsmainadm    : smsmainadm,
                          smsmainuser   : smsmainuser,
                          smsmainpass   : smsmainpass,
                          smscust       : smscust,
                          smscustuser   : smscustuser, 
                          smscustpass   : smscustpass,
                          
                           emdomain       : emdomain,
                          emservice      : emservice,
                          emcount        : emcount,
                          emcost         : emcost,
                          emtax          : emtax,
                          emexpiry       : emexpiry,
                          emtype         : emtype,
                          emrenewel      : emrenewel,
                          emmanaged      : emmanaged,
                          emdetails      : emdetails,
                          
                           seodomain      : seodomain,
                          seosergment    : seosergment,
                          seoresult1     : seoresult1,
                          seoresult2     : seoresult2,
                          seoresult3     : seoresult3,
                          seoengine      : seoengine,
                          seoamount      : seoamount,
                          seokeyword     : seokeyword,

                          amcdomain      : amcdomain,
                          amcamount      : amcamount,
                          amcsdate       : amcsdate,
                          amcedate       : amcedate,
                          amc_per        : amc_per
                          
                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                      setTimeout(function(){
                     	   	$('#ocompny').val('');
                           	$('#rbranch').val('');
                           	$('#orderty').val('');
                           	$('#ocustomer').val('');
                           	$('#ordramnt').val('');
                           	$('#disamount').val('');
                           	$('#netamount').val('');
                           	$('#ordate').val('');
                           	$('#compltdate').val('');
                           	$('#bill_head').val('');
                            $('#total').val('');
                           	
                           	$('#ordertax').val('');
                           	$('#orderbdo').val('');
                           	
                           	$('#ddomain').val('');
                           	$('#downer').val('');
                           	$('#dprovider').val('');
                           	$('#dregdate').val('');
                           	$('#drenewel').val('');
                           	$('#dexp').val('');
                           	$('#damount').val('');
                           	$('#dtax').val('');
                           	$('#dredirectn').val('');
                           	$('#duser').val('');
                           	$('#dpass').val('');
                           	$('#daccess').val('');
                           	$('#dremarks').val('');
                           	$('#dom_credentl').val('');
                           	$('#damount').val('');
                            $('#gstno').val('');

                           	$('#sercomp').val('');
                           	$('#opertsystm').val('');
                           	$('#servalc').val('');
                           	$('#srstartdat').val('');
                           	$('#srenddate').val('');
                           	$('#sramount').val('');
                           	$('#srtax').val('');
                           	$('#srremarks').val('');
                           	$('#srowner').val('');
                           	$('#sr_credentl').val('');
                           	$('#srspace').val('');
                           	
                           	$('#alcalc').val('');
                           	$('#alcprovided').val('');
                           	$('#alcstart').val('');
                           	$('#alcend').val('');
                           	$('#alcamount').val('');
                           	$('#alctax').val('');
                           	$('#alcremarks').val('');
                           	
                           	
                           	$('#smsdomain').val('');
                           	$('#smsaccess').val('');
                           	$('#smscount').val('');
                           	$('#smsperrat').val('');
                           	$('#smsrenewel').val('');
                           	$('#smsamount').val('');
                           	$('#smsserv_prov').val('');
                           	$('#smsserderid').val('');
                           	$('#smstype').val('');
                           	$('#smsutility').val('');
                           	$('#smsmanaged').val('');
                           	$('#smsmainadm').val('');
                           	$('#smsmainuser').val('');
                           	$('#smsmainpass').val('');
                           	$('#smscust').val('');
                           	$('#smscustuser').val('');
                           	$('#smscustpass').val('');
                           	
                           	$('#emdomain').val('');
                           	$('#emservice').val('');
                           	$('#emcount').val('');
                           	$('#emcost').val('');
                           	$('#emtax').val('');
                           	$('#emexpiry').val('');
                           	$('#emtype').val('');
                           	$('#emrenewel').val('');
                           	$('#emmanaged').val('');
                           	$('#emdetails').val('');
                           	
                           	$('#seodomain').val('');
                           	$('#seosergment').val('');
                           	$('#seoresult1').val('');
                           	$('#seoresult2').val('');
                           	$('#seoresult3').val('');
                           	$('#seoengine').val('');
                           	$('#seoamount').val('');
                           	$('#seokeyword').val('');
                            $('#hidvall').val('');                          	
                           	   
                           	alert("Order Details Updated Successfully");
                            alert(res23);
                           	window.location.href='orders.php';
                            $("#retdiv").hide();
                            }, 3000);
                           	// $("#marketingdiv123").load("orders.php #marketingdiv123");   
                            // datat3();
                      }
                   }); 
    	    }
   }
        
        
    	
    	    	
    	function delete_orders(id)
    	{
    		
    		var result = confirm("Want to delete?");
			if (result) 
			{
        $("#retdiv").show();
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_delete_orders : 1,
			id : id
			},
			cache: true,
			success: function(res)
			{
        setTimeout(function(){
        window.location.href='orders.php'; 
				  // $("#marketingdiv123").load("orders.php #marketingdiv123");
			      datat();
            $("#retdiv").hide();
}, 3000);
        	}  
			});
   			}
    	}
    	

      function get_orderdata(id)
      {
        //$("#marketingdiv2").load("orders.php?idd2="+id+" #marketingdiv2");
        //alert(id);
$("#retdiv").show();
        $("ordderid11").val(id);
        $.ajax({
      type: "POST",
      url: "ajaxmarket.php",
      data: {
      btn_edit_market: 1,
      id:id
      },
      cache: true,
      success: function(res)
      {
setTimeout(function(){
            $("#marketingdiv2").load("orders.php?idd2="+id+"&idd3="+1+" #marketingdiv2");
            $("#retdiv").hide();
}, 3000);
      }  
      });
      }



    	
    	function edit_orders(id)
    	{
        $("#retdiv").show();
        //$("#marketingdiv2").load("orders.php?idd2="+id+" #marketingdiv2");
        //alert(id);
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
        setTimeout(function(){
	         	 window.location.href="orders.php?idd2="+id;
             $("#retdiv").hide();
             }, 3000);
			}  
			});
    	}


    </script>
    
    <script>

      /*function new_customer(val){
        document.getElementById(val).style.display='block';
      }*/
    	function get_customer(val)
    	{
       /* var res = val.split("-",1);
        alert(res);*/
        $("#retdiv").show();
        setTimeout(function(){
    $("#marketingdiv2").load("orders.php?customerid="+val+" #marketingdiv2");
    $("#retdiv").hide();
}, 1000);
      //document.getElementById('minusbtn').style.display='none';
      //window.location.href="orders.php?customerid="+val; 
       //alert(val);
       // edit_orders(val);
       //var otype=$('#orderty').val();
       //window.location.href="ajaxmarket7.php?val="+val+"&otype="+otype;
      //   //var otype=document.getElementById('orderty').value;
        //alert(otype);
    		/*$.ajax({
      type: "POST",
      url: "ajaxmarket7.php",
      data: {
      btn_edit_market: 1,
      val:val,
      otype:otype
      },
      cache: true,
      success: function(res)
      {
        alert(res);
       //$('#ordertable').html(res);
        //$("#marketingdiv2").load("orders.php?idd2="+id+" #marketingdiv2");       
      }  
      });*/
    	}
    
    	
    	
function branch_change(str)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("rbranch").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajaxmarket.php?comp_idd="+str,true);
xmlhttp.send();
}

function order_type(val)
  {
    $("#retdiv").show();
        setTimeout(function(){
    document.getElementById('domain_det').style.display='none';
    document.getElementById('server_del').style.display='none';
    document.getElementById('seo_del').style.display='none';
    document.getElementById('sms_del').style.display='none';
    document.getElementById('email_del').style.display='none';
    document.getElementById('server_del').style.display='none';
    document.getElementById('alc_det').style.display='none';
    document.getElementById('web_del').style.display='none';
    document.getElementById('amc_det').style.display='none';
   if(val == 16){
    document.getElementById('domain_det').style.display='block';
   }
   if(val == 25){
    document.getElementById('server_del').style.display='block';
   }
   if(val == 17 || val==7 || val==9 || val==8 || val==11 || val==10){
    document.getElementById('domain_det').style.display='block';
    document.getElementById('server_del').style.display='block';
   }
   if(val == 13){
    document.getElementById('seo_del').style.display='block';
   }
   if(val == 23 || val==24){
    document.getElementById('sms_del').style.display='block';
   }
   if(val == 18 || val == 19){
    document.getElementById('email_del').style.display='block';
   }
   if(val == 20 || val == 21){
    document.getElementById('email_del').style.display='block';
   }
   if(val == 7 || val==9 || val==8){
    document.getElementById('web_del').style.display='block';
   } 
   if(val == 14){
    document.getElementById('amc_det').style.display='block';
   }
   $("#retdiv").hide();
}, 1000);
  }
  function calc_netamount()
    {
      var pamount=document.getElementById('ordramnt').value;

      var dis=document.getElementById('disamount').value;
      document.getElementById('netamount').value=pamount-dis;
     } 
     function calc_total()
    {
      var netamount=document.getElementById('netamount').value;
      var tax=document.getElementById('ordertax').value;
      document.getElementById('total').value= +netamount + +(netamount * tax /100);
     } 

     function calc_dnetamo()
    {

      var netamount=document.getElementById('damount').value;
     // alert(netamount);
      var tax=document.getElementById('dtax').value;
      document.getElementById('dnetamo').value= +netamount + +(netamount * tax /100);
     } 

      function calc_date()
    {
     
      var da = document.getElementById('dregdate').value;
      var date = new Date(da);
      var newdate = new Date(date);
      if((newdate.getFullYear()%4 ==0 && newdate.getMonth()<2) || (newdate.getFullYear()%4 ==3 && newdate.getMonth()>1)  ){
        newdate.setDate(newdate.getDate() + 365);
      }else{
        newdate.setDate(newdate.getDate() + 364);
      }
    
      var dd = newdate.getDate();
      var mm = newdate.getMonth() + 1;
      var y = newdate.getFullYear();
      var exp = dd + '/' + mm + '/' + y;

      newdate.setDate(newdate.getDate() - 60);

      var dd = newdate.getDate();
      var mm = newdate.getMonth() + 1;
      var y = newdate.getFullYear();
      var ren = dd + '/' + mm + '/' + y;
      /*var rd=new Date(da);
      var d=rd.getDate();
      var m=rd.getMonth();
      var y=rd.getFullYear();
      var exp='';
      var ren='';
      if(m==0 || m==2 ||m==4 ||m==6 ||m==7 ||m==9 ||m==11){
        if(m==2){
        if(d==1){
          if(y%4==3){
          exp=new Date((y+1),m,(28));
          ren=new Date((y+1),(m-2),(28));
          }else{
            exp=new Date((y+1),m,(29));
            ren=new Date((y+1),(m-2),(29));
          }
        }else{
          exp=new Date((y+1),(m+1),(d-1));
          ren=new Date((y+1),(m-1),(d-1));
        }
      }
        else if(d==1){
          if(m==0 && m==7){
          exp=new Date((y+1),m,31);
          ren=new Date((y+1),(m-2),31);
        }
          else
          exp=new Date((y+1),m,30); 
          ren=new Date((y+1),(m-2),30); 
        }
        else{
          exp=new Date((y+1),(m+1),(d-1));
          ren=new Date((y+1),(m-1),(d-1));
        }
      }
      else{
        if(d==1){
          exp=new Date((y+1),(m),30);
          ren=new Date((y+1),(m-1),30);
        }else{
          exp=new Date((y+1),(m+1),(d-1));
          ren=new Date((y+1),(m-1),(d-1));
        }

      }*/
      document.getElementById('dexp').value=exp;//exp.getDate()+" - "+exp.getMonth()+" - "+exp.getFullYear();
       document.getElementById('drenewel').value=ren;//.getDate()+" - "+ren.getMonth()+" - "+ren.getFullYear();
     } 

    function add_new_customer1(){

     document.getElementById('customer123').style.display='block';
     document.getElementById('plusbtn1').style.display='none';
     document.getElementById('minusbtn').style.display='block';
     }

     function add_new_customer2(){

      document.getElementById('customer123').style.display='none';
      document.getElementById('plusbtn1').style.display='block';
      document.getElementById('minusbtn').style.display='none';
     }

    
        function add_new_customer()
        {
          $("#retdiv").show();
         var vcompany = $('#vcompany').val();
       var vtype = $('#vtype').val();
       var vcontact = $('#vcontact').val();
       var vdesignatn = $('#vdesignatn').val();
       
       var vmob = $('#vmob').val();
       var vmob2 = $('#vmob2').val();
       var vemail = $('#vemail').val();
       var vemail2 = $('#vemail2').val();
       var vland1 = $('#vland1').val();
       var vland2 = $('#vland2').val(); 
       var vmob3 = $('#vmob3').val();
       var vemail3 = $('#vemail3').val();     
       var permantaddrs = $('#permantaddrs').val();
       var commnctnaddrs = $('#commnctnaddrs').val();
       var vdistrict = $('#vdistrict').val();
       var vstate   = $('#vstate').val();
       var vcountry  = $('#vcountry').val();
       var vpincode  = $('#vpincode').val();
       var vremarks   = $('#vremarks').val();
       
       var vreferred   = $('#vreferred').val();
       var vsource   = $('#vsource').val();
       
        var vgoogle   = $('#vgoogle').val();
         var vstatus   = $('#vstatus').val();
         var gstNo   = $('#gstNo').val();
       
       var add_new_customer =1;
         var input1 = document.getElementById("vlogo");
          var input2 = document.getElementById("vbusiness");
        //alert(vmob2+vmob3+vemail+vemail3);
         if(vcompany == ''){
             alert("Enter Company Name");
         } else if(vmob == ''){
             alert("Enter Mobile");
         } else { 
      
         file1 = input1.files[0];
         file2 = input2.files[0];
         formData= new FormData();
         formData.append("image1", file1);
         formData.append("image2", file2);
      
         formData.append("add_new_customer", add_new_customer);
         formData.append("vcompany", vcompany);
         formData.append("vtype", vtype);
         formData.append("vcontact", vcontact);
         formData.append("vdesignatn", vdesignatn);
         
         formData.append("vmob", vmob);
         formData.append("vmob2", vmob2);
         formData.append("vemail", vemail);
         formData.append("vemail2", vemail2);
         formData.append("vland1", vland1);
         formData.append("vland2", vland2);
         formData.append("vmob3", vmob3);
         formData.append("vemail3", vemail3);

         formData.append("permantaddrs", permantaddrs);
         formData.append("commnctnaddrs", commnctnaddrs);      
         formData.append("vdistrict", vdistrict);
         formData.append("vstate", vstate);
         formData.append("vcountry", vcountry);
         formData.append("vpincode", vpincode);
         formData.append("vremarks", vremarks);
      
      formData.append("vreferred", vreferred);
      formData.append("vsource", vsource);
      
      formData.append("vgoogle", vgoogle);
      formData.append("vstatus", vstatus);
      formData.append("gstNo", gstNo);
        $.ajax({
        url: "ajaxmarket.php",
        type: "POST",
        data: formData,
        processData: false,
        contentType: false,
        cache: false,
        success: function(data){
          setTimeout(function(){
          var val=data.split('|');
          if (val[0]==0){
          alert("New Customer Added");
          $('#ocustomer').html(val[1]).selectpicker('refresh');
          document.getElementById('customer123').style.display='none';
          document.getElementById('plusbtn1').style.display='block';
          document.getElementById('minusbtn').style.display='none';
        }
        else
        {
          alert("Customer Adding Failed");
          $('#ocustomer').html(val[1]);
        }
        $("#retdiv").hide();
}, 3000);
        }
     });   
    }
          
        }
    function select_customer(){
      var ocustomer = $('#ocustomer').val();
$("#retdiv").show();
       $.ajax({
      type: "POST",
      url: "ajax_customer.php",
      data: {
      ocustomer : ocustomer
      },
      cache: true,
      success: function(res)
      {
        setTimeout(function(){
        $('#ocustomer1').val(res);
        $("#retdiv").hide();
}, 3000);
      }  
      });


    }
    function minusdisplay(){ 

      document.getElementById('minusbtn').style.display='none';

    }
    function type_of_order(id){
      //window.location.href="orders.php?type="+id;
      $("#marketingdiv2").load("orders.php?type="+id+" #marketingdiv2");
    }
    

    </script>
        <link href="bootstrap/css/bootstrap1.min.css" rel="stylesheet">
    <link rel="stylesheet" href="bootstrap/css/bootstrap-select.min.css" />
  <style type="text/css">
    
  </style>
  
  </head>
<body  class="hold-transition skin-blue sidebar-mini">
  <div style="display: none;" class="background-light" id="retdiv">
      <!-- <div style="display: none;" class="background-light" id="retdiv"> -->
      <div class="loader"></div>
    </div>
  <div class="wrapper">
   <?php include("head.php");
         include("left.php");
          ?> 
	 
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1> Orders
          	<small>- Control panel</small>
          	</h1>
          <ol class="breadcrumb">
            <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Orders</li> 
          </ol>
        </section>
  <!-- Main content -->
        <section class="content" >
          <div class="row" >
            <div class="col-xs-12" >





   <div  class="box-body" id="marketingdiv2">
   <?php
   $idd2='';
    if(empty($_GET['idd2'])){
        
      //$idd2 = strip_tags(base64_decode($_GET['idd2']));
      $ordr_amt1='';
      $dis_amnt1='';
      $net_amnt1='';
      $or_tax1='';
      $total1='';
      $ordr_date1='';
      $compl_date1='';
      $bill_head1='';
      $order_id1='';
      }else{
      $idd2 = strip_tags(base64_decode($_GET['idd2']));
	    $sq   = mysqli_query($con, "SELECT * FROM `p_orders` WHERE `oid`='$idd2' " );
	    $data = mysqli_fetch_assoc($sq);
      $ordr_amt1=$data['ordr_amt'];
      $dis_amnt1=$data['dis_amnt'];
      $net_amnt1=$data['net_amnt'];
      $or_tax1=$data['or_tax'];
      $total1=$data['total_amnt'];
      $ordr_date1=$data['ordr_date'];
      $compl_date1=$data['compl_date'];
      $bill_head1=$data['bill_head'];
      $order_id1=$data['order_id'];
      }
    ?>

	<div class="box-body" >
<div class="col-xs-5" style="padding-left: 0px">
<div class="panel panel-default">
	                    <div class="panel-heading">
                            <i class="fa fa-file-image-o fa-fw"></i> Order
                        </div>
                    <div class="panel-body" >
                    			
 <div class="row" >	
<div class="col-md-12" style="" >
  <div class="col-md-11" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">

<!--    
  <input type="text" name="ocustomer" id="ocustomer"  list="languages" placeholder="Customer" value="<?php echo $custres['cname']; ?>" onchange="get_customer(this.value)">
  
  <datalist id="languages">
     <?php
    $custsel = mysqli_query($con, "SELECT `cid`,`cname` FROM `p_customers` WHERE `cname` != '' GROUP BY `cname` ");
    while($custres = mysqli_fetch_array($custsel)){
       ?>
         <option value="<?php echo $custres['cid'].'-'.$custres['cname']; ?>"><?php echo $custres['cname']; ?></option>
    <?php  } ?>
  </datalist> -->
  
 
<select name="ocustomer" id="ocustomer" class="form-control selectpicker" data-show-subtext="true" data-live-search="true" onchange="get_customer(this.value)">
    <option value="" selected disabled>Customer</option>  
    <?php
    $custsel = mysqli_query($con, "SELECT `cid`,`cname` FROM `p_customers` WHERE `cname` != '' GROUP BY `cname` ");
    while($custres = mysqli_fetch_array($custsel)){
      if($data['ocustm'] == $custres['cid']){  ?>
         <option value="<?php echo ($custres['cid']); ?>" selected><?php echo $custres['cname']; ?></option>
    <?php }
      else if($_GET['customerid'] == $custres['cid']){  ?>
         <option value="<?php echo ($custres['cid']); ?>" selected><?php echo $custres['cname']; ?></option>
    <?php }
     else {  ?>
         <option value="<?php echo ($custres['cid']); ?>"><?php echo $custres['cname']; ?></option>
    <?php } } ?>
  </select> 
</div></div>
<div class="col-md-1" style="padding-left: 5px;padding-right: 0px;" id="plusbtn1"> 
  <div class="form-group">
    <button id="plusbtn" onclick="add_new_customer1()" style="background-color: white; padding: 0px;"><img src="assets/add.png" onload="minusdisplay();" width="25px" height="25px"></button>
  </div>
</div>
<?php 
if(empty($_GET['idd2'])){ ?>
<div class="col-md-1" style="padding-left: 5px;padding-right: 0px;" id="minusbtn1" > 
  <div class="form-group">
    <button id="minusbtn" onclick="add_new_customer2()" style="background-color: white; padding: 0px;"><img src="assets/minus.png" width="25px" height="25px"></button>
  </div>
</div>
<?php
}
?>
<form action="" method="POST">
<div class="col-md-12" style="padding-left: 5px;padding-right: 0px;" > 
  <div class="form-group">
    <?php
    $type_of_order=0;
    if(isset($_GET["type"])){
      $type_of_order=$_GET["type"];
    }  ?>
  <input type="radio" name="type1" value="0" onfocus="type_of_order(this.value);"checked > All
  <input type="radio" name="type1" value="1" onfocus="type_of_order(this.value);"<?php if($type_of_order==1){ ?>checked <?php } ?> > New 
  <input type="radio" name="type1" value="2" onfocus="type_of_order(this.value);" <?php if($type_of_order==2){ ?>checked <?php } ?> > Renewel 
  <input type="radio" name="type1" value="3" onfocus="type_of_order(this.value);" <?php if($type_of_order==3){ ?>checked <?php } ?> > Update
  <input type="radio" name="type1" value="4" onfocus="type_of_order(this.value);" <?php if($type_of_order==4){ ?>checked <?php } ?> > Rebuild

  </div>
</div>
</form>  
	 
<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">
  <select name="orderty" id="orderty"  class="form-control" onchange="order_type(this.value);" >
    <option value="" selected="selected" disabled>Order Type</option>
     
    <?php 
    if($type_of_order==0){
      $sq1 = mysqli_query($con, "SELECT * FROM `p_business`");
    }else{
    $sq1 = mysqli_query($con, "SELECT * FROM `p_business` WHERE `bstatus`='$type_of_order' ");}
    while($rs1 = mysqli_fetch_array($sq1)){ 
        if($data['ordr_type'] == $rs1['bid']){ 
      ?>
      <option value="<?php echo $rs1['bid']; ?>" selected><?php echo $rs1['b_business']; ?></option>
      <?php } else { ?>
      <option value="<?php echo $rs1['bid']; ?>"><?php echo $rs1['b_business']; ?></option>  
    <?php } }  ?>
  </select>
</div></div>


<!-- <div class="col-md-1" style="padding-left: 5px;padding-right: 0px;">          
<div class="form-group">
    <button id="sreg" onclick="new_customer('customerreg')"><img src="assets/add.png" width="25px" height="25px"></button>
</div>
</div>  --> 

<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;" >         
  <div class="form-group">
  <select name="ocompny" id="ocompny" class="form-control" onchange="branch_change(this.value);">
    <option value="" selected disabled>Company</option>
  <?php
  $sq2 = mysqli_query($con,"SELECT cid,c_comp FROM `p_company` ");
  while($res2 = mysqli_fetch_array($sq2)){
    if($data['ocomp'] == $res2['cid']){
  ?>  
  <option value="<?php echo $res2['cid']; ?>" selected><?php echo ucfirst($res2['c_comp']); ?></option>
  <?php } else { ?>
    <option value="<?php echo $res2['cid']; ?>"><?php echo ucfirst($res2['c_comp']); ?></option>
    <?php } } ?>
  </select> 
 </div></div>
 
 
 <div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">         
  <div class="form-group">
  <select name="rbranch" id="rbranch" class="form-control">
    <option value="" selected disabled>Branch</option>
    <?php
    $p_bran = $data['obranch'];
    $p_comp = $data['ocomp'];
    $bselect = mysqli_query($con,"SELECT * FROM `p_branch` WHERE `b_comp`='$p_comp' ");
    while($rsult = mysqli_fetch_array($bselect)) { 
        if($p_bran == $rsult['b_branchna']){ ?>
      <option value="<?php echo $rsult['b_branchna']; ?>" selected><?php echo $rsult['b_branchna']; ?></option>   
       <?php } else { ?>    
      <option value="<?php echo $rsult['b_branchna']; ?>"><?php echo $rsult['b_branchna']; ?></option>  
    <?php } } ?>
  </select> 
 </div></div>







<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="ordramnt" id="ordramnt" onkeypress="return isNumber2(event)" class="form-control" placeholder="Preposed Amount" value="<?php echo $ordr_amt1; ?>"/>	
</div></div>
<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px;">          
<div class="form-group">
  <input type="text" name="disamount" id="disamount" onkeypress="return isNumber2(event)" onchange="calc_netamount()" class="form-control" placeholder="Discount Amount" value="<?php echo $dis_amnt1; ?>"/>  
</div></div>

 	</div>	
</div>




	
	
	

	<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="netamount" id="netamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Total" value="<?php echo $net_amnt1; ?>" readonly/>	
</div></div>


<!-- <div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">				
<div class="form-group">
	<input type="text" name="ordertax" id="ordertax" class="form-control" onkeypress="return isNumber2(event)" onchange="calc_total()" placeholder="Tax" value="<?php echo $or_tax1; ?>"/>	
</div></div> -->
<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;" >          
<div class="form-group">
<select name="ordertax" id="ordertax" class="form-control" onchange="calc_total()">
  <option value="" >Tax</option>
    <?php
  $sq2 = mysqli_query($con,"SELECT * FROM `tax_master` ");
  while($res2 = mysqli_fetch_array($sq2)){
  ?>
 <!--  <option value="<?php echo $res2['tax_name']; ?>" selected><?php echo ucfirst($res2['country_name']); ?></option> -->
  
    <option value="<?php echo $res2['tax_per']; ?>"><?php echo ($res2['tax_name'] ." ( ". $res2['tax_per'] ." ) "); ?></option>
   <?php }?> 

</select> 
</div></div>

	<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">         
<div class="form-group">
  <input type="text" name="total" id="total" onkeypress="return isNumber2(event)"  class="form-control" placeholder="Net Amount" value="<?php echo $total1; ?>"readonly/> 
</div></div>

	<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">						
<div class="form-group">
	<input type="text" name="ordate" id="ordate" class="form-control tcal" placeholder="Order Date" value="<?php echo $ordr_date1; ?>"/>	
</div></div>

<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">				
<div class="form-group">
	<input type="text" name="compltdate" id="compltdate" class="form-control tcal" placeholder="Delivery Date" value="<?php echo $compl_date1; ?>"/>	
</div></div>



<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">				
<div class="form-group">
	<select name="orderbdo" id="orderbdo" class="form-control">
		<option value="">BDO</option>
		 <?php
           $emp = mysqli_query($con,"SELECT id,emp_name FROM employee_registration WHERE `status`='1'");
           while($emp_list = mysqli_fetch_array($emp))
           { 
           	if($data['or_bdo'] == $emp_list['emp_name']){
           	?>
           	<option value="<?php echo $emp_list['emp_name']; ?>" selected><?php echo $emp_list['emp_name']; ?></option>
           	<?php } else { ?>
           	 <option value="<?php echo $emp_list['emp_name']; ?>"><?php echo $emp_list['emp_name']; ?></option>
            <?php } } ?>	
	</select>	
</div></div>


<div class="col-md-12" style=" padding-left: 2px; padding-right: 0px;">				
<div class="form-group">
	<textarea name="bill_head" id="bill_head" class="form-control" style=" height: 75px;" placeholder="Bill Head"><?php echo $bill_head1; ?></textarea>
</div></div>	
	
<?php

$order_idd = $order_id1;
$dorder1='';
$s_order1='';
$al_order1='';
$sm_order1='';
$em_orderid1='';
$se_order1='';

//$dorder1='';
if($order_idd != ''){
$sjqry1 = mysqli_query($con,"SELECT * FROM `p_domain` WHERE `dorder`='$order_idd' ");
$rsqry1 = mysqli_fetch_array($sjqry1);

$sjqry2 = mysqli_query($con,"SELECT * FROM `p_server` WHERE `s_order`='$order_idd' ");
$rsqry2 = mysqli_fetch_array($sjqry2);

$sjqry3 = mysqli_query($con,"SELECT * FROM `p_alc` WHERE `al_order`='$order_idd' ");
$rsqry3 = mysqli_fetch_array($sjqry3);


$sjqry4 = mysqli_query($con,"SELECT * FROM `p_sms` WHERE `sm_order`='$order_idd' ");
$rsqry4 = mysqli_fetch_array($sjqry4);


$sjqry5 = mysqli_query($con,"SELECT * FROM `p_email` WHERE `em_orderid`='$order_idd' ");
$rsqry5 = mysqli_fetch_array($sjqry5);

$sjqry6 = mysqli_query($con,"SELECT * FROM `p_seo` WHERE `se_order`='$order_idd' ");
$rsqry6 = mysqli_fetch_array($sjqry6);

$sjqry7 = mysqli_query($con,"SELECT * FROM `p_website` WHERE `web_order`='$order_idd' ");
$rsqry7 = mysqli_fetch_array($sjqry7);

$sjqry9 = mysqli_query($con,"SELECT * FROM `p_amc` WHERE `amc_order`='$order_idd' ");
$rsqry9 = mysqli_fetch_array($sjqry9);

$dorder1=$rsqry1['dorder'];
$s_order1=$rsqry2['s_order'];
$al_order1=$rsqry3['al_order'];
$sm_order1=$rsqry4['sm_order'];
$em_orderid1=$rsqry5['em_orderid'];
$se_order1=$rsqry6['se_order'];
$web_order1=$rsqry7['web_order'];
$amc_order1=$rsqry9['amc_order'];
}
?>
	
<!-- <div class="col-md-12"  >						
<div class="form-group">
	<div class="checkbox">
                      <label>
                        <input type="checkbox" name="domain" id="domain" onclick="add_details('domain_det',this.value);" value="domain" <?php if($dorder1 != ''){ ?> checked <?php } ?> > Domain Only  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                      </label>
                      
                       <label>
                        <input type="checkbox" name="server" id="server" onclick="add_details('server_del',this.value);" value="server" <?php if($s_order1 != ''){ ?> checked <?php } ?>> Server Only &nbsp;&nbsp;&nbsp;
                      </label>
                      
                     
                      <label>
                        <input type="checkbox" name="dom_server" id="dom_server" onclick="add_details('dom_server',this.value);" value="dom_server" <?php if(($s_order1 != '') && isset($rsqry2['s_order'])){ ?> checked <?php } ?> > Domain & Server  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                      </label>
                      
                       <label>
                        <input type="checkbox" name="alc" id="alc" onclick="add_details('alc_det',this.value);" value="alc" <?php if($al_order1 != ''){ ?> checked <?php } ?>> ALC &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                      </label>
                      
                      
                      <label>
                        <input type="checkbox" name="sms" id="sms" onclick="add_details('sms_del',this.value);" value="sms" <?php if($sm_order1 != ''){ ?> checked <?php } ?>> SMS &nbsp;&nbsp;&nbsp;
                      </label>
                      
                      <label>
                        <input type="checkbox" name="email" id="email" onclick="add_details('email_del',this.value);" value="email" <?php if($em_orderid1 != ''){ ?> checked <?php } ?>> Email &nbsp;&nbsp;&nbsp;
                      </label>
                      
                      <label>
                        <input type="checkbox" name="seo" id="seo" onclick="add_details('seo_del',this.value);" value="seo" <?php if($se_order1 != ''){ ?> checked <?php } ?>> SEO
                      </label>
                   </div>
</div>	</div>
 -->


		

<div class="col-md-12">
<input type="checkbox" name="custsmssent" id="custsmssent" value="sms" style=" margin-left: 20px;"> Sent SMS to Customer
<input type="hidden" name="orderid11" id="orderid11" value="<?php echo $idd2;?>">
<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">				
<div class="form-group">
  <?php
    $sq   = mysqli_query($con, "SELECT * FROM `p_orders` WHERE `oid`='$idd2' " );
      $data = mysqli_fetch_assoc($sq);
  ?>
	<select name="order_status" id="order_status" class="form-control">
		<option value="0" <?php if($data['ostatus'] == '0'){ ?> selected="selected"  <?php } ?>>Live</option>
		<option value="1" <?php if($data['ostatus'] == '1'){ ?> selected="selected"  <?php } ?>>Billed</option>
		<option value="2" <?php if($data['ostatus'] == '2'){ ?> selected="selected"  <?php } ?>>Settled</option>
		<option value="3" <?php if($data['ostatus'] == '3'){ ?> selected="selected"  <?php } ?>>Work Under Hold</option>
	</select>	
</div></div>
</div>
	
</div></div>	</div>
	
	<div class="col-xs-7" >	

    <div id="add_customer" style="background-color: white ; ">

    </div>

 <!-- <div id="customerreg" style="display: none;">
  <?php
  /* include("customerreg.php");*/
        
          ?> 
 </div> -->
<!-- <div>
  <table id="ordertable">
  </table>
  <div> -->
    <table id="ordertable">
  </table>

<?php
  if(isset($_GET['customerid'])){
    $customerid=$_GET['customerid']
  ?>
<div class="box" >
   <div class="box-body" style="padding-left: 2px;padding-right: 2px">
        <div class="box-body table-responsive no-padding" >
   
                      
                  <table id="example1" class="table table-bordered table-striped" >
                    <thead >
                    <tr >
                     <th style="display: none;">#</th>
<th>Order No</th>                     
<th>Order Type</th>
<th>Amount</th>
<th>Order Date</th>
<th>Completion Date</th>
<th>Status</th>
<th>Action</th>
</tr>
                    </thead>
                    <tbody>
 <?php 
  if(isset($_GET['status'])){
      $status=$_GET['status'];
       $sqq = mysqli_query($con, "SELECT * FROM `p_orders` where `ostatus`='$status' AND `ocustm`='$customerid' ORDER BY `oid`  DESC"); 
        
        // Now you can use $file variable according to your code requirements
    }else
 $sqq = mysqli_query($con, "SELECT * FROM `p_orders` WHERE `ocustm`='$customerid' ORDER BY `oid`  DESC");
 $k=1;

 while($rss = mysqli_fetch_array($sqq)){
    
  $comid = $rss['ocomp'];
  $sq1 = mysqli_query($con,"SELECT c_comp FROM `p_company` WHERE `cid`='$comid' ");
  $rs1 = mysqli_fetch_array($sq1);  
  
  $orderid = $rss['order_id'];
  $sq2 = mysqli_query($con, "SELECT * FROM `p_domain` WHERE `dorder`='$orderid' ");
  $rs2 = mysqli_fetch_array($sq2);
  
  $sq3 = mysqli_query($con, "SELECT * FROM `p_server` WHERE `s_order`='$orderid' ");
  $rs3 = mysqli_fetch_array($sq3);
  
  $sq4 = mysqli_query($con, "SELECT * FROM `p_alc` WHERE `al_order`='$orderid' ");
  $rs4 = mysqli_fetch_array($sq4);
  
  $ocustm = $rss['ocustm'];
  $sq5 = mysqli_query($con, "SELECT cname FROM `p_customers` WHERE `cid`='$ocustm'");
  $rs5 = mysqli_fetch_array($sq5); 
  
  $sq6 = mysqli_query($con, "SELECT * FROM `p_sms` WHERE `sm_order`='$orderid' ");
  $rs6 = mysqli_fetch_array($sq6); 
  
  $sq7 = mysqli_query($con, "SELECT * FROM `p_email` WHERE `em_orderid`='$orderid' ");
  $rs7 = mysqli_fetch_array($sq7); 
  
  $sq8 = mysqli_query($con, "SELECT * FROM `p_seo` WHERE `se_order`='$orderid' ");
  $rs8 = mysqli_fetch_array($sq8);  
  
  $orddat = $rss['ordr_date'];
  $exp = explode("/",$orddat);
  $orddate = $exp[0].'-'.$exp[1].'-'.$exp[2]; 
  if($orddate == '//'){
    $orddate = '';
  }
  
  $comdat = $rss['compl_date'];
  $exp2 = explode("/",$comdat);
  $compltdate = $exp2[0].'-'.$exp2[1].'-'.$exp2[2]; 
  if($compltdate == '//'){
    $compltdate = '';
  }
  $date1=date_create($compltdate);
  $date2=date_create(date("Y-m-d"));
  $diff=date_diff($date2,$date1);
  if($rss['ostatus'] == '0'){?>
    <tr style="background-color:  #ffff66;">
 <?php }
 else if($rss['ostatus'] == '2'){?>
    <tr style="background-color:  #ff5c33;">
 <?php }
  else if($rss['ostatus'] == '1'){?>
    <tr style="background-color: #66ff66;">
 <?php }
 else{?>
    <tr style="background-color: #ff4d4d;">
 <?php }
 ?>                     

  <td style="display: none;"><?php echo $k; ?></td>
  <td><?php echo $rss['oid']; ?></td>
  <td><?php echo $rss['ordr_type']; ?></td>
  <td><?php echo $rss['total_amnt']; ?></td>
  <td><?php echo $orddate; ?></td>
  <td><?php echo $compltdate; ?></td>
  <td><?php if($rss['ostatus'] == '0'){ echo "Open"; } else if($rss['ostatus'] == '1'){ echo "Work Completed"; } else if($rss['ostatus'] == '2'){ echo "Work In Progress"; } else if($rss['ostatus'] == '3'){ echo "Work Under Hold"; } ?></td>
  <td>
    <a onClick="get_orderdata('<?php echo base64_encode($rss['order_id']); ?>');" style=" cursor: pointer;" >get details</a>
    <!-- 
  &nbsp;  <a href="" data-toggle="modal" data-target="#myModal<?php echo $rss['oid']; ?>" style=" cursor: pointer;"><span class="glyphicon glyphicon-eye-open" style="font-size:14px;"></span></a> &nbsp;                 
    <a onClick="edit_orders('<?php echo base64_encode($rss['oid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp;
    <a onClick="delete_orders('<?php echo base64_encode($rss['oid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;   -->
  </td>
</tr>


<div class="modal fade" id="myModal<?php echo $rss['oid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Order Details</h4>
      </div>
      <div class="modal-body" id="myModal2">
  
 <div style=" width:550px; ">
  <div style=" float:left; width:150px;  font-size:14px; color:#0000FF; ">Company Name</div><div style="width:375px; ">: &nbsp;&nbsp; <?php echo $rs1['c_comp']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Branch Name </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["obranch"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Type </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["ordr_type"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Customer </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs5['cname']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["ordr_amt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Discount Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["dis_amnt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Net Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["net_amnt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Date </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $orddate; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Completion Date </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $compltdate; ?></div>
  
 
   <?php if($rs2["d_domain"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Domain Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain Name</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_domain"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Ownership</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_owner"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_provider"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Reg. Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_regdate"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewal Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_renewel"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Intimation</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_intimation"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Redirection</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_redirectn"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_user"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_pass"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">AccessLink</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_access"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_remarks"]; ?></div>      
    <?php } ?>
    <?php if($rs3["s_comp"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Server Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Server Company</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_comp"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">OS</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_os"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">ALC</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_alc"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Start Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_start"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">End Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_end"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_remarks"]; ?></div>
     <?php } ?>
     
    <?php if($rs4["al_alc"] != ''){ ?> 
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">ALC Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">ALC</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_alc"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Provided By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_provided"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Start Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_start"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">End Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_end"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_remarks"]; ?></div>
    <?php } ?>
    
    <?php if($rs6["sm_domain"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">SMS Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_domain"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Access Link</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_access"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Count</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_count"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Per Rate</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_perrate"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewel</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_renewel"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Service Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_service"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SenderID</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_senderid"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Type</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_type"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Utility</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_utility"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Managed By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_managed"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Main Admin</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_main"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_muser"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_mpass"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Customer Admin</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_user"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_uuser"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_upass"]; ?></div>
    <?php } ?>
    
   <?php if($rs7["em_domain"] != ''){ ?>
   <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Email Details</h4>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_domain"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Service Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_service"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">No. Of Email</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_noemail"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Per Email Cost</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_cost"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_tax"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Expiry Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_expiry"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Type</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_type"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewel Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_renewel"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Managed By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_managed"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Email Details</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_details"]; ?></div>   
    <?php } ?>
   
   <?php if($rs8["se_domain"] != ''){ ?>
   <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">SEO Details</h4>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_domain"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Segment</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_segment"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(1)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank1"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(2)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank2"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(3)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank3"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Search Engine</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_engine"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_amount"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Keyword</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_keywords"]; ?></div>
   <?php } ?>
   

 </div>
  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
       
      </div>
    </div>
  </div>
</div>  


<?php $k=$k+1; } ?>
                    </tbody>
                    </table>
  
              </div>
                </div>
             </div>

<?php  }?>
        <div id="customer123" style="display: none">
        <div class="box" >
          <div class="box-body" style="padding-left: 10px;padding-right: 10px;">
            <div class="x_panel">
              <div class="x_content" id="marketingdiv3">
               <?php
               if(empty($_GET['idd2'])){
        
                  //$idd2 = strip_tags(base64_decode($_GET['idd2']));
                  $cname1='';
                  $ccontact1='';
                  $cdesignatn1='';
                  $cmob1='';
                  $cemail1='';
                  $cphone1='';
                  $cmob2='';
                  $cemail2='';
                  $cphone2='';
                  $cmob3='';
                  $cemail3='';
                  $perm_addr1='';
                  $comm_addr1='';
                  $cpincode1='';
                  $cremarks1='';
                  $crefered1='';
                  $cgoogle1='';
                  $cstatus1='';
                  $ctype1='';
                  $csource1='';
                  $gstNo='';
                }else{
                   $idd2 = strip_tags(base64_decode($_GET['idd2']));
                   $sq = mysqli_query($con, "SELECT * FROM `p_customers` WHERE `cid`='$idd2' " );
                   $rs = mysqli_fetch_assoc($sq);
                  $cname1=$rs['cname'];
                  $ccontact1=$rs['ccontact'];
                  $cdesignatn1=$rs['cdesignatn'];
                  $cmob1=$rs['cmob'];
                  $cemail1=$rs['cemail'];
                  $cphone1=$rs['cphone1'];
                  $cmob2=$rs['cmob2'];
                  $cemail2=$rs['cemail2'];
                  $cphone2=$rs['cphone2'];
                  $cmob3=$rs['cmob3'];
                  $cemail3=$rs['cemail3'];
                  $perm_addr1=$rs['perm_addr'];
                  $comm_addr1=$rs['comm_addr'];
                  $cpincode1=$rs['cpincode'];
                  $cremarks1=$rs['cremarks'];
                  $crefered1=$rs['crefered'];
                  $cgoogle1=$rs['cgoogle'];
                  $cstatus1= $rs['cstatus'];
                  $ctype1=$rs['ctype'];
                  $csource1=$rs['csource'];
                  $gstNo=$rs['gstNo'];
                  } ?>                
                <div class="form-horizontal form-label-left">
                   
                   <div class="panel panel-default">
                    <div class="panel-heading">
                      <i class="fa fa fa-users"></i> &nbsp; Add New Customer
                    </div></div>  
                    
                    
                    <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <input type="text" name="vcompany" id="vcompany" class="form-control" placeholder="Company Name" value="<?php echo $cname1; ?>"/>
                     </div></div> 
                     
                     <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <select name="vtype" id="vtype" class="form-control" >
                          <option value="">Type</option>
                          <option value="Silver" <?php if($ctype1 == 'Silver'){ ?> selected <?php } ?> >Silver</option>
                          <option value="Gold" <?php if($ctype1 == 'Gold'){ ?> selected <?php } ?>>Gold</option>
                          <option value="Diamond" <?php if($ctype1 == 'Diamond'){ ?> selected <?php } ?>>Diamond</option>
                                                    
                        </select>
                      </div></div>  
                     
                     <div class="form-group">
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vcontact" id="vcontact" class="form-control" placeholder="Contact Person" value="<?php echo $ccontact1; ?>"/>
                     </div>
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vdesignatn" id="vdesignatn" class="form-control" placeholder="Designation" value="<?php echo $cdesignatn1; ?>" />
                     </div></div> 
                     
                     
                     
                     <div class="form-group">
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vmob" id="vmob" onkeypress="return isNumber(event)" class="form-control" placeholder="Mobile1" value="<?php echo $cmob1; ?>"/>
                     </div>
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vmob2" id="vmob2" onkeypress="return isNumber(event)" class="form-control" value="<?php echo $cmob2; ?>" placeholder="Mobile2"/>
                     </div></div> 

                     <div class="form-group">
                     <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vmob3" id="vmob3" onkeypress="return isNumber(event)" class="form-control" value="<?php echo $cmob3; ?>" placeholder="Mobile3"/>
                     </div> 
                     
                     
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vemail" id="vemail" class="form-control" placeholder="Email1" value="<?php echo $cemail1; ?>"/>
                     </div></div>

                     <div class="form-group">

                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vemail2" id="vemail2" class="form-control" placeholder="Email2" value="<?php echo $cemail2; ?>"/>
                     </div>

                     <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vemail3" id="vemail3" class="form-control" placeholder="Email3" value="<?php echo $cemail3; ?>"/>
                     </div></div> 
                     
                     <div class="form-group">
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vland1" id="vland1" class="form-control" placeholder="Land Phone1" value="<?php echo $cphone1; ?>"/>
                     </div>
                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vland2" id="vland2" class="form-control" placeholder="Land Phone2" value="<?php echo $cphone2; ?>"/>
                     </div></div> 
                     
                     
                     <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <textarea name="permantaddrs" id="permantaddrs" class="form-control" placeholder="Permanant Address" ><?php echo $perm_addr1; ?></textarea>
                      </div></div>
                     
                     <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <textarea name="commnctnaddrs" id="commnctnaddrs" class="form-control" placeholder="Communication Address"><?php echo $comm_addr1; ?></textarea>
                      </div></div>
                      
                      
                      
                       
                      
                      
                      <div class="form-group">

                         <div class="col-md-6 col-sm-12 col-xs-12">
                        <select name="vcountry" id="vcountry" class="form-control">
  <option value="" >Country</option>
    <?php
  $sq2 = mysqli_query($con,"SELECT id,country_name FROM `countries` ");
  while($res2 = mysqli_fetch_array($sq2)){
     if($res2['country_name'] == 'India'){ ?> 
  <option value="<?php echo $res2['country_name']; ?>" selected><?php echo ucfirst($res2['country_name']); ?></option>
  <?php } else if($rs['ccountry'] == $res2['country_name']) { ?>
  <option value="<?php echo $res2['country_name']; ?>" selected><?php echo ucfirst($res2['country_name']); ?></option>
  <?php } else { ?>
    <option value="<?php echo $res2['country_name']; ?>"><?php echo ucfirst($res2['country_name']); ?></option>
    <?php } } ?>
</select>
                     </div>

                     
                      <div class="col-md-6 col-sm-12 col-xs-12">
                         <select class="form-control" id="vstate" name="vstate" onchange="state_change(this.value);">
  <option value="">State</option>
        <?php
        $stmt01 = mysqli_query($con,"SELECT * FROM `states` ");
        while($res01 = mysqli_fetch_array($stmt01)) {
          if($res01['state_name'] == 'KERALA'){ ?>
        <option value="<?php echo $res01['state_name']; ?>" selected><?php echo $res01['state_name']; ?></option>       
        <?php } else if($rs['cstate'] == $res01['state_name']){ ?>
        <option value="<?php echo $res01['state_name']; ?>" selected><?php echo $res01['state_name']; ?></option>
      <?php } else { ?>    
         <option value="<?php echo $res01['state_name']; ?>"><?php echo $res01['state_name']; ?></option>
        <?php } } ?>
  </select> 
                     </div>
                     </div>
                     
                     
                     
                     <div class="form-group">
                       <div class="col-md-6 col-sm-12 col-xs-12">
                        <select class="form-control" id="vdistrict" name="vdistrict"  >
    <option value="">District</option>
     <?php 
     $dis = $rs['cdistrict'];
   $sta = $rs['cstate'];
   if($sta == ''){
    $sta = 'Kerala';
   }
   $stmt01 = mysqli_query($con,"SELECT * FROM `cities` WHERE `state_name`='$sta' ");
        while($res01 = mysqli_fetch_array($stmt01)) {
           if($res01['cities_name'] == 'Thrissur'){ ?>
         <option value="<?php echo $res01['cities_name']; ?>" selected><?php echo $res01['cities_name']; ?></option>     
          <?php } else if($res01['cities_name'] == $dis){ ?> 
        <option value="<?php echo $res01['cities_name']; ?>" selected><?php echo $res01['cities_name']; ?></option> 
        <?php } else { ?> 
        <option value="<?php echo $res01['cities_name']; ?>"><?php echo $res01['cities_name']; ?></option>    
       <?php } } ?>
    </select>
                     </div>
                     
                     <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="vpincode" id="vpincode" class="form-control" placeholder="Pincode" value="<?php echo $cpincode1; ?>" />
                     </div>                     
                     </div> 
                     
                     
                     
                      <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <textarea name="vremarks" id="vremarks" class="form-control" placeholder="Remarks"><?php echo $cremarks1; ?></textarea>
                      </div></div>
                      
                     <div class="form-group">
                       <div class="col-md-6 col-sm-12 col-xs-12">    
                        <input type="text" name="vreferred" id="vreferred" class="form-control" placeholder="Referred By" value="<?php echo $crefered1; ?>"/>                   
                       </div>
                       <div class="col-md-6 col-sm-12 col-xs-12">   
                        <select name="vsource" id="vsource" class="form-control">
                           <option value="">Source</option> 
                           <option value="NewsPaper" <?php if($csource1 == 'NewsPaper'){ ?> selected <?php } ?> >NewsPaper</option>
                           <option value="E-Directory" <?php if($csource1 == 'E-Directory'){ ?> selected <?php } ?> >E-Directory</option>
                           <option value="Magazine" <?php if($csource1 == 'Magazine'){ ?> selected <?php } ?> >Magazine</option>
                           <option value="Staff" <?php if($csource1 == 'Staff'){ ?> selected <?php } ?> >Staff</option>
                           <option value="Referred" <?php if($csource1 == 'Referred'){ ?> selected <?php } ?> >Referred</option>
                           <option value="Marketing" <?php if($csource1 == 'Marketing'){ ?> selected <?php } ?> >Marketing</option>
                           <option value="Other" <?php if($csource1 == 'Other'){ ?> selected <?php } ?> >Other</option>                          
                        </select>               
                       </div>
                     </div> 
                        
                      
                     
                     
                     <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <input type="text" name="vgoogle" id="vgoogle" class="form-control" placeholder="Google Link" value="<?php echo $cgoogle1; ?>" />
                     </div></div> 
                     
                     <div class="form-group">

                      <div class="col-md-6 col-sm-12 col-xs-12">
                        <input type="text" name="gstNo" id="gstNo" class="form-control" placeholder="GST NO" value="<?php echo $gstNo; ?>" />
                     </div> 
                     
                     
              
                      <div class="col-md-6 col-sm-12 col-xs-12">
                       <select name="vstatus" id="vstatus" class="form-control">
                       <option value="Live" <?php if($cstatus1 == 'Live'){ ?> selected <?php } ?> >Live</option>
                        <option value="Lost" <?php if($cstatus1 == 'Lost'){ ?> selected <?php } ?>>Lost</option>
                        <option value="Closed" <?php if($cstatus1 == 'Closed'){ ?> selected <?php } ?>>Closed</option>
                       </select>
                     </div>
                   </div>

                    
                      <div class="form-group">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                        Logo  
                       <input type="file" name="vlogo" id="vlogo" />
                      </div></div>
                      
                      <div class="form-group">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                        Business Card 
                        <input type="file" name="vbusiness" id="vbusiness" />
                      </div></div>
                       
                     <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
<input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" onclick="add_new_customer();" style=" float: right; 
margin-right: 10px; " />
<input type="submit" class="btn btn-primary" name="frasubmit1" id="frasubmit1" value="Back" onclick="window.location.href = 'orders.php';" style=" float: right; 
margin-right: 20px; " />

                     </div></div> 
                     
           
                    
                    

        </div></div></div></div></div></div>


<?php if(isset($rsqry4['web_order'])) { ?>
  <div id="web_del">  
<?php } else { ?>
  <div id="web_del" style=" display: none;">  
<?php } 
$sjqry7 = mysqli_query($con,"SELECT * FROM `p_website` WHERE `web_order`='$order_idd' ");
$rsqry7 = mysqli_fetch_array($sjqry7);

?>  


   <div class="panel panel-default">
        <div class="panel-heading">
             <i class="fa fa-server fa-fw"></i> Website Details
        </div>
    <div class="panel-body" >
                      


<div class="row" >  
<div class="col-md-12" style="" >


<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;" >         
<div class="form-group">
  <select name="web_type" id="web_type" class="form-control">
    <option value="" selected disabled>Website Type</option>
    <option value="Static" <?php if($rsqry7['web_type'] == 'Static'){ ?> selected <?php } ?>>Static</option>
    <option value="Dynamic" <?php if($rsqry7['web_type'] == 'Dynamic'){ ?> selected <?php } ?>>Dynamic</option>
  </select>   
</div></div>  


<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">
  <select name="web_tec" id="web_tec" class="form-control">
    <option value="" selected disabled>Technology</option>
    <option value="Wordpress" <?php if($rsqry7['web_tec'] == 'Wordpress'){ ?> selected <?php } ?>>Wordpress</option>
    <option value="Core" <?php if($rsqry7['web_tec'] == 'Core'){ ?> selected <?php } ?>>Core</option>
    <option value="jumla" <?php if($rsqry7['web_tec'] == 'jumla'){ ?> selected <?php } ?>>jumla</option>
  </select>     
</div></div>  




</div></div>








</div></div>
</div>




<?php if(isset($rsqry1['dorder'])){ ?>
<div id="domain_det">
<?php } else { ?>
<div id="domain_det" style=" display: none; ">
<?php }$sjqry1 = mysqli_query($con,"SELECT * FROM `p_domain` WHERE `dorder`='$order_idd' ");
$rsqry1 = mysqli_fetch_array($sjqry1); ?>	
        <div class="panel panel-default">
                        <div class="panel-heading">
                            <i class="fa fa-wordpress fa-fw"></i> Domain Details
                        </div>
                    <div class="panel-body" >
                    	
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-12" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="ddomain" id="ddomain" class="form-control" placeholder="Domain Name" value="<?php echo $rsqry1['d_domain']; ?>"/>			
</div></div>	

<!-- <div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >         
<div class="form-group">
  <input type="text" name="domain" id="domain" class="form-control" placeholder="Domain" value="<?php echo $rsqry1['d_domain'];  ?>"/>      
</div></div>
 -->
<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<select name="downer" id="downer" class="form-control">
		<option value="">Ownership</option>
		<option value="Programers" <?php if($rsqry1['d_owner'] == 'Programers'){ ?> selected <?php } ?>>PROGRAMERS</option>
		<option value="Customer" <?php if($rsqry1['d_owner'] == 'Customer'){ ?> selected <?php } ?>>CUSTOMER</option>
	</select>
				
</div></div>

<div class="col-md-6"  style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<!-- <input type="text" name="dprovider" id="dprovider" class="form-control" placeholder="Domain Provider" value="<?php echo $rsqry1['d_provider']; ?>"/> -->
  <select name="dprovider" id="dprovider" class="form-control">
  <option value="" >Domain Provider</option>
    <?php
  $sq6 = mysqli_query($con,"SELECT * FROM `p_domainprovider` ");
  while($res6 = mysqli_fetch_array($sq6)){
  ?>
 <!--  <option value="<?php echo $res2['tax_name']; ?>" selected><?php echo ucfirst($res2['country_name']); ?></option> -->
  
    <option value="<?php echo $res6['provider']; ?>"><?php echo ($res6['provider'] ); ?></option>
   <?php }?> 
</select> 			
</div></div>

<div class="col-md-4"  style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input placeholder="Reg. Date" type="date" name="dregdate" id="dregdate" class="form-control " onfocus="calc_date()"  value="<?php  echo date('Y-m-d'); ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="drenewel" id="drenewel" class="form-control" placeholder="Renewal Date" value="<?php echo $rsqry1['d_renewel']; ?>" readonly/>			
</div></div>
<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >         
<div class="form-group">
  <input type="text" name="dexp" id="dexp" class="form-control" placeholder="Exp. Date" value="<?php echo $rsqry1['d_expdate']; ?>" readonly/>      
</div></div>


</div></div>



<div class="row" >	
<div class="col-md-12" style="" >





<div class="col-md-3" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="damount" id="damount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry1['d_amnt']; ?>"/>			
</div></div>

<!-- <<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="dtax" id="dtax" class="form-control" placeholder="Tax" value="<?php echo $rsqry1['d_tax']; ?>"/>			
</div></div> -->
 <div class="col-md-3" style="padding-left: 2px;padding-right: 0px;" >          
<div class="form-group">
<select name="dtax" id="dtax" class="form-control" onchange="calc_dnetamo();">
  <option value="" >Tax</option>
    <?php
  $sq2 = mysqli_query($con,"SELECT * FROM `tax_master` ");
  while($res2 = mysqli_fetch_array($sq2)){
  ?>
 <!--  <option value="<?php echo $res2['tax_name']; ?>" selected><?php echo ucfirst($res2['country_name']); ?></option> -->
  
    <option value="<?php echo $res2['tax_per']; ?>"><?php echo ($res2['tax_name'] ." ( ". $res2['tax_per'] ." ) "); ?></option>
   <?php }?> 
</select> 
</div></div>

<div class="col-md-3" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">
  <input type="text" name="dnetamo" id="dnetamo" class="form-control" placeholder="Netamount" value="<?php echo $rsqry1['d_netamount']; ?>" readonly/>     
</div></div>

<div class="col-md-3" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">
  <input type="text" name="gstno" id="gstno" class="form-control" placeholder="GST No" value="<?php echo $rsqry1['GstNo'];?>"/>     
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;"  >					
<div class="form-group">
	<input type="text" name="dredirectn" id="dredirectn" class="form-control" placeholder="Redirection" value="<?php echo $rsqry1['d_redirectn']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="duser" id="duser" class="form-control" placeholder="Username" value="<?php echo $rsqry1['d_user']; ?>" />			
</div></div>


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="dpass" id="dpass" class="form-control" placeholder="Password" value="<?php echo $rsqry1['d_pass']; ?>" />			
</div></div>


</div></div>





<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="daccess" id="daccess" class="form-control" placeholder="Access Link" value="<?php echo $rsqry1['d_access']; ?>"/>			
</div></div>
<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<select name="dom_credentl" id="dom_credentl" class="form-control">
		<option value="">Credential</option>
		<option value="Yes" <?php if($rsqry1['d_credential'] == 'Yes') { ?> selected <?php } ?>>Yes</option>
		<option value="No" <?php if($rsqry1['d_credential'] == 'No') { ?> selected <?php } ?>>No</option>
	</select>			
</div></div>



<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
<textarea name="dremarks" id="dremarks" class="form-control" style=" height: 75px;" placeholder="Remarks"><?php echo $rsqry1['d_remarks']; ?></textarea>
</div></div>


</div></div>


</div></div>

</div>




<?php if(isset($rsqry9['amc_order'])){ ?>
   <div id="amc_det">
<?php } else { ?>
  <div id="amc_det" style=" display: none;">
<?php }
$sjqry9 = mysqli_query($con,"SELECT * FROM `p_amc` WHERE `amc_order`='$order_idd' ");
$rsqry9 = mysqli_fetch_array($sjqry9);

 ?> 
        <div class="panel panel-default">
                        <div class="panel-heading">
                            <i class="fa fa-file-pdf-o fa-fw"></i> AMC Details
                        </div>
                    <div class="panel-body" >
                          
 
<div class="row" >  
<div class="col-md-12" style="" >

<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >         
<div class="form-group">
  <input type="text" name="amcdomain" id="amcdomain" class="form-control" placeholder="Domain" value="<?php echo $rsqry9['amc_domain']; ?>"/>      
</div></div>  
<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >         
<div class="form-group">
  <input type="text" name="amc_per" id="amc_per" class="form-control" placeholder="AMC %" value="<?php echo $rsqry9['amc_per']; ?>"/>     
</div></div>  

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >         
<div class="form-group">
  <input type="text" name="amcamount" id="amcamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry9['netamount']; ?>"/>     
</div></div>  

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">          
<div class="form-group">
  <input type="date" name="amcsdate" id="amcsdate" class="form-control tcal" placeholder="Start Date" value="<?php echo $rsqry9['sdate']; ?>"/>      
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >         
<div class="form-group">
  <input type="date" name="amcedate" id="amcedate" class="form-control tcal" placeholder="End Date" value="<?php echo $rsqry9['edate']; ?>"/>      
</div></div>





</div></div></div>


</div></div>









<?php if(isset($rsqry3['al_order'])){ ?>
   <div id="alc_det">
<?php } else { ?>
	<div id="alc_det" style=" display: none;">
<?php }
$sjqry3 = mysqli_query($con,"SELECT * FROM `p_alc` WHERE `al_order`='$order_idd' ");
$rsqry3 = mysqli_fetch_array($sjqry3);

 ?>	
        <div class="panel panel-default">
                        <div class="panel-heading">
                            <i class="fa fa-file-pdf-o fa-fw"></i> ALC Details
                        </div>
                    <div class="panel-body" >
                        	
 
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="alcalc" id="alcalc" class="form-control" placeholder="ALC" value="<?php echo $rsqry3['al_alc']; ?>"/>			
</div></div>	
<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="alcprovided" id="alcprovided" class="form-control" placeholder="Provides By" value="<?php echo $rsqry3['al_provided']; ?>"/>			
</div></div>	


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="alcstart" id="alcstart" class="form-control tcal" placeholder="Start Date" value="<?php echo $rsqry3['al_start']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="alcend" id="alcend" class="form-control tcal" placeholder="End Date" value="<?php echo $rsqry3['al_end']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="alcamount" id="alcamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry3['al_amnt']; ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="alctax" id="alctax" class="form-control" placeholder="Tax" value="<?php echo $rsqry3['al_tax']; ?>"/>			
</div></div>



</div>

<div class="col-md-12" style="" >

<div class="col-md-12" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
		<textarea name="alcremarks" id="alcremarks" class="form-control" placeholder="Remarks" style="height: 75px;"><?php echo $rsqry3['al_remarks']; ?></textarea>	
</div></div></div>	
</div>





</div></div>


</div>









<?php if(isset($rsqry2['s_order'])){ ?>
<div id="server_del" >
<?php } else { ?>
<div id="server_del" style=" display: none;">	
<?php }
$sjqry2 = mysqli_query($con,"SELECT * FROM `p_server` WHERE `s_order`='$order_idd' ");
$rsqry2 = mysqli_fetch_array($sjqry2);
 ?>	

   <div class="panel panel-default">
                        <div class="panel-heading">
                            <i class="fa fa-server fa-fw"></i> Server Details
                        </div>
                    <div class="panel-body" >
                    	
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-7" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="sercomp" id="sercomp" class="form-control" placeholder="Server Company" value="<?php echo $rsqry2['s_comp']; ?>"/>			
</div></div>	


<div class="col-md-5" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="opertsystm" id="opertsystm" class="form-control" placeholder="Os" value="<?php echo $rsqry2['s_os']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="servalc" id="servalc" class="form-control" placeholder="ALC" value="<?php echo $rsqry2['s_alc']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="srstartdat" id="srstartdat" class="form-control tcal" placeholder="Start date" value="<?php echo $rsqry2['s_start']; ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="srenddate" id="srenddate" class="form-control tcal" placeholder="End Date" value="<?php echo $rsqry2['s_end']; ?>"/>			
</div></div>

</div></div>



<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="sramount" id="sramount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry2['s_amnt']; ?>"/>			
</div></div>

<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="srtax" id="srtax" class="form-control" placeholder="Tax" value="<?php echo $rsqry2['s_tax']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<select name="srowner" id="srowner" class="form-control">
		<option value="">Ownership</option>
		<option value="Programers" <?php if($rsqry2['s_owner'] == 'Programers'){ ?> selected <?php } ?>>Programers</option>
		<option value="Customer" <?php if($rsqry2['s_owner'] == 'Customer'){ ?> selected <?php } ?>>Customer</option>
	</select>
				
</div></div>



<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">				
<div class="form-group">
	<select name="sr_credentl" id="sr_credentl" class="form-control">
		<option value="">Credential</option>
		<option value="Yes" <?php if($rsqry2['s_credential'] == 'Yes') { ?> selected <?php } ?>>Yes</option>
		<option value="No" <?php if($rsqry2['s_credential'] == 'No') { ?> selected <?php } ?>>No</option>
	</select>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="srspace" id="srspace" class="form-control" placeholder="Server Space" value="<?php echo $rsqry2['s_space']; ?>"/>			
</div></div>

<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<textarea name="srremarks" id="srremarks" placeholder="Remarks" class="form-control" style="height: 35px;"><?php echo $rsqry2['s_remarks']; ?></textarea>		
</div></div>	






</div></div>
</div></div>
</div>





<?php if(isset($rsqry4['sm_order'])) { ?>
	<div id="sms_del">	
<?php } else { ?>
	<div id="sms_del" style=" display: none;">	
<?php } 
$sjqry4 = mysqli_query($con,"SELECT * FROM `p_sms` WHERE `sm_order`='$order_idd' ");
$rsqry4 = mysqli_fetch_array($sjqry4);

?>	


   <div class="panel panel-default">
        <div class="panel-heading">
             <i class="fa fa-server fa-fw"></i> SMS Details
        </div>
    <div class="panel-body" >
                    	
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="smsdomain" id="smsdomain" class="form-control" placeholder="Domain" value="<?php echo $rsqry4['sm_domain']; ?>"/>			
</div></div>	


<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smsaccess" id="smsaccess" class="form-control" placeholder="Access Link" value="<?php echo $rsqry4['sm_access']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smscount" id="smscount" class="form-control" onkeypress="return isNumber(event)" placeholder="Count" value="<?php echo $rsqry4['sm_count']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smsperrat" id="smsperrat" class="form-control" onkeypress="return isNumber2(event)" placeholder="SMS Per Rate" value="<?php echo $rsqry4['sm_perrate']; ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smsrenewel" id="smsrenewel" class="form-control tcal" placeholder="Renewel" value="<?php echo $rsqry4['sm_renewel']; ?>"/>			
</div></div>

</div></div>



<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="smsamount" id="smsamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry4['sm_amnt']; ?>"/>			
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="smsserv_prov" id="smsserv_prov" class="form-control" placeholder="Service Provider" value="<?php echo $rsqry4['sm_service']; ?>"/>			
</div></div>


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="smsserderid" id="smsserderid" class="form-control" placeholder="Sender ID" value="<?php echo $rsqry4['sm_senderid']; ?>" />		
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<select name="smstype" id="smstype" class="form-control">
		<option value="" selected disabled>SMS Type</option>
		<option value="Promotional" <?php if($rsqry4['sm_type'] == 'Promotional'){ ?> selected <?php } ?>>Promotional</option>
		<option value="Transactional" <?php if($rsqry4['sm_type'] == 'Transactional'){ ?> selected <?php } ?>>Transactional</option>
	</select>		
</div></div>	


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<select name="smsutility" id="smsutility" class="form-control">
		<option value="" selected disabled>SMS Utility</option>
		<option value="API" <?php if($rsqry4['sm_utility'] == 'API'){ ?> selected <?php } ?>>API</option>
		<option value="Direct" <?php if($rsqry4['sm_utility'] == 'Direct'){ ?> selected <?php } ?>>Direct</option>
		<option value="Both" <?php if($rsqry4['sm_utility'] == 'Both'){ ?> selected <?php } ?>>Both</option>
	</select>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<select name="smsmanaged" id="smsmanaged" class="form-control">
		<option value="" selected disabled>Managed By</option>
		<option value="Aparna" <?php if($rsqry4['sm_managed'] == 'Aparna'){ ?> selected <?php } ?>>Aparna</option>
	</select>			
</div></div>



<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; " >					
<div class="form-group">
	<input type="text" name="smsmainadm" id="smsmainadm" class="form-control" placeholder="Main Admin" value="<?php echo $rsqry4['sm_main']; ?>" />		
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="smsmainuser" id="smsmainuser" class="form-control" placeholder="Username" value="<?php echo $rsqry4['sm_muser']; ?>" />		
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smsmainpass" id="smsmainpass" class="form-control" placeholder="Password" value="<?php echo $rsqry4['sm_mpass']; ?>" />		
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smscust" id="smscust" class="form-control" placeholder="Customer Admin" value="<?php echo $rsqry4['sm_user']; ?>" />		
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smscustuser" id="smscustuser" class="form-control" placeholder="Username" value="<?php echo $rsqry4['sm_uuser']; ?>" />		
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="smscustpass" id="smscustpass" class="form-control" placeholder="Password" value="<?php echo $rsqry4['sm_upass']; ?>" />		
</div></div>

	


</div></div>








</div></div>
</div>







<?php if(isset($rsqry5['em_orderid'])) { ?>
	<div id="email_del">
<?php } else { ?>
<div id="email_del" style=" display: none;">	
<?php }
$sjqry5 = mysqli_query($con,"SELECT * FROM `p_email` WHERE `em_orderid`='$order_idd' ");
$rsqry5 = mysqli_fetch_array($sjqry5);
 ?>		
	

   <div class="panel panel-default">
        <div class="panel-heading">
             <i class="fa fa-server fa-fw"></i> Email Details
        </div>
    <div class="panel-body" >
                    	
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="emdomain" id="emdomain" class="form-control" placeholder="Domain" value="<?php echo $rsqry5['em_domain']; ?>"/>			
</div></div>	


<div class="col-md-3" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="emservice" id="emservice" class="form-control" placeholder="Service Provider" value="<?php echo $rsqry5['em_service']; ?>"/>			
</div></div>

<div class="col-md-3" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="emcount" id="emcount" class="form-control" placeholder="No. of Email" value="<?php echo $rsqry5['em_noemail']; ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="emcost" id="emcost" onkeypress="return isNumber2(event)" class="form-control " placeholder="Per Email Cost" value="<?php echo $rsqry5['em_cost']; ?>"/>			
</div></div>



<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="emtax" id="emtax" class="form-control" placeholder="Tax" value="<?php echo $rsqry5['em_tax']; ?>"/>			
</div></div>

<div class="col-md-4" style=" padding-left: 2px; padding-right: 0px; ">					
<div class="form-group">
	<input type="text" name="emexpiry" id="emexpiry" class="form-control tcal" placeholder="Expiry Date" value="<?php echo $rsqry5['em_expiry']; ?>"/>			
</div></div>


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<select name="emtype" id="emtype" class="form-control">
		<option value="" selected disabled>Type</option>
		<option value="Paid" <?php if($rsqry5['em_type'] == 'Paid'){ ?> selected <?php } ?>>Paid</option>
		<option value="Free" <?php if($rsqry5['em_type'] == 'Free'){ ?> selected <?php } ?>>Free</option>
	</select>		
</div></div>	


<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="emrenewel" id="emrenewel" class="form-control tcal" placeholder="Renewel Date" value="<?php echo $rsqry5['em_renewel']; ?>"/>		
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<select name="emmanaged" id="emmanaged" class="form-control">
		<option value="" selected disabled>Managed By</option>
		<option value="Aparna" <?php if($rsqry5['em_managed'] == 'Aparna'){ ?> selected <?php } ?>>Aparna</option>
	</select>			
</div></div>



<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<textarea name="emdetails" id="emdetails" class="form-control" placeholder="Email Details" style="height:35px;"><?php echo $rsqry5['em_details']; ?></textarea>	
</div></div>

	


</div></div>




</div></div>
</div>






<?php if(isset($rsqry6['se_order'])) { ?>
<div id="seo_del" >	
<?php } else { ?>
<div id="seo_del" style=" display: none;">
<?php } 
$sjqry6 = mysqli_query($con,"SELECT * FROM `p_seo` WHERE `se_order`='$order_idd' ");
$rsqry6 = mysqli_fetch_array($sjqry6);
?>		
	

   <div class="panel panel-default">
        <div class="panel-heading">
             <i class="fa fa-server fa-fw"></i> SEO Details
        </div>
    <div class="panel-body" >
                    	
<div class="row" >	
<div class="col-md-12" style="" >

<div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; "  >					
<div class="form-group">
	<input type="text" name="seodomain" id="seodomain" class="form-control" placeholder="Domain" value="<?php echo $rsqry6['se_domain']; ?>"/>			
</div></div>	


<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<select name="seosergment" id="seosergment" class="form-control">
		<option value="">Segment</option>
		<option value="Monthly" <?php if($rsqry6['se_segment'] =='Monthly'){ ?> selected <?php } ?>>Monthly</option>
		<option value="Quarterly" <?php if($rsqry6['se_segment'] =='Quarterly'){ ?> selected <?php } ?>>Quarterly</option>
		<option value="Half Yearly" <?php if($rsqry6['se_segment'] =='Half Yearly'){ ?> selected <?php } ?>>Half Yearly</option>
		<option value="Yearly" <?php if($rsqry6['se_segment'] =='Yearly'){ ?> selected <?php } ?>>Yearly</option>
	</select>
				
</div></div>

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="seoresult1" id="seoresult1" class="form-control" placeholder="Ranking Result(1)" value="<?php echo $rsqry6['se_rank1']; ?>"/>			
</div></div>	

<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;" >					
<div class="form-group">
	<input type="text" name="seoresult2" id="seoresult2" class="form-control " placeholder="Ranking Result(2)" value="<?php echo $rsqry6['se_rank2']; ?>"/>			
</div></div>



<div class="col-md-4" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="seoresult3" id="seoresult3" class="form-control" placeholder="Ranking Result(3)" value="<?php echo $rsqry6['se_rank3']; ?>"/>			
</div></div>

<div class="col-md-6"   style=" padding-left: 2px; padding-right: 0px;"  >					
<div class="form-group">
	<select name="seoengine" id="seoengine" class="form-control">
		<option value="">Search Engine</option>
		<option value="MSN" <?php if($rsqry6['se_engine'] == 'MSN'){ ?> selected <?php } ?>>MSN</option>
		<option value="Google" <?php if($rsqry6['se_engine'] == 'Google'){ ?> selected <?php } ?>>Google</option>
		<option value="Yahoo" <?php if($rsqry6['se_engine'] == 'Yahoo'){ ?> selected <?php } ?>>Yahoo</option>
		<option value="Rediff" <?php if($rsqry6['se_engine'] == 'Rediff'){ ?> selected <?php } ?>>Rediff</option>
		<option value="Bing" <?php if($rsqry6['se_engine'] == 'Bing'){ ?> selected <?php } ?>>Bing</option>
		<option value="Others" <?php if($rsqry6['se_engine'] == 'Others'){ ?> selected <?php } ?>>Others</option>
		
	</select>			
</div></div>

<div class="col-md-6" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<input type="text" name="seoamount" id="seoamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rsqry6['se_amount']; ?>" />
</div></div>	
	

<div class="col-md-12" style="padding-left: 2px;padding-right: 0px;">					
<div class="form-group">
	<textarea name="seokeyword" id="seokeyword" class="form-control" placeholder="Keywords" style="height:35px;"><?php echo $rsqry6['se_keywords']; ?></textarea>	
</div></div>

	
</div></div>

</div></div>
</div> </div>







	
<div class="row" >	
<div class="col-md-12" style="" >
			
<div class="form-group">
<?php if(!empty($_GET['idd2']) && !isset($_GET['idd3'])){ ?>
	<input type="hidden" name="hidvall" id="hidvall" value="<?php echo $data['order_id']; ?>" />
    <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Update" onclick="edit_new_order();" style=" float: right;margin-right: 20px; " /> 
<?php } else { ?>
    <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" onclick="add_new_order();" style=" float: right;margin-right: 20px; " />	
<?php } ?> 
</div>

</div></div>	
	
	
	
  
	
	

</div>

<div align="right" style="padding-right: 10px">
    <a href="orders.php?status=0" style="background: #ccccb3;padding: 10px">Live</a>
    <a href="orders.php?status=1" style="background: #ccccb3;padding: 10px">Billed</a>
    <a href="orders.php?status=2" style="background: #ccccb3;padding: 10px">Settled</a>
    <a href="orders.php" style="background: #ccccb3;padding: 10px">ALL</a>

  </div>

  </div>
  
  

  
  
<div id="marketingdiv123">


<div class="box" >
   <div class="box-body" style="padding-left: 2px;padding-right: 2px">
        <div class="box-body table-responsive no-padding" >
   
  	                 	
                  <table id="example1" class="table table-bordered table-striped" >
                    <thead >
                    <tr >
                     <th style="display: none;">#</th>
<th>Order No</th>                   	
<th>Company</th>
<th>Customer</th>
<th>Order Type</th>
<th>Amount</th>
<th>Order Date</th>
<th>Completion Date</th>
<th>Completion Time</th>
<th>Status</th>
<th>Action</th>
</tr>
                    </thead>
                    <tbody>
 <?php 
  if(isset($_GET['status'])){
      $status=$_GET['status'];
       $sqq = mysqli_query($con, "SELECT * FROM `p_orders` where `ostatus`='$status' ORDER BY `oid`  DESC"); 
        
        // Now you can use $file variable according to your code requirements
    }else
 $sqq = mysqli_query($con, "SELECT * FROM `p_orders` ORDER BY `oid`  DESC");
 $k=1;

 while($rss = mysqli_fetch_array($sqq)){
  	
  $comid = $rss['ocomp'];
  $sq1 = mysqli_query($con,"SELECT c_comp FROM `p_company` WHERE `cid`='$comid' ");
  $rs1 = mysqli_fetch_array($sq1);  
  
  $orderid = $rss['order_id'];
  $sq2 = mysqli_query($con, "SELECT * FROM `p_domain` WHERE `dorder`='$orderid' ");
  $rs2 = mysqli_fetch_array($sq2);
  
  $sq3 = mysqli_query($con, "SELECT * FROM `p_server` WHERE `s_order`='$orderid' ");
  $rs3 = mysqli_fetch_array($sq3);
  
  $sq4 = mysqli_query($con, "SELECT * FROM `p_alc` WHERE `al_order`='$orderid' ");
  $rs4 = mysqli_fetch_array($sq4);
  
  $ocustm = $rss['ocustm'];
  $sq5 = mysqli_query($con, "SELECT cname FROM `p_customers` WHERE `cid`='$ocustm'");
  $rs5 = mysqli_fetch_array($sq5); 
  
  $sq6 = mysqli_query($con, "SELECT * FROM `p_sms` WHERE `sm_order`='$orderid' ");
  $rs6 = mysqli_fetch_array($sq6); 
  
  $sq7 = mysqli_query($con, "SELECT * FROM `p_email` WHERE `em_orderid`='$orderid' ");
  $rs7 = mysqli_fetch_array($sq7); 
  
  $sq8 = mysqli_query($con, "SELECT * FROM `p_seo` WHERE `se_order`='$orderid' ");
  $rs8 = mysqli_fetch_array($sq8); 	
  
  $orddat = $rss['ordr_date'];
  $exp = explode("/",$orddat);
  $orddate = $exp[0].'-'.$exp[1].'-'.$exp[2]; 
  if($orddate == '//'){
  	$orddate = '';
  }
  
  $comdat = $rss['compl_date'];
  $exp2 = explode("/",$comdat);
  $compltdate = $exp2[0].'-'.$exp2[1].'-'.$exp2[2]; 
  if($compltdate == '//'){
  	$compltdate = '';
  }
  $date1=date_create($compltdate);
  $date2=date_create(date("Y-m-d"));
  $diff=date_diff($date2,$date1);
  if($rss['ostatus'] == '0'){?>
    <tr style="background-color:  #ffff66;">
 <?php }
 else if($rss['ostatus'] == '2'){?>
    <tr style="background-color:  #ff5c33;">
 <?php }
  else if($rss['ostatus'] == '1'){?>
    <tr style="background-color: #66ff66;">
 <?php }
 else{?>
    <tr style="background-color: #ff4d4d;">
 <?php }
 ?>                   	

  <td style="display: none;"><?php echo $k; ?></td>
  <td><?php echo $rss['oid']; ?></td>
	<td><?php echo $rs1['c_comp']; ?></td>
	<td><?php echo $rs5['cname']; ?></td>
	<td><?php
      $order_type1= $rss['ordr_type'];
      $query1=mysqli_query($con, "SELECT * FROM `p_business` WHERE `bstatus`='1' AND `bid`='$order_type1' ");
      $results=mysqli_fetch_assoc($query1);
      $order_name=$results['b_business'];

      echo $order_name; ?></td>
	<td><?php echo $rss['total_amnt']; ?></td>
	<td><?php echo $orddate; ?></td>
	<td><?php echo $compltdate; ?></td>
  <td><?php echo $diff->format("%R%a days"); ?></td>
	<td><?php if($rss['ostatus'] == '0'){ echo "Live"; } else if($rss['ostatus'] == '1'){ echo "Billed"; } else if($rss['ostatus'] == '2'){ echo "Settled"; } else if($rss['ostatus'] == '3'){ echo "Work Under Hold"; } ?></td>
	<td>
		
	&nbsp;  <a href="" data-toggle="modal" data-target="#myModal<?php echo $rss['oid']; ?>" style=" cursor: pointer;"><span class="glyphicon glyphicon-eye-open" style="font-size:14px;"></span></a> &nbsp;               	
    <a onClick="edit_orders('<?php echo base64_encode($rss['oid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp;
    <a onClick="delete_orders('<?php echo base64_encode($rss['oid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;	
	</td>
</tr>


<div class="modal fade" id="myModal<?php echo $rss['oid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Order Details</h4>
      </div>
      <div class="modal-body" id="myModal2">
  
 <div style=" width:550px; ">
  <div style=" float:left; width:150px;  font-size:14px; color:#0000FF; ">Company Name</div><div style="width:375px; ">: &nbsp;&nbsp; <?php echo $rs1['c_comp']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Branch Name </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["obranch"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Type </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["ordr_type"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Customer </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs5['cname']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["ordr_amt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Discount Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["dis_amnt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Net Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rss["net_amnt"]; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Order Date </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $orddate; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Completion Date </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $compltdate; ?></div>
  
 
   <?php if($rs2["d_domain"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Domain Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain Name</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_domain"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Ownership</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_owner"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_provider"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Reg. Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_regdate"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewal Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_renewel"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Exp. Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_expdate"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Redirection</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_redirectn"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_user"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_pass"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">AccessLink</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_access"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2["d_remarks"]; ?></div>      
    <?php } ?>
    <?php if($rs3["s_comp"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Server Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Server Company</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_comp"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">OS</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_os"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">ALC</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_alc"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Start Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_start"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">End Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_end"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3["s_remarks"]; ?></div>
     <?php } ?>
     
    <?php if($rs4["al_alc"] != ''){ ?> 
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">ALC Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">ALC</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_alc"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Provided By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_provided"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Start Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_start"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">End Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_end"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_tax"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4["al_remarks"]; ?></div>
    <?php } ?>
    
    <?php if($rs6["sm_domain"] != ''){ ?>
    <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">SMS Details</h4>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_domain"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Access Link</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_access"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Count</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_count"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Per Rate</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_perrate"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewel</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_renewel"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_amnt"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Service Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_service"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SenderID</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_senderid"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Type</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_type"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">SMS Utility</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_utility"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Managed By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_managed"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Main Admin</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_main"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_muser"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_mpass"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Customer Admin</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_user"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Username</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_uuser"]; ?></div>
    <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Password</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs6["sm_upass"]; ?></div>
    <?php } ?>
    
   <?php if($rs7["em_domain"] != ''){ ?>
   <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">Email Details</h4>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_domain"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Service Provider</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_service"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">No. Of Email</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_noemail"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Per Email Cost</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_cost"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Tax</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_tax"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Expiry Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_expiry"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Type</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_type"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Renewel Date</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_renewel"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Managed By</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_managed"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Email Details</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs7["em_details"]; ?></div>   
    <?php } ?>
   
   <?php if($rs8["se_domain"] != ''){ ?>
   <h4 class="modal-title" id="myModalLabel"  style=" background-color: #E8E8E8;">SEO Details</h4>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Domain</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_domain"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Segment</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_segment"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(1)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank1"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(2)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank2"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Raking Result(3)</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_rank3"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Search Engine</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_engine"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_amount"]; ?></div>
   <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Keyword</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs8["se_keywords"]; ?></div>
   <?php } ?>
   

 </div>
  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
       
      </div>
    </div>
  </div>
</div>  


<?php $k=$k+1; } ?>
                    </tbody>
                    </table>
  
         		  </div>
                </div>
             </div>
	
	
</div>
	
		
			
			
			








                           
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
  </div><!-- /.content-wrapper -->
  </div>
	
     <!-- jQuery 2.1.4 -->
    <script src="<?php echo $sujpath; ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="<?php echo $sujpath; ?>bootstrap/js/bootstrap.min.js"></script>
    <!-- DataTables -->
  <script src="<?php echo $sujpath; ?>plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="<?php echo $sujpath; ?>plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo $sujpath; ?>plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?php echo $sujpath; ?>dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo $sujpath; ?>dist/js/demo.js"></script>
    <!-- page script -->

 
  <script src="bootstrap/js/bootstrap-select.min.js"></script>

  <script type="text/javascript">
    function PreviewImage(no) {
    	var oFReader = new FileReader();
        oFReader.readAsDataURL(document.getElementById("uploadImage"+no).files[0]);
        oFReader.onload = function (oFREvent) {
            document.getElementById("uploadPreview"+no).src = oFREvent.target.result;
        };
    }
</script>

<style>
label.filebutton {
    width:120px;
    height:80px;
    overflow:hidden;
    position:relative;
}
label span input {
    z-index: 999;
    line-height: 0;
    font-size: 50px;
    position: absolute;
    top: -2px;
    left: -700px;
    opacity: 0;
    filter: alpha(opacity = 0);
    -ms-filter: "alpha(opacity=0)";
    cursor: pointer;
    _cursor: hand;
    margin: 0;
    padding:0;
}
</style>



    <script>
      $(document).ready(function() {
        $("#example1").DataTable();
      });
      
	function datat(){
	  alert("Data Deleted Successfully.");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat2(){
	  alert("Data Added Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat3(){
	  alert("Updated Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
   </script>  
   
   



   
  </body>
</html>
