Пример #1
0
 public function actionSetCount()
 {
     $sql = "SELECT COUNT(id) AS count_img, id_object FROM {{images}} GROUP BY id_object";
     $res = Yii::app()->db->createCommand($sql)->queryAll();
     foreach ($res as $item) {
         $model = Apartment::model()->findByPk($item['id_object']);
         if ($model) {
             $model->count_img = $item['count_img'];
             $model->update(array('count_img'));
         } else {
             echo 'not found model with id = ' . $item['id_object'] . '<br>';
         }
     }
     deb($res);
 }
// ********************************
$s3 = new Aws\S3\S3Client(['version' => 'latest', 'region' => 'us-east-1']);
$bucket = strtolower('phpmys3backup' . '-' . $now);
deb("Creating Bucket {$bucket}");
$create_bucket_response = $s3->createBucket(['ACL' => 'public-read', 'Bucket' => $bucket]);
deb("created bucket {$bucket}");
deb("bucket created - doing file add");
foreach ($alldb as $db) {
    $filename = "{$db}.sql.gz";
    $path = "/tmp/{$now}/";
    $uploadfile = $path . $filename;
    $result = $s3->putObject(['ACL' => 'public-read', 'Bucket' => $bucket, 'Key' => $uploadfile, 'SourceFile' => $uploadfile]);
    $objUrl = $result['ObjectURL'];
    deb("Uploaded Object URL: {$objUrl}");
}
// ********************************
// Cleanup the local filesystem
// ********************************
system("rm -rf /tmp/{$now}/");
deb("DONE");
syslog(LOG_INFO, "phpMyS3Backup - completed run ID {$now}");
// ********************************
// Done!
// ********************************
function deb($msg)
{
    if (DEBUG_ON) {
        print $msg . "\n</p>";
    }
}
//header('Location: /introspection.php');
Пример #3
0
<?php

$user_ip = zbs_UserDetectIp('debug');
$user_login = zbs_UserGetLoginByIp($user_ip);
$us_config = zbs_LoadConfig();
if (@$us_config['MG_ENABLED']) {
    $megogo = new MegogoFrontend();
    deb($megogo->renderSubscribeForm());
} else {
    show_window(__('Sorry'), __('This module is disabled'));
}
Пример #4
0
function catv_ActivityCreateCustomDate($userid, $state, $customdate)
{
    $userid = vf($userid, 3);
    $state = vf($state, 3);
    $admin = whoami();
    $query = "\r\n          INSERT INTO `catv_activity` (\r\n            `id` ,\r\n            `userid` ,\r\n            `state` ,\r\n            `date` ,\r\n            `admin`\r\n            )\r\n            VALUES (NULL , '" . $userid . "', '" . $state . "', '" . $customdate . "', '" . $admin . "');\r\n           ";
    nr_query($query);
    deb($query);
    log_register("CATV ACTIVITY CHANGE (" . $userid . ") " . $state);
}
Пример #5
0
 if (wf_CheckGet(array('userid'))) {
     $userid = vf($_GET['userid']);
     //collect all data
     $alluseractivity = catv_ActivityGetAllByUser($userid);
     $lasuseractivity = catv_ActivityGetLastByUser($userid);
     $lasuseractivitytime = catv_ActivityGetTimeLastByUser($userid);
     $userdata = catv_UserGetData($userid);
     $curyear = curyear();
     $curmonth = date("m");
     $curday = date("d");
     $curtime = curtime();
     $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt'];
     //if creating new activity
     if (wf_CheckPost(array('newacttime', 'newactday'))) {
         $customdate = $_POST['newactyear'] . '-' . $_POST['newactmonth'] . '-' . $_POST['newactday'] . ' ' . $_POST['newacttime'];
         deb($customdate);
         catv_ActivityCreateCustomDate($userid, $_POST['newactivity'], $customdate);
         rcms_redirect('?module=catv_useractivity&userid=' . $userid);
     }
     //edit form construct
     $actinputs = '';
     $actinputs .= wf_Trigger('newactivity', 'Connected', $lasuseractivity, true) . '<hr>';
     $actinputs .= wf_TextInput('newactday', 'Day', $curday, false, '2');
     $actinputs .= wf_MonthSelector('newactmonth', 'Month', $curmonth, false);
     $actinputs .= wf_YearSelector('newactyear', 'Year', true) . '<br>';
     $actinputs .= wf_HiddenInput('newacttime', $curtime);
     $actinputs .= wf_Submit('Change');
     $actform = wf_Form('', 'POST', $actinputs, 'glamour');
     show_window(__('User activity') . ' ' . $address, $actform);
     catv_ActivityShowAll($userid);
     catv_ProfileBack($userid);
 function getKursDepartment($LR)
 {
     if (isset($this->faculty[$LR["ccategory"]])) {
         $ret = "00";
         $cc = $LR["ccategory"];
         #echo "<br>".$cc; deb($LR,1);
         if ($cc == "00" or $cc == "20" or $cc == "30" or $cc == "50" or $cc == "60") {
             $ret = $cc;
         } else {
             foreach ($this->kurskat as $dep => $kukatlist) {
                 #deb( $cc);deb( $kukatlist);
                 if ($cc == 165 and in_array($cc, $kukatlist)) {
                     deb($LR, 1);
                     $ret = $this->dep[$dep][2];
                 }
             }
         }
         return $ret;
     }
     foreach ($this->kurskat as $kuka => $depa) {
         if (in_array($LR["ccategory"], $depa)) {
             $this->cdep = $kuka;
             break;
         }
     }
 }
<?php

$a['title'] = "Adicionar Empresa";
escape();
if (!empty($_POST['name']) && !empty($_POST['tel']) && !empty($_POST['email']) && !empty($_POST['crm'])) {
    $sql = "INSERT INTO companys (name, address, tel, email, notes, crm) VALUES (" . '"' . $_POST['name'] . '", "' . $_POST['address'] . '", "' . $_POST['tel'] . '", "' . $_POST['email'] . '", "' . $_POST['notes'] . '", "' . $_POST['crm'] . '")';
    deb($sql);
    mysql_query($sql);
    header("Location: " . $a['path'] . "/?load=list_billing");
}
Пример #8
0
 public function actionIndex()
 {
     Currency::model()->parseCbr();
     deb('ok');
 }
		<?php 
if ($_SESSION['id']) {
    ?>
		 <div id="toolbar">
			<a href="<?php 
    echo $a['path'];
    ?>
?load=user">(<?php 
    echo $_SESSION['username'];
    ?>
)</a> <a href="<?php 
    echo $a['path'];
    ?>
?logout">Sair</a><br />
			<?php 
    echo date("d/m/y");
    ?>
		 </div>
		<?php 
}
?>
	</div>
</div>
<?php 
deb($a['debvar']);
?>
</body> 
</html>