function init($id, $type, $no) { $amount = NULL; $alloc = NULL; $result = checker($id, $type); while ($myrow = db_fetch($result)) { $amount = $myrow[5]; $alloc = $myrow[4]; } $sql = "INSERT INTO " . TB_PREF . "cust_alloc_details(details_id, no, alloc, total_amount, trans_date) VALUES(" . db_escape($id) . ", " . db_escape($no) . ", " . db_escape($alloc) . ", " . db_escape($amount) . ", NOW())"; return db_query($sql, 'Error'); }
<input type="radio" name="drink" value="0"<?php checker('drink', 0, 0); ?> />Aucun <br/><br/> Snack (€) <br/> <input type="radio" name="snack" value="0.6" <?php checker('snack', 0.6, 1); ?> />0.6 <input type="radio" name="snack" value="0.8" <?php checker('snack', 0.8, 0); ?> />0.8 <input type="radio" name="snack" value="0" <?php checker('snack', 0, 0); ?> />Aucun <br/><br/> Price: <?php echo $orderPrice; ?> €<br/><br/> <span class="button" id="submitButton">Valider !</span> <br/><br/> <script> /* * all these code submit the form when the value are changed, but disable the validation attribute so we don't post it yet */ var drink_elements = document.validationForm.drink; for (var i = 0; i < drink_elements.length; i++) {
</form> </div></div> <div class="ui-block-c"><div class="ui-bar ui-bar-a"> <form method="POST" action="getdoc.php" data-ajax="false"> Doctor Info :<select name="doc"> <?php $query = "SELECT DISTINCT doctor_city from doctor"; $result = mysql_query($query); checker($result); $x = 0; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row[$x] . "'>" . $row[$x] . "</option>"; } ?> </select> <button type="submit" href="#" class="ui-btn ui-btn-inline ui-icon-check ui-btn-icon-left">Submit</button> </form> </div></div> </div><!-- /grid-b -->
<?php // в switch проходить по числу или строке function checker($m) { switch ($m) { // после case идет очень ограничивающее значение, строка '01', надо писать шире, 1 case '01': // надо писать case 1: - потому что при приведении к числу всякие варианты приведутся к 1 echo 'Единица'; break; default: echo 'Ничего'; break; } } // хотя на php 5.6 такой код работает ожидаемо echo checker(1); // Единица echo checker('01'); // Единица echo checker('1'); // Единица // вообще же сравнение сработает в обе стороны, но надо делать код проще
session_start(); ?> <?php function checker($field) { $field = filter_var($field, FILTER_SANITIZE_EMAIL); if (filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_POST['submit'])) { $name = $_POST['name']; $email = checker($_POST['email']); $subject = $_POST['subj']; $message = $_POST['message1']; if (isset($name) && isset($email) && isset($subject) && isset($message)) { //if ($securimage->check($_POST['captcha_code']) == true) { if (exist($domain) == 'false') { $query = "INSERT INTO feedback(id,name,email_add,subject,message) VALUES('','" . $name . "','" . $email . "','" . $subject . "','" . $message . "')"; mysql_query($query) or die(mysql_error()); header('Location: index.php'); } else { alert("Existing domain."); } //} /*else{ echo "The security code entered was incorrect.<br /><br />"; echo "Please try again.";
if ($new['error'] != 0 && MYSQL == 'on' && MYSQL_ERROR != 'on') { $new = get_last_roster(); } elseif ($new['error'] != 0 && (MYSQL != 'on' || MYSQL_ERROR == 'on')) { $new['data']['request_data']['items'] = array(); } } elseif (MYSQL == 'on' && MYSQL_ERROR != 'on') { $new = get_last_roster(); } else { $new['error'] = 1; $new['data']['request_data']['items'] = array(); } $roster =& roster_sort($new['data']['request_data']['items']); //print_r($roster); if (count($new['data']['request_data']['items']) > 0) { foreach ($new['data']['request_data']['items'] as $val) { $tmp = checker($val, $lang, $config, $tables, $new['error']); if (isset($tmp['link'])) { $links[$val['name']] =& $tmp['link']; } if (isset($tmp['data'])) { $data[$val['name']] =& $tmp['data']; } } //print_r($new['data']['request_data']['items']); //print_r($links); if (count($links) > 0) { multiget($links, $result, PARS); foreach ($result as $name => $val) { $res_tmp[$name] = pars_data($val, $config, $lang, $name, $roster[$name]); unset($result[$name]); }
function showcatsandauthors() { global $settings; //-------------------- authors-list ---------- echo "<div id=\"authors\">\n"; echo "<h2>Edit authors</h2>\n\n"; //starting the table echo "<table>\n\n"; echo "<tr><th>nickname</th><th>full name</th><th>e-mail</th>"; echo "<th>rights</th><th></th></tr>"; //getting all data from authors-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_authors ORDER BY id;"; $result = mysql_query($dosql) or die(mysql_error()); $i = 1; while ($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; /* //showing date/time of joining $dateformat = $settings['dateformat']; $showdate = date($dateformat , strtotime($row['joined'])); echo "<td>" . $showdate . "</td>\n"; */ echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['nickname'] . "</a></td>\n"; echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['realname'] . "</a></td>\n"; echo "<td><a href=\"mailto:" . $row['mail'] . "\">" . $row['mail'] . "</a></td>\n"; //show the author's publication-rights echo "<td>\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_own']) . " title=\"User may create new postings and edit them later\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_own']) . " title=\"User may set own postings to live status\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_all']) . " title=\"User may edit postings from any author\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_all']) . " title=\"User may set postings from any author to live status\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['admin']) . " title=\"User is administrator and can do anything\" />\n</td>\n"; //a simple delete button echo "<td class=\"right\">\n"; echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=delauthor&id=" . $row['id']; echo "\" onSubmit=\"return yesno('Do you really want to delete this author? She/He might be angry about that!')\">\n"; echo "<input type=\"submit\" value=\"delete\" />\n</form>\n</td>\n"; echo "</tr>\n\n"; $i += 1; } //button for new author echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=newauthor\">"; echo "<tr>\n"; echo "<td><input type=\"text\" name=\"newnick\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newname\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newmail\" value=\"\" /></td>\n"; echo "<td></td>\n<td class=\"right\">\n"; echo "<input type=\"submit\" value=\"new\" />\n"; echo "</td>\n</tr>\n</form>\n</table>\n"; echo "</div>\n\n\n"; //-------------------- categories ---------- echo "<div id=\"categories\">\n"; echo "<h2>Edit categories</h2>\n\n"; //getting all data from category-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_categories ORDER BY id;"; $result = mysql_query($dosql) or die(mysql_error()); $i = 1; while ($row = mysql_fetch_assoc($result)) { $cats[$i] = $row; $i += 1; } //start the form echo "<form action=\"index.php?page=organisation&do=savecats\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; //show all items in each list echo "<table>\n"; echo "<tr><th>name</th><th>description</th><th></th></tr>"; $i = 1; foreach ($cats as $showcat) { //show category echo "<tr>\n<td>\n"; echo "<input class=\"cat\" type=\"text\" value=\"" . $cats[$i]['name']; echo "\" name=\"cat" . $cats[$i]['id'] . "\" />\n</td>\n<td>"; //show description echo "<input class=\"desc\" type=\"text\" value=\"" . $cats[$i]['description']; echo "\" name=\"desc" . $cats[$i]['id'] . "\" />\n</td>\n"; //show delete button echo "<td class=\"right\"><input onClick=\"return yesno('Do you really want to delete this category?')\" type=\"submit\" value=\"delete\" "; echo "name=\"del" . $cats[$i]['id'] . "\" />\n</td>\n</tr>\n\n"; $i += 1; } //show a new category, which is to be filled echo "<tr>\n<td>"; echo "<input class=\"cat\" name=\"newcat\" type=\"text\" value=\"\" /></td>\n"; echo "<td><input class=\"desc\"name=\"newdesc\" type=\"text\" value=\"\" />"; echo "</td><td class=\"right\"><<< add new </td>\n"; echo "</tr>\n"; echo "<tr class=\"last\"><td colspan=\"2\"></td>"; echo "<td class=\"right\"><input type=\"submit\" value=\"save all\" /></td>"; echo "</table>"; echo "</form>\n"; echo "</div>"; }
echo CREATE_JSON_COLLECTION; ?> </a></li> </ul> </li> <li> <a href="javascript:;" id="Upload" rel="upload" title="<?php echo DOWNLOAD_TITLE; ?> "></a> </li> </ul> </div> <div id="LeftBar"> <?php echo checker($main_admin, $userid) ? '<div class="root"><a href="javascript:;" rel="show->pref" id="WindowType">' . MANAGER_PREF . '</a></div>' : ''; ?> <div class="root"><?php echo ROOT_FOLDER; ?> </div> <ul id="Root"> <li><a href="javascript:;" rel="set->root->images"><?php echo IMAGES; ?> </a></li> <li><a href="javascript:;" rel="set->root->media"><?php echo MEDIA; ?> </a></li> <li><a href="javascript:;" rel="set->root->flash"><?php
function showcatsandauthors() { global $settings; //-------------------- authors-list ---------- echo "<div id=\"authors\">\n"; echo "<h2>" . bla("org_editauthors") . "</h2>\n\n"; //starting the table echo "<table>\n\n"; echo "<tr><th>" . bla("org_nickname") . "</th><th>" . bla("org_fullname") . "</th><th>" . bla("org_mail") . "</th>"; echo "<th>" . bla("org_rights") . "</th><th></th></tr>"; //getting all data from authors-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_authors ORDER BY id"; $result = $GLOBALS['lbdata']->GetArray($dosql); $i = 1; foreach ($result as $row) { echo "<tr>\n"; /* //showing date/time of joining $dateformat = $settings['dateformat']; $showdate = date($dateformat , strtotime($row['joined'])); echo "<td>" . $showdate . "</td>\n"; */ echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['nickname'] . "</a></td>\n"; echo "<td><a href=\"index.php?page=organisation&do=editauthor&id=" . $row['id']; echo "\">" . $row['realname'] . "</a></td>\n"; echo "<td><a href=\"mailto:" . $row['mail'] . "\">" . $row['mail'] . "</a></td>\n"; //show the author's publication-rights echo "<td>\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_own']) . " title=\"" . bla("org_right1") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_own']) . " title=\"" . bla("org_right2") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['edit_all']) . " title=\"" . bla("org_right3") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['publish_all']) . " title=\"" . bla("org_right4") . "\" />\n"; echo "<input type=\"checkbox\" disabled=\"disabled\" "; echo checker($row['admin']) . " title=\"" . bla("org_right5") . "\" />\n</td>\n"; //a simple delete button echo "<td class=\"right\">\n"; echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=delauthor&id=" . $row['id']; echo "\" onSubmit=\"return yesno('" . bla("alert_deleteauthor") . "')\">\n"; echo "<input type=\"submit\" value=\"" . bla("but_delete") . "\" />\n</form>\n</td>\n"; echo "</tr>\n\n"; $i += 1; } //button for new author echo "<form method=\"post\" enctype=\"multipart/form-data\" \n action=\"index.php?page=organisation&do=newauthor\">"; echo "<tr>\n"; echo "<td><input type=\"text\" name=\"newnick\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newname\" value=\"\" /></td>\n"; echo "<td><input type=\"text\" name=\"newmail\" value=\"\" /></td>\n"; echo "<td></td>\n<td class=\"right\">\n"; echo "<input type=\"submit\" value=\"" . bla("but_new") . "\" />\n"; echo "</td>\n</tr>\n</form>\n</table>\n"; echo "</div>\n\n\n"; //-------------------- categories ---------- echo "<div id=\"categories\">\n"; echo "<h2>" . bla("org_editcats") . "</h2>\n\n"; //getting all data from category-table $dosql = "SELECT * FROM " . $GLOBALS['prefix'] . "lb_categories ORDER BY id;"; $result = $GLOBALS['lbdata']->GetArray($dosql); $i = 1; foreach ($result as $row) { $cats[$i] = $row; $i += 1; } //start the form echo "<form action=\"index.php?page=organisation&do=savecats\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; //show all items in each list echo "<table>\n"; echo "<tr><th>" . bla("org_catname") . "</th><th>" . bla("org_catdesc") . "</th><th></th></tr>"; $i = 1; foreach ($cats as $showcat) { //show category echo "<tr>\n<td>\n"; echo "<input class=\"cat\" type=\"text\" value=\"" . $cats[$i]['name']; echo "\" name=\"cat" . $cats[$i]['id'] . "\" />\n</td>\n<td>"; //show description echo "<input class=\"desc\" type=\"text\" value=\"" . $cats[$i]['description']; echo "\" name=\"desc" . $cats[$i]['id'] . "\" />\n</td>\n"; //show delete button echo "<td class=\"right\"><input onClick=\"return yesno('" . bla("msg_deletecategory") . "')\" type=\"submit\" value=\"" . bla("but_delete") . "\" "; echo "name=\"del" . $cats[$i]['id'] . "\" />\n</td>\n</tr>\n\n"; $i += 1; } //show a new category, which is to be filled echo "<tr>\n<td>"; echo "<input class=\"cat\" name=\"newcat\" type=\"text\" value=\"\" /></td>\n"; echo "<td><input class=\"desc\"name=\"newdesc\" type=\"text\" value=\"\" />"; echo "</td><td class=\"right\"><<< " . bla("org_addnew") . " </td>\n"; echo "</tr>\n"; echo "<tr class=\"last\"><td colspan=\"2\"></td>"; echo "<td class=\"right\"><input type=\"submit\" value=\"" . bla("but_saveall") . "\" /></td>"; echo "</table>"; echo "</form>\n"; // ----- Tags -----------------------// echo "\n\n<h2>" . bla("org_cattag") . "</h2>\n\n"; echo "<table><tr><th>" . bla("org_cat") . "</th><th>" . bla("org_newtag") . "</th><th></th></tr>"; echo "<form action=\"index.php?page=organisation&do=tagfromcat\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; echo "<tr><td>"; echo "<select name=\"catname\" class=\"cat\">"; $i = 1; foreach ($cats as $showcat) { echo "<option value=\"" . $cats[$i]['id'] . "\">" . $cats[$i]['name'] . "</option>"; $i += 1; } echo "</select>"; echo "</td><td>"; echo "<input type=\"text\" name=\"newtagname\" value=\"\" class=\"tag\" />"; echo "</td><td>"; echo "<input type=\"submit\" value=\"Make tag\" />"; echo "</td></tr>"; echo "</table>"; echo "</form>"; echo "<p>" . bla("org_cattag_help") . "</p>\n"; echo "\n\n<h2>" . bla("org_managetags") . "</h2>\n\n"; echo "<table><tr><th>" . bla("org_tag") . "</th><th>" . bla("org_action") . "</th><th>" . bla("org_newname") . "</th></tr>"; echo "<form action=\"index.php?page=organisation&do=edittag\""; echo " method=\"post\" enctype=\"multipart/form-data\">\n\n"; echo "<tr><td>"; echo "<select name=\"tagnames\" class=\"cat\">"; $taglist = gettaglist(); foreach ($taglist as $tag) { echo "<option value=\"" . $tag . "\">" . $tag . "</option>\n"; } echo "</td><td><input type=\"radio\" name=\"tagaction\" value=\"deletetag\"> " . bla("org_deletetag") . "</td><td></td></tr>\n"; echo "<tr><td></td><td><input type=\"radio\" name=\"tagaction\" value=\"amendtag\"> " . bla("org_replacetag") . " >>></td>\n"; echo "<td><input type=\"text\" name=\"newtagname\" class=\"tag\" /></td></tr>"; echo "<tr><td></td><td><input type=\"radio\" name=\"tagaction\" value=\"createcat\"> " . bla("org_tagtocat") . " >>></td>\n"; echo "<td><select name=\"catname\" class=\"tag\">"; $i = 1; foreach ($cats as $showcat) { echo "<option value=\"" . $cats[$i]['id'] . "\">" . $cats[$i]['name'] . "</option>"; $i += 1; } echo "</select></td></tr>"; echo "<tr><td></td><td></td><td><input onClick=\"return yesno('" . bla("org_confirmchange") . "')\" type=\"submit\" value=\"Submit\" /></td></tr>"; echo "</form></table>\n"; echo "<p>" . bla("org_managetags_help") . "</p>"; echo "</div>\n\n"; }
<?php $user = $pass = ""; $fname = $mname = $lname = $email = $address = $strNum = $pcode = $gender = ""; $userErr = $passErr = $fnameErr = $lnameErr = $addressErr = $strNumErr = $pcodeErr = ""; $db = 'library'; $host = 'localhost'; $port = 8889; $con = mysqli_connect($host, 'root', 'root', $db) or die("Unable to connect to MySQL"); if ($_SERVER["REQUEST_METHOD"] == "POST") { // check for valid input if (checker()) { // add user to the database $query = "INSERT INTO member (username, password, fname, lname) VALUES ('{$user}', '{$pass}', '{$fname}', '{$lname}')"; $result = mysqli_query($con, $query); if (!$result) { echo "Username already exists!"; } else { echo "Success, you are now a user"; } $strSQL = "SELECT memberID, username FROM member"; $query = mysqli_query($con, $strSQL); if (!$query) { echo "syntax error"; } $memberID = ""; while ($result = mysqli_fetch_array($query)) { if ($result['username'] == $user) { $memberID = $result['memberID']; } }
function filter_for_email() { //var_dump($_POST); if (isset($_POST["filter_by_dodavatel"])) { $filter_dodavatel = sec_input($_POST["filter_by_dodavatel"]); } if (isset($_POST["filter_date_od"])) { $filter_date_od = sec_input($_POST["filter_date_od"]); } if (isset($_POST["search_date_do"])) { $search_date_do = sec_input($_POST["search_date_do"]); } $where[] = "komplet=0"; $where[] = "o.vymaz=0"; if (!empty($filter_dodavatel)) { $where[] = "o.id_dodavatel = {$filter_dodavatel}"; } if (!empty($filter_date_od)) { $where[] = "o.datum >= \"{$filter_date_od}\""; } if (!empty($search_date_do)) { $where[] = "o.datum <= \"{$search_date_do}\""; } $query = "SELECT * from dodavatel WHERE id={$filter_dodavatel}"; $dodavatel = sql_query($query)[0]; $query = "SELECT o.id, DATE_FORMAT(datum, '%d. %m. %Y, %H:%i:%s') AS dat_upr, komplet, dod.meno as dodavatel, o.poznamka \r\n FROM do_objednavka o\r\n INNER JOIN dodavatel dod\r\n ON o.id_dodavatel = dod.id\r\n WHERE " . implode(" AND ", $where) . " "; $query .= "ORDER BY datum DESC"; //var_dump($query); echo "<h1>" . $dodavatel["meno"] . "</h1>"; echo "<form method=\"POST\">"; echo "<div>" . (!empty($dodavatel["email"]) ? "<span class=\"bold\">email:</span> " . $dodavatel["email"] . "" : "") . "</div>"; echo select("send_from", "Odoslať ako:", "SELECT id, CONCAT(zobraz_meno, ', ', email) as meno from uzivatel \r\n WHERE skupina=1 AND perm_uroven_id=1 AND vymaz=0 \r\n ORDER BY meno", $_SESSION["username"], "", "", "", "NO"); hidden("dodavatel", $dodavatel["id"]); echo "<table id=\"all_orders\">"; echo "<thead> <tr>\r\n <th></th>\r\n <th>dátum</th>\r\n <th>produkt</th> \r\n <th>zákazník</th>\r\n <th>poznámka</th>\r\n \r\n </tr></thead><tbody>"; //var_dump($where); $objednavka = sql_query($query); //$objednavka = $objednavka[0]; //var_dump($objednavka); if (count($objednavka) > 0) { foreach ($objednavka as $obj) { $revizia = sql_query("\r\n SELECT objr.*, p.meno, p.email_meno\r\n FROM do_objednavka_row objr\r\n INNER JOIN do_produkt p\r\n ON objr.id_do_produkt = p.id\r\n WHERE objr.id_do_objednavka = " . $obj["id"] . "\r\n ORDER BY objr.datum DESC LIMIT 1\r\n "); $revizia = $revizia[0]; echo "\r\n <tr class=\"obj_" . $obj[nastavenie] . "\">\r\n <td class=\"obj_cislo\">\r\n "; checker("id_do_objednavka[" . $obj["id"] . "][id]", $obj["id"], "", "yes"); echo "</td>"; echo "<td class=\"obj_datum do_obj_datum\">" . $obj["dat_upr"] . " </td>\r\n <td class=\"obj_datum do_obj_produkt\"><a href=\"?vyber=do_objednavka&order=" . $obj[id] . "\">\r\n " . (!empty($revizia[ks]) ? $revizia["ks"] . $revizia["jednotka"] . " " : "") . "\r\n " . (!empty($revizia[email_meno]) ? $revizia[email_meno] : $revizia[meno]) . "\r\n </a></td>\r\n "; //var_dump($vyroba2); echo "<td class=\"obj_status\">" . $revizia[zakaznik] . "</td> \r\n <td class=\"do_obj_poznamka\">\r\n " . textfield("id_do_objednavka[" . $obj["id"] . "][poznamka]", $_SESSION["search_text"], "", "", 40) . "\r\n </td>\r\n </tr>\r\n "; } } echo "</tbody></table>"; if (!empty($dodavatel["email"])) { echo submit("send_email_dodavatel", "Odošli email s objednávkou"); } echo "</form>"; }
} if (floatval($v) > 200) { return ''; } return $v; } $lastp = 0; for ($i = 0; $row = @pg_fetch_array($result, $i); $i++) { $times[] = strtotime(substr($row["gvalid"], 0, 16)); $tcs0[] = checker($row["tcs0"]); $tcs1[] = checker($row["tcs1"]); $tcs2[] = checker($row["tcs2"]); $tcs3[] = checker($row["tcs3"]); $Asubc[] = checker($row["subc"]); $Atmpf[] = checker($row["tmpf"]); $Adwpf[] = checker($row["dwpf"]); $p = floatval($row["pcpn"]); $newp = 0; if ($p > $lastp) { $newp = $p - $lastp; } if ($p < $lastp && $p > 0) { $newp = $p; } $pcpn[] = $newp; $lastp = $p; $freezing[] = 32; } pg_close($c0); //pg_close($c1); include "../../../include/jpgraph/jpgraph.php";
$cls = "silver"; } echo "<div id=\"tasker\" class=\"{$cls}\">\r\n \r\n <div class=\"tasker_title\">Úlohy\r\n <div class=\"minimize\">_</div>\r\n </div>"; echo "<div class=\"tasker_content {$minimized}\">"; echo "<div class=\"new_task\">"; echo select("task_for", "", "SELECT id, meno from uzivatel \r\n WHERE skupina=1 AND id<>1 AND vymaz=0\r\n AND id<>" . $_SESSION["username"] . " \r\n ORDER BY meno", "", "", "", "", "NO"); echo textfield("task_text", ""); echo "</div>"; echo "<div class=\"tasker_user\">"; echo "<div class=\"tasks_from\">Doručené správy"; $tasks = sql_query("SELECT t.*, u.meno from task t\r\n INNER JOIN uzivatel u\r\n ON t.uzivatel_id = u.id\r\n WHERE t.for_uzivatel_id = " . $_SESSION["username"] . " \r\n AND (t.komplet=0 OR (t.komplet=1 AND t.datum_komplet >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)))\r\n AND t.vymaz = 0\r\n ORDER BY t.komplet ASC, t.datum"); foreach ($tasks as $task) { echo "<div class=\"tasker_task_from\">"; echo "<div class=\"tasker_username\">" . $task["meno"] . "</div>"; if ($task["komplet"] == 0) { echo checker("task_complete", $task["id"], ""); echo "<div class=\"task_text datum\">" . dateDate($task["datum"]) . "</div>"; } else { echo "<div class=\"check\"></div>"; echo "<div class=\"task_text datum\">" . dateDate($task["datum_komplet"]) . "</div>"; } echo "<div class=\"task_text\">" . $task["task"] . "</div>"; echo "</div>"; } echo "</div>"; echo "<div class=\"tasks_for\">Odoslané správy"; $tasks = sql_query("SELECT t.*, u.meno from task t\r\n INNER JOIN uzivatel u\r\n ON t.for_uzivatel_id = u.id\r\n WHERE t.uzivatel_id = " . $_SESSION["username"] . " \r\n AND (t.komplet=0 OR (t.komplet=1 AND t.datum_komplet >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)))\r\n AND t.vymaz = 0\r\n ORDER BY t.komplet ASC, t.datum"); foreach ($tasks as $task) { echo "<div class=\"tasker_task_for\">"; echo "<div class=\"tasker_username\">" . $task["meno"] . "</div>"; if ($task["komplet"] > 0) {