public function add($usr, $string, $date, $link) { global $con; //Load all the variables into an array $key_array = array("usr" => $usr, "string" => $string, "date" => $date, "link" => $link); //Add the row to the table addRow($con, "feed", $key_array); //Return success return 200; }
private function send($send_parameters) { global $con; $to = $send_parameters["to"]; $from = $_SESSION["userid"]; $msg = $send_parameters["msg"]; $subj = $send_parameters["subject"]; $convoid = $send_parameters["thread"]; if (isset($to) && isset($msg) && isset($subj)) { if (!isset($convoid)) { $convoid = random_key(256); } $send_array = array("thread" => $convoid, "sender" => $from, "receiver" => $to, "subject" => $subj, "msg" => $msg, "date" => date("Y-m-d H:i:s")); addRow($con, "msg", $send_array); return 200; } else { return 401; } }
if (isset($_REQUEST['oper'])) { try { switch ($_REQUEST['oper']) { case 'del': _log(__FILE__ . " - line " . __LINE__ . ": Request for deletion: " . print_r($_REQUEST, TRUE)); // explode, then implode adding quotes $deleteUUID = explode(",", utf8_decode($_REQUEST['id'])); $deleteParameters = '"' . implode('","', $deleteUUID) . '"'; if ($db->query("DELETE FROM Obstacles WHERE UUID IN (" . $deleteParameters . ")")) { _log(__FILE__ . " - line " . __LINE__ . ": Obstacle(s) deleted: " . $deleteParameters); } else { _log(__FILE__ . " - line " . __LINE__ . ": Error deleting position(s) \"" . $deleteParameters . "\"! " . $db->lastErrorMsg()); exit(0); } break; case 'edit': updateRow(); break; case 'add': addRow(); // unsupported break; } } catch (PDOException $e) { _log(__FILE__ . " - line " . __LINE__ . ": Some query failed: " . PDO_PREFIX . SQLITE_DB_FILENAME . ": " . $e->getMessage()); exit(0); // flag jQueryGrid that this failed } } else { updateRow(); }
\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t</thead> \t\t\t\t\t\t<tbody id="media_content"> \t\t\t\t\t\t\t{$text} \t\t\t\t\t\t</tbody> \t\t\t\t\t</table> \t\t\t\t \t\t\t</div><!-- end middle--> \t\t</div><!-- end content--> \t\t<div class="bgB"></div> \t</div><!-- end media--> EOT; } if ($allowactions) { $actionTD = '<td class="action" >Action</td>'; } else { $actionTD = ''; } $text = ''; $i = 0; foreach ($kshowsData as $kshow) { $text .= addRow($kshow, $allowactions, $i); $i = 1 - $i; } $htmlPager = mySmartPagerRenderer::createHtmlPager($lastPage, $page); if ($firstTime) { firstPage($text, $htmlPager, $producer_id, $actionTD, $kaltura_part_of_flag, $screenname, $partner_id); } else { $output = array(".currentPage" => $page, ".maxPage" => $lastPage, ".objectsInPage" => count($kshowsData), ".totalObjects" => $numResults, "media_content" => $text, "media_pager" => $htmlPager); echo json_encode($output); }
} // Пропуск заголовка CSV $res = addRow($data); $res == 0 ? $cnt++ : ($warn[$i - 1] = $res); if (microtime(true) - $time > $hangcheck) { $db->query("UPDATE `tasks` SET `lines`='{$i}',`accepted`='{$cnt}' WHERE `tid`='{$tid}'"); $time = microtime(true); } } $i--; break; case '.txt': while (($str = fgets($handle)) !== false) { $data = explode("\t", $str); $i++; $res = addRow($data); $res == 0 ? $cnt++ : ($warn[$i] = $res); if (microtime(true) - $time > $hangcheck) { $db->query("UPDATE `tasks` SET `lines`='{$i}',`accepted`='{$cnt}' WHERE `tid`='{$tid}'"); $time = microtime(true); } } break; } if ($checkexist) { $chkst->close(); } fclose($handle); $stmt->close(); } $warns = array();
foreach ($res as $record) { $entry_id = $record[0]; $plays = $record[1]; $views = $record[2]; $entries_data[$entry_id] = array("plays" => $plays, "views" => $views); } //old code from doSelectRs //while($rs->next()) //{ // $entry_id = $rs->getInt(1); // $plays= $rs->getInt(2); // $views = $rs->getInt(3); // $entries_data[$entry_id] = array("plays" => $plays, "views" => $views); //} foreach ($widget_log_list as $widget_log) { $media_content .= addRow($widget_log, @$kshows_data[$widget_log->getKshowId()], @$entries_data[$widget_log->getEntryId()], $i % 2 == 0); ++$i; } if ($firstTime) { $options = dashboardUtils::partnerOptions($partner_id); ?> <script type="text/javascript"> jQuery(document).ready(function(){ mediaSortOrder = "views"; var defaultMediaPageSize = 100; mediaPager = new ObjectPager('media', defaultMediaPageSize, requestMediaWidget ); updatePagerAndRebind ( "media_pager" , null , requestMediaPageWidget ); updatePagerAndRebind ( "media_pagerB" , null , requestMediaPageWidget );
$kostenstellen = array(); $kostenstelle = new wawi_kostenstelle(); $kostenstelle->getAll(); foreach ($kostenstelle->result as $row) { $kostenstellen[$row->kostenstelle_id] = $row->bezeichnung; } // Buchung laden $obj = new buchung(); if (!is_null($person_id)) { $obj->getBuchungPerson($person_id); foreach ($obj->result as $row) { addRow($row); } } elseif (!is_null($buchung_id)) { $obj->load($buchung_id); addRow($obj); } else { die('Falsche Parameterübergabe'); } // Ausgabe einer Buchung function addRow($row) { global $oRdf, $datum; global $konten, $kostenstellen, $buchungstypen; $i = $oRdf->newObjekt($row->buchung_id); $oRdf->obj[$i]->setAttribut('buchung_id', $row->buchung_id, true); $oRdf->obj[$i]->setAttribut('buchungsdatum', $datum->formatDatum($row->buchungsdatum, 'd.m.Y'), true); $oRdf->obj[$i]->setAttribut('buchungsdatum_iso', $row->buchungsdatum, true); $oRdf->obj[$i]->setAttribut('buchungstext', $row->buchungstext, true); $oRdf->obj[$i]->setAttribut('betrag', $row->betrag, true); $oRdf->obj[$i]->setAttribut('konto', isset($konten[$row->konto_id]) ? $konten[$row->konto_id] : '', true);
<td style="width:60px;" class="type" ><span>180</span></td> <td style="width:40px;" class="type" ><span>7</span></td> <td style="width:60px;" class="type" ><span>30</span></td> <td style="width:60px;" class="type" ><span>180</span></td> <td style="width:80px;" class="type" ><span>For dates</span></td> <td style="width:80px;" class="type" ><span>Total</span></td> </tr> </thead> <tbody id="media_content"> <?php $i = 0; $media_content = ""; foreach ($partners_stat as $partner_stat) { $media_content .= addRow($partner_stat, $i % 2 == 0); ++$i; if ($i % 10 == 0) { echo $media_content; $media_content = ""; } } echo $media_content; ?> </tbody> </table> <?php if (!$excel) {
\t\t\t\t\t\t<tbody id="media_content"> \t\t\t\t\t\t\t{$text} \t\t\t\t\t\t</tbody> \t\t\t\t\t</table> \t\t\t</div><!-- end middle--> \t\t\t<div class="clearfix"> \t\t\t\t<ul class="pager" id="media_pagerB"> \t\t\t\t\t{$pagerHtml} \t\t\t\t</ul> \t\t\t</div> \t\t</div><!-- end content--> \t\t<div class="bgB"></div> \t</div><!-- end media--> EOT; } $text = ''; $i = 0; foreach ($kusersData as $kuser) { $text .= addRow($kuser, $i % 2 == 0); ++$i; } $htmlPager = mySmartPagerRenderer::createHtmlPager($lastPage, $page); if (!isset($user_id)) { $user_id = null; } if ($firstTime) { firstPage($text, $htmlPager, $user_id, $partner_id); } else { $output = array(".currentPage" => $page, ".maxPage" => $lastPage, ".objectsInPage" => count($kusersData), ".totalObjects" => $numResults, "media_content" => $text, "media_pager" => $htmlPager, "media_pagerB" => $htmlPager); echo json_encode($output); }
private function create($parameters) { global $con; if (!isset($parameters["item1"]) || !isset($parameters["item2"])) { return 401; } elseif (!isset($_SESSION["userid"])) { return 403; } else { $offerid = random_key(256); $offer_fields = array("id" => $offerid, "item1" => $parameters["item1"], "item2" => $parameters["item2"]); addRow($con, "exchange", $offer_fields); $originItem = new Item(array("action" => "get", "filter" => array("id" => $parameters["item1"]))); $originInfo = $originItem->run(); if ($originInfo[0]["usr"] != $_SESSION["userid"]) { return 403; exit; } $itemAuth = new User(array("action" => "get", "id" => $originInfo[0]["usr"])); $userGet = $itemAuth->run(); $afname = $userGet[0]["fname"]; $acceptItem = new Item(array("action" => "get", "filter" => array("id" => $parameters["item2"]))); $acceptInfo = $acceptItem->run(); $ai_name = $acceptInfo[0]["name"]; $ai_usr = $acceptInfo[0]["usr"]; $pronoun = "their"; switch (trim($userGet[0]["gender"])) { case "0": $pronoun = "his"; break; case "1": $pronoun = "her"; break; } $offermsg = $afname . " has decided to trade {$pronoun} " . $originInfo[0]["name"] . " for your " . $ai_name; $link = "exchange.php?offerid=" . trim($offerid); sendNotify($acceptInfo[0]["usr"], $offermsg, $link); return 200; } }
if (!$rslt) { unlink($file_path); \Sop\Log::error(__FILE__, __LINE__, 'Failed to add clmn.'); $msg020 = "The registration failed: clmn"; // 登録に失敗しました: clmn \Sop\Api::exitWithError(array($msg020)); } $clmn_list[$idx]['clmn_id'] = getLastID($db); // row 更新用 } // --- TBL: row foreach ($sheet_data as $row_order => $row) { foreach ($row as $idx => $row_text) { $clmn_id = $clmn_list[$idx + 1]['clmn_id']; $row_id = -1; $rslt = addRow($db, $row_id, $pj_id, $sop_id, $tpl_id, $schema_id, $tbl_id, $clmn_id, $row_text, $row_order); if (!$rslt) { unlink($file_path); \Sop\Log::error(__FILE__, __LINE__, 'Failed to add row.'); $msg021 = "The registration failed: row"; // 登録に失敗しました: row \Sop\Api::exitWithError(array($msg021)); } } } } } // --- TBL: history $history_id = -1; $rslt = addHistory($db, $history_id, $pj_id, $sop_id, $tpl_id, $schema_id, null, null, $HISTORY_ACTION_TPL_UPLD, $date, $user_id, null, $upld_cmnt); if (!$rslt) {
<?php function addRow($uiconf, $even_row) { $s = '<tr ' . ($even_row ? 'class="even" ' : '') . '>' . '<td><a href="' . url_for("system/editUiconf?id=" . $uiconf->getId()) . '">' . $uiconf->getId() . '</a></td>' . '<td>' . $uiconf->getObjType() . '</td>' . '<td>' . $uiconf->getPartnerId() . '</td>' . '<td>' . $uiconf->getSubpId() . '</td>' . '<td style="text-align:left;">' . $uiconf->getName() . '</td>' . '<td>' . $uiconf->getConfFilePath() . '</td>' . '<td>' . $uiconf->getWidth() . '</td>' . '<td>' . $uiconf->getHeight() . '</td>' . '<td>' . $uiconf->getSwfUrl() . '</td>' . '<td>' . $uiconf->getCreatedAt() . '</td>' . '<td>' . $uiconf->getUpdatedAt() . '</td>' . '<td>' . $uiconf->getTags() . '</td>' . '</tr>'; return $s; } $i = 0; $media_content = ""; foreach ($uiconfs as $uiconf) { $media_content .= addRow($uiconf, $i % 2 == 0); ++$i; } ?> <script type="text/javascript"> function openInNewWindow ( url ) { h = window.open ( url ); return ; } </script> <div class="mykaltura_viewAll mykaltura_media" style="width: 80%;"> <div> <form action="<?php echo url_for("system/viewUiconf"); ?> " method="get">
} } while ($addr = $addresses->nextAddress()) { $color = $alternate++ % 2 ? "odd" : ""; echo "<tr class='" . $color . "' name='entry'>"; if ($is_mobile) { // addRow("select"); addRow("lastname"); addRow("firstname"); // addRow("first_last"); // addRow("all_phones"); // addRow("email"); addRow("edit"); } else { foreach ($disp_cols as $col) { addRow($col); } } echo "</tr>\n"; } echo "</table>"; echo " <input type='checkbox' id='MassCB' onclick=\"MassSelection()\" /> <em><strong>" . ucfmsg("SELECT_ALL") . "</strong></em><br><br>"; if ($use_doodle) { echo "<div class='left'><input type='button' value=\"" . ucfmsg("DOODLE") . "\" onclick=\"Doodle()\" /></div>"; } echo "<div class='left'><input type='button' value=\"" . ucfmsg("SEND_EMAIL") . "\" onclick=\"MailSelection()\" /></div>"; if (!$read_only) { echo "<div class='left'><input type='button' value=\"" . ucfmsg("DELETE") . "\" onclick=\"DeleteSel()\" /></div>"; if (isset($table_groups) and $table_groups != "" and !$is_fix_group) { // -- Remove from group -- if ($group_name != "" and $group_name != "[none]") {
<?php } ?> <div id="category" class="nblock"> <div class="nblockhead"> Categories </div> <div class="nblockrem"><div class="notielems"> <?php if (count($client->category) == 0) { echo '<div class="nempty">Please add some categories of notifiers before starting up.</div>'; } else { ?> <table class="noti"> <tr><th>Name</th><th>Summary</th></tr> <?php foreach ($client->category as $r) { addRow(array($r['name'], $r['summary'])); } ?> </table> <?php } ?> <div class="notioptions"> <div class="notiadd notioption"> <div class="button">Add</div> <div class="body"> <form method="post"> <input type="hidden" name="ntype" value="addcategory" /> <label for="name">Name</label> <input type="text" name="name" placeholder="Important, Not necessary, College related etc." required="required" /> <label for="summary">Summary</label>
private function create($fields, $requiredFields, $forbidden) { global $con, $available_condition, $available_category; $fields["citytown"] = "Worcester"; $fields["state"] = "MA"; $fields["stadd2"] = "100 Institute Road"; $pass = true; $hasforbidden = false; foreach ($requiredFields as $v) { if (!array_key_exists($v, $fields)) { return 401; } else { if (trim($fields[$v]) == "") { return 401; } } } foreach ($forbidden as $v) { if (array_key_exists($v, $fields)) { return 402; } } $userInfo = array(); if (!isset($_SESSION["userid"])) { return 403; } else { $curUser = new User(array("action" => "get", "id" => $_SESSION["userid"])); $userInfo = $curUser->run(true); } if ($userInfo[0]["status"] != "2") { return 403; } else { $itemid = random_key(256); $fields["adddate"] = time(); $emv = $this->calculateEMV($fields["name"]); $fields["emv"] = $emv; $base_array = array("usr" => trim($_SESSION["userid"]), "id" => $itemid); if (isset($fields) && is_array($fields)) { $item_fields = array_merge($base_array, $fields); } else { $item_fields = $base_array; } addRow($con, "item", $item_fields); $pronoun = "his/her"; switch (intval($userInfo[0]["gender"])) { case 1: $pronoun = "his"; break; case 2: $pronoun = "her"; break; } $feed = new Feed(); $feed->add($_SESSION["userid"], "posted {$pronoun} item: {$item_fields["name"]}", time(), "/view.php?itemid={$itemid}&userid={$_SESSION["userid"]}"); return $itemid; } }
</div> <div class="table-responsive"> <div class="panel panel-default"> <!-- Default panel contents --> <div class="panel-heading">Equipment List</div> <!-- Table --> <table class="table"> <tr> <th>Node Name</th> <th>Node Type</th> <th>Cabinet Number</th> <th>Cabinet Type</th> <th>Homing CO</th> </tr> <?php require_once 'includes/database_master.inc.php'; require_once 'includes/node_row.inc.php'; $database_master = new DatabaseMaster(); $offset = ($page - 1) * 25; $query = "SELECT n.nodeName, n.node_type, c.cabinetNo, c.cabinet_type, n.central_officeName,n.sinNo,n.electricMeterNo,n.nodeLocation\n FROM node AS n\n LEFT JOIN cabinet AS c\n ON n.cabinetNo = c.cabinetNo\n ORDER BY c.cabinetNo, n.nodeName\n LIMIT {$offset}, {$nodesPerPage}"; $queryResult = $database_master->querySelect($query); foreach ($queryResult as $row) { addRow($row); } ?> </table> </div> </div>