示例#1
0
文件: api.php 项目: migumuno/obesity
         if ($result->resultado) {
             echo 'ok';
         }
     }
     break;
 case "upload_file":
     if (isset($_POST['paciente'])) {
         $patient = new Patient($db);
         $result = $patient->getPatient('info', $_POST['paciente']);
         if ($result->resultado) {
             $destino = text2url($result->datos[0]['id_patient'] . '_' . $result->datos[0]['nombre'] . ' ' . $result->datos[0]['apellidos']);
         }
     } else {
         $destino = text2url($_SESSION['user']['id'] . '_' . $_SESSION['user']['name']);
     }
     $name = text2url($_POST['nombre']);
     $ruta = subirArchivo($_FILES['fichero'], $destino, $name);
     $documentation = new Documentation($db);
     $data = array();
     if (isset($_POST['paciente'])) {
         $data['id_patient'] = $_POST['paciente'];
     } else {
         $data['id_patient'] = $_SESSION['user']['id'];
     }
     $data['emisor'] = $_SESSION['user']['type'];
     $data['url'] = $ruta;
     $data['nombre'] = $_POST['nombre'];
     $result = $documentation->insertDocumentation($data);
     if ($result->resultado) {
         echo 'ok';
     }
示例#2
0
function rssGen()
{
    // Include config file with URL value and RSS info
    include $_SESSION['thisPath'] . '../../../config/helladan.php';
    $content = '<rss version="2.0">
	<channel>
		<title>' . $rssTitle . '</title> 
		<link>' . $siteURL . '</link>
		<description>' . $rssDescription . '</description>' . "\n";
    $link = connectDB();
    // Request to list article
    $req = 'SELECT hp.post_id, hp.post_title, hp.post_date, hp.post_tag, 
					   hu.user_email
				FROM hella_posts hp
				NATURAL JOIN hella_users hu
				ORDER BY post_id DESC';
    $que = mysqli_query($link, $req);
    foreach ($que as $item) {
        $id = $item['post_id'];
        $title = html_entity_decode($item['post_title'], ENT_QUOTES);
        $url = text2url($title);
        $postDate = date("D, d M Y H:i:s", strtotime($item['post_date']));
        $authorMail = $item['user_email'];
        $postTag = html_entity_decode($item['post_tag']);
        $loc = 'http://' . $siteURL . '/article-' . $id . '-' . $url;
        $content .= '		
		<item>
			<title>' . $title . '</title> 
			<link>' . $loc . '</link> 
			<description>' . $title . '</description> 
			<pubDate>' . $postDate . ' GMT</pubDate>
			<author>' . $authorMail . '</author>
			<guid>' . $postTag . '</guid>
		</item>' . "\n";
    }
    $content .= '
	</channel>
</rss>';
    $flux = fopen('flux.xml', 'c+');
    ftruncate($flux, 0);
    fputs($flux, $content);
}
示例#3
0
                OFFSET ' . $offset;
$que = mysqli_query($link, $req) or die($req);
/*//////////////////////////////////////////////////////////////////////////////////////////*/
/*//////////////////////////////////////////////////////////////////////////////////////////*/
/*////////////////////////////////// Loop to display post //////////////////////////////////*/
/*//////////////////////////////////////////////////////////////////////////////////////////*/
// If no data in querry, there is posts
if (mysqli_num_rows($que) != 0) {
    foreach ($que as $item) {
        $post_id = $item['post_id'];
        $title = html_entity_decode($item['post_title'], ENT_QUOTES);
        $content = html_entity_decode($item["post_content"]);
        $author = $item['user_pseudo'];
        $tag = $item['post_tag'];
        $lastArticlePageId = $post_id;
        $url = text2url($title);
        ?>

					<!-- Post display -->
					<div class="panel post">
						<a href="article-<?php 
        echo $post_id;
        ?>
-<?php 
        echo $url;
        ?>
">
							<h1 class="postTitle">
								<?php 
        echo $title;
        ?>