Commit 5109d863 authored by Dieudonne Timma Meyatchie's avatar Dieudonne Timma Meyatchie
Browse files

letzte version

parent 0941f9bb
......@@ -10,8 +10,8 @@ class THMReversCookings
static $attribs;
public function __construct(){
$this->attribs['width'] = '335px';
$this->attribs['height'] = '250px';
$this->attribs['width'] = '70px';
$this->attribs['height'] = '70px';
}
//check , if the User has a profil
public static function hasprofil($userid){
......@@ -39,17 +39,18 @@ class THMReversCookings
return $result;
}
public static function myprofil($userid, $element){
public static function myprofil($userid, $element , $ismyprofil){
$db = JFactory::getDbo();
$query = 'SELECT * FROM #__thm_reverscookingsprofils WHERE '.$element.' ='.$userid;
$db->setQuery($query);
$userdata = $db->loadObjectList();
$image = self::hasbild('#__thm_reverscookingsprofils_bild', 'profilid', $userdata[0]->id);
$result='<div>';
$result .= '<div><h3>'.$userdata[0]->uname.'</h3></div>';
$result .= '<div><h4>'.$userdata[0]->uname.'</h4></div>';
$result .= '<div><a href='.JRoute::_('index.php/component/uddeim/?task=new&Itemid=0').'>Cook with Me!</a></div>';
$result .= '<div>'.JHTML :: image('components/com_thm_reverscookings/img/profil_bild/'.$image[0]->filename, $userdata[0]->uname."_Bild", self::$attribs).'</div>';
$result .='<div><h3> Addres: '.$userdata[0]->address.'<br> '.$userdata[0]->plz.' '.$userdata[0]->ort.'</h3></div>';
$result .= '<div>'.JHTML :: image('components/com_thm_reverscookings/img/profil_bild/'.$image[0]->filename, $userdata[0]->uname."_Bild", self::$attribs).'<a href="'.JRoute::_('index.php?option=com_thm_reverscookings&view=reverscookingsprofil&layout=edit&id='.$userid).'"></a></div>';
if($ismyprofil == false)
$result .='<div><h4> Adresse: '.$userdata[0]->address.'<br> '.$userdata[0]->plz.' '.$userdata[0]->ort.'</h4></div>';
$result .='</div>';
return $result;
......
......@@ -22,7 +22,7 @@ if(isset($requestid) == true){
if($profilid != null){
$index = intval($profilid->userid);
$ingarr = $profilid->ing;
echo THMReversCookings::myprofil($index,'id');
echo THMReversCookings::myprofil($index,'id',false);
echo "<div><h4> Ich habe:</h4>";
for($i=0; $i < count($ingarr); $i++)
echo '<h4>'.$ingarr[$i]."</h4>";
......@@ -30,31 +30,36 @@ if(isset($requestid) == true){
}
}else{
$id = intval($requestid);
echo THMReversCookings::myprofil($id,'id');
echo THMReversCookings::myprofil($id,'id',false);
}
}else {
echo THMReversCookings::myprofil($userid, 'created_by');
echo THMReversCookings::myprofil($userid, 'created_by',true);
}
}
if($viewtype == 1){
if(isset($requestid)){
if(isset($requestid) && !strcmp($requestview,'reverscookingsprofil') == 0){
$profilid = null;
$profilid = THMReversCookings::suchzutaten($requestid, $userid);
if($profilid != null){
$id = intval($profilid->userid);
$ingarr = $profilid->ing;
echo THMReversCookings::myprofil($id,'id');
echo THMReversCookings::myprofil($id,'id',false);
echo "<div><h4> Ich habe:</h4>";
for($i=0; $i < count($ingarr); $i++)
echo '<h4>'.$ingarr[$i]."</h4>";
echo"</div>";
}
else{echo THMReversCookings::myprofil($userid, 'created_by');}
else{echo THMReversCookings::myprofil($userid, 'created_by',false);}
}
else{
if(!empty($requestid))
echo THMReversCookings::myprofil($requestid, 'id',false);
else
echo THMReversCookings::myprofil($userid, 'created_by',true);
}
else{echo THMReversCookings::myprofil($userid, 'created_by');}
}
}
?>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment