本文整理汇总了PHP中Tracking::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::model方法的具体用法?PHP Tracking::model怎么用?PHP Tracking::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracking
的用法示例。
在下文中一共展示了Tracking::model方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionData
public function actionData()
{
$transport_id = (int) Yii::app()->request->getPost('id');
$pass = Yii::app()->request->getPost('pass', '');
$dataRequest = Yii::app()->request->getPost('data', '');
$data = json_decode($dataRequest, false);
if ($transport_id && $pass && is_array($data)) {
Yii::app()->getModule('cabinet');
$transport = Transport::model()->findByPk($transport_id);
if (!is_null($transport)) {
$tracking = Tracking::model();
$checkPass = $tracking->getPasswordForAPI($transport);
if (0 == strcmp($pass, $checkPass)) {
$res = $tracking->saveTrackData($transport_id, $data);
echo CJSON::encode(['status' => $res ? 'success' : 'failed']);
Yii::log("actionData success", "info");
} else {
echo CJSON::encode(['status' => 'failed', 'data' => "wrong pass for transport_id=[{$transport_id}]"]);
}
} else {
echo CJSON::encode(['status' => 'failed', 'data' => "Transport not found [{$transport_id}]"]);
}
} else {
echo CJSON::encode(['status' => 'failed', 'data' => "Wrong params transport_id=[{$transport_id}],pass=[{$pass}]"]);
}
Yii::app()->end();
}
示例2: actionAvtoparkAdd
public function actionAvtoparkAdd($id = 0)
{
if (!empty($id)) {
$Transport = Transport::model()->findByPk($id);
if (!Yii::app()->user->checkAccess('admin') && (Yii::app()->getUser()->getProfile()->modules->head != UserModules::DIRECTOR_COMPANY || Yii::app()->user->getProfile()->company_id != $Transport->user->company_id) && (Yii::app()->getUser()->getProfile()->modules->avtopark != '1' || $Transport->user_id != Yii::app()->user->id)) {
throw new CHttpException(403);
}
} else {
if (!Yii::app()->user->checkAccess('admin') && Yii::app()->getUser()->getProfile()->modules->head != UserModules::DIRECTOR_COMPANY && Yii::app()->getUser()->getProfile()->modules->avtopark != '1') {
throw new CHttpException(403);
}
$Transport = new Transport();
}
if (isset($_POST['save'])) {
$Transport->setAttributes($_POST['Transport'], false);
if ($Transport->validate()) {
$Transport->save();
$Transport->setRelations($_POST['Transport']);
if (isset($_POST['photos'])) {
$Transport->setPhoto($_POST['photos']);
}
$this->redirect('/cabinet/avtopark/');
}
}
$track = null;
$points = [];
Yii::import('application.modules.tracking.models.*');
if ($Transport->tracking_on && $Transport->tracking_password) {
$points = Tracking::model()->getDataForCurrentTrack($Transport->transport_id);
}
$this->render('avtoparkAdd', ['Transport' => $Transport, 'points' => $points]);
}
示例3: actionDeletefj
public function actionDeletefj()
{
$userid = Yii::app()->session['login']['id'];
$groupid = $_POST['groupid'];
// groups tabel deleting
$groups = Group::model()->findByAttributes(array('group_id' => $groupid));
//$groups = new Group;
$groups->group_activestatus = '2';
if ($groups->save(false)) {
echo "success";
}
$imagetypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Image'));
$videotypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Video'));
$sourcetypeidfinao = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'finao'));
$sourcetypeidtile = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'tile'));
$tracked_tileids = Yii::app()->session['login']['id'];
/*$tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid'=>$tracked_tileids,'tracked_tileid'=>$tileid));
if(isset($tileinfo['0']['tracking_id']))
{
$tileinfo = Tracking::model()->findByAttributes(array('tracking_id'=>$tileinfo['0']['tracking_id']));
$tileinfo->delete();
} */
$sourcetypeidjournal = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'journal'));
$groupfinao = UserFinao::model()->findByAttributes(array('group_id' => $groupid));
// finaos deleteing
$type = "finao";
if ($type == "finao") {
// uploadedetails deleteing
$delfiles = Uploaddetails::model()->findAllByAttributes(array('upload_sourceid' => $groupfinao->user_finao_id));
//$delfiles1 = Uploaddetails::model()->findAllByAttributes(array('uploadtype'=>$videotypeid->lookup_id,'upload_sourcetype'=>$sourcetypeidfinao->lookup_id,'upload_sourceid'=>$journalid,'uploadedby'=>$userid));
if (isset($delfiles) && !empty($delfiles)) {
foreach ($delfiles as $image) {
$image->status = 2;
$image->save(false);
}
}
/*if(isset($delfiles1) && !empty($delfiles1))
{
foreach($delfiles1 as $video)
{
$video->status = 2;
$video->save(false);
}
}*/
$tiles = UserFinaoTile::model()->findAllByAttributes(array('finao_id' => $groupfinao->user_finao_id, 'createdby' => $userid));
if (isset($tiles) && !empty($tiles)) {
foreach ($tiles as $eachtile) {
$eachtile->status = '2';
$eachtile->save(false);
}
}
// finaos deleteing
$finaodel = UserFinao::model()->findAllByAttributes(array('user_finao_id' => $groupfinao->user_finao_id, 'updatedby' => $userid));
//echo $groupfinao->user_finao_id; echo $userid;
if (isset($finaodel) && !empty($finaodel)) {
$finaodel->finao_activestatus = '2';
$finaodel->save(false);
}
$tracked_tileids = Yii::app()->session['login']['id'];
$tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid' => $tracked_tileids, 'tracked_tileid' => $tileid));
if (isset($tileinfo['0']['tracking_id'])) {
$tileinfo = Tracking::model()->findByAttributes(array('tracking_id' => $tileinfo['0']['tracking_id']));
$tileinfo->delete();
}
//echo "successful";
}
}
示例4: count
<li>
<a href="javascript:void(0)" onclick="view_change_status('<?php
echo $userid;
?>
');" >
<img src="<?php
echo Yii::app()->baseUrl;
?>
/images/notifications.png" width="35" />
<span class="latest-notifications">
<?php
$counts = Tracking::model()->findAllByAttributes(array('tracked_userid' => $userid, 'status' => 1, 'view_status' => 0));
?>
<div id = "countdiv" style="font-size: 12px;" class="orange"><?php
if (count($counts) > 0) {
echo count($counts);
}
?>
</div>
</span>
</a><!-- Begin Home Item -->
示例5: foreach
<div class="followers">
<div class="orange font-16px padding-10pixels">Trackers - Those who are following you</div>
<div style="height:300px; width:97%; overflow:auto; float:left;">
<?php
foreach ($findalltiles as $tiledisplay) {
$gettrackercount = Tracking::model()->findAllByAttributes(array('tracked_tileid' => $tiledisplay->lookup_id, 'tracked_userid' => Yii::app()->session['login']['id'], 'status' => 1));
?>
<?php
if (count($gettrackercount) > 0) {
?>
<div>
<a style="color:#838383; font-size: 14px; font-weight:bold;" >
<div id ="plusimgg-<?php
echo $tiledisplay->lookup_id;
?>
示例6: foreach
$userid = Yii::app()->session['login']['id'];
foreach ($userrelatedtotiles as $relatetiles) {
?>
<?php
$finduser = User::model()->findByAttributes(array('userid' => $relatetiles->userid));
$image = UserProfile::model()->findByAttributes(array('user_id' => $relatetiles->userid));
if ($image->profile_image != "") {
$profileimage = Yii::app()->baseUrl . "/images/uploads/profileimages/" . $image->profile_image;
} else {
$profileimage = Yii::app()->baseUrl . "/images/no-image.jpg";
}
if ($finduser->userid != Yii::app()->session['login']['id']) {
if (!empty($finduser)) {
$checktracktilestatus = Tracking::model()->findAllByAttributes(array('tracked_tileid' => $relatetiles->tile_id, 'tracked_userid' => $finduser->userid, 'status' => 0, 'tracker_userid' => $userid));
$checktracktile = Tracking::model()->findAllByAttributes(array('tracked_tileid' => $relatetiles->tile_id, 'tracked_userid' => $finduser->userid, 'status' => 1, 'tracker_userid' => $userid));
$counttrackers = count($checktracktile);
?>
<input type="hidden" id="tileid" value="<?php
echo $relatetiles->tile_id;
?>
"/>
<div class="results-tab">
<div class="profile-pic-img">
<a href="<?php
echo Yii::app()->createUrl('finao/motivationmesg/frndid/' . $finduser->userid);
?>
">
<img width="100" src="<?php
echo $profileimage;
示例7: foreach
} else {
?>
<div class="clear-right padding-10pixels"></div>
<div id="Default3" class="contentHolder2">
<div class="friends-list-wrapper" id="divtrackedlist">
<ul class="grid cs-style-7">
<?php
$i = 1;
foreach ($imtracking as $track) {
$i++;
//echo $userid;
$ful_tracking = Tracking::model()->findByAttributes(array('tracker_userid' => $track->tracker_userid, 'tracked_userid' => $userid));
//print_r($ful_tracking);
$userimage = UserProfile::model()->findByAttributes(array('user_id' => $track->tracker_userid));
if (isset($userimage->profile_image) && $userimage->profile_image != "") {
$src = Yii::app()->baseUrl . "/images/uploads/profileimages/" . $userimage->profile_image;
} else {
$src = Yii::app()->baseUrl . "/images/no-image.jpg";
}
?>
<li>
<figure>
<a href="<?php
echo Yii::app()->createUrl('finao/motivationmesg/frndid/' . $track->tracker_userid);
?>
"><img src="<?php
示例8: actionTrackingSendRandomData
public function actionTrackingSendRandomData()
{
if (!Yii::app()->getUser()->getIsGuest()) {
$num = mt_rand(5, 10);
$data = [];
$lat = 55.751244;
$lng = 37.618423;
$time = time();
for ($i = 0; $i < $num; ++$i) {
$tmp = ['lat' => null, 'lng' => null, 'time' => null];
$dir = 0 == mt_rand(1, 1000) % 2 ? -1 : 1;
$delta = (double) mt_rand(1, 20) / (double) 1000000;
$lat += $delta * $dir;
$tmp['lat'] = $lat;
$dir = 0 == mt_rand(1, 1000) % 2 ? -1 : 1;
$delta = (double) mt_rand(1, 20) / (double) 1000000;
$lng += $delta * $dir;
$tmp['lng'] = $lng;
$time -= 10;
$tmp['time'] = $time;
$data[] = $tmp;
}
Yii::app()->getModule('cabinet');
Yii::app()->getModule('tracking');
$Transport = \Transport::model()->findByAttributes(['user_id' => 1, 'tracking_on' => 1]);
$transport_id = $Transport->transport_id;
$pass = \Tracking::model()->getPasswordForAPI($Transport);
//$transport_id = 1;
//$pass = '9e6b47bfa24a7958d5bc8a3dd4c876eb';
$post = ['id' => $transport_id, 'pass' => $pass, 'data' => json_encode($data)];
$ch = curl_init();
try {
//curl_setopt($ch, CURLOPT_URL, "http://cargotogo.com/tracking/data");
curl_setopt($ch, CURLOPT_URL, "http://" . $_SERVER['HTTP_HOST'] . "/tracking/data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json'] );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
if (FALSE === $response) {
$str_log = '';
$str_log = "CURL error=[" . curl_error($ch) . "]";
$str_log .= ",HTTP_CODE=[" . curl_getinfo($ch, CURLINFO_HTTP_CODE) . "]";
$str_log .= ",Last URL=[" . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) . "]";
$str_log .= ",last headers=[" . curl_getinfo($ch, CURLINFO_HEADER_OUT) . "]";
echo "ERROR : " . $str_log;
} else {
echo "SUCCESS : [{$response}]";
}
} finally {
curl_close($ch);
}
}
Yii::app()->end();
}
示例9: foreach
echo $tiledisplay->lookup_id;
?>
" style="display:none"><?php
echo '<br />' . $users->fname;
?>
</div>
<?php
}
}
?>
</td>
<td style="padding-left:650px">
<h3>Trackers</h3>
<?php
foreach ($findalltiles as $tiledisplay) {
$gettrackercount = Tracking::model()->findAllByAttributes(array('tracked_tileid' => $tiledisplay->lookup_id, 'tracked_userid' => $userid, 'status' => 1));
if (count($gettrackercount) > 0) {
?>
<br></br><div><a ><div id = "plusimgg-<?php
echo $tiledisplay->lookup_id;
?>
"><img src = "<?php
echo Yii::app()->baseUrl;
?>
/images/plus.gif" onClick="showuserss(<?php
echo $tiledisplay->lookup_id;
?>
)"></img></div><div id = "minusimgg-<?php
echo $tiledisplay->lookup_id;
?>
" style="display:none"><img src = "<?php
示例10: actionDeletefj
public function actionDeletefj()
{
$userid = $_POST['userid'];
$journalid = $_POST['journalid'];
$tileid = $_POST['tileid'];
$type = $_POST['type'];
$imagetypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Image'));
$videotypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Video'));
$sourcetypeidfinao = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'finao'));
$sourcetypeidtile = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'tile'));
$tracked_tileids = Yii::app()->session['login']['id'];
$tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid' => $tracked_tileids, 'tracked_tileid' => $tileid));
//echo $tileinfo['0']['tracking_id']; exit;
if (isset($tileinfo['0']['tracking_id'])) {
$tileinfo = Tracking::model()->findByAttributes(array('tracking_id' => $tileinfo['0']['tracking_id']));
$tileinfo->delete();
}
$sourcetypeidjournal = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'journal'));
if ($type == "journal") {
$flag = "";
$delfiles = Uploaddetails::model()->findByAttributes(array('uploadtype' => $imagetypeid->lookup_id, 'upload_sourcetype' => $sourcetypeidjournal->lookup_id, 'upload_sourceid' => $journalid, 'uploadedby' => $userid));
$delfiles1 = Uploaddetails::model()->findByAttributes(array('uploadtype' => $videotypeid->lookup_id, 'upload_sourcetype' => $sourcetypeidjournal->lookup_id, 'upload_sourceid' => $journalid, 'uploadedby' => $userid));
$delid = UserFinaoJournal::model()->findByPk($journalid);
if (isset($delid) && !empty($delid)) {
$delid->delete();
//$delid->journal_status = 2;
//$delid->save(false);
}
echo "successful";
}
if ($type == "finao") {
$delfiles = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $imagetypeid->lookup_id, 'upload_sourcetype' => $sourcetypeidfinao->lookup_id, 'upload_sourceid' => $journalid, 'uploadedby' => $userid));
$delfiles1 = Uploaddetails::model()->findAllByAttributes(array('uploadtype' => $videotypeid->lookup_id, 'upload_sourcetype' => $sourcetypeidfinao->lookup_id, 'upload_sourceid' => $journalid, 'uploadedby' => $userid));
if (isset($delfiles) && !empty($delfiles)) {
foreach ($delfiles as $image) {
$image->status = 2;
$image->save(false);
}
}
if (isset($delfiles1) && !empty($delfiles1)) {
foreach ($delfiles1 as $video) {
$video->status = 2;
$video->save(false);
}
}
$journals = UserFinaoJournal::model()->findAllByAttributes(array('finao_id' => $journalid, 'user_id' => $userid));
if (isset($journals) && !empty($journals)) {
foreach ($journals as $eachjournal) {
$eachjournal->journal_status = 2;
$eachjournal->save(false);
}
}
//$journals->delete();
$tiles = UserFinaoTile::model()->findAllByAttributes(array('finao_id' => $journalid, 'createdby' => $userid));
if (isset($tiles) && !empty($tiles)) {
foreach ($tiles as $eachtile) {
$eachtile->status = 2;
$eachtile->save(false);
}
}
$finaodel = UserFinao::model()->findByPk($journalid);
if (isset($finaodel) && !empty($finaodel)) {
$finaodel->finao_activestatus = 2;
$finaodel->save(false);
}
$tracked_tileids = Yii::app()->session['login']['id'];
$tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid' => $tracked_tileids, 'tracked_tileid' => $tileid));
//echo $tileinfo['0']['tracking_id']; exit;
if (isset($tileinfo['0']['tracking_id'])) {
$tileinfo = Tracking::model()->findByAttributes(array('tracking_id' => $tileinfo['0']['tracking_id']));
$tileinfo->delete();
}
/*if(isset($finaodel) && !empty($finaodel))
$finaodel->delete();*/
echo "successful";
}
}
示例11: actionGroupDeleteTracktiles
public function actionGroupDeleteTracktiles()
{
$tileid = $_REQUEST['tileid'];
$frndid = $_REQUEST['frndid'];
$inc = $_REQUEST['inc'];
$class = "follow-finao";
if (empty($inc)) {
$inc = 0;
$class = "orange-button";
}
$userid = Yii::app()->session['login']['id'];
$tileform1 = Tracking::model()->findByAttributes(array('tracker_userid' => $userid, 'tracked_tileid' => $tileid, 'tracked_userid' => $frndid));
if ($tileform1->delete()) {
echo '<a href="javascript:void(0)" onclick="follow_groups(' . $userid . ',' . $tileid . ')" class="white-link font-12px" >Follow Group</a>';
}
}