</td> <td> <?php if ($row->commissionCash) { setlocale(LC_MONETARY, 'en_US'); echo money_format('%n', $row->commissionCash) . ' / 10 = ' . money_format('%n', $row->commissionCash / 10); } ?> </td> <td> <?php echo $row->commissionCredits * -1 . ' / 10 = ' . money_format('%n', $row->commissionCredits / -10); ?> <!--<?php echo $row->commissionCredits; ?> --> </td> </tr> <?php $k = 1 - $k; } ?> </table> <?php } } HTML_cbodb::$transactionTypeArray = CbodbTransaction::getTransactionTypesList(); HTML_cbodb::$adminTransactionTypeArray = CbodbTransaction::getAdminTransactionTypesList(); HTML_cbodb::$timeTransactionTypeArray = CbodbTransaction::getTimeTransactionTypesList();
function saveNewBicycle($option) { global $mainframe; $item = new CbodbItem(); $postrow = JRequest::get('post'); $memberID = JRequest::getVar('memberID'); $db =& JFactory::getDBO(); $query = "SELECT MAX(tag) FROM #__cbodb_items"; $db->setQuery($query); $maxTag = $db->loadResult(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } $item->tag = $maxTag + 1; $item->isBike = 1; $item->setAll($postrow); //$item->commissionUserID = JRequest::getVar('memberID'); $item->saveData(); // Added 2012-07-26 Lee Reis Post-Givecamp 2012 $membertransaction = new CbodbTransaction(); date_default_timezone_set(getConfigValue("timeZone")); $membertransaction->dateOpen = date("Y-m-d H:i:s", time()); $membertransaction->dateClosed = date("Y-m-d H:i:s", time()); $membertransaction->type = 7; $membertransaction->memberID = $memberID; $membertransaction->itemID = $maxTag + 1; $membertransaction->cash = $item->priceSale; $membertransaction->saveData(); // End of Added 2012-07-26 $mainframe->redirect('index.php?option=' . $option . '&task=shop&key=3b767559374f5132236f6e68256b2529#top', "Bicycle is saved with tag number {$item->tag}. Please write the number on the bike's tag!"); }
public function getMemberInfo() { if (isset($this->data->id)) { $credits = CbodbTransaction::getMemberCredits($this->data->id); return $credits; } return NULL; }
function startClass($option, $rows, $memberID, $error = NULL) { ?> <h1>Starting class</h1> <?php if ($error) { echo '<h2 style="color: red;">ERROR: ' . $error . '</h2>'; } ?> <form action="index.php#top" method="post" name="classForm"> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="saveclass" /> <input type="hidden" name="memberID" value="<?php echo $memberID; ?> " /> <?php echo '<h2>Class:</h2>'; HTML_cbodb::dropdownFromArray(classID, HTML_cbodb::$cbodb_classtypes, 0); echo '<p><br>Class length: <input type="text" value="2" name="duration" size="5"> hours<br>'; echo '<h2>Date:</h2>'; echo 'Today? <input type="checkbox" name="startsnow"> (or leave unchecked and enter a date below)'; echo '<p> <select name="classdate[year]"> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option selected value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> </select> '; echo '<SELECT NAME="classdate[month]"> <OPTION value="1">Jan</OPTION> <OPTION value="2">Feb</OPTION> <OPTION value="3">Mar</OPTION> <OPTION value="4">Apr</OPTION> <OPTION value="5">May</OPTION> <OPTION value="6">Jun</OPTION> <OPTION value="7">Jul</OPTION> <OPTION value="8">Aug</OPTION> <OPTION value="9">Sep</OPTION> <OPTION value="10">Oct</OPTION> <OPTION value="11">Nov</OPTION> <OPTION value="12">Dec</OPTION> </SELECT> '; echo '<select name="classdate[day]">'; for ($day = 0; $day < 32; $day++) { echo "<option value=\"{$day}\">{$day}</option>"; } echo '</select>'; echo ' <h2>Students:</h2> (Uncheck box for students not taking this class)<br><br> <table class="loggedInList"> <tr><th></th><th width="150px">Name</th><th>Since</th><th width="80px">Credits</th><th width="80px">Member</th><th>Paid Cash</th><th>Paid Credits</th></tr>'; $timezone = new DateTimeZone(getConfigValue("timeZone")); foreach ($rows as $row) { if ($row->type == 3) { // John Mikolich December 30, 2010 // See my other comments from today regarding the // hard-coded 'UTC'. // $dateOpen = new DateTime($row->dateOpen,new DateTimeZone("UTC")); $dateOpen = new DateTime($row->dateOpen, new DateTimeZone(getConfigValue("timeZone"))); date_timezone_set($dateOpen, $timezone); echo '<tr>'; echo '<td><input type="checkbox" name="students[' . $row->id . '][inclass]" id="inclass"></td>'; echo '<td>' . $row->nameFirst . " " . $row->nameLast . '</td> <td>' . date_format($dateOpen, "n/d/Y H:i") . '</td> <td> ' . sprintf("%.2F", CbodbTransaction::getMemberCredits($row->id)) . '</td>'; echo '<td>' . ($row->isMember ? 'Yes' : 'No') . '</td>'; echo '<td><input type="text" name="students[' . $row->id . '][paidcash]" size="5"></td>'; echo '<td><input type="text" name="students[' . $row->id . '][paidcredits]" size="5"></td>'; /*if ($row->isGroup2) {*/ echo '</tr>'; } } echo '</table>'; echo '<br><br><input class="bigbutton" type="submit" name="startclass" value="Start Class">'; echo '</form>'; $option = "com_cbodb"; $link = JRoute::_('index.php?option=' . $option . '&task=shop&key=3b767559374f5132236f6e68256b2529' . '#top'); echo '<br /><h2>or <a href=' . $link . '>Return to Clock-In Page</a></h2>'; }