$dataCols[$k2]["ent"] = $fields[$val]["entity"] . $i; } } $bioFields = array(147 => "2309", 148 => "0903", 149 => "0904", 150 => "462274628", 151 => "8005", 152 => "8008"); //7 hat $biosCount = 4; for ($i = 1; $i <= $biosCount; $i++) { foreach ($bioFields as $key => $val) { $k2 = $key + intval(($i - 1) * 6); $k2 = (int) $k2; $dataCols[$k2] = $fields[$val]; $dataCols[$k2]["ent"] = "bio_details" . $i; } } try { $data = get_data_array(); } catch (Exception $e) { var_dump($e); } $lists = array(); function get_data_array() { global $dataFile, $dataCols, $fields, $lists, $docsCount, $biosCount; if (($handle = fopen($dataFile, "r")) === FALSE) { return array(); } $results = array(); $j = 0; while (($cols = fgetcsv($handle, 0, "\t")) !== FALSE) { $glData = array(); $row = array();
public function block_content($context, array $blocks = array()) { // line 4 echo "<div class=\"module\">\n <div class=\"module-head\">\n <h3>"; // line 6 echo isset($context["module_title"]) ? $context["module_title"] : null; echo "</h3>\n </div>\n <div class=\"module-body\">\n "; // line 9 echo get_flashdata("tugas"); echo "\n\n <div>\n "; // line 12 echo form_open("admin/tugas/edit_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . $this->getAttribute(isset($context["pertanyaan"]) ? $context["pertanyaan"] : null, "id")); echo "\n <input type=\"hidden\" name=\"jumlah_pilihan\" value=\"4\">\n <table class=\"table table-bordered table-hover\">\n <thead>\n <tr>\n <th>\n <div class=\"bs-callout bs-callout-info bs-callout-noborder\">\n <div class=\"btn-group pull-right\">\n <a class=\"btn btn-default\" href=\""; // line 20 echo twig_escape_filter($this->env, site_url("admin/tugas/edit/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . enurl_redirect(current_url())), "html", null, true); echo "\"><i class=\"icon-edit\"></i> Edit Tugas</a>\n "; // line 21 if ($this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "aktif") == 0) { // line 22 echo " "; echo anchor("admin/tugas/tampilkan/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . enurl_redirect(current_url()), "<i class=\"icon-ok\"></i> Tampilkan</a>", array("class" => "btn btn-default", "data-toggle" => "tooltip", "title" => "Tampilkan agar siswa dapat <br>mengerjakan tugas")); echo "\n "; } else { // line 24 echo " "; echo anchor("admin/tugas/sembunyikan/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . enurl_redirect(current_url()), "<i class=\"icon-ok\"></i> Sembunyikan</a>", array("class" => "btn btn-success", "data-toggle" => "tooltip", "title" => "Sembunyikan agar siswa sudah <br>tidak dapat mengerjakan tugas")); echo "\n "; } // line 26 echo " </div>\n <h2 class=\"title-info\" data-toggle=\"collapse\" data-target=\"#demo\">"; // line 27 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "judul"), "html", null, true); echo "</h2>\n <div id=\"demo\" class=\"collapse\">\n <label class=\"label label-warning\">Tipe : "; // line 29 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "type"), "html", null, true); echo "</label>\n <label class=\"label label-info\">Durasi : "; // line 30 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "durasi"), "html", null, true); echo " Menit</label>\n <table class=\"table table-condensed table-striped\">\n <thead>\n <tr>\n <th>Pengajar</th>\n <th>Matapelajaran</th>\n <th>Hari</th>\n <th>Jam</th>\n <th>Kelas</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><a href=\""; // line 43 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["pengajar"]) ? $context["pengajar"] : null, "link_profil"), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["pengajar"]) ? $context["pengajar"] : null, "nama"), "html", null, true); echo "</a></td>\n <td>"; // line 44 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["mapel"]) ? $context["mapel"] : null, "nama"), "html", null, true); echo "</td>\n <td>"; // line 45 echo twig_escape_filter($this->env, get_indo_hari($this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "hari_id")), "html", null, true); echo "</td>\n <td>"; // line 46 echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "jam_mulai"), "H:i"), "html", null, true); echo " - "; echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "jam_selesai"), "H:i"), "html", null, true); echo "</td>\n <td>"; // line 47 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["kelas"]) ? $context["kelas"] : null, "nama"), "html", null, true); echo " <span class=\"badge badge-info\">"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["kelas"]) ? $context["kelas"] : null, "jumlah_siswa"), "html", null, true); echo " siswa</span></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"info\">\n <td>\n <div class=\"row-fluid\">\n <div class=\"span10\">\n <ul class=\"unstyled inline\" style=\"margin-left: -5px;\">\n "; // line 62 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["retrieve_all_pertanyaan"]) ? $context["retrieve_all_pertanyaan"] : null, "results")); foreach ($context['_seq'] as $context["s_key"] => $context["s"]) { // line 63 echo " <li>\n "; // line 64 if (!twig_test_empty($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "kunci_index"))) { // line 65 echo " "; $context["kunci_index"] = get_abjad($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "kunci_index")); // line 66 echo " "; } else { // line 67 echo " "; $context["kunci_index"] = ""; // line 68 echo " "; } // line 69 echo " "; echo anchor("admin/tugas/edit_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . $this->getAttribute(isset($context["s"]) ? $context["s"] : null, "id"), (isset($context["s_key"]) ? $context["s_key"] : null) . ". " . (isset($context["kunci_index"]) ? $context["kunci_index"] : null), array("class" => "label label-info", "data-toggle" => "tooltip", "title" => word_limiter(strip_tags($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "pertanyaan")), 50))); echo "\n </li>\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['s_key'], $context['s'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 72 echo " </ul>\n <b>Jumlah Soal Tersimpan : "; // line 73 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["retrieve_all_pertanyaan"]) ? $context["retrieve_all_pertanyaan"] : null, "total_record"), "html", null, true); echo "</b>\n </div>\n <div class=\"span2\">\n "; // line 76 echo anchor("admin/tugas/add_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id"), "Tambah Soal", array("class" => "btn btn-primary")); echo "\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>\n <div class=\"btn-group pull-right\">\n <button class=\"btn btn-primary\" type=\"submit\">Update Soal</button>\n "; // line 85 echo anchor("admin/tugas/delete_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . $this->getAttribute(isset($context["pertanyaan"]) ? $context["pertanyaan"] : null, "id"), "Hapus Soal", array("class" => "btn btn-danger", "onclick" => "return confirm('Anda yakin ingin manghapus soal ini?')")); echo "\n </div>\n <h3>Edit Pertanyaan <span class=\"text-error\">*</span> "; // line 87 echo form_error("pertanyaan"); echo "</h3>\n <textarea id=\"question\" name=\"pertanyaan\" style=\"width:100%;height:200px;\">"; // line 88 echo set_value("pertanyaan", $this->getAttribute(isset($context["pertanyaan"]) ? $context["pertanyaan"] : null, "pertanyaan")); echo "</textarea>\n </td>\n </tr>\n "; // line 91 if ($this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "type_id") == 3) { // line 92 echo "\n "; // line 93 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable(range(1, 4)); foreach ($context['_seq'] as $context["_key"] => $context["i"]) { // line 94 echo " <tr>\n <td>\n <input type=\"hidden\" name=\"pilihan_"; // line 96 echo twig_escape_filter($this->env, isset($context["i"]) ? $context["i"] : null, "html", null, true); echo "_id\" value=\""; echo twig_escape_filter($this->env, get_data_array(isset($context["pilihan"]) ? $context["pilihan"] : null, isset($context["i"]) ? $context["i"] : null, "id"), "html", null, true); echo "\">\n <div class=\"pull-right controls\">\n <label class=\"radio inline\"><input type=\"radio\" name=\"kunci\" value=\"pilihan_"; // line 98 echo twig_escape_filter($this->env, isset($context["i"]) ? $context["i"] : null, "html", null, true); echo "\" "; echo twig_escape_filter($this->env, set_radio("kunci", "pilihan_" . (isset($context["i"]) ? $context["i"] : null), get_data_array(isset($context["pilihan"]) ? $context["pilihan"] : null, isset($context["i"]) ? $context["i"] : null, "kunci") == 1 ? true : ""), "html", null, true); echo "> <b class=\"text-warning\">Jadikan Kunci</b></label>\n </div>\n <h3>Edit Pilihan "; // line 100 echo twig_escape_filter($this->env, get_abjad(isset($context["i"]) ? $context["i"] : null), "html", null, true); echo "</h3>\n <textarea class=\"tiny_options\" name=\"pilihan_"; // line 101 echo twig_escape_filter($this->env, isset($context["i"]) ? $context["i"] : null, "html", null, true); echo "\" style=\"width:100%;height:200px;\">"; echo set_value("pilihan_" . (isset($context["i"]) ? $context["i"] : null), get_data_array(isset($context["pilihan"]) ? $context["pilihan"] : null, isset($context["i"]) ? $context["i"] : null, "konten")); echo "</textarea>\n </td>\n </tr>\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 105 echo " \n "; } // line 107 echo " <tr>\n <td>\n <button class=\"btn btn-primary\" type=\"submit\">Update Soal</button>\n <a class=\"btn btn-default\" href=\""; // line 110 echo twig_escape_filter($this->env, site_url("admin/tugas/soal/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id")), "html", null, true); echo "\">Kembali</a>\n \n "; // line 112 echo anchor("admin/tugas/delete_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . $this->getAttribute(isset($context["pertanyaan"]) ? $context["pertanyaan"] : null, "id"), "Hapus Soal", array("class" => "btn btn-danger pull-right", "onclick" => "return confirm('Anda yakin ingin manghapus soal ini?')")); echo "\n </td>\n </tr>\n </tbody>\n </table>\n "; // line 117 echo form_close(); echo "\n </div>\n </div>\n</div>\n"; }
echo "<br />UPDATE {$update_value['4']} SET {$update_text} WHERE {$where_text} <br />"; $update_query = mysql_query("UPDATE {$update_value['4']} SET {$update_text} WHERE {$where_text}") or die("Error 135 : " . mysql_error()); } $push_data_array = array($update_value[0], $update_value[1], $update_value[2], $update_value[3], $update_value[4], $update_value[5], 'N', $update_value[6]); array_push($array_m_push_update, $push_data_array); unset($push_data_array); $update_record_count += 1; } update_m_push($array_m_push_update, 'update'); unset($array_m_push_update); } //DELETE RECORDS $delete_record_count = 0; lite_connect($_POST['sync_user']); $check_status_sql = "SELECT lite_patient_id, emr_patient_id, lite_specific_id, emr_specific_id, table_name, entry_date, sync_type FROM m_push_status WHERE push_flag ='Y' AND sync_type='D'"; $delete_array = get_data_array($check_status_sql); //print_r($delete_array); if ($delete_array != NULL || $delete_array != '') { ehr_connect(); $array_m_push_update = array(); foreach ($delete_array as $del_array => $delete_value) { //print_r($delete_array); //echo "<br />"; $delete_text = where_clause($delete_value); if ($delete_value[4] == 'm_patient_fp_method_service' || $delete_value[4] == 'm_patient_fp_obgyn' || $delete_value[4] == 'm_patient_fp_hx' || $delete_value[4] == 'm_consult_mc_postpartum' || $delete_value[4] == 'm_consult_mc_prenatal' || $delete_value[4] == 'm_consult_mc_services' || $delete_value[4] == 'm_consult_mc_vaccine' || $delete_value[4] == 'm_consult_ccdev_vaccine' || $delete_value[4] == 'm_consult_ccdev_services' || $delete_value[4] == 'm_consult_vaccine' || $delete_value[4] == 'm_consult_notes_complaint' || $delete_value[4] == 'm_consult_notes_dxclass') { $get_all_compare = mysql_query("SELECT * FROM {$delete_value['4']} WHERE {$delete_text}") or die("Error 200 : " . mysql_error()); while ($get_all_result = mysql_fetch_array($get_all_compare)) { switch ($delete_value[4]) { case 'm_consult_mc_prenatal': $spc_field = 'mc_id'; $field_to_find = 'visit_sequence';
$push_data_array = array($new_consult[0], $new_consult[1], $new_consult[2], $new_id, $new_consult[4], $new_consult[5], 'N', $new_consult[6]); array_push($array_m_push_update, $push_data_array); unset($push_data_array); } update_m_push($array_m_push_update, 'newconsult'); unset($array_m_push_update); } else { echo "No new consult"; } //other table with consult_id $table_array = array('m_patient_mc', 'm_patient_fp'); //list of secondary table related with consult_id foreach ($table_array as $tablename) { lite_connect($host); $check_status_sql = "SELECT lite_patient_id, emr_patient_id, lite_specific_id, emr_specific_id, table_name, entry_date, sync_type FROM m_push_status WHERE push_flag ='Y' AND table_name='{$tablename}' AND sync_type='N'"; $new_entry_array = get_data_array($check_status_sql); if ($new_entry_array != NULL || $new_consult_array != '') { ehr_connect(); $array_m_push_update = array(); foreach ($new_entry_array as $entry_array => $new_entry) { $new_id = get_new_id($new_entry); $insert_text = insert_values($new_entry, $new_id); insert_query($insert_text, $new_entry[4]); $push_data_array = array($new_entry[0], $new_entry[1], $new_entry[2], $new_id, $new_entry[4], $new_entry[5], 'N', $new_entry[6]); array_push($array_m_push_update, $push_data_array); unset($push_data_array); } update_m_push($array_m_push_update, 'new'); unset($array_m_push_update); } }
<?php defined('APP_PATH') || define('APP_PATH', realpath('.')); function get_data_array($url) { $result = array('charset' => 'utf8'); $adapter = explode('://', $url)[0]; $url = explode("{$adapter}://", $url)[1]; $adapter = ucfirst($adapter); $auth = explode('@', $url)[0]; $hst = explode('@', $url)[1]; $host = explode('/', $hst)[0]; $db = explode('/', $hst)[1]; $db = explode('?', $db)[0]; $_auth = explode(':', $auth); $result['adapter'] = $adapter; $result['username'] = $_auth[0]; $result['password'] = $_auth[1]; $result['host'] = $host; $result['dbname'] = $db; return $result; } $cfg = array('adapter' => 'Mysql', 'host' => 'localhost', 'username' => 'rps2', 'password' => 'rps2', 'dbname' => 'rps2', 'charset' => 'utf8'); if (isset($_SERVER['CLEARDB_DATABASE_URL'])) { $cfg = get_data_array($_SERVER['CLEARDB_DATABASE_URL']); } return new \Phalcon\Config(array('database' => $cfg, 'application' => array('modelsDir' => APP_PATH . '/models/', 'migrationsDir' => APP_PATH . '/migrations/', 'viewsDir' => APP_PATH . '/views/', 'baseUri' => '/')));
$postDB = new postDB(); $rResult = $postDB->execSQL($sQuery); $sQuery = "\n SELECT count(postIndex.postid) AS count FROM postIndex,postInfo WHERE postIndex.historyid = postInfo.historyid AND postIndex.deleted = 0"; $result = $postDB->execSQL($sQuery); $iTotal = $result[0]["count"]; $sQuery = "\n SELECT count(postIndex.postid) AS count FROM postIndex,postInfo WHERE postIndex.historyid = postInfo.historyid AND postIndex.deleted = 0\n {$sWhere}"; $result = $postDB->execSQL($sQuery); $iFilteredTotal = $result[0]["count"]; $postDB->close(); return $rResult; } function fatal_error($sErrorMessage = '') { header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error'); die($sErrorMessage); } function get_data_array($result) { $array = array(); foreach ($result as $entry) { $dataid = $entry["postid"]; $histid = $entry["historyid"]; $op = "<a href='' name='new'>添加</a> <a href='' name='delete'>删除</a> <a href='' name='edit'>编辑</a> <input type='hidden' data-id='{$dataid}' data-histid='{$histid}'/>"; array_push($array, array($entry["title"], $entry["author"], $entry["createTime"], $op)); } return $array; } $result = get_query_result($_GET); $dataArray = get_data_array($result); $output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iFilteredTotal, "aaData" => $dataArray); echo json_encode($output);
var_dump($response); while ($row_get_sysid = mysql_fetch_assoc($get_sysid)) { $new_sysid = $row_get_sysid['sysid']; switch ($row_get_sysid['property_type']) { case 'Multifamily': $property_type = 7; break; case 'Residential Detached': $property_type = 1; break; case 'Residential Attached': $property_type = 2; break; } if (!empty($property_type)) { $listing_array = get_data_array($property_type, $new_sysid); if (!empty($listing_array)) { update_database($property_type, $listing_array, $new_sysid); patch($new_sysid); } } } } else { echo '<br/>All listings are patched<br/>'; } $selectSQL = "SELECT SQL_CALC_FOUND_ROWS DISTINCT listings.sysid, postal_code, house_number, street_name, street_type, city, province FROM listings\nLEFT JOIN listing_geoaddress ON listings.sysid=listing_geoaddress.sysid WHERE (ISNULL(lat) OR listing_geoaddress.updated='N') AND status='A' AND property_type!='Land Only' ORDER BY RAND() LIMIT 0, 10"; $get_sysid = mysql_query_or_die($selectSQL, $useradmin); $row = mysql_fetch_row(mysql_query("SELECT FOUND_ROWS()", $useradmin)); if ($row[0] > 0) { echo "<br/>There are " . $row[0] . " listings that don't have geo code address (or don't have accurate geo code).<br/><br/>"; //login and receive server response.