JezK
Edit File: business.php
<?php include("header.php"); if (isset($_REQUEST['id']) && $_REQUEST['id'] != '') { $bid = $videocon->encrypt_decrypt('decrypt', $_REQUEST['id']); ///// buseinesss ///// $businessdet = $videocon->getBusiness('id', $bid); $stateName = $videocon->getStatesById($businessdet[0]['state']); $cityName = $videocon->getCitiesById($businessdet[0]['city']); $category = $videocon->categories($businessdet['0']['cat_id']); $categoryName = $category[0]['name']; ///// counts ///// $upcomingcnt = $videocon->upcomingCnt('', '', $bid); $completdCancelledCnt = $videocon->completdCancelledCnt('', '', $bid); $completedAmt1=isset($completdCancelledCnt['1']['totalamt'])?$completdCancelledCnt['1']['totalamt']:0; $completedAmt2=isset($completdCancelledCnt['4']['totalamt'])?$completdCancelledCnt['4']['totalamt']:0; $completedAmt3=isset($completdCancelledCnt['2']['totalamt'])?$completdCancelledCnt['2']['totalamt']:0; $completedAmt=$completedAmt1 + $completedAmt2 + $completedAmt3; $completedAmCount1=isset($completdCancelledCnt['1']['cnt'])?$completdCancelledCnt['1']['cnt']:0; $completedAmCount2=isset($completdCancelledCnt['4']['cnt'])?$completdCancelledCnt['4']['cnt']:0; $completedAmCount3=isset($completdCancelledCnt['2']['cnt'])?$completdCancelledCnt['2']['cnt']:0; $completedAmCount=$completedAmCount1 + $completedAmCount2 + $completedAmCount3; $upcomingAmt = isset($upcomingcnt['totalamt']) ? $upcomingcnt['totalamt'] : 0; //$completedAmt = isset($completdCancelledCnt['2']['totalamt']) ? $completdCancelledCnt['2']['totalamt'] : 0; $cancelledAmt = isset($completdCancelledCnt['3']['totalamt']) ? $completdCancelledCnt['3']['totalamt'] : 0; $totalAmount = $upcomingAmt + $completedAmt + $cancelledAmt; ///// availability ///// $getavailability = $videocon->getAvailability('', $bid); // print_r($getavailability);exit; ///// Transactions ///// $fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : ''; $todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : ''; // echo $fromdate.$todate;exit; $fromdateformt = date("F d, Y", strtotime($fromdate)); $todateformt = date("F d, Y", strtotime($todate)); // echo $bid;exit; $transactions = $videocon->getUserTransactionDetails($fromdate, $todate, '', $bid); // print_r($transactions);exit; $active1 = "active"; $active2 = ""; $active3 = ""; $active4 = ""; if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 3) { $active3 = "active"; $active1 = ""; } if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 4) { $active4 = "active"; $active1 = ""; } } ?> <style> #dataTable1_filter input[type="search"] { display: none; } </style> <section class="section-padding"> <div class="container"> <!-- Nav tabs --> <ul class="nav nav-tabs border-0" role="tablist"> <li class="nav-item"> <a class="nav-link anc-Color <?php echo $active1; ?>" data-toggle="tab" href="#profile">PROFILE</a> </li> <li class="nav-item"> <a class="nav-link anc-Color <?php echo $active2; ?>" data-toggle="tab" href="#availability">AVAILABILITY</a> </li> <li class="nav-item"> <a class="nav-link anc-Color <?php echo $active3; ?>" data-toggle="tab" href="#paymentHistory">PAYMENT HISTORY</a> </li> <li class="nav-item"> <a class="nav-link anc-Color <?php echo $active4; ?>" data-toggle="tab" href="#videoConference">VIDEO CONFERENCES</a> </li> </ul> <!-- Tab panes --> <div class="tab-content bg-white m-3"> <div id="profile" class="container tab-pane <?php echo $active1; ?>"><br> <!-- owner details --> <div class="row"> <div class="col-xl-4 col-md-4 col-lg-6 mb-4"> <?php if(file_exists("../uploads/".$businessdet['0']['business_pic'])){ ?> <img class="d-block" src="../uploads/<?php echo $businessdet['0']['business_pic']; ?>" width="200px" height="150"> <?php }else{ ?> <img class="d-block" src="img/profession.png" width="200px" height="150"> <?php } ?> </div> <div class="col-xl-4 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Business Name</p> <p><?php echo $businessdet['0']['business_name']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Specialization</p> <p><?php echo $businessdet['0']['specialization']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Profession</p> <p><?php echo $businessdet['0']['profession']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Mobile Number</p> <p>+<?php echo $businessdet['0']['country_code']; ?> <?php echo $businessdet['0']['mobile']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">State</p> <p><?php echo $stateName[$businessdet[0]['state']]; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Username</p> <p><?php echo $businessdet['0']['username']; ?></p> </div> </div> <div class="col-xl-4 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Owner Name</p> <p><?php echo $businessdet['0']['owner']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Email Address</p> <p><?php echo $businessdet['0']['email']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Location</p> <p><?php echo $businessdet['0']['location']; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Category</p> <p><?php echo $categoryName; ?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">City</p> <p><?php echo $cityName[$businessdet[0]['city']]; ?></p> </div> <!-- <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Admin Fee</p> <select class="addressColor" id="filterby"> <option>10%</option> <option>20%</option> </select> </div> --> </div> </div> <!--end owner details --> <hr> <!-- MEMBERSHIP details --> <!-- <div class="row"> <div class="col-xl-9 col-md-4 col-lg-6"><h5>MEMBERSHIP DETAILS</h5></div> <div class="col-xl-3 col-md-4 col-lg-6 d-flex justify-content-end"> <select class="addressColor extendDropdown"> <option>Extend Plan</option> <option>20%</option> </select> </div> </div> <div class="row mt-4"> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Payment Type</p> <p>Paypal</p> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Membership Start Date</p> <p>July 2, 2019</p> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Membership End Date</p> <p>July 5, 2019</p> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Membership Plan</p> <p>1 Year Plan</p> </div> </div> </div> --> <!--End MEMBERSHIP details --> <!-- <hr> --> <!-- ACOUNT DETAILS --> <h6 class="my-3">ACOUNT DETAILS</h6> <?php if($businessdet[0]['country']== "101"){ ?> <div class="row"> <div class="col-xl-6 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Bank Name</p> <p><?php echo $businessdet[0]['bankName'];?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Account Number</p> <p><?php echo $businessdet[0]['accountNumber'];?></p> </div> </div> <div class="col-xl-6 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Bank City</p> <p><?php echo $businessdet[0]['bankCity'];?></p> </div> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">IFSC Code</p> <p><?php echo $businessdet['0']['ifscCode']; ?></p> </div> </div> </div> <?php }else{ ?> <div class="row"> <div class="col-xl-6 col-md-4 col-lg-6"> <div class="mb-4 pb-1 userDetails"> <p class="addressColor">Paypal ID</p> <p><?php echo $businessdet['0']['paypal_email']; ?></p> </div> </div> </div> <?php } ?> <!--End ACOUNT DETAILS --> <hr> <div class="row dashboard-counts"> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="wrapper count-title d-flex blue-Block"> <!-- <div class="icon"><i class="icon-user"></i></div> --> <div class="icon"><i><img src="img/users.png" class="dashboard-icon1"></i></div> <div class="name mb-2"><strong class="count-number text-white"><?php if ($upcomingcnt['cnt'] != "") { echo $upcomingcnt['cnt']; } else { echo 0; } ?></strong> <span>Upcoming</span> </div> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="wrapper count-title d-flex pink-Block"> <div class="icon"><i><img src="img/businesses.png" class="dashboard-icon2"></i></div> <div class="name mb-2"><strong class="count-number text-white"><?php /* if (isset($completdCancelledCnt['2']['cnt'])) { echo $completdCancelledCnt['2']['cnt']; } else { echo 0; }*/ if($completedAmCount>0){ echo $completedAmCount; }else{ echo "0";}?></strong> <span>Completed Appointments</span> </div> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="wrapper count-title orange-Block d-flex"> <div class="icon"><i><img src="img/users.png" class="dashboard-icon3"></i></div> <div class="name mb-2"><strong class="count-number text-white"><?php if (isset($completdCancelledCnt['3']['cnt'])) { echo $completdCancelledCnt['3']['cnt']; } else { echo 0; } ?></strong> <span>Cancelled Appointments</span> </div> </div> </div> <div class="col-xl-3 col-md-4 col-lg-6"> <div class="wrapper count-title green-Block d-flex"> <div class="icon"><i><img src="img/total-income.png" class="dashboard-icon4"></i></div> <div class="name mb-2"><strong class="count-number text-white"><?php echo ($businessdet[0]['country'] =='101'?"Rs.":"$").$totalAmount; ?></strong> <span>Total Income</span> </div> </div> </div> </div> </div> <div id="availability" class="container tab-pane <?php echo $active2; ?>"><br> <div class="table-responsive"> <table id="dataTable1" class="table table-striped table-borderless" style="width:100%"> <thead class="tableBackground"> <tr> <!-- <th></th> --> <th>S.No</th> <th>BUSINESS/PROFESSIONAL</th> <th>BUSINESS OWNER</th> <th>PROFESSIONAL FULLNAME</th> <th>SLOTS DATES</th> <th>SLOTS From TIME</th> <th>SLOTS TO TIME</th> <th>ADDED DATE</th> <th>ACTION</th> </tr> </thead> <tbody> <?php $l = 0; foreach ($getavailability as $k => $v) { $businessDetProf = $videocon->getBusiness('id', $v['addedby_id']); if ($v['timeslots_addedby'] == 1) { $b = "Business"; } else if ($v['timeslots_addedby'] == 2) { $b = "Professional"; } $l++; ?> <tr> <!-- <td> <label class="container1"> <input type="checkbox" class="checkmark"> <span class="checkmark1"></span> </label> </td> --> <td><?php echo $l; ?></td> <td><?php echo $b; ?></td> <td><?php echo $businessDetProf[0]['business_name'];?></td> <td><?php echo $businessDetProf[0]['professional_name'];?></td> <td class="more"><span style="padding-left:5px;padding-right:15px;" class="" data-toggle="tooltip" data-placement="left" data-container="body" title="<?php echo str_replace('/', '-', $v['slots_added_dates']); ?>"><?php echo str_replace('/', '-', $v['slots_added_dates']); ?></span></td> <td><?php echo $v['available_from']; ?></td> <td><?php echo $v['available_to']; ?></td> <td><?php echo date('m-d-Y', strtotime($v['date'])); ?></td> <td> <a href="availabilityView.php?aid=<?php echo $videocon->encrypt_decrypt('encrypt', $v['id']); ?>" class="viewStyles">View</a> <!-- <span><a href="#" class="viewStyles">View</a></span> --> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div id="paymentHistory" class="container tab-pane <?php echo $active3; ?>"><br> <div class="row"> <div class="mb-2 col-xl-5 col-md-6 col-lg-12"> <form action='' method='GET' id="transactions"> <label class="fieldName mt-2 mr-2">Select Date Range</label> <div id="reportrange" class="formField-control" style="cursor: pointer; padding: 5px 10px; border: 1px solid #ccc;"> <i class=" float-right "><img src="img/calenderdark.png"></i> <span></span> <input type="hidden" class="hidden fromdate" name="fromdate" value=""> <input type="hidden" class="hidden todate" name="todate" value=""> <input type="hidden" class="hidden " name="id" value="<?php echo $_REQUEST['id']; ?>"> <input type="hidden" class="hidden " name="tab" value="3"> </div> </form> </div> <div class="col-xl-7 col-md-6 col-lg-12 mt-4 pt-1 d-flex justify-content-end"> <!-- <button class="btn btn-primary px-5">Export Data</button> --> <form action="paymentExport.php" method="POST" id="exportdata" name="exportdata" onsubmit="return exporttransactions()"> <input type="submit" class="btn btn-primary btn-sm w-100" value="Export data" /> <input type="hidden" name="Export"> <input type="hidden" id="tfromdate" name="tfromdate" value=""> <input type="hidden" id="ttodate" name="ttodate" value=""> <input type="hidden" id="tsearch" name="tsearch" value=""> <input type="hidden" id="tsearch" name="id" value="<?php echo $videocon->encrypt_decrypt('decrypt', $_REQUEST['id']); ?>"> </form> </div> </div> <!--ENd calender --> <!-- <span class=""> <a class="selectAll buttonStyle">Select All</a> <a class="unSelectAll buttonStyle">Unselect All</a> </span> --> <div class="table-responsive"> <table id="dataTable2" class="table table-striped table-borderless" style="width:100%"> <thead class="tableBackground"> <tr> <!-- <th></th> --> <th>S.No</th> <th>BOOKING DATE</th> <th>SLOT DATE</th> <th>SLOT TIMES</th> <th>DETAILS</th> <th>AMOUNT</th> <th>BOOKING STATUS</th> <th>ACTION</th> </tr> </thead> <tbody> <?php if ($transactions != '') { $i = 0; foreach ($transactions as $k => $v) { $i++; $status = ''; if ($v['booking_status'] == 1) { $status = "Upcoming"; } else if ($v['booking_status'] == 2) { $status = "Completed"; } else if ($v['booking_status'] == 3) { $status = "Cancelled"; } else if ($v['booking_status'] == 4) { $status = "Accepted"; } ?> <tr> <!-- <td> <label class="container1"> <input type="checkbox" class="checkmark"> <span class="checkmark1"></span> </label> </td> --> <td><?php echo $i ?>.</td> <td><?php echo $v['date']; ?></td> <td><?php echo $v['slot_date']; ?></td> <td><?php echo $v['slot_times']; ?></td> <td><?php echo $v['client_name'] ?></td> <td> <?php echo ($v['currency']=='INR'?"Rs.":"$").$v['amount'] ?></td> <td><?php echo $status;?></td> <td> <span><a href="paymentView.php?bid=<?php echo $videocon->encrypt_decrypt('encrypt', $v['id']); ?>" class="viewStyles">View</a></span> </td> </tr> <?php } } ?> </tbody> </table> </div> </div> <div id="videoConference" class="container tab-pane <?php echo $active4; ?>"><br> <div class="container"> <div class="calender-Right"> <!-- form-group --> <!-- <?php if ($_POST['signup_type'] == 1 || isset($_POST['appointments'])) { ?> <select name="appointmentType" class="col-xl-5 col-md-6 col-lg-8 formField-control" id="appointmentType" onchange="getAppointments(0,'','')";> <option value="1">All Appointments</option> <option value="2">Business Appointments</option> </select> <?php } ?> --> <label class="fieldName mt-2 mr-2">Select Date Range</label> <div id="reportrange4" class="col-xl-5 col-md-6 col-lg-8 formField-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc;"> <i class=" float-right "><img src="img/calenderdark.png"></i> <span></span> <input type="hidden" class="hidden " name="" id="hiddenval" value="0"> <input type="hidden" class="hidden " name="fromdate" value=""> <input type="hidden" class="hidden " name="todate" value=""> </div> </div> </div> <!--ENd calender --> <!-- <span class=""> <a class="selectAll buttonStyle">Select All</a> <a class="unSelectAll buttonStyle">Unselect All</a> </span> --> <div class="container" id="upcoming"> </div> </div> </div> </div> </section> <?php include("footer.php"); ?> <script> ////// starting ///////// $(document).ready(function() { var url = window.location.href; function getParameterByName(name, href) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(href); /* if( results == null ) return ""; else */ return decodeURIComponent(results[1].replace(/\+/g, " ")); } var from = getParameterByName("fromdate", url); var to = getParameterByName("todate", url); var x1 = moment(from).format('DD MMMM, YYYY '); var y1 = moment(to).format('DD MMMM, YYYY'); // alert(x1); $('#reportrange span').html(x1 + ' - ' + y1); }); $('#reportrange').on('apply.daterangepicker', function(ev, picker) { alert(picker.startDate.format('DD-MM-YYYY') + ' To ' + picker.endDate.format('DD-MM-YYYY')); var fromdate = picker.startDate.format('YYYY-MM-DD'); var todate = picker.endDate.format('YYYY-MM-DD'); $('#transactions').submit(); }); function exporttransactions() { $('#tfromdate').val('<?php echo isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : ""; ?>') $('#ttodate').val('<?php echo isset($_REQUEST['todate']) ? $_REQUEST['todate'] : ""; ?>') $('#tsearch').val($('.getserchfieldval').val()); $("#exportdata").submit(); return false; } //// ending ///////// ///////////////// var fromdate = ''; var todate = ''; $(function() { var appendType = 'upcoming'; getAppointments(0, fromdate, todate); $('.page').on('scroll', function() { if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { var limitStart = $("#" + appendType + " .container").length; getAppointments(limitStart, fromdate, todate); } }); }); function getAppointments(limitStart, fromdate, todate) { var appendType = 'upcoming'; var scrolltype = '4'; var bid = "<?php echo $bid; ?>"; var s = $('#reportrange4 span').html(); if ($('#hiddenval').val() == 0) { var fromdate = ''; var todate = ''; } else { var arr1 = s.split("-")[0]; var arr2 = s.split("-")[1]; var fromdate1 = new Date(arr1); var todate2 = new Date(arr2); fromMonth = '' + (fromdate1.getMonth() + 1), fromDay = '' + fromdate1.getDate(), fromYear = fromdate1.getFullYear(); toMonth = '' + (todate2.getMonth() + 1), toDay = '' + todate2.getDate(), toYear = todate2.getFullYear(); var fromdate = fromYear + '-' + fromMonth + '-' + fromDay; var todate = toYear + '-' + toMonth + '-' + toDay; // alert( fromMonth+"-"+fromDay+"-"+fromYear +" "+ toMonth+"-"+toDay+"-"+toYear ); } if (limitStart == 0) { $("#upcoming").html(''); } $.post( "ajax.php", { action: "appointments", min: limitStart, fromdate: fromdate, todate: todate, bid: bid }, function(data) { if (limitStart <= 0 && !data) { // alert('fail'); $("#" + appendType).html(""); if (scrolltype == 4) { $("#" + appendType).append("<div class='container pb-3'><div class='row justify-content-center'><h2 class='bg-goldImg text-center' style='padding: 10px;'>No Conferences</h2></div></div>"); } } if (data) { // alert('sucess'); $("#" + appendType).append(data); } return false; } ); } $(function() { var start = moment().subtract(1, 'days'); var end = moment(); function cb(start, end) { $('.fromdate').val(start.format('YYYY-MM-DD')); $('.todate').val(end.format('YYYY-MM-DD')); $('#reportrange4 span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); } $('#reportrange4').daterangepicker({ startDate: start, endDate: end, ranges: { 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] } }, cb); cb(start, end); }); /* $(document).ready(function() { var url = window.location.href; function getParameterByName( name,href ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( href ); return decodeURIComponent(results[1].replace(/\+/g, " ")); } var from = getParameterByName("fromdate",url); var to = getParameterByName("todate",url); var x1 = moment(from).format('DD MMMM, YYYY '); var y1 = moment(to).format('DD MMMM, YYYY'); $('#reportrange4 span').html(x1 + ' - ' + y1); }); */ $('#reportrange4').on('apply.daterangepicker', function(ev, picker) { var fromdate = picker.startDate.format('YYYY-MM-DD'); var todate = picker.endDate.format('YYYY-MM-DD'); $('#hiddenval').val('1'); // alert('hai'); getAppointments(0, fromdate, todate); }); </script>