Exemplo n.º 1
0
?>
</title>
  </head>
<body>
<?php 
// Получаем перечень турниров
if ($debug) {
    $FileName = $Lines . "league.html";
    if (!file_exists($FileName)) {
        $Html = download("{$Host}/bets.php?line_id[]={$Sport}", "GET", "{$Host}/center.php");
        file_put_contents($FileName, $Html);
    } else {
        $Html = file_get_contents($FileName);
    }
} else {
    $Html = download_page("{$Host}/bets.php?line_id[]={$Sport}", "GET", "{$Host}/center.php");
}
function extract_league($Html)
{
    $Html = replace_all($Html, '<table', '</table>', '', 'долгосрочные ставки');
    return extract_form_hash($Html);
}
$Form = copy_be(win1251_to_utf8($Html), '<form id="fbets"', '</form>');
if ($debug) {
    file_put_contents($Lines . "form.txt", $Form);
}
$PostHash = extract_league($Form);
$FormAction = extract_form_action($Form);
if ($debug) {
    file_put_contents($Lines . "league.txt", implode_hash("\r\n", $PostHash));
}
Exemplo n.º 2
0
						</div>
			        </div>
			        <div class="col-md-9">
			          <div class="outside">
			            <p>
			              <span id="slider-prev">
			              </span>
			              |
			              <span id="slider-next">
			              </span>
			            </p>
			          </div>
			
			          <ul class="bxslider1 clients-list">
				          <?php 
$feeds = $depts_raw = new SimpleXMLElement(download_page('http://www.feefo.com/feefo/xmlfeed.jsp?logon=www.superescapes.co.uk'));
$feeds = json_decode(json_encode($feeds), true);
if (!empty($feeds['FEEDBACK'])) {
    foreach ($feeds['FEEDBACK'] as $feed) {
        //echo "<pre>";print_r($feed);exit;
        echo '<li><div class="every">';
        echo '<div  class="every_star"><img src="' . base_url() . 'images/f' . $feed['HREVIEWRATING'] . '.jpg" class=""></div>';
        $truncated = strlen($feed['SHORTCUSTOMERCOMMENT']) > 20 ? substr($feed['SHORTCUSTOMERCOMMENT'], 0, 20) . '...' : $feed['SHORTCUSTOMERCOMMENT'];
        echo '<h2>' . $truncated . '</h2>';
        $truncated = strlen($feed['CUSTOMERCOMMENT']) > 100 ? substr($feed['CUSTOMERCOMMENT'], 0, 100) . '...' : $feed['CUSTOMERCOMMENT'];
        echo '<p>' . $truncated . '</p>';
        echo '</div></li>';
    }
}
?>
			          
Exemplo n.º 3
0
    $Html = kill_tag_bound($Html, 'input|itemevent|a|b');
    $Html = str_ireplace(' noshade', '', $Html);
    $Html = kill_property($Html, 'time|color');
    $Html = replace_all($Html, '<sup>', '</sup>', ' ');
    $Html = kill_tag($Html, 'big');
    $Html = str_ireplace('<endpreview/>', '', $Html);
    $Html = str_ireplace('<hr><br>', '<hr>', $Html);
    $Html = str_ireplace('<br>Оглавление<', '<', $Html);
    $Html = str_ireplace('<br>Оглавление<', '<', $Html);
    $Html = replace_all($Html, '<u>', '</form>', '</form>');
    $Html = kill_tag_bound($Html, 'u|form');
    $Html = delete_all($Html, '<span ', '</span>', 'maxcap');
    return $Html;
}
// Получаем перечень ставок
if ($debug) {
    $FileName = $Lines . "bets.html";
    if (!file_exists($FileName)) {
        $Html = download_page("http://odds.marathonbet.com/odds-view.phtml?h=0&r0=0&r0=0", "GET", '', '');
        file_put_contents($FileName, $Html);
    } else {
        $Html = file_get_contents($FileName);
    }
} else {
    $Html = download_page("http://odds.marathonbet.com/odds-view.phtml?h=0&r0=0&r0=0", "GET", '', '');
}
$Result = extract_bet($Html);
if ($debug) {
    file_put_contents($Lines . 'bets.txt', $Result);
}
print $Result;
Exemplo n.º 4
0
    }
    $Html = $Result;
    $Html = str_ireplace('>-<', '><', $Html);
    $Html = kill_comment($Html);
    $Html = kill_tag($Html, 'script');
    $Html = kill_tag_bound($Html, 'a|b|img|strong');
    $Html = kill_property($Html, 'tagno|bgcolor|align|valign|width|cellspacing|border|cellpadding');
    $Html = replace_all_contain($Html, '<tr', '</tr>', '', ' тайм)|' . ' тайм:|' . ' четверть:|' . '-й сет:|' . 'Дополнительные тоталы:|' . 'colspan="17"|' . 'Первый матч|' . 'Второй матч|' . 'Хозяева|' . 'Счет серии');
    return $Html;
}
// Получаем перечень ставок
$PostData = explode("\r\n", $Leagues);
if ($debug) {
    $FileName = $Lines . "bets.html";
    if (!file_exists($FileName)) {
        $Html = download_page("http://favoritbet.com/index.php", "POST", "http://favoritbet.com/ru/bet/{$SportId}/", implode('&', $PostData));
        file_put_contents($FileName, $Html);
    } else {
        $Html = file_get_contents($FileName);
    }
} else {
    $Html = download_page("http://favoritbet.com/index.php", "POST", "http://favoritbet.com/ru/bet/{$SportId}/", implode('&', $PostData));
}
$Result = extract_bet(utf8_to_ansi_ru($Html));
if ($debug) {
    file_put_contents($Lines . "bets.txt", $Result);
}
print $Result;
?>

Exemplo n.º 5
0
 public function dynamicDeals()
 {
     //echo "<pre>";print_r('asdf');exit;
     $data = array();
     //$this->load->model('ManagerChoices');
     //$manager_deals = $this->ManagerChoices->fetch_a_search(array('deal_category'=>$_GET['type']),'ALL');
     $this->layouts->add_include(array('css/bootstrap-responsive.min.css', 'css/jquery-ui.css', 'css/font-awesome.min.css', 'css/google_font.css', 'css/custom.css', 'css/responsive.css', 'css/menu.css', 'css/preview.min.css', 'css/bxslider/jquery.bxslider.css', 'css/jquery.fancybox.css', 'css/mamaison.css', 'css/tenerife-holidays.css', 'css/slideshow.css', 'js/jquery-ui.js', 'js/jquery.blockUI.js', 'js/responsee.js', 'js/bxslider/jquery.bxslider.js', 'js/jquery.fancybox.pack.js', 'js/gallery.js', 'js/script-home.js'));
     for ($i = 0; $i < 12; $i++) {
         $data['calendar']['months'][date('m-Y', strtotime('+' . $i . ' month'))] = date('M Y', strtotime('+' . $i . ' month'));
     }
     $departures = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=1&compid=1'));
     foreach ($departures as $departure) {
         $code = (array) $departure->attributes()->code;
         $name = (array) $departure->attributes()->name;
         $data['calendar']['filtered_departures'] = seperatorFlights($code[0], $name[0]);
     }
     $input_cal_info = array('month_cal' => date('m') . '-' . date('Y'));
     $data['calendar']['datesInfo'] = $this->loadDates($input_cal_info);
     $data['calendar']['nights_limit'] = 21;
     $data['calendar']['book_types'] = array('fh' => 'Flights & Hotel', 'h' => 'Just Hotel', 'f' => 'Just Flight');
     $this->layouts->set_title('Home');
     $this->layouts->view('deals/dynamicDeals', $data);
 }
Exemplo n.º 6
0
} else {
    $Html = file_get_contents($FileName);
}
$FileName = $Lines . "sport.txt";
file_put_contents($FileName, extract_sport($Html));
// Получаем перечень турниров
$FileName = $Lines . "league.html";
if (!file_exists($FileName)) {
    $PostData = explode("\r\n", file_get_contents($Lines . "sport.txt"));
    $Html = download_page("http://www.betcity.ru/bets.php", "POST", "http://www.betcity.ru/main2.php", implode('&', $PostData));
    file_put_contents($FileName, $Html);
} else {
    $Html = file_get_contents($FileName);
}
$FileName = $Lines . "league.txt";
file_put_contents($FileName, extract_league($Html));
// Получаем перечень ставок
$FileName = $Lines . "bets.html";
if (!file_exists($FileName)) {
    $PostData = explode("\r\n", file_get_contents($Lines . 'league.txt'));
    $Html = download_page("http://www.betcity.ru/bets2.php", "POST", "http://www.betcity.ru/bets.php", implode('&', $PostData));
    file_put_contents($FileName, $Html);
} else {
    $Html = file_get_contents($FileName);
}
$FileName = $Lines . 'bets.txt';
file_put_contents($FileName, extract_bet($Html));
print file_get_contents($FileName);
?>

Exemplo n.º 7
0
function boookattach($results, $type = '')
{
    // Include the main TCPDF library (search for installation path).
    //require_once('tcpdf/examples/tcpdf_include.php');
    $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'utf-8', false);
    //$pdf->Footer('hello');
    // create new PDF document
    //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    //$pdf->SetAuthor('Nicola Asuni');
    //$pdf->SetTitle('TCPDF Example 001');
    //$pdf->SetSubject('<h1>TCPDF Tutorial</h1>');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '<div style="float:right">haoooooooo</div>', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
    $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
    // set header and footer fonts
    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    // set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(20);
    //echo PDF_MARGIN_FOOTER;exit;
    // set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    // set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    // set some language-dependent strings (optional)
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    // ---------------------------------------------------------
    // set default font subsetting mode
    $pdf->setFontSubsetting(true);
    // Set font
    // dejavusans is a UTF-8 Unicode font, if you only need to
    // print standard ASCII chars, you can use core fonts like
    // helvetica or times to reduce file size.
    //$pdf->SetFont('dejavusans', '', 10, '', true);
    $pdf->SetFont('Helvetica', '', 10, '', 'false');
    // Add a page
    // This method has several options, check the source code documentation for more information.
    $pdf->AddPage();
    // set text shadow effect
    $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 1, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 0, 'blend_mode' => 'Normal'));
    // Set some content to print
    $tbl = '<br /><br/><br/><br/>	
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
 
 <tr>
  <td style="width:60%"><b>Your Personal Travel Advisor:</b>' . @$results['pdfdata']['adviser_info']['name'] . '</td>
  <td style="width:40%"><b>Quote Reference:</b>' . @$results['pdfdata']['adviser_info']['reference'] . '</td>
 </tr>
 <tr>  
  <td style="width:60%"><b>Phone Number:</b>' . @$results['pdfdata']['adviser_info']['phone'] . '</td>
  <td style="width:40%"><b>Date:</b> ' . @$results['pdfdata']['adviser_info']['date'] . '</td> 
 </tr>
 <tr>
  <td style="width:60%"><b>Email Address:</b>' . @$results['pdfdata']['adviser_info']['email'] . '</td>
  <td style="width:40%"><b>Adults:</b> ' . @$results['seg'][0]['num_adults'] . ' <b>Children:</b> ' . @$results['seg'][0]['num_children'] . '</td>  
 </tr>
</table>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    //$ci = $results['controller'];
    $t = json_decode($results['row'][0]['adults_info'], true);
    $tbl = '
<div>
	<span>Dear ' . $t['fname'][0] . '</span>
	</br>
	<p>
		I have pleasure in enclosing a quote in respect of your recent enquiry with Super Escapes. Please feel free to contact us, should you need any more information or advice.
	</p>
</div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    if (isset($results['fobj'])) {
        $depts = fetch_departures();
        $arrivs = fetch_arrivals();
        $dep_arr = explode('-', $depts[$results['fobj']['@attributes']['depapt']]);
        $arr_arr = explode('-', $arrivs[$results['fobj']['@attributes']['arrapt']]);
        $ret_arr = explode('-', $depts[$results['fobj']['@attributes']['retapt']]);
        $dept_start_time = substr(explode(' ', $results['fobj']['@attributes']['outdep'])[1], 0, -3);
        $dept_arr_time = substr(explode(' ', $results['fobj']['@attributes']['outarr'])[1], 0, -3);
        $return_start_time = substr(explode(' ', $results['fobj']['@attributes']['indep'])[1], 0, -3);
        $return_arr_time = substr(explode(' ', $results['fobj']['@attributes']['inarr'])[1], 0, -3);
        $tbl = '
<b><u>Flight Details : </u></b><br><br>  
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
	<tr>
		<th style="width:35%;text-align:center;font-weight:bold;">Route</th>
		<td style="width:13%;text-align:center;font-weight:bold;">Dep Date</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Dep Time</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Arr Date</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Arr Time</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Flight No</td>
	</tr>
    <tr>
        <td >' . current($dep_arr) . ' Airport ' . array_pop($arr_arr) . ' Airport</td>
        <td>' . explode(' ', $results['fobj']['@attributes']['outdep'])[0] . '</td>
		<td>' . $dept_start_time . '</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['outarr'])[0] . '</td>
		<td>' . $dept_arr_time . '</td>
		<td>' . $results['fobj']['@attributes']['outfltnum'] . '</td>
    </tr>
    <tr>
         <td >' . array_pop($arr_arr) . ' Airport ' . current($ret_arr) . ' Airport</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['indep'])[0] . '</td>    	
		<td>' . $return_start_time . '</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['inarr'])[0] . '</td>
		<td>' . $return_arr_time . '</td>
		<td>' . $results['fobj']['@attributes']['infltnum'] . '</td>
    </tr>  
</table>';
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    $ci = $results['controller'];
    if (!empty($results['hobjs'])) {
        $tbl = '
<b><u>Accommodation Details: </u></b><br><br>  
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
	<tr>
		<th style="text-align:center;font-weight:bold;">Hotel</th>
		<td style="text-align:center;font-weight:bold;">Resort</td>
		<td style="text-align:center;font-weight:bold;">Board</td>
		<td style="text-align:center;font-weight:bold;">Room</td>
		<td style="text-align:center;font-weight:bold;">Rating</td>		
	</tr>
    <tr>
        <td style="text-align:center;">' . urldecode($results['hobjs'][0]['@attributes']['hotelname']) . '</td>
        <td style="text-align:center;">' . urldecode($results['hobjs'][0]['@attributes']['resort']) . '</td>
		<td style="text-align:center;">' . boardbasis($results['hobjs'][0]['@attributes']['boardbasis']) . '</td>
		<td style="text-align:center;">' . $results['seg'][0]['num_rooms'] . ' ' . $results['hobjs'][0]['@attributes']['suppname'] . '</td>
		<td style="text-align:center;">' . (int) $results['hobjs'][0]['@attributes']['starrating'] . ' KEY</td>		
    </tr>
    <tr>
		<td style="text-align:center;font-weight:bold;">Check In</td>
    	<td style="text-align:center;font-weight:bold;">Check Out</td>
		<td style="text-align:center;font-weight:bold;">Adults</td>
		<td style="text-align:center;font-weight:bold;">Children</td>
		<td style="text-align:center;font-weight:bold;">Infants</td>
    </tr>
	<tr>
		<td style="text-align:center;">' . $results['hobjs'][0]['@attributes']['checkindate'] . '</td>
    	<td style="text-align:center;">' . date('d/m/Y', strtotime('+' . $results['hobjs'][0]['@attributes']['nights'] . " day", $ci->cvtDt(str_date($results['hobjs'][0]['@attributes']['checkindate'])))) . '</td>
		<td style="text-align:center;">' . @$results['seg'][0]['num_adults'] . '</td>
		<td style="text-align:center;">' . @$results['seg'][0]['num_children'] . '</td>
		<td style="text-align:center;"></td>
    </tr>	
</table>';
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    $tbl = <<<EOD
<div style="margin-top:20px;">
\t<b><u>Price Summary:</u></p>\t
\t<p>
\t\tThe total price inclusive of any discounts for the holiday described above is: £653.92 To make a firm reservation please call us on 01386298033 and quote the reference number at the top of this quote. Our friendly and experienced travel consultants will be happy to book the above holiday or look for any alternatives that may suit your needs. 
\t</p>
\t<p>\t\t
\t\tMay we take this opportunity of thanking you for your enquiry, and we do hope that we are able to assist you in fulfilling your requirements.
\t</p>
</div>
EOD;
    $pdf->writeHTML($tbl, true, false, false, false, '');
    $tbl = <<<EOD
<div style="margin-top:20px;text-align:center;">\t
\t<small>
\t\t* All costings are subject to a final confirmation which will be given upon making a firm reservation *
\t</small>
</div><br/><br/>
EOD;
    $pdf->writeHTML($tbl, true, false, false, false, '');
    /*$tbl = '
    <div style="margin-top:20px;width:100%;display:inline-flex;">	
    	<div style="color:blue;text-align:center;width:60%">BookItNow Travel is a trading name of broadway Travel Services (Wimbledon) Ltd. Whose registered office is at Unit 1,Finway,Dallow Road,Luton,Beds LUI 1WE</div>
    	<div> <img src="'.base_url().'/images/abta.png"/></div>
    </div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');*/
    //echo $tbl;exit;
    $tbl = '
<div style="margin-top:20px;">
	<span>Yours sincerely</span>
	<p>' . @$results['pdfdata']['adviser_info']['name'] . '</p>
</div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    if (!empty($results['hobjs'])) {
        // $hotel_meta = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=7&compid=1&brochurecode=BEWE-AMTSES1CO0'));
        $hotel_meta = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=7&compid=1&brochurecode=' . $results['hobjs'][0]['@attributes']['brocode']));
        $i = 1;
        $desc = urldecode($hotel_meta->HotelDescription);
        $ty = new tidy();
        $desc = $ty->repairString($desc);
        $tbl = '<br /><br/><br/><br/><h2 style="text-align:center; "pagebreak="true">Accommodation Info</h2><table>';
        foreach ($hotel_meta->Images->Url as $img) {
            $tbl .= '<tr>';
            //Allow_url_fopen must be On
            if (is_array(@getimagesize(urldecode($img)))) {
                $tbl .= '<td colspan="1"  style="margin-right: 30px !important;"><img src="' . urldecode($img) . '" /></td>';
            } else {
                $tbl .= '<td colspan="3"><img src="' . base_url() . '/images/destination_placeholder.jpg"/></td>';
            }
            $tbl .= '<td colspan="1"></td>';
            if ($i == 1) {
                $tbl .= '<td rowspan="' . count($hotel_meta->Images->Url) . '" colspan="8">' . $desc . '</td>';
            }
            $tbl .= '</tr>';
            //$tbl .= '<style>.desc{background:red;}</style>';
            $i++;
        }
        $tbl .= '</table>';
        //echo $tbl;exit;
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    // ---------------------------------------------------------
    // Close and output PDF document
    // This method has several options, check the source code documentation for more information.
    //$pdf->Output('D:\xampp\htdocs\test_plugins\tcpdf\examples\example_001.pdf', 'F');
    if ($type == 'email') {
        $pdf->Output(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf', 'F');
        if (file_exists(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf')) {
            $subject = 'Quick Quote Ref: ' . $results['pdfdata']['adviser_info']['reference'] . ' - Book it now';
            $body = 'Dear ' . $t['fname'][0];
            $body .= '<p></p>';
            $body .= '<p>Please find the attached document</p>';
            $body .= '<p></p>';
            $body .= '<p>Cheers</p>';
            $body .= '<p>BootItNow</p>';
            $from = '*****@*****.**';
            $sendername = "BookItNow Admin";
            $list = array($results['row'][0]['email']);
            $config['protocol'] = "smtp";
            $config['smtp_host'] = 'mail.expertwebworx.in';
            $config['smtp_port'] = '25';
            $config['smtp_user'] = '******';
            $config['smtp_pass'] = '******';
            $config['smtp_crypto'] = 'tls';
            $config['charset'] = "iso-8859-1";
            $config['mailtype'] = "html";
            $ci->load->library('email', $config);
            $ci->email->set_newline("\r\n");
            $ci->email->from($from, $sendername);
            $ci->email->to($list);
            $ci->email->reply_to($from, $sendername);
            $ci->email->subject($subject);
            $ci->email->attach(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf');
            $ci->email->message($body);
            if ($ci->email->send()) {
            }
        }
    } else {
        $pdf->Output($results['pdfdata']['adviser_info']['reference'] . '.pdf', 'D');
        exit;
    }
    //============================================================+
    // END OF FILE
    //============================================================+
}
Exemplo n.º 8
0
    return $Html;
}
// Получаем перечень ставок
if ($Leagues != '') {
    $PostData = explode("\r\n", $Leagues);
    $PostData[] = 'filter=all';
    $PostData[] = 'rospis=on';
    if ($debug) {
        $FileName = $Lines . "bets.html";
        if (!file_exists($FileName)) {
            $Html = download_page("http://plusminus1.com/bet.php?events={$Sport}", "POST", "http://plusminus1.com/bet.php?view=on", implode('&', $PostData));
            file_put_contents($FileName, $Html);
        } else {
            $Html = file_get_contents($FileName);
        }
    } else {
        $Html = download_page("http://plusminus1.com/bet.php?events={$Sport}", "POST", "http://plusminus1.com/bet.php?view=on", implode('&', $PostData));
    }
    $Result = extract_bet(convert_to_utf8($Html));
    if ($debug) {
        file_put_contents($Lines . 'bets.txt', $Result);
    }
    if ($debug) {
        file_put_contents($Lines . 'bets.txt.html', $Result);
    }
}
print $Result;
?>
</body>
</html>
Exemplo n.º 9
0
    $Html = kill_tag_bound($Html, 'input|b|a|img|strong');
    $Html = str_ireplace('<br>', '|', $Html);
    $Html = str_ireplace('>-<', '><', $Html);
    $Html = str_ireplace(' bgcolor="#66FFFF"', ' league="#66FFFF"', $Html);
    $Html = kill_property($Html, 'bgcolor|align|valign|width|border|class');
    $Html = replace_all_contain($Html, '<tr', '</tr>', '', 'угл |' . 'ж.к ');
    return $Html;
}
// Получаем перечень ставок
if ($Leagues != '') {
    $PostData = explode("\r\n", $Leagues);
    $PostData[] = 'xtime=0';
    $PostData[] = 'task=matches';
    $PostData[] = 'sendm=sendm';
    if ($debug) {
        $FileName = $Lines . "bets.html";
        if (!file_exists($FileName)) {
            $Html = download_page("http://www.buker.ru/dostaken.php", "POST", "http://www.buker.ru/dostaken.php", implode('&', $PostData));
            file_put_contents($FileName, $Html);
        } else {
            $Html = file_get_contents($FileName);
        }
    } else {
        $Html = download_page("http://www.buker.ru/dostaken.php", "POST", "http://www.buker.ru/dostaken.php", implode('&', $PostData));
    }
    $Result = extract_bet($Html);
    if ($debug) {
        file_put_contents($Lines . 'bets.txt', $Result);
    }
}
print $Result;
Exemplo n.º 10
0
    //  <!-- Убираем левые коэффициенты в скобках -->
    $Html = replace_all($Html, '>(', ')', '>');
    //  <!-- Убираем оглавление -->
    $Html = delete_all($Html, "<div ", "</div", "Оглавление");
    $Html = kill_property($Html, 'width|border');
    $Html = replace_all_contain($Html, '<tr', '</tr>', '', '>Хозяева|' . '>Гости|' . '>Фолы|' . '>ж/к|' . '>угл.');
    return $Html;
}
// Получаем перечень ставок
if ($Leagues != '') {
    $PostData[] = 'hd=' . $Leagues;
    $PostData[] = 'filter=';
    $PostData[] = 'linedate=';
    $PostData[] = 'ltype=';
    if ($debug) {
        $FileName = $Lines . "bets.html";
        if (!file_exists($FileName)) {
            $Html = download_page("http://www.parimatch.com/bet.html", "GET", "http://www.parimatch.com/line.html?id=0", implode('&', $PostData), true);
            file_put_contents($FileName, $Html);
        } else {
            $Html = file_get_contents($FileName);
        }
    } else {
        $Html = download_page("http://www.parimatch.com/bet.html", "GET", "http://www.parimatch.com/line.html?id=0", implode('&', $PostData));
    }
    $Result = extract_bet($Html);
    if ($debug) {
        file_put_contents($Lines . 'bets.txt', $Result);
    }
}
print $Result;
Exemplo n.º 11
0
 public function readMappingsFun()
 {
     $this->load->model('Arrivals');
     $arr_rows = $this->Arrivals->fetch_all();
     $arr_rows = array_column($arr_rows, 'map_root');
     $str = '';
     if ($this->input->post('pos') == 'country') {
         $depts_raw = new SimpleXMLElement(download_page("http://87.102.127.86:8005/search/websearch.exe?pageid=5&compid=1&countryid=" . $this->input->post('com_id')));
         $depts_raw = json_decode(json_encode($depts_raw), true);
         $t = array();
         foreach ($depts_raw['country'] as $key_country => $regions) {
             if ($key_country == 'region') {
                 $count = 0;
                 foreach ($regions as $key_region => $region) {
                     if ($key_region === '@attributes') {
                         $str .= "<li><span class='regions'>" . urldecode($regions['@attributes']['name']) . '</span>';
                         $count_area = 0;
                         foreach ($regions['area'] as $key_area => $area) {
                             if ($key_area === '@attributes') {
                                 $arrpts = 'arrivals=' . $regions['area']['@attributes']['arrapts'];
                                 //new
                                 $cra = $this->input->post('com_id') . '-' . $regions['@attributes']['Id'] . '-' . $regions['area']['@attributes']['id'];
                                 //new
                                 $attribute = in_array($cra, $arr_rows) ? 'checked' : '';
                                 //new
                                 $str .= "<ul><li><input {$arrpts} type='checkbox' {$attribute} value='" . $cra . "' onchange='checkMe(this)' /><span>" . urldecode($regions['area']['@attributes']['name']) . '</span><ul>';
                                 $str .= '</ul></li></ul>';
                                 $count_area++;
                             }
                             if (!$count_area) {
                                 $arrpts = 'arrivals=' . $area['@attributes']['arrapts'];
                                 //new
                                 $cra = $this->input->post('com_id') . '-' . $regions['@attributes']['Id'] . '-' . $area['@attributes']['id'];
                                 //new
                                 $attribute = in_array($cra, $arr_rows) ? 'checked' : '';
                                 //new
                                 $str .= "<ul><li><input {$arrpts} type='checkbox' {$attribute} value='" . $cra . "' onchange='checkMe(this)' /><span>" . urldecode($area['@attributes']['name']) . ' </span><ul>';
                                 $str .= '</ul></li></ul>';
                             }
                         }
                         $str .= '</li>';
                         $count++;
                     }
                     if (!$count) {
                         $str .= "<li><span class='regions'>" . urldecode($region['@attributes']['name']) . '</span>';
                         $count_area = 0;
                         foreach ($region['area'] as $key_area => $area) {
                             if ($key_area === '@attributes') {
                                 $arrpts = 'arrivals=' . $region['area']['@attributes']['arrapts'];
                                 //new
                                 $cra = $this->input->post('com_id') . '-' . $region['@attributes']['Id'] . '-' . $region['area']['@attributes']['id'];
                                 //new
                                 $attribute = in_array($cra, $arr_rows) ? 'checked' : '';
                                 $str .= "<ul><li><input {$arrpts} type='checkbox' {$attribute} value='" . $cra . "' onchange='checkMe(this)' /><span>" . urldecode($region['area']['@attributes']['name']) . "</span><ul>";
                                 $str .= '</ul></li></ul>';
                                 $count_area++;
                             }
                             if (!$count_area) {
                                 $arrpts = 'arrivals=' . $area['@attributes']['arrapts'];
                                 //new
                                 $cra = $cra = $this->input->post('com_id') . '-' . $region['@attributes']['Id'] . '-' . $area['@attributes']['id'];
                                 //new
                                 $attribute = in_array($cra, $arr_rows) ? 'checked' : '';
                                 //new
                                 $str .= "<ul><li><input {$arrpts} type='checkbox' {$attribute} value='" . $cra . "' onchange='checkMe(this)' /><span>" . urldecode($area['@attributes']['name']) . " </span><ul>";
                                 $str .= '</ul></li></ul>';
                             }
                         }
                         $str .= '</li>';
                     }
                 }
             }
         }
     }
     echo $str;
     exit;
 }
Exemplo n.º 12
0
// $data = "{ 'key': 'value' }";
// header('Content-Type: application/json');
// echo json_encode($data);
function download_page($path)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $path);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 500);
    $retValue = curl_exec($ch);
    curl_close($ch);
    return $retValue;
}
$bartData = download_page('http://api.bart.gov/api/etd.aspx?cmd=etd&orig=deln&key=MW9S-E7SL-26DU-VV8V&dir=s');
$bartData = simplexml_load_string($bartData);
$bartData = json_encode((array) $bartData);
$bartData = json_decode($bartData, true);
$simpleBartData = array();
$stationLines = $bartData["station"]["etd"];
// Check for only one line:
if (!isset($stationLines[0])) {
    $stationLines = array($stationLines);
}
foreach ($stationLines as $currentLine) {
    $lineEstimates = $currentLine["estimate"];
    // Check for only one estimate:
    if (!isset($lineEstimates[0])) {
        $lineEstimates = array($lineEstimates);
    }
Exemplo n.º 13
0
    curl_setopt($curl, CURLOPT_URL, $path);
    //Setto FALSE per non includere header nell'output
    curl_setopt($curl, CURLOPT_HEADER, 0);
    //Concedo un massimo di 5 secondi di esecuzione delle funzioni cURL
    curl_setopt($curl, CURLOPT_TIMEOUT, 5);
    //Setto TRUE per ritornare il valore dato da curl_exec()
    //come una stringa, invece di fare un output diretto
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    //Esegue la sessione cURL
    $retValue = curl_exec($curl);
    //Chiudo la sessione cURL
    curl_close($curl);
    return $retValue;
}
//Converto l'URL in stringa
$sXML = download_page($url);
//Converto l'URL da stringa a oggetto, per interagirci con xpath
$oXML = new SimpleXmlElement($sXML);
//Creo un nuovo documento DOM
$doc = new DOMDocument("1.0", "UTF-8");
//Inizializzo la radice Aggregatori
$root = $doc->appendChild($doc->createElement("Aggregatori"));
//Eseguo ciclo sull'URL oggetto
foreach ($oXML->xpath("//catalogo/@url") as $valore) {
    //Se riesce a caricare la porzione di URL interessata
    if ($xml2 = simplexml_load_file($valore)) {
        //Per tutti gli aggregatori prelevo id e url
        $id = $xml2->xpath("//aggregatore/@id");
        $url = $xml2->xpath("//aggregatore/@url");
        //Popolo il documento XML appendendo ogni aggregatore trovato
        //e settando per ciascuno gli attributi id e url