Exemplo n.º 1
0
 public function run()
 {
     $this->userinfo = User::model()->findByPk($this->userid);
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $this->userid . "' AND Iscompleted = 0";
     if ($this->userid != Yii::app()->session['login']['id']) {
         $Criteria->condition = "AND finao_status_Ispublic = 0";
     }
     $finaos = UserFinao::model()->findAll($Criteria);
     if (!empty($finaos)) {
         foreach ($finaos as $finaoids) {
             $ids[] = $finaoids->user_finao_id;
         }
         $Criteria = new CDbCriteria();
         $Criteria->group = 'tile_id';
         $Criteria->condition = "userid = '" . $this->userid . "'";
         if (!empty($ids)) {
             $Criteria->addInCondition('finao_id', $ids);
         }
         $Criteria->order = 'createddate DESC';
         $this->alltiles = UserFinaoTile::model()->findAll($Criteria);
     } else {
         $this->alltiles = "";
     }
     $uploadtypeimage = Lookups::model()->findByAttributes(array('lookup_name' => 'Image', 'lookup_type' => 'uploadtype', 'lookup_status' => 1));
     //$uploadsourcetypeimage = Lookups::model()->findByAttributes(array('lookup_type'=>'uploadsourcetype','lookup_name'=>'finao','lookup_status'=>1));
     $uploadtypevideo = Lookups::model()->findByAttributes(array('lookup_name' => 'Video', 'lookup_type' => 'uploadtype', 'lookup_status' => 1));
     //$uploadsourcetypevideo = Lookups::model()->findByAttributes(array('lookup_type'=>'uploadsourcetype','lookup_name'=>'finao','lookup_status'=>1));
     $images = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $uploadtypeimage->lookup_id, 'uploadedby' => $this->userid, 'status' => 1));
     $videos = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $uploadtypevideo->lookup_id, 'uploadedby' => $this->userid, 'status' => 1));
     $this->imgcount = count($images);
     $this->videocount = count($videos);
     $this->render('_topheader', array('tilescount' => count($this->alltiles), 'userinfo' => $this->userinfo, 'finaocount' => count($finaos), 'imgcount' => $this->imgcount, 'videocount' => $this->videocount));
 }
Exemplo n.º 2
0
 public function run()
 {
     /*$userid = Yii::app()->session['login']['id'];
     
     		//$userid = Yii::app()->session['login']['id'];
     
     		$criteria=new CDbCriteria;
     
             $criteria->distinct = true;
     
     		$criteria->condition = "userid = '".$userid."'";
     
     		$alltiles = UserFinaoTile::model()->findAll($criteria);*/
     if (isset($this->homepage)) {
         $userid = Yii::app()->session['login']['id'];
         $this->userinfo = User::model()->findByPk($userid);
         $widstyle = 'notile';
         $Criteria = new CDbCriteria();
         $Criteria->condition = "userid = '" . $userid . "' AND Iscompleted = 0";
         $finaos = UserFinao::model()->findAll($Criteria);
         if (!empty($finaos)) {
             $Criteria = new CDbCriteria();
             $Criteria->group = 'tile_id';
             $Criteria->condition = "userid = '" . $userid . "'";
             /*if(isset($_REQUEST['frndid']))
             
             				{*/
             if (!empty($finaos)) {
                 foreach ($finaos as $finaoids) {
                     $ids[] = $finaoids->user_finao_id;
                 }
             }
             if (!empty($ids)) {
                 $Criteria->addInCondition('finao_id', $ids);
             }
             /*}*/
             $Criteria->order = 'createddate DESC';
             $this->alltiles = UserFinaoTile::model()->findAll($Criteria);
         } else {
             $this->alltiles = "";
         }
         $uploadtypeimage = Lookups::model()->findByAttributes(array('lookup_name' => 'Image', 'lookup_type' => 'uploadtype', 'lookup_status' => 1));
         //$uploadsourcetypeimage = Lookups::model()->findByAttributes(array('lookup_type'=>'uploadsourcetype','lookup_name'=>'finao','lookup_status'=>1));
         $uploadtypevideo = Lookups::model()->findByAttributes(array('lookup_name' => 'Video', 'lookup_type' => 'uploadtype', 'lookup_status' => 1));
         //$uploadsourcetypevideo = Lookups::model()->findByAttributes(array('lookup_type'=>'uploadsourcetype','lookup_name'=>'finao','lookup_status'=>1));
         $images = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $uploadtypeimage->lookup_id, 'uploadedby' => $userid, 'status' => 1));
         $videos = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $uploadtypevideo->lookup_id, 'uploadedby' => $userid, 'status' => 1));
         $this->imgcount = count($images);
         $this->videocount = count($videos);
         $this->totaltilecount = count($this->alltiles);
     }
     if ($this->widgetstyle == 'tile') {
         $this->render('_tile', array('alltiles' => $this->alltiles, 'userinfo' => $this->userinfo, 'totaltilecount' => $this->totaltilecount, 'imgcount' => $this->imgcount, 'videocount' => $this->videocount));
     } else {
         $this->render('_tilenotumb', array('alltiles' => $this->alltiles, 'userinfo' => $this->userinfo, 'totaltilecount' => $this->totaltilecount, 'imgcount' => $this->imgcount, 'videocount' => $this->videocount));
     }
 }
Exemplo n.º 3
0
 public function getUserProfile($userid, $share, $groupid)
 {
     $userinfo = User::model()->findByPk($userid);
     $profileinfo = UserProfile::model()->findByAttributes(array('user_id' => $userid));
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $userid . "' and finao_activestatus != 2 and IsGroup = 1 and group_id=" . $groupid;
     if ($userid == Yii::app()->session['login']['id'] && $share != "share") {
         $Criteria->addCondition("Iscompleted = 0", "AND", "IsGroup = 0", "AND");
     }
     if (isset($share) && $share == "share" || $userid != Yii::app()->session['login']['id']) {
         $Criteria->addCondition("finao_status_Ispublic = 1", "AND");
     }
     $Criteria->order = "updateddate DESC";
     $finaos = UserFinao::model()->findAll($Criteria);
     $latestfinao = UserFinao::model()->find(array('condition' => 'userid = ' . $userid . ' AND Iscompleted = 0 order by updateddate DESC'));
     if (!empty($finaos)) {
         $Criteria = new CDbCriteria();
         $Criteria->group = 'tile_id';
         $Criteria->condition = "userid = '" . $userid . "'";
         $Criteria->select = "t1.tilename , t1.tile_imageurl , t1.Is_customtile, t.* ";
         if (!empty($finaos)) {
             foreach ($finaos as $finaoids) {
                 $ids[] = $finaoids->user_finao_id;
             }
         }
         if (!empty($ids)) {
             $Criteria->addInCondition('finao_id', $ids);
         }
         $Criteria->order = 'createddate DESC';
         $Criteria->join = " left join fn_tilesinfo t1 on t.tile_id = t1.tile_id and t.userid = t1.createdby ";
         $tilesinfo = UserFinaoTile::model()->findAll($Criteria);
     } else {
         $tilesinfo = "";
     }
     return array('userid' => $userid, 'userinfo' => $userinfo, 'profileinfo' => $profileinfo, 'finao' => $latestfinao, 'tilesinfo' => $tilesinfo);
 }
Exemplo n.º 4
0
 /**
  * Displays the login page
  */
 public function actionLogin()
 {
     $uname = $_POST['uname'];
     $pwd = md5($_POST['pwd']);
     $remember = $_POST['remember'];
     $currenturl = Yii::app()->request->urlReferrer;
     $model = User::model()->findByAttributes(array('email' => $uname, 'password' => $pwd, 'status' => 1));
     if ($model) {
         $login = array();
         if (isset(Yii::app()->session['login'])) {
             unset(Yii::app()->session['login']);
         }
         if (isset(Yii::app()->session['userinfo'])) {
             unset(Yii::app()->session['userinfo']);
         }
         $login["id"] = $model->userid;
         $login["username"] = $model->fname;
         $login["email"] = $model->email;
         $login["socialnetworkid"] = $model->socialnetworkid;
         $login["trackid"] = $model->trackid;
         $login["superuser"] = $model->superuser;
         /* code added by gowri for bg image */
         $userprofile = UserProfile::model()->findByAttributes(array('user_id' => $model->userid));
         $login["profImage"] = isset($userprofile->profile_image) ? $userprofile->profile_image : "";
         $login["bgImage"] = isset($userprofile->profile_bg_image) ? $userprofile->profile_bg_image : "";
         Yii::app()->session['login'] = $login;
         //$passwordcookie = base64_encode($_POST['pwd']);
         $passwordcookie = base64_encode($_POST['pwd']);
         //Changed on 26022013
         $imgsrc = "http://" . $_SERVER['SERVER_NAME'] . "/images/uploads/profileimages/" . Yii::app()->session['login']['profImage'];
         $shopusercookie = new CHttpCookie('shop_uname', $imgsrc);
         $shopusercookie->expire = time() + 2 * 604800;
         //Ended on 260222013
         if ($remember == "true") {
             $usercookie = new CHttpCookie('login_usernme', $uname);
             $usercookie->expire = time() + 2 * 604800;
             $passcookie = new CHttpCookie('login_paswrd', $_POST['pwd']);
             $passcookie->expire = time() + 2 * 604800;
             Yii::app()->request->cookies['login_usernme'] = $usercookie;
             Yii::app()->request->cookies['login_paswrd'] = $passcookie;
         }
         //Added on 26022013
         Yii::app()->request->cookies['shop_uname'] = $shopusercookie;
         //Ended on 26022013
         /*if($remember == "false")
           
           
           
           {
           
           
           
           unset(Yii::app()->request->cookies['login_usernme']);
           
           
           
           unset(Yii::app()->request->cookies['login_paswrd']);
           
           
           
           }*/
         $IsSkipped = UserProfile::model()->findByAttributes(array('user_id' => $model->userid));
         $IsFinao = UserFinao::model()->findByAttributes(array('userid' => $model->userid));
         if (!empty($IsSkipped) && $IsSkipped->IsCompleted == "skipped") {
             if (!isset($IsFinao) || empty($IsFinao)) {
                 echo "AddFinao";
             } else {
                 echo "MotivationMesg";
             }
         } elseif ($IsSkipped->IsCompleted == "saved") {
             if (!isset($IsFinao) || empty($IsFinao)) {
                 echo "AddFinao";
             } else {
                 echo "MotivationMesg";
             }
         } else {
             echo "MyProfile";
         }
     } else {
         $notactivate = User::model()->findByAttributes(array('email' => $uname, 'password' => $pwd));
         if ($notactivate) {
             echo "Your account is not activated";
         } else {
             echo "not-login";
         }
         //exit;
     }
 }
Exemplo n.º 5
0
</a></span>
			<?php 
        }
        ?>
	

			</div>



		



		<?php 
        $finaos = UserFinao::model()->findByPK($finaoid);
        $tiles = UserFinaoTile::model()->findAll(array('condition' => 'finao_id =' . $finaoalll->upload_sourceid));
        //print_r($tiles);exit;
        //echo $finaos->Iscompleted;
        if ($userid == Yii::app()->session['login']['id'] && $finaos->Iscompleted != 1 && isset($share) && $share != "share") {
            //exit;
            ?>
         
         
			<span style="display:none" id="set<?php 
            echo $finaoalll->uploaddetail_id;
            ?>
" class="edit-journal-options">

                  
                   
Exemplo n.º 6
0
                        $imgsrc = $this->cdnurl . "/images/no-image-small.jpg";
                    }
                }
            }
        }
        if (isset($user) && isset($user->profile_image)) {
            $profileimg = $this->cdnurl . "/images/uploads/profileimages/" . $user->profile_image;
        } else {
            $profileimg = $this->cdnurl . "/images/no-image-small.jpg";
        }
        ?>

			    <div class="finao-desc-media">
				<?php 
        $tileid = UserFinaoTile::model()->findByAttributes(array('tile_id' => $tppl->tile_id, 'finao_id' => $tppl->finao_id));
        $groupid = UserFinao::model()->findByAttributes(array('user_finao_id' => $tppl->finao_id, 'IsGroup' => 1));
        if ($groupid) {
            $res = 'group';
        } else {
            $res = 'tile';
        }
        ?>
                                	<div class="finao-content-caption"><?php 
        echo $tppl->finao_msg;
        ?>
</div>
                                	<div class="finao-hero-content">
                                    
                                     <div style="overflow:hidden;background:url('<?php 
        echo $imgsrc;
        ?>
Exemplo n.º 7
0
        <?php 
    }
    ?>
 
  <?php 
}
?>

</div>
            
<div class="detailed-container">
<?php 
foreach ($uploadinfo as $eachImgVid) {
    $tileid = UserFinaoTile::model()->findByAttributes(array('finao_id' => $eachImgVid['upload_sourceid']));
    if ($eachImgVid["upload_sourcetype"] == '37') {
        $finaomsg = UserFinao::model()->findByPk($eachImgVid['upload_sourceid']);
        $finaomsg = $finaomsg->finao_msg;
    } else {
        if ($eachImgVid["upload_sourcetype"] == '36') {
            $finaomsg = TilesInfo::model()->findByAttributes(array('tile_id' => $eachImgVid['upload_sourceid']));
            $finaomsg = $finaomsg->tilename;
        } else {
            $finaomsg = UserFinaoJournal::model()->findByAttributes(array('finao_id' => $eachImgVid['upload_sourceid'], 'user_id' => $_REQUEST['userid']));
            $finaomsg = $finaomsg->finao_journal;
            //print_r($uploadinfo[0][upload_sourceid]);exit;
        }
    }
    if ($uploadtype == 'Image') {
        if (file_exists(Yii::app()->basePath . "/../" . $eachImgVid["uploadfile_path"] . "/thumbs/" . $eachImgVid["uploadfile_name"]) && $eachImgVid["uploadfile_name"] != "") {
            $path = "/thumbs/";
            ?>
Exemplo n.º 8
0
        ?>
            
            </div>
        </div>
        
		<div class="contentHolder ps-container" id="Default">
			<div class="finao-display-container">
	<?php 
        $Criteria = new CDbCriteria();
        if ($userid == Yii::app()->session['login']['id'] && isset($share) && $share != "share") {
            $Criteria->condition = "userid = '" . $userid . "' and Iscompleted!=1 and finao_activestatus=1 and IsGroup = 0";
        } else {
            $Criteria->condition = "userid = '" . $userid . "' and Iscompleted!=1 and finao_activestatus = 1 and finao_status_Ispublic=1 and IsGroup = 0";
        }
        $Criteria->order = "updateddate desc";
        $totfinaos = UserFinao::model()->findAll($Criteria);
        $i = 0;
        foreach ($totfinaos as $finaoalll) {
            $i++;
            $finaotile = UserFinaoTile::model()->findByAttributes(array('finao_id' => $finaoalll->user_finao_id));
            //echo $finaotile->tile_id;
            //echo $userid;
            ?>
    <script language="javascript">
	$(document).ready(function() {
			$("#fancyboximg"+<?php 
            echo $i;
            ?>
).fancybox({});
			$("#fancyboximgs"+<?php 
            echo $finaoalll->user_finao_id;
Exemplo n.º 9
0
 public function actionUpdatedetails()
 {
     //print_r($_POST);exit;
     $uploaddetail_id = $_POST['uploaddetail_id'];
     $userid = $_POST['userid'];
     // only caption edit
     $dates = date('Y-m-d H:i:s');
     $connection = yii::app()->db;
     if ($_POST['type'] == 'video') {
         $sql = "UPDATE  fn_uploaddetails SET video_caption='" . $_POST['caption'] . "',updateddate='" . $dates . "'  WHERE uploaddetail_id=" . $uploaddetail_id;
     } else {
         $sql = "UPDATE  fn_uploaddetails SET caption='" . $_POST['caption'] . "',updateddate='" . $dates . "'  WHERE uploaddetail_id=" . $uploaddetail_id;
     }
     $command = $connection->createCommand($sql);
     $command->execute();
     if (!empty($_FILES['journalimage']['name'])) {
         $filename = '';
         $result = 'ERROR';
         $result_msg = '';
         $allowed_image = array('image/gif', 'image/jpeg', 'image/jpg', 'image/png');
         define('PICTURE_SIZE_ALLOWED', 10485760);
         // bytes 2242880
         if (isset($_FILES['journalimage'])) {
             if ($_FILES['journalimage']['error'] == UPLOAD_ERR_OK) {
                 if (in_array($_FILES['journalimage']['type'], $allowed_image)) {
                     if (filesize($_FILES['journalimage']['tmp_name']) <= PICTURE_SIZE_ALLOWED) {
                         $filename = $_POST['finaoid'] . '-' . rand(125678, 00) . '-' . $_FILES['journalimage']['name'];
                         $source = Yii::getPathOfAlias('webroot') . '/images/uploads/finaoimages' . '/' . $filename;
                         move_uploaded_file($_FILES['journalimage']['tmp_name'], $source);
                         if (file_exists($source)) {
                             $upload = new Uploaddetails();
                             $destination = Yii::getPathOfAlias('webroot') . '/images/uploads/finaoimages/thumbs/' . $filename;
                             $destination1 = Yii::getPathOfAlias('webroot') . '/images/uploads/finaoimages/medium/' . $filename;
                             $this->generatethumb($source, $destination, 90, 90);
                             $this->generatethumb($source, $destination1, 240, 240);
                             $dates = date('Y-m-d H:i:s');
                             $connection = yii::app()->db;
                             $sql = "UPDATE  fn_uploaddetails SET uploadfile_name='" . $filename . "',uploadfile_path='/images/uploads/finaoimages',updateddate='" . $dates . "'  WHERE uploaddetail_id=" . $uploaddetail_id;
                             $command = $connection->createCommand($sql);
                             $command->execute();
                         }
                         //phpclamav clamscan for scanning viruses
                         //passthru('clamscan -d /var/lib/clamav --no-summary '.$filename, $virus_msg); //scan virus
                         $virus_msg = 'OK';
                         //assume clamav returing OK.
                         if ($virus_msg != 'OK') {
                             unlink($source);
                             $result_msg = $filename . " : " . FILE_VIRUS_AFFECTED;
                             $result_msg = '<font color=red>' . $result_msg . '</font>';
                             $filename = '';
                         } else {
                             // main action -- move uploaded file to $upload_dir
                             $result = 'OK';
                         }
                     } else {
                         $filesize = filesize($_FILES['file']['tmp_name']);
                         // or $_FILES['file']['size']
                         $filetype = $_FILES['file']['type'];
                         $result_msg = PICTURE_SIZE;
                     }
                 } else {
                     $result_msg = SELECT_IMAGE;
                 }
             } elseif ($_FILES['file']['error'] == UPLOAD_ERR_INI_SIZE) {
                 $result_msg = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
             } else {
                 $result_msg = 'Unknown error';
             }
         }
     }
     $finao = Uploaddetails::model()->findByPK($uploaddetail_id);
     $finaoid = $finao->upload_sourceid;
     $finaos = new UserFinao();
     $finaos = UserFinao::model()->findByPk($finaoid);
     if (!empty($finaos)) {
         $finaos->updateddate = new CDbExpression('NOW()');
         if ($finaos->save(false)) {
             //echo 'saved date';exit;
             $this->redirect(Yii::app()->createUrl('finao/motivationMesg', array('menutype' => 'finao', 'finaoid' => $finaoid)));
         }
         /*$tileiddata = UserFinaoTile::model()->findByAttributes(array('finao_id'=>$finaoid,'userid'=>$userid,'status'=>1));
         		$this->addTrackingNotifications($userid,$tileiddata['tile_id'],'Added Image To Journal',$finaoid,0);*/
     }
     //$tempdocmodel=Uploaddetails::model()->updateByPk($Model->$_POST['journalid'],array("status"=>'ok'));
     // $filesmodel=UserFinaoJournal::model()->updateAll(array('user'=>"$userid",'date'=>$currenttime),"status=>'ok'");
 }
Exemplo n.º 10
0
    public function actionGetVideocontestdetail()
    {
        //print_r($_REQUEST);
        if (isset($_REQUEST["videoid"])) {
            $userid = Yii::app()->session['login']['id'];
            $videoid = $_REQUEST["videoid"];
            $vidler = Yii::app()->getComponents(false);
            $user = $vidler['vidler']['user'];
            $pass = $vidler['vidler']['pwd'];
            $api_key = $vidler['vidler']['appkey'];
            $callback_url = '/';
            $v = new Viddler_V2($api_key);
            $auth = $v->viddler_users_auth(array('user' => $user, 'password' => $pass));
            $sessionid = $auth['auth']['sessionid'];
            $results = $v->viddler_videos_getDetails(array('sessionid' => $sessionid, 'video_id' => $videoid));
            //exit;
            // print_r($results);exit;
            if (!empty($results)) {
                $finaomsg = $results['video']['description'];
                $newfinao = new UserFinao();
                // for badword
                $words = str_word_count($finaomsg, 1);
                $lastWord = array_pop($words);
                $lastSpacePosition = strrpos($finaomsg, ' ');
                $textWithoutLastWord = $finaomsg;
                $tiles = FnProfanityWords::model()->findAll();
                foreach ($tiles as $tiles) {
                    if (strtolower($lastWord) == strtolower($tiles->badword)) {
                        $textWithoutLastWord = substr($finaomsg, 0, $lastSpacePosition);
                        $textWithoutLastWord .= ' **** ';
                    }
                }
                if (isset($finaomsg) && $finaomsg != "") {
                    $newfinao->finao_msg = $textWithoutLastWord;
                }
                $public = 1;
                $newfinao->finao_status_Ispublic = $public;
                $newfinao->userid = $userid;
                $newfinao->createddate = new CDbExpression('NOW()');
                $newfinao->updatedby = $userid;
                $newfinao->updateddate = new CDbExpression('NOW()');
                $newfinao->finao_status = 38;
                if ($newfinao->save(false)) {
                    $finao_id = $newfinao->user_finao_id;
                    $tileid = 66;
                    $newtile = new UserFinaoTile();
                    $newtile->tile_id = $tileid;
                    $newtile->tile_name = 'Career Catapult';
                    $newtile->finao_id = $newfinao->user_finao_id;
                    $tileimgurl = 'careercatapult.jpg';
                    $newtile->tile_profileImagurl = $tileimgurl;
                    $newtile->userid = $userid;
                    $newtile->status = 1;
                    $newtile->createddate = new CDbExpression('NOW()');
                    $newtile->createdby = $userid;
                    $newtile->updateddate = new CDbExpression('NOW()');
                    $newtile->updatedby = $userid;
                    if ($newtile->save(false)) {
                        //echo $newtile->user_tileid;
                        $tilename = 'Career Catapult';
                        $istileinfo = TilesInfo::model()->findByAttributes(array('tilename' => $tilename, 'createdby' => $userid));
                        if (!isset($istileinfo) && empty($istileinfo)) {
                            $tileinfo = new TilesInfo();
                            $tileinfo->tile_id = $tileid;
                            $tileinfo->tilename = $tilename;
                            $tileinfo->tile_imageurl = $tileimgurl;
                            $tileinfo->status = 1;
                            $tileinfo->createdby = $userid;
                            $tileinfo->createddate = new CDbExpression('NOW()');
                            $tileinfo->updateddate = new CDbExpression('NOW()');
                            $tileinfo->updatedby = $userid;
                            $tileinfo->save(false);
                        }
                        /*echo  'FInaoid-'.$finao_id.'userid-'.$userid.'Video Id-'.$videoid;exit;*/
                        $uploadvideo = new Uploaddetails();
                        $uploadvideo->upload_sourcetype = 37;
                        $uploadvideo->uploadtype = 35;
                        $uploadvideo->upload_sourceid = $finao_id;
                        $uploadvideo->uploadedby = $userid;
                        $uploadvideo->uploadeddate = new CDbExpression('NOW()');
                        $uploadvideo->status = 0;
                        $uploadvideo->updatedby = $userid;
                        $uploadvideo->updateddate = new CDbExpression('NOW()');
                        $uploadvideo->videoid = $videoid;
                        $uploadvideo->videostatus = "not ready";
                        $uploadvideo->video_img = $results['video']['thumbnail_url'];
                        $uploadvideo->video_caption = $results['video']['title'];
                        if ($uploadvideo->save(false)) {
                            $usercheck = User::model()->findByAttributes(array('userid' => Yii::app()->session['login']['id'], 'status' => 1));
                            $aprroveurl = 'http://' . $_SERVER['HTTP_HOST'] . '/finao/AprroveVideo/userid/' . $usercheck->userid . '/uploadid/' . $uploadvideo->uploaddetail_id;
                            $mesg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Confirmation</title>
</head>

<body>

	<div style="width:670px; margin:0px auto; padding:0px; background:#FFF; border-left:solid 20px #dddddd; border-right:solid 20px #dddddd;">
	<div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Email_Header.png" style="padding:0; margin:0; border:0;" /></div>
    <div style="width:650px; padding:10px; margin:0px; font-family:Geneva, Arial, Helvetica, sans-serif;"><br />
    	<div style="color:rgb(244, 123, 32); font-weight:bold; font-size:16px; padding-bottom:5px;">Dear Admin,</div>
        
        
     <div style="color:rgb(77,77,77); font-size:12px; line-height:18px; padding-bottom:15px;">
	 
	   <p>' . ucfirst($usercheck->fname) . ' has posted a Video.</p>
	   <p>Please review the Video by clicking on the View Video button below and click on the Approve Video button to publish this video.  </p>
<p>If you happen to see the message "Video not Found" or "Encoding in Progress", Please check back later. Video encoding sometimes can take up to an hour.</p>
	   
      <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.viddler.com/v/' . $videoid . '" target="_new"><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/view-video.jpg"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <a href="' . $aprroveurl . '" target="_new" ><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/approve-video.jpg"></a><br />  <br />
       </p>
     </div>
        <div style="color:rgb(77,77,77); font-size:12px; line-height:12px; padding-bottom:10px;"> </div>
        
        <div><img src="http://' . $_SERVER['HTTP_HOST'] . '/images/Signature.png" style="border:0; padding:0; margin:0;" /></div>
        
    </div>
	<div style="width:650px; margin:0px auto; text-align:right">
    	<ul style="list-style:none; margin:0px; padding:0px;">
            <a target="_blank" href="https://www.facebook.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) 0 -38px; width:13px; height:29px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
             <a target="_blank" href="http://pinterest.com/finaonation/"><li style="background:url(http://finaonation.com/images/soc-icons.png) -80px -38px; width:24px; height:30px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
            <a target="_blank" href="http://www.linkedin.com/company/2253999"><li style="background:url(http://finaonation.com/images/soc-icons.png) -21px -38px; width:26px; height:27px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
            <a target="_blank" href="https://twitter.com/FINAONation"><li style="background:url(http://finaonation.com/images/soc-icons.png) -53px -38px; width:20px; height:26px; display:inline-block; list-style:none; margin:0 4px;"></li></a>
       </ul>
    </div>
    <div style="background:#000; width:670px; font-size:11px; color:rgb(153, 153, 153); text-align:center; padding:10px 0; font-family:Geneva, Arial, Helvetica, sans-serif;">
        <div style="padding-bottom:5px;">This message was mailed to <span style="color:rgb(244, 123, 32)!important;">' . $email . '</span> by FINAO Nation.</div>
        <div style="padding-bottom:5px;">
            <a href="http://' . $_SERVER['HTTP_HOST'] . '" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">FINAO</a> | 
            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/contactus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Contact Us</a> | 
            <a href="http://' . $_SERVER['HTTP_HOST'] . '/profile/aboutus" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">About FINAO</a> | 
            <a href="mailto:unsubscribe@finaonation.com?Subject=Hello%20again" style="color:rgb(244, 123, 32); padding:0 5px; text-decoration:underline;">Unsubscribe</a>
            
            
        </div>
        <div>
			<div style="padding:0px!important; margin:0px!important; line-height:18px;">To unsubscribe, click the link above, or send an email to: <a href="#" style="color:rgb(153, 153, 153)!important; text-decoration:none; cursor:default;">unsubscribe@finaonation.com</a>. Do not reply to this email address.</div> 
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">It is a notification only address and is not monitored for incoming email. </div>
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">Use of the FINAO Nation website and mobile app constitutes acceptance of our Terms of Use and Privacy Policy.</div>
            <div style="padding:0px!important; margin:0px!important; line-height:18px;">&copy; ' . date("Y") . ' FINAO Nation, 13024 Beverly Park Rd, Mukilteo, WA 98275, U.S.A.</div>
        </div>
    </div>
</div>

</body>
</html>';
                            $subj = "video Contest";
                            // To send HTML mail, the Content-type header must be set
                            $headers = 'MIME-Version: 1.0' . "\r\n";
                            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                            // Additional headers
                            $headers .= 'From:Finaonation <*****@*****.**>' . "\r\n";
                            $headers .= 'Bcc: dev@wincito.com,nagesh@wincito.com' . "\r\n";
                            $to = '*****@*****.**';
                            //$to  = 'wallace@finaonation.com,georgie@finaonation.com,robert@finaonation.com';
                            mail($to, $subj, $mesg, $headers);
                            $this->redirect(Yii::app()->createUrl('finao/Viewvideohdcu/video/true'));
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 11
0
 public function run()
 {
     $user = UserProfile::model()->findByAttributes(array('user_id' => $this->userid));
     $ontrackid = Lookups::model()->findByAttributes(array('lookup_type' => 'finaostatus', 'lookup_name' => 'On Track'));
     $aheadid = Lookups::model()->findByAttributes(array('lookup_type' => 'finaostatus', 'lookup_name' => 'Ahead'));
     $behindid = Lookups::model()->findByAttributes(array('lookup_type' => 'finaostatus', 'lookup_name' => 'Behind'));
     if (isset($this->tileid)) {
         $finaos = UserFinaoTile::model()->findAllByAttributes(array('tile_id' => $this->tileid, 'userid' => $this->userid));
         foreach ($finaos as $finaoids) {
             $ids[] = $finaoids->finao_id;
         }
     }
     if (isset($this->groupid) && $this->groupid != "") {
         $condition = "and IsGroup = 1 and group_id = " . $this->groupid . "";
     } else {
         $condition = "and IsGroup = 0 ";
     }
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $this->userid . "' and finao_activestatus = 1 and IsCompleted = 0 " . $condition . "";
     if (isset($ids) && !empty($ids)) {
         $Criteria->addInCondition('user_finao_id', $ids);
     }
     if (Yii::app()->session['login']['id'] != $this->userid || $this->share == "share") {
         $Criteria->addCondition("finao_status_Ispublic = 1", 'AND');
     }
     $Criteria->order = "updateddate DESC";
     $Criteria->addCondition("finao_status = '" . $ontrackid->lookup_id . "'", 'AND');
     $ontrack = UserFinao::model()->findAll($Criteria);
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $this->userid . "' and finao_activestatus != 2 and IsCompleted = 0";
     if (isset($ids) && !empty($ids)) {
         $Criteria->addInCondition('user_finao_id', $ids);
     }
     if (Yii::app()->session['login']['id'] != $this->userid || $this->share == "share") {
         $Criteria->addCondition("finao_status_Ispublic = 1", 'AND');
     }
     $Criteria->order = "updateddate DESC";
     $Criteria->addCondition("finao_status = '" . $aheadid->lookup_id . "'", 'AND');
     $ahead = UserFinao::model()->findAll($Criteria);
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $this->userid . "' and finao_activestatus != 2 and IsCompleted = 0";
     if (isset($ids) && !empty($ids)) {
         $Criteria->addInCondition('user_finao_id', $ids);
     }
     if (Yii::app()->session['login']['id'] != $this->userid || $this->share == "share") {
         $Criteria->addCondition("finao_status_Ispublic = 1", 'AND');
     }
     $Criteria->order = "updateddate DESC";
     $Criteria->addCondition("finao_status = '" . $behindid->lookup_id . "'", 'AND');
     $behind = UserFinao::model()->findAll($Criteria);
     $Criteria = new CDbCriteria();
     $Criteria->condition = "userid = '" . $this->userid . "' and finao_activestatus != 2 and IsCompleted = 1";
     if (isset($ids) && !empty($ids)) {
         $Criteria->addInCondition('user_finao_id', $ids);
     }
     $Criteria->order = "updateddate DESC";
     $completed = UserFinao::model()->findAll($Criteria);
     /*$ontrack = UserFinao::model()->findAll(array('condition'=>'userid = "'.$this->userid.'" AND finao_status = 38'));
     
     		$ahead = UserFinao::model()->findAll(array('condition'=>'userid = "'.$this->userid.'" AND finao_status = 39'));
     
     		$behind = UserFinao::model()->findAll(array('condition'=>'userid = "'.$this->userid.'" AND finao_status = 40'));*/
     if (isset($this->frndprofile)) {
         $frndprofile = "mainpage";
     } else {
         $frndprofile = "no";
     }
     if (isset($this->left)) {
         $leftlayout = "leftlayout";
     } else {
         $leftlayout = "";
     }
     if (isset($this->finao)) {
         $finaopage = "finao";
     } else {
         $finaopage = "";
     }
     $this->render('_progressBar', array('user' => $user, 'ontrack' => $ontrack, 'ahead' => $ahead, 'behind' => $behind, 'frndprofile' => $frndprofile, 'leftlayout' => $leftlayout, 'finaopage' => $finaopage, 'completed' => $completed));
 }