function genratePayble() { error_reporting(1); $filename = "data.xls"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename=' . $filename); $postData = $this->input->post(); $enquries = $this->consultants->getPay($postData); $weeks = getWeekRange(); $enqArr = array(); $evids = array(); if ($enquries && count($enquries) > 0) { foreach ($enquries as $enq) { $dateDiff = myDateDiff($weeks[1]['start']['date'], $enq['eventDate']); $week = (int) ($dateDiff['days'] / 7 + 1); $enqArr[$week][] = $enq; $evids[] = $enq['eventID']; } } $invitations = $this->consultants->getMusicianInvitationForEvent('', array('event_id' => $evids)); $invarr = array(); foreach ($invitations as $inv) { $invarr[$inv->event_id][] = $inv; } $htmlcontent = "<table>"; $htmlcontent .= "<tr><th>Gig Name</th><th>Date</th><th>Day</th><th>Lead Singer</th><th>Band brand</th><th>Musician name</th><th>Paid Amount</th></tr>"; $events = $enqArr; $eventInv = $invarr; $awaitingDepositsList = array(); $showcaseInfo = array(); if ($events) { foreach ($events as $week => $val) { foreach ($val as $ev) { $leadsinger = ''; $leadsingertip = ''; $bandsizetip = ''; $bandsize = '0'; $nrplytip = ''; $nrply = '0'; $declinedtip = ''; $declined = '0'; $musiciancost = 0; $event = $ev['eventID']; if (isset($eventInv[$ev['eventID']])) { foreach ($eventInv[$ev['eventID']] as $inv) { if ($inv->event_lead_singer) { $lead = "Yes"; } else { $lead = "No"; } $musician_name = $inv->first_name . ' ' . $inv->last_name; $band_brand = $inv->band_brand; $musiciancost = $inv->base_cost + $inv->extra_time_cost + $inv->distance_cost; $htmlcontent .= "<tr><td>" . $ev['firstName'] . ' ' . $ev['lastName'] . "</td><td>" . mysqlDate2UkDate($ev['eventDate']) . "</td><td>" . getDayFromMysqlDate($ev['eventDate']) . "</td><td>" . $lead . "</td><td>" . $band_brand . "</td><td>" . $musician_name . "</td><td>" . $musiciancost . "</td></tr>"; } } } } } $htmlcontent .= "</table>"; // Create as XLS file and send to browser for download echo $htmlcontent; }
echo $event['eventID']; ?> " > <input type="button" class="btn" name="sendenquiryemail" value="Send Enquiry Email" /> </a> </div> <div class="row"> <span style="font-size:16px; font-weight:bold;"> <?php echo $event['firstName'] . ' ' . $event['lastName']; ?> </span> <span style="font-size:16px; font-weight:bold;"> <?php echo getDayFromMysqlDate($event['eventDate']); ?> </span> <span style="font-size:16px; font-weight:bold;"> <?php echo mysqlDate2UkDate($event['eventDate']); ?> </span> <span> <a style="font-size:16px; font-weight:bold;" href="javascript:void(0)" id="eventbs_<?php echo $event['eventID']; ?> " class="jqtipsajax" ><?php echo $bandsize; ?> </a><span style="display:none;"><?php
<?php } } } ?> </div> <div class="fleft td wp11"><?php echo $inv->eventType; ?> </div> <div class="fleft td wp6"><?php echo mysqlDate2UkDate($inv->eventDate); ?> </div> <div class="fleft td wp6"><?php echo getDayFromMysqlDate($inv->eventDate); ?> </div> <div class="fleft td wp5"> <span ><?php if (trim($loc)) { echo $loc; } else { echo 'N/A'; } ?> </span> </div> <div class="fleft td wp7"><a href="javascript:void(0)" id="eventls_<?php echo $inv->event_id; ?>