public function getPostsByTopic($topic_id) { $postList = array(); $query = sprintf("SELECT * FROM Forum_Post WHERE topic_id=%d;", $topic_id); $results = get_query($query); return $results; }
function run_query($table) { global $conn; if (!($result = $conn->query(get_query($table)))) { die('Query error: "' . $conn->error . '"'); } return $result; }
/** * 搜索需求 */ public function search() { $key = get_query('key'); if (empty($key)) { this . getList(); } $list = $this->pM->search($key, LIST_PPN, get_query('p', 1)); json_success(array('isEnd' => empty($list), 'list' => $list)); }
public function searchDocByClass($class_name) { $query = sprintf("SELECT * FROM Document WHERE class_name='%s';", $class_name); $results = get_query($query); $docList = array(); if (is_null($results)) { $docList = array(); } else { while ($result = $results->fetch_assoc()) { array_push($docList, $result); } } return $docList; }
public function createDocument($username, $class_name, $subject, $doc_name, $doc_type, $path_to_doc) { //get random doc_id $doc_id = get_rand_num(); while (value_exists("Document", "doc_id", $doc_id)) { $doc_id = get_rand_num(); } $int = 1; //get all documents where doc_name similar to $doc_name AND path_to_doc==$path_to_doc $query_string = sprintf("SELECT * FROM `Document` WHERE doc_name LIKE '%s%%' AND path_to_doc='%s';", mysql_escape_string($doc_name), mysql_escape_string($path_to_doc)); $data = get_query($query_string); if (isset($data)) { //put results into an array $doc_list = array(); while ($row = $data->fetch_assoc()) { array_push($doc_list, $row['doc_name']); } $int = 0; $new_doc_name = $doc_name; while ($int < $data->num_rows) { if (strcmp($doc_list[$int], $new_doc_name) == 0) { $new_doc_name = sprintf("%s%d", $doc_name, $int); $int = 0; } else { $int++; } } } else { $new_doc_name = $doc_name; } db_add("Document", sprintf("'%d', '%s', '%s', '%s', '%s', '%s', '%s', '0', '0', 'false'", $doc_id, $username, mysql_escape_string($class_name), $subject, mysql_escape_string($new_doc_name), $doc_type, mysql_escape_string($path_to_doc))); $this->doc_name = $new_doc_name; $this->username = $username; $this->class_name = $class_name; $this->subject = $subject; $this->doc_type = $doc_type; $this->path_to_doc = $path_to_doc; $this->doc_id = $doc_id; $this->blocked = false; $this->upvotes = 0; $this->downvotes = 0; }
function list_recipes($msg) { parse_str($msg); // $sql='select name, rindex from main where type='.$rType.' order by name'; $sql = get_query($sfield, $smatch); $sql .= " and m.type=" . $rType . " order by name"; $result = mysql_query($sql); echo '<table width="99%"><tr>'; $col = 1; while ($entry = mysql_fetch_assoc($result)) { echo '<td width="33%" align="center">'; echo '<br><a href="show_recipe.php?&index=' . $entry['rindex'] . '">' . $entry['name'] . '</a></td>'; $col++; if ($col % 3 == 1) { echo '</tr><tr>'; } } echo '</tr></table>'; return; }
function movies($location) { require_once 'simple_html_dom.php'; $str = get_query('http://www.google.com/movies?near=' . urlencode($location)); $html = str_get_html($str); $lines = array(); foreach ($html->find('#movie_results .theater') as $div) { $i = 0; foreach ($div->find('.movie') as $movie) { $times = remEntities(strip_tags($movie->find('.times', 0)->innertext)); $line = strip_tags($movie->find('.name a', 0)->innertext) . ' [ ' . $times . ' ] @ ' . strip_tags($div->find('h2 a', 0)->innertext); $lines[$line] = $line; $i++; if ($i == 10) { break; } } break; } $html->clear(); return $lines; }
/** * Extracts file argument either from file parameter or PATH_INFO. * @param string $scriptname name of the calling script * @return string file path (only safe characters) */ function get_file_argument_limited($scriptname) { $relativepath = FALSE; // first try normal parameter (compatible method == no relative links!) if (isset($_GET['file'])) { return makesafe($_GET['file']); } // then try extract file from PATH_INFO (slasharguments method) if (!empty($_SERVER['PATH_INFO'])) { $path_info = $_SERVER['PATH_INFO']; // check that PATH_INFO works == must not contain the script name if (!strpos($path_info, $scriptname)) { return makesafe(rawurldecode($path_info)); } } // now if both fail try the old way // (for compatibility with misconfigured or older buggy php implementations) $arr = get_query($scriptname); if (!empty($arr[1])) { return makesafe(rawurldecode(strip_querystring($arr[1]))); } error('Unexpected PHP set up. Turn off the smartpix config option.'); }
<a target="_blank" href="<?php echo $config["site_name"]?>index.php/contact/?track=wp_qi"><strong>Give us a contact</strong></a> and we'll help you finding and <strong>resolving your performance and optimization issues</strong>.<br><br> For further details on Performance and Optimization, <a target="_blank" href="<?php echo $config["site_name"]?>index.php/2012/01/code-query-optimizer-consultant-website-performance-optimization/?track=wp_qi"><strong>click here</strong></a>. </td> </tr> </table> </td> </tr> </table> </form> <?php if($_POST) { $sql = ""; $sql = $_POST["query"]; $action = intval($_POST["chk"]); $results = get_query($sql, $action); if(mysql_error()) { echo mysql_error(); } else { ?> <table align="center" border=1> <tr> <?php foreach($results["fields"] as $fld) { ?> <td align="center"><strong><?php echo $fld?></strong></td> <?php }
function decode_url($whattodo = "global") { //$url = substr(strrchr($_SERVER['REQUEST_URI'],'/'),1); $url = get_query(); $url = explode(";", $url); if (isset($url)) { for ($x = 0; $x < sizeof($url); $x++) { $vars = explode(".", $url[$x]); if (isset($vars) && sizeof($vars) == 2) { if ('array' == $whattodo) { $gb_urlvars[$vars[0]] = $vars[1]; } else { isset($GLOBALS[$vars[0]]) ? true : ($GLOBALS[$vars[0]] = $vars[1]); } } } } isset($gb_urlvars) ? $GLOBALS["gb_urlvars"] = $gb_urlvars : ($GLOBALS["gb_urlvars"] = ""); }
<?php $result = get_query("SELECT * FROM send_repair AS a INNER JOIN repair AS b ON a.rp_id=b.rp_id INNER JOIN type_repair AS c ON b.tr_id=c.tr_id WHERE a.sr_id=" . $_GET['id'], $con); $r = assoc_get($result); $arr_rp = unserialize($r['rp_item']); $arr_sw = unserialize($r['rp_software']); ?> <div class="height-report" style="padding-top:10px"> <div class="container"> <div class="title-report col-md-12"><?php echo $name_report; ?> <span class="pull-right"> สำหรับลูกค้า</span></div> <table class="table table-bordered height-table"> <tr> <td colspan="3"> <span>พีเอส ซัพพลาย</span><span class="pull-right">เลขที่ <?php echo $r['sr_id']; ?> </span><br> <span>อาคารคอมพิวเตอร์พลาซ่า ห้อง A12</span> <br> <span>312 ถ.มณีนพรัตน์ ต.ศรีภูมิ อ.เมือง จ.เชียงใหม่ 50200</span><span class="pull-right">วันที่ <?php echo date('d/m/Y'); ?> </span><br> <span>Tel. 094-6071991 Fax. 053-405399</span><span class="pull-right">เวลา <?php echo date('H:i:s'); ?> </span><br> </td> </tr>
public function showUsers() { $results = get_query("SELECT * FROM `Registered_User`;"); return $results; }
if (function_exists('imagefilter') && defined('IMG_FILTER_NEGATE')) { $imgFilters = array(1 => array(IMG_FILTER_NEGATE, 0), 2 => array(IMG_FILTER_GRAYSCALE, 0), 3 => array(IMG_FILTER_BRIGHTNESS, 1), 4 => array(IMG_FILTER_CONTRAST, 1), 5 => array(IMG_FILTER_COLORIZE, 4), 6 => array(IMG_FILTER_EDGEDETECT, 0), 7 => array(IMG_FILTER_EMBOSS, 0), 8 => array(IMG_FILTER_GAUSSIAN_BLUR, 0), 9 => array(IMG_FILTER_SELECTIVE_BLUR, 0), 10 => array(IMG_FILTER_MEAN_REMOVAL, 0), 11 => array(IMG_FILTER_SMOOTH, 0)); } $w = (int) abs(get_query('w', 0)); // width $h = (int) abs(get_query('h', 0)); // height $z = (int) get_query('z', 1); // zoom $q = (int) abs(get_query('q', 80)); // quality $a = get_query('a', 'c'); // align $f = get_query('f', ''); // filter $s = (bool) get_query('s', 0); // sharpen if ($w == 0 && $h == 0) { $w = 60; $h = 60; } $w = min($w, MAX_WIDTH); $h = min($h, MAX_HEIGHT); ini_set('memory_limit', '50M'); if ($src) { $image = get_image($mime, $src); if ($image === false) { _error('unable to open img'); } $ow = imagesx($image); $oh = imagesy($image);
<?php $con = connect_db(); $customer = $_POST['customer']; $result = get_query("SELECT count(c_id) AS cntid FROM customer_fix WHERE c_phone='{$customer['c_phone']}'", $con); $rs = assoc_get($result); if ($rs['cntid'] <= 0) { insert_table('customer_fix', $customer, $con); $result = getTable_where('customer_fix', 'c_phone', $customer['c_phone'], $con); $rsNewCustomer = assoc_get($result); $repair = $_POST['rp']; $repair['c_id'] = $rsNewCustomer['c_id']; $repair['rp_datekey'] = date("Y-m-d H:i:s"); insert_table('repair_tb', $repair, $con); } else { $result = getTable_where('customer_fix', 'c_phone', $customer['c_phone'], $con); $rsNewCustomer = assoc_get($result); $repair = $_POST['rp']; $repair['c_id'] = $rsNewCustomer['c_id']; $repair['rp_datekey'] = date("Y-m-d H:i:s"); //dieArray($repair); insert_table('repair_tb', $repair, $con); } close_db($con); ?> <script> alert('เพิ่มข้อมูลเรียบร้อยแล้ว'); window.location='index.php?module=system_repair&action=list_repair'; </script>
<?php $key = 'Your API Key'; $zip = $_POST['FromZip']; $cc = $_POST['FromCountry']; // Get the first TV service for this region: $url = 'http://api.rovicorp.com/TVlistings/v9/listings/services/postalcode/' . $zip . '/info?locale=en-US&countrycode=' . $cc . '&apikey=' . $key . '&sig=sig'; $services = get_query($url); $services = json_decode($services); $services = $services->ServicesResult->Services->Service; if (count($services)) { $sid = $services[0]->ServiceId; if (!empty($sid)) { $url = 'http://api.rovicorp.com/TVlistings/v9/listings/linearschedule/' . $sid . '/info?locale=en-US&duration=60&inprogress=true&apikey=' . $key . '&sig=sig'; $whatson = get_query($url); $whatson = json_decode($whatson); # echo '<pre>'.print_r($whatson,true).'</pre>'; $whatson = $whatson->LinearScheduleResult->Schedule->Airings; $shows = array(); $shows[] = "TV Shows starting in the next 60 minutes are:"; $i = 0; foreach ($whatson as $show) { $shows[] = $show->Channel . ' - ' . $show->Title; $i++; if ($i == 10) { break; } } print_sms_reply($shows); } } else {
function view_matches($round) { $query = get_query($round); $result = mysql_query($query); if (!$result) { echo "error: " . $query; die('Invalid'); } for ($i = 1; $i <= mysql_num_rows($result); $i++) { $match = mysql_fetch_assoc($result); $live_match = now_match() == $match ? "id=\"live_match\"" : ''; echo "<table class=\"bottom-spacer_20 table-center\"" . $live_match . ">\n\n <tr>\n<td class='mrm_band" . winner($match['band1_id'], $match["id"]) . "'>" . get_band_name($match['band1_id']) . "</td>\n<td></td>\n<td class='mrm_band" . winner($match['band2_id'], $match["id"]) . "'>" . get_band_name($match['band2_id']) . "</td>\n</tr>\n" . "<tr>\n<td class='" . winner($match['band1_id'], $match["id"]) . "'><img src=\"" . get_band_pic_url($match['band1_id']) . "\" width=\"200px\"></td>\n<td " . timer_or_vs($match) . " class='middle'> VS </td>\n<td class='" . winner($match['band2_id'], $match["id"]) . "'>" . "<img src=\"" . get_band_pic_url($match['band2_id']) . "\" width=\"200px\"></td>\n</tr>\n"; echo "<tr class=\"scoreboard\">"; admin_scoreboard($match); echo "</tr>"; voting_status_message_for($match); voting_buttons($match, $round); show_close_match($match, $round); echo "<tr>\n<td class=\"text-right\">Start Time:</td><td colspan=\"2\">" . date('F d @ g:i a', strtotime($match['start_time'])) . "</td></tr>"; echo "<tr>\n<td class=\"text-right\">End Time:</td><td colspan=\"2\">" . date('F d @ g:i a', strtotime($match['end_time'])) . "</td></tr>"; echo "</table>\n"; echo "<table class=\"bottom-spacer_20 table-center\"" . $live_match . ">\n\n <tr><td><strong>Match sponsored by: " . $match['sponsor'] . "</strong></td></tr>\n\n <tr><td>" . $match['sponsor_msg'] . "</td></tr>\n\n <tr><td><a href='/mrm_manage_sponsor.php?match=" . $match['id'] . "'>Edit</a></td></tr>"; echo "</table>\n"; } }
$_GET['u'] = urldecode(get_query('u', $url_query)); $_GET['o'] = get_query('o', $url_query); //print_r($_GET);echo strlen($base64_query);exit; if (!empty($_GET['u']) && !empty($_GET['o'])) { include_once '../weixin/weixin.auth.php'; require_once '../inc/common_hhr.php'; $back_url = $_GET['u']; $hrr_openid = $_GET['o']; $share_id = $_GET['s']; $openid = !empty($_SESSION['wx_user']['openid']) ? $_SESSION['wx_user']['openid'] : '123456789'; $partner_id = cloud_get_field('partner_id', 'partner_wx_infos', " openid ='{$hrr_openid}' AND is_delete = 1 "); $time = time(); $url_data = parse_url($back_url); $type = dirname($url_data['path']) == '/goods' ? 2 : 1; //2对应是goods,1对应是活动 $pid = $type == 2 ? get_query('gid', $url_data['query']) : get_query('aid', $url_data['query']); //判断是否浏览过 $is_looked = cloud_get_field('id', 'partner_share_click_record', 'openid = \'' . $openid . '\' AND pid = ' . $pid . ' AND type = ' . $type); if (empty($is_looked)) { //判断是否已经是其他人的粉丝 if (!cloud_get_field('id', 'customers_from', "openid = '{$openid}'")) { //添加用户粉丝判断 if (!cloud_insert('customers_from', 'openid,partner_id,type,time', "'{$openid}','{$partner_id}',2,'{$time}'")) { echo "error"; exti; } } //添加浏览记录 if (!cloud_insert('partner_share_click_record', 'share_id,pid,type,openid,partner_id,back_url,time', "'{$share_id}','{$pid}','{$type}','{$openid}','{$partner_id}','{$back_url}','{$time}'")) { echo "error 2"; exit;
<?php date_default_timezone_set("Asia/Bangkok"); $con = connect_db(); $result = get_query("SELECT * FROM repair_tb AS A INNER JOIN customer_fix AS B ON A.c_id=B.c_id WHERE A.rp_id='{$_GET['id']}'", $con); $r = assoc_get($result); require_once '../plugin/mpdf60/mpdf.php'; $mpdf = new mPDF('th', 'A4', '', '', 5, 5, 20, 20, 5, 5); $mpdf->mirrorMargins = 1; // Use different Odd/Even headers and footers and mirror margins $header = ' <table width="100%" style="border-bottom: 1px solid #000; vertical-align: bottom; font-size: 9pt; color: #000;"><tr> <td width="35%"><img src="../img/logo.png" width="150px"></td> <td width="65%" align="right"> <span>พีเอส ซัพพลาย</span> <span>อาคารคอมพิวเตอร์พลาซ่า ห้อง A12</span> <br> <span>312 ถ.มณีนพรัตน์ ต.ศรีภูมิ อ.เมือง จ.เชียงใหม่ 50200</span><br> <span>Tel. 094-6071991 Fax. 053-405399</span><br> </td> </tr></table> '; $footer = '<table width="100%" style="border-top: 1px solid #000000; vertical-align: bottom; font-size: 9pt; color: #000088;"><tr> <td width="33%"></td> <td width="33%" align="center">หน้า {PAGENO}</td> <td width="33%" style="text-align: right;"></td> </tr></table>'; $mpdf->SetHTMLHeader($header); $mpdf->SetHTMLHeader($header, E); $mpdf->SetHTMLFooter($footer); $mpdf->SetHTMLFooter($footer, E); $html = '<table style="width:100%; padding:10px 0 10px 0;">';
/** * 活动日志列表页 */ public function index() { $debug = intval(get_query('debug', 0)); $this->assign('debug', $debug == 1 ? true : false); $this->display(PUBLIC_TMPL_PATH . 'public/index.html'); // 视图判断 // if(isset($_GET['tp'])){ // $pathInfos = parse_url($_SERVER['REQUEST_URI']); // $itemStyle = get_query('tp') == 'grid' ? 'grid' : 'blog'; // setcookie('view',$itemStyle,time()+3153600000,'/'); // header('HTTP/1.1 301 Moved Permanently'); // header('Location:'.$pathInfos['path']); // exit; // } else{ // $itemStyle = get_cookie('view') == 'grid' ? 'grid' : 'blog'; // } // // global $ACTIVITY_CATEGORY; // $nowHour = strtotime(date('Y-m-d H:i:00')); // $nM = D('Notice'); // // 去掉走秀网活动 // $where = EXCLUDE_SID." AND status = 1 AND starttime < $nowHour AND endtime > $nowHour"; // $order = 'starttime DESC,ssort ASC,id ASC'; // // $sid = get_query('sid'); // $category = get_query('category'); // // if(!empty($sid)){ // $where .= " AND sid= $sid "; // $store = $this->sM->getStoreById($sid); // } // if(!empty($category)){ // if($category == 'new'){ // 今日新上的活动 // $where .= " AND starttime > ".$this->todayTs; // } else if($category == 'hot'){ // 最热的活动 // $where .= " AND soldouts > ".ACTIVITY_HOT_SOLDOUTS; // } else if($category == 'syt'){ // 即将结束的活动 // $where .= " AND endtime < ".strtotime('+3 day',$this->todayTs); // $order = 'endtime ASC,ssort ASC,id ASC'; // } else if($category == 'exp'){ // 过期的活动 // $where = " status = 1 AND endtime < $nowHour"; // } else { // $where .= " AND category LIKE '%$category%' "; // } // $cate4seo = $ACTIVITY_CATEGORY[$category]['seo'];// seo信息 // } // // $lazyCount = 1; $ppn = ACTIVITY_LIST_BLOG_PPN; // if($itemStyle == 'grid'){ // $lazyCount = 2; $ppn = ACTIVITY_LIST_GRID_PPN; // } // $todayBrands = $this->bM->getTodayBrands(); // if(empty($todayBrands)) $yesterdayBrands = $this->bM->getYesterdayBrands(); // // $this->showActivityList($ppn,$where,$order); //ACTIVITY_LIST_PPN // // // $this->assign('onlineStores',$this->sM->getOnlineStores()); // $this->assign('notices',$nM->getMergerFormatList()); // $this->assign('noticeCount',$nM->getOnlineNoticeTotal()); // $this->assign('todayBrands',array_slice($todayBrands,0,BRAND_TODAY_FIRST_COUNT)); // $this->assign('yesterdayBrands',$yesterdayBrands); // $this->assign('hotBrands',$this->bM->getHotBrands(30)); // $this->assign('brandCates',$this->bM->getOnlineBrandsCategory()); // $this->assign('soldoutProducts',$this->pM->getSoldoutList(54)); // // $this->assign('sid',$sid); // $this->assign('store',$store); // $this->assign('category',$category); // $this->assign('cate4seo',$cate4seo); // seo信息 // $this->assign('lazyCount',$lazyCount); // $this->assign('itemStyle',$itemStyle); // $this->assign('itemTplt','activity:list_item_'.$itemStyle); // // $this->display(PUBLIC_TMPL_PATH.'activity/list.html'); }
function checkacc($customers_email, $customers_password, $username, $password, $database, $configValues) { if (strlen($_SESSION['customer_ip']) < 7) { //$ip = $HTTP_SERVER_VARS["REMOTE_ADDR"]; $ip = $_SERVER['REMOTE_ADDR']; $_SESSION['customer_ip'] = $ip; } $ip = $_SESSION['customer_ip']; //echo "ip = $ip <br>"; // set all defaults for not logged in $_SESSION['loggedin'] = 0; $_SESSION['promotion'] = 0; $_SESSION['customers_email'] = $customers_email; $_SESSION['customers_password'] = $customers_password; $_SESSION['login_date_time'] = date("F j, Y, g:i a"); $_SESSION['login_timestamp'] = time(); $_SESSION['bytesleft'] = 0; // check freenet user name $mysql = new_mysql($username, $password, $database, "localhost"); $query = "SELECT * FROM customers WHERE customers_email_address='{$customers_email}'"; $result = get_query($query, $mysql); if ($result == 0) { //echo "<br> Failed Freenet user not fount <br>"; mysql_close(); $_SESSION['code'] = 0; return 0; } // check freenet password and collect needed user info $i = 0; $first = mysql_result($result, $i, "customers_firstname"); $_SESSION['firstname'] = $first; $email = mysql_result($result, $i, "customers_email_address"); $expire = mysql_result($result, $i, "customers_date_account_expires"); $_SESSION['expire'] = $expire; $strlen = strlen($expire); $cust_password = mysql_result($result, $i, "customers_password"); $pass = strcmp($cust_password, $customers_password); if ($pass != 0) { // echo "<br> Failed user name (email) not found in database <br>"; mysql_close(); $_SESSION['code'] = -1; return -1; } // check to see if customer has an IP address set in mysql records // if not make sure they don't already have an account as someone else // if no records with this ip then update there ip address in customer account $cust_ip_address = mysql_result($result, $i, "customers_ip_address"); $strlen = strlen($cust_ip_address); // echo "strlen = $strlen <br>"; if (strlen($cust_ip_address) == 0) { $cust_ip_address = $_SESSION['customer_ip']; if (strlen($cust_ip_address) < 7) { // invalid ip address given to check $_SESSION['code'] = -5; return 5; } // $cust_ip_address = $HTTP_SERVER_VARS["REMOTE_ADDR"]; // echo " ip = $cust_ip_address <br>"; $query = "SELECT * FROM customers WHERE customers_ip_address='{$cust_ip_address}'"; $result = get_query($query, $mysql); if ($result != 0) { // sorry they already have an account they will have to update the other one mysql_close(); $_SESSION['code'] = -3; return -3; } $query = "UPDATE customers SET customers_ip_address='{$cust_ip_address}' WHERE customers_email_address='{$customers_email}'"; get_query($query, $mysql); } $expire = update_account($customers_email, $mysql, $configValues); // check if account time window expired $timenow = time(); if ($timenow > $expire) { // time window has expired so // set code account expired and return -2 $_SESSION['code'] = -2; return -2; } // successfull login $expire = date("F j, Y, g:i a", $expire); $_SESSION['expire'] = $expire; //echo "<b>firstname: $first <br>E-mail: $email<br>Account will expires on: $expire <br><hr><br>"; //echo "<br> cust_password = $cust_password customers_password = $customers_password <br>"; //echo "<br> timenow = $timenow <br>"; $_SESSION['code'] = 1; $_SESSION['loggedin'] = 1; mysql_close(); return 1; }
<?php $con = connect_db(); if (isset($_POST['date'])) { $result = get_query("SELECT * FROM repair_tb AS A INNER JOIN customer_fix AS B ON A.c_id=B.c_id WHERE rp_datekey LIKE '%" . $_POST['date'] . "%'", $con); $val = $_POST['date']; } else { $date = date("Y-m-d"); $result = get_query("SELECT * FROM repair_tb AS A INNER JOIN customer_fix AS B ON A.c_id=B.c_id WHERE rp_datekey LIKE '%" . $date . "%'", $con); $val = $date; } ?> <div class="panel panel-default"> <div class="panel-heading">รายงานประวัน</div> <div class="panel-body"> <form action="?module=system_repair&action=report_day" method="post"> <input type="date" name="date" value="<?php echo $val; ?> "><button type="submit">ค้นหา</button> </form> <table class="table table-bordered"> <tr> <th>ลำดับ</th> <th>รหัสใบแจ้งซ่อม</th> <th>ชื่อ-นามสกุล</th> <th>วันที่ เวลา</th> <th>สถานะ</th> </tr> <?php $i = 1;
include $file_timer_begin; $link = mysqli_connect($host, $user, $pass, $db) or die('Erreur : ' . mysqli_error()); mysqli_query($link, "TRUNCATE `prop_sub`"); $tab_props = array(31, 135, 136, 144, 170, 179, 180, 186, 195, 276, 921, 941); //$tab_props=array(31,135,136,144,180,186,195,276,921,941); for ($i = 0; $i < count($tab_props); $i++) { $prop = $tab_props[$i]; echo "\ntable p" . $prop; $sql = "SELECT id, qwd, P18 from p{$prop}"; $rep = mysqli_query($link, $sql); while ($data = mysqli_fetch_assoc($rep)) { $id_prop = $data['id']; $qwd = $data['qwd']; $sub_query = ""; if ($prop != 170 && $prop != 179) { $res = get_query($prop, $qwd); if ($res != "") { $responseArray = json_decode($res, true); foreach ($responseArray["items"] as $key => $value) { $sql = "SELECT id from p{$prop} WHERE qwd=" . $value; $rep2 = mysqli_query($link, $sql); if (mysqli_num_rows($rep2) > 0) { $row = mysqli_fetch_assoc($rep2); $id_sub = $row['id']; $rep3 = mysqli_query($link, "INSERT INTO prop_sub (prop,id_prop,id_sub) VALUES (" . $prop . "," . $id_prop . "," . $id_sub . ") "); $sub_query .= " OR id_prop=" . $id_sub; } } } } //Pour chaque on fait recherche de 279 ou 461 selon la propriété
<div class="panel-body"> <table class="table table-bordered table-data"> <thead> <tr> <th class="text-center" style="width:5%">ลำดับ</th> <th class="text-center" style="width:10%">รหัสใบซ่อม</th> <th class="text-center">ชื่อ - นามสกุล</th> <th class="text-center" style="width:10%">เบอร์โทรศัพท์</th> <th class="text-center" style="width:15%">E-mail</th> <th class="text-center" style="width:15%">เวลาแจ้งซ่อม</th> <th class="text-center" style="width:10%">สถานะ</th> <th style="width:10%"></th> </tr> </thead> <?php $result = get_query("SELECT * FROM repair_tb AS A INNER JOIN customer_fix AS B ON A.c_id=B.c_id WHERE A.rp_status!='7'", $con); ?> <tbody> <?php $i = 1; while ($r = assoc_get($result)) { ?> <tr> <td class="text-center"><?php echo $i; ?> </td> <td class="text-center">RP-<?php echo $r['rp_id']; ?> </td>
header('Content-disposition: attachment; filename=' . $tid . '.png'); header('Content-type: image/png'); readfile($target . '.png'); } else { if (file_exists($target . '.json')) { header('HTTP/1.0 202 Accepted', true, 202); echo json_encode(array('code' => 202, 'message' => 'Image2pdf progressing...')); } else { header('HTTP/1.0 404 Not Found', true, 404); } } } break; case 'show': break; case 'progress': $tid = get_query('tid'); $target = dirname(__DIR__) . '/output/' . $tid; if (file_exists($target . '.pdf') or file_exists($target . '.png')) { echo json_encode(array('code' => 200, 'progress' => 100, 'message' => 'Completed')); } else { if (file_exists($target . '.json')) { echo json_encode(array('code' => 200, 'progress' => 50, 'message' => 'Progress...')); } else { header('HTTP/1.0 404 Not Found', true, 404); } } break; default: echo json_encode(array('code' => 404)); }