<td> <input type="checkbox" class="check" value="' . $id . '" name="args[]" /> </td> '; $image = Banner::getImage($id, 1); if (!empty($image)) { echo ' <td> <img width="200" height="80" src="../uploads/banner/thumbs/' . $image . '"/> </td>'; } else { echo '<td> - </td>'; } echo ' <td> ' . $banner->prepareLink() . ' </td> <td> ' . BannerSection::findName($banner->prepareId_section()) . ' </td> '; echo ' <td> <center> ' . $banner->getOrder() . ' </center> </td> <td> ' . $status . ' </td> <td> <center>' . $date1->format('d-m-Y') . '</center> </td>'; if ($canEdit) { echo '<td><center><a href="edit.php?id=' . $id . '"><img src="' . ICON . 'edit.png" /></a> </center></td>'; } if ($canDelete) { echo '<td><center><a id="' . $id . '" class="eliminar" href="javascript:deleteIt(' . $id . ')"><img src="' . ICON . 'delete.png" /> </a> </center> </td>'; } echo '</tr>'; } ?> </table> <br style="clear:both;" />
/** * Escapes a date for use in SQL, includes surrounding quotes * * A `NULL` or invalid value will be returned as `'NULL'` * * @param string $value The date to escape * @return string The escaped date */ private function escapeDate($value) { if ($value === NULL) { return 'NULL'; } try { $value = new fDate($value); return "'" . $value->format('Y-m-d') . "'"; } catch (fValidationException $e) { return 'NULL'; } }
<div id="content" class="span-24 last"> <?php $tmpl->place('menuAdmin'); ?> <h2>Administration</h2><h3>Currency</h3> <table> <thead> <tr><th>Country</th><th>Exchange</th><th>Month</th><th>Year</th><th>Icon</th></tr> </thead> <tbody> <?php try { $currencies = Currency::findAll(); foreach ($currencies as $currency) { $tempDate = new fDate($currency->getMonth()); printf("<tr class=\"currencyRow\"><td class=\"hideFirst\" id=\"cId\">%s</td></td><td id=\"cCountry\" class=\"varInput\">%s</td><td id=\"cExchange\" class=\"varInput\">%s</td><td id=\"cMonth\" class=\"varInput\">%s</td><td id=\"cYear\" class=\"varInput\">%s</td>", $currency->prepareId(), $currency->prepareCountry(), $currency->prepareExchange(2), $tempDate->format('F'), $tempDate->format('Y')); printf("<td id=\"iconCell\" class=\"hideFirst\"><ul id=\"icons\" class=\"ui-widget ui-helper-clearfix\">\n\t\t\t\t\t\t\t\t<li id=\"save\" title=\"Save\" class=\"ui-state-default ui-corner-all\"><span class=\"ui-icon ui-icon-circle-check\"></span></li>\n\t\t\t\t\t\t\t\t<li id=\"cancel\" title=\"Cancel\" class=\"ui-state-default ui-corner-all\"><span class=\"ui-icon ui-icon-circle-close\"></span></li>\n\t\t\t\t\t\t\t\t</ul></td></tr>"); } } catch (fExpectedException $e) { echo $e->printMessage(); } ?> <tr id="newItem"> <td><input id="nuCountry" value="Input Country"></input></td> <td><input id="nuExchange" value="Input Value"></input></td> <td> <select id="nuMonth"> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option>