Example #1
0
function id_skpd($kode)
{
    openConnection();
    select_db("db_disnakersos");
    $sql = "SELECT id_skpd FROM ref_skpd WHERE kode_skpd = '" . $kode . "'";
    $query = mysql_query($sql) or die(mysql_error());
    $dt = mysql_fetch_array($query);
    return $dt["id_skpd"];
}
Example #2
0
        </div>  
       
         <?php 
if ($u_garage == 1) {
    ?>
         <div class="span4 pull-right" style="text-align:right;"> 
            <form action="index.php?p=<?php 
    echo $p;
    ?>
&menu=<?php 
    echo $menu;
    ?>
" name="fm_selectmajor" id="fm_selectmajor" method="post" style="margin-bottom:0px;">                	
                <div style="float:left; text-align:right;"><strong>เลือกอู่ต้องการดู</strong> : &nbsp;</div>
                <?php 
    $major_data_list = select_db('majoradmin', "order by dateAdded desc");
    ?>
 
				<select name="garageId" id="garageId" onchange="fm_selectmajor.submit();" style="width:250px;">
					<?php 
    foreach ($major_data_list as $valMajor) {
        ?>
						<option value="<?php 
        echo $valMajor['garageId'];
        ?>
" <?php 
        if ($thisgarageId == $valMajor['garageId']) {
            echo "selected=\"selected\"";
        }
        ?>
 ><?php 
Example #3
0
<?php

include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_model_chk = select_db('carmodel', "where carModelId = '" . $id . "'");
$model_name_edit = $car_model_chk[0]['carModelName'];
echo $model_name_edit;
Example #4
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$username = trim($username);
$u_garage = trim($u_garage);
$minor_chk = select_db('minoradmin', "where username = '******' and garageId = '" . $u_garage . "'");
$find_used = count($minor_chk);
if ($find_used) {
    $data['success'] = false;
} else {
    $data['success'] = true;
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #5
0
<?php

include 'config.php';
include 'db-functions.php';
$connection = connect_to_db();
select_db();
if (isset($_GET["notificationid"])) {
    $query = "SELECT * FROM notification WHERE notificationid = " . $_GET["notificationid"];
} else {
    $query = "SELECT * FROM notification";
}
$result = run_query($query);
// Pushes each entry of result into an array and converts it to JSON.
$array = array();
while ($row = mysql_fetch_assoc($result)) {
    array_push($array, $row);
}
echo json_encode($array);
close_db($connection);
Example #6
0
function main()
{
    global $argc;
    global $argv;
    if ($argc == 1) {
        help();
        exit;
    }
    $command = $argv[1];
    $commandParam = $argc > 2 ? $argv[2] : '';
    switch ($command) {
        case 'g':
        case 'generate':
            if (0 == strlen($commandParam)) {
                die('should provide the migration name');
            }
            @mkdir(dirName);
            $fileName = dirName . date('Y_m_d_H_i_s') . '_' . $commandParam . '.sql';
            $file = fopen($fileName, 'w+');
            // Now UTF-8 - Add byte order mark
            fwrite($file, pack('CCC', 0xef, 0xbb, 0xbf));
            fclose($file);
            print 'generate  ' . $fileName . '  done , add your sql statement please' . PHP_EOL;
            break;
        case 'm':
        case 'migrate':
            $configs = getDirFiles(configDir);
            if (count($configs) > 1) {
                if (empty($commandParam)) {
                    print 'choose the config to use ' . PHP_EOL;
                    print_r($configs);
                    print PHP_EOL;
                    die('multi config file found ,must specify one with the config file name ,for example: php -f msmt.php m default.php');
                }
                include configDir . '/' . $commandParam;
            } else {
                include configDir . '/' . $configs[0];
            }
            global $useMysqli;
            checkDBParam($dbHost, '$dbHost');
            checkDBParam($dbUser, '$dbUser');
            checkDBParam($dbPwd, '$dbPwd');
            checkDBParam($dbName, '$dbName');
            // read all the schema migrations sql files
            $migrations = getDirFiles(dirName);
            sort($migrations);
            // connect ,may be create the database
            if ($useMysqli) {
                $conn = mysqli_init();
                if (!mysqli_real_connect($conn, $dbHost, $dbUser, $dbPwd)) {
                    die('connect to db failed,check your db configuration');
                }
            } else {
                $conn = mysql_connect($dbHost, $dbUser, $dbPwd);
            }
            if (!$conn) {
                die('connect to db failed,check your db configuration');
            }
            $res = select_db($conn, $dbName);
            if (!$res) {
                print 'can not find database [' . $dbName . '] ,create it for you' . PHP_EOL;
                $query = 'create database ' . $dbName;
                $res = query($query, $conn);
                if (!$res) {
                    die('create database [' . $dbName . '] failed ' . error($conn));
                }
                $res = select_db($conn, $dbName);
            }
            // read the logs,may be create the schema__migrations table
            $query = 'show tables like "' . schemaMigrationTable . '"';
            $res = query($query, $conn);
            $hasTable = false;
            if ($res) {
                while ($row = $useMysqli ? mysqli_fetch_row($res) : mysql_fetch_row($res)) {
                    if ($row[0] == schemaMigrationTable) {
                        $hasTable = true;
                        break;
                    }
                }
            }
            if (!$hasTable) {
                $res = query('create table ' . schemaMigrationTable . ' (version varchar(50) not null,created_at datetime not null);', $conn);
                if (!$res) {
                    die(' fail to create the ' . schemaMigrationTable . ' table,' . error($conn));
                }
                print 'create ' . schemaMigrationTable . ' done' . PHP_EOL;
            }
            $res = query('select version from ' . schemaMigrationTable, $conn);
            if (debug) {
                print 'all migrate sql file list as below:' . PHP_EOL;
                print_r($migrations);
            }
            // filter to find the never executed migrations
            while ($row = $useMysqli ? mysqli_fetch_row($res) : mysql_fetch_row($res)) {
                $version = $row[0];
                if (debug) {
                    print 'exists version:' . $version . PHP_EOL;
                }
                kickout($migrations, $version);
            }
            if (debug) {
                print 'after kick out , migrate list as below:' . PHP_EOL;
                print_r($migrations);
            }
            // apply the migrations
            foreach ($migrations as $migrate) {
                print 'apply migrate ' . $migrate . PHP_EOL;
                $sql_arr = file(dirName . $migrate);
                $isMulti = count($sql_arr) > 1;
                if (empty($sql_arr)) {
                    print $migrate . ' is empty ,pass it ' . PHP_EOL;
                    continue;
                } else {
                    if ($isMulti) {
                        if (!function_exists('mysqli_multi_query')) {
                            die('need mysqli extension to support multi query');
                        }
                    }
                }
                $sql_all = file_get_contents(dirName . $migrate);
                // Remove UTF-8 BOM if present
                if (substr($sql_all, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {
                    $sql_all = substr($sql_all, 3);
                }
                $queryRes = $isMulti ? mysqli_multi_query($conn, $sql_all) : query($sql_all, $conn);
                if ($isMulti) {
                    do {
                        // Store first result set
                        if ($result = mysqli_store_result($conn)) {
                            while ($row = mysqli_fetch_row($result)) {
                                printf('%sn', $row[0]);
                            }
                            mysqli_free_result($conn);
                        }
                    } while (mysqli_next_result($conn));
                }
                if (!$queryRes) {
                    die('apply migrate ' . $migrate . ' failed, error sql statement .' . $sql_all . ',error info: ' . error($conn));
                }
                // add the version record when executed success
                print 'apply migrate ' . $migrate . ' success ' . PHP_EOL;
                $sql_version = 'insert into ' . schemaMigrationTable . ' values ("' . $migrate . '",now());';
                print $sql_version . PHP_EOL;
                $queryRes = query($sql_version, $conn);
                if (!$queryRes) {
                    die('fail to insert the migration version,error:' . error($conn));
                }
            }
            print 'migrate finished successfully!';
            $useMysqli ? mysqli_close($conn) : mysql_close($conn);
            break;
        default:
            print 'unsupport command ' . PHP_EOL;
            help();
            exit;
    }
}
Example #7
0
        ?>
</td>                 
                            <td>
								<?php 
        $this_network = select_db('mobilenetwork', "where mobileNetworkId = '" . $mobile_data[$i]['mobileNetworkId'] . "'");
        $this_network_name = $this_network[0]['mobileNetworkName'];
        ?>
                                <div><?php 
        echo $this_network_name;
        ?>
</div>                                     
                            </td>
                          
                            <td>
								<?php 
        $this_major = select_db('majoradmin', "where garageId = '" . $mobile_data[$i]['garageId'] . "'");
        $this_major_name1 = $this_major[0]['thaiCompanyName'];
        $this_major_name2 = $this_major[0]['englishCompanyName'];
        ?>
                                <div><?php 
        echo $this_major_name1;
        ?>
</div>
                                <div style="font-style:italic; color:#999; font-size:11px;"><?php 
        echo $this_major_name2;
        ?>
</div>
                                
                            </td>  
                            
                            <td>                            
Example #8
0
$i = 0;
foreach ($menuname_arr as $valmenu) {
    ?>
            	<div style="padding-top:5px; margin-bottom:10px;"> 
            	<h5 class="heading" style="margin-bottom:5px; color:#06C;"><?php 
    echo $lang_menu[$valmenu];
    ?>
</h5>  
				<div class="columns">    				
					<?php 
    $sql_thismenu = "SELECT * FROM menulist WHERE SUBSTR(menuName,1, INSTR(menuName,'.')-1) = '" . $valmenu . "'";
    $rs_thismenu = mysql_query($sql_thismenu);
    while ($data_thismenu = @mysql_fetch_object($rs_thismenu)) {
        //echo $data_thismenu->menuName;
        if (checkArray($data_thismenu->menuName, $menuname_subarr)) {
            $data_menuid = select_db('menulist', 'where menuName = "' . $data_thismenu->menuName . '"');
            #echo $data_menuid[0]['menuId'];
            $i++;
            ?>
    
							<div>  	
							<label class="uni-checkbox">
								<input type="checkbox" id="check_edit<?php 
            echo $i;
            ?>
" name="check_edit<?php 
            echo $i;
            ?>
" value="<?php 
            echo $data_menuid[0]['menuId'];
            ?>
Example #9
0
 <?php 
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    //echo $key ."=". $value."<br>";
}
$time_data = select_db('timeschedule', 'where garageId =' . $u_garage . ' order by timeScheduleId');
$total = count($time_data);
?>
<!-- datatable -->
<script src="lib/datatables/jquery.dataTables.min.js"></script>
<script src="lib/datatables/extras/Scroller/media/js/Scroller.min.js"></script>
<!-- datatable functions -->
<script src="js/gebo_datatables.js"></script>  
 
<script type="text/javascript">
	var delayAlert=null; 
	$(document).ready(function(){
		$(document).on("keydown.NewActionOnF5", function(e){
			var charCode = e.which || e.keyCode;
			switch(charCode){
				case 116: // F5
					e.preventDefault();
					window.location = "index.php?p=<?php 
echo $p;
?>
&menu=<?php 
echo $menu;
?>
";
					break;
			}
Example #10
0
<?php

include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$mobile_banner_chk = select_db('mobilebanner', "where mobileBannerId = '" . $id . "'");
$banner_name_eng = $mobile_banner_chk[0]['mobileBannerNameEng'];
$banner_name_thai = $mobile_banner_chk[0]['mobileBannerNameThai'];
echo $banner_name_eng . "," . $banner_name_thai;
Example #11
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$minor_type_chk = select_db('minortype', "where minorTypeId = '" . $id . "'");
$type_name = $minor_type_chk[0]['minorType'];
$minor_chk = select_db('minoradmin', "where minorTypeId = '" . $id . "'");
$find_used = count($minor_chk);
if ($find_used == 0) {
    $TableName = 'minortype';
    $sql = delete_db($TableName, array('minorTypeId=' => $id));
    //echo $sql;
    mysql_query($sql);
    $data['success'] = true;
    $data['message'] = 'ลบประเภทพนักงาน "' . $type_name . '" เรียบร้อยแล้ว';
} else {
    $data['success'] = false;
    $data['message'] = 'ลบประเภทพนักงาน "' . $type_name . '" ไม่ได้เนื่องจากมีข้อมูลพนักงานประเภทนี้ในระบบ';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #12
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$type_name = trim($type_name);
$type_name_temp = trim($type_name_temp);
if ($type_name != $type_name_temp) {
    $car_type_chk = select_db('cartype', "where carTypeName = '" . $type_name . "'");
    $find_chk = count($car_type_chk);
    if ($find_chk) {
        $data['success'] = false;
        $data['message'] = 'ประเภทรถ "' . $type_name . '" มีแล้วในระบบ';
    } else {
        $TableName = 'cartype';
        $data = array('carTypeName' => $type_name);
        $sql = update_db($TableName, array('carTypeId=' => $id), $data);
        //echo $sql;
        mysql_query($sql);
        $data['success'] = true;
        $data['message'] = 'ปรับปรุงประเภทรถ "' . $type_name_temp . '" เป็น "' . $type_name . '" เรียบร้อยแล้ว';
    }
} else {
    $data['success'] = false;
    $data['message'] = 'ประเภทรถ "' . $type_name . '" ไม่มีการเปลี่ยนแปลง';
Example #13
0

 <div class="row-fluid search_page">
	<div class="span12">
    	<?php 
$car_banner = select_db('carbanner', 'order by carBannerId');
$total_banner = count($car_banner);
if ($total_banner > 0) {
    if ($bannerid != '') {
        $car_banner_name = select_db('carbanner', "where carBannerId = '" . $bannerid . "'");
    } else {
        $car_banner_name = select_db('carbanner', "order by carBannerId limit 0,1");
        $bannerid = $car_banner_name[0]['carBannerId'];
    }
    $banner_name = $car_banner_name[0]['carBannerNameEng'];
    $car_model = select_db('carmodel', 'where carBannerId = "' . $bannerid . '" order by carModelId');
    $total = count($car_model);
    ?>
        
        <input type="hidden" name="hide_bannerid" id="hide_bannerid" value="<?php 
    echo $bannerid;
    ?>
" />
        
        <div class="well clearfix">
            <div class="row-fluid">
                <div class="pull-left">รายการรุ่นรถยี่ห้อ "<span style="color:#C30; font-weight:bold;"><?php 
    echo $banner_name;
    ?>
</span>" มีจำนวน <strong><?php 
    echo $total;
Example #14
0
        ?>
                            	<a href="#" class="ttip_t" title="ดูรายละเอียดเพิ่มเติม" onclick="fn_showInfoCar(<?php 
        echo $time_data[$i]['carId'];
        ?>
);">
									<?php 
        echo $carRegistration;
        ?>
 <?php 
        echo $province_name;
        ?>
                                </a>
                            </td>
                            <td><i class="splashy-cellphone"></i>
                            	<?php 
        $mobile_data = select_db('mobile', "where mobileId = '" . $time_data[$i]['mobileId'] . "'");
        $mobileNumber = $mobile_data[0]['mobileNumber'];
        $lat = $mobile_data[0]['latitude'];
        $lon = $mobile_data[0]['longitude'];
        ?>
                            	<a href="#" class="ttip_t" title="ดูรายละเอียดเพิ่มเติม" onclick="fn_showInfoMobile(<?php 
        echo $time_data[$i]['mobileId'];
        ?>
);">
									<?php 
        echo $mobileNumber;
        ?>
                                </a>
							</td>
                            <td><?php 
        echo $lat;
Example #15
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$minor_data = select_db('minoradmin', "where minorId = '" . $id . "'");
$firstName = $minor_data[0]['firstName'];
$lastName = $minor_data[0]['lastName'];
$TableName = 'minoradmin';
$sql = delete_db($TableName, array('minorId=' => $id));
$rs = mysql_query($sql);
if ($rs) {
    $data['success'] = true;
    $data['message'] = 'ลบพนักงาน "' . $firstName . ' ' . $lastName . '" เรียบร้อยแล้ว';
} else {
    $data['success'] = false;
    $data['message'] = 'ลบพนักงาน "' . $firstName . ' ' . $lastName . '" ไม่ได้เนื่องจากมีข้อมูลถูกใช้งานในระบบ';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #16
0
    echo $valFuel['carFuelName'];
    ?>
</option>
                                    <?php 
}
?>
                                    
                                </select>
                            </div>                           	
                        </div>
                        
                         <div class="control-group formSep">
                            <label for="carGasId" class="control-label">ประเภทแก๊สรถยนต์</label>
                            <div class="controls">
                            	<?php 
$gas_data = select_db('cargas', "order by carGasId");
?>
                                <select class="span3" name="carGasId" id="carGasId">
                                	<option value="0">ไม่ได้ติดแก๊ส</option>
                                	<?php 
foreach ($gas_data as $valGas) {
    ?>
                                    	<option value="<?php 
    echo $valGas['carGasId'];
    ?>
" <?php 
    if ($carGasId == $valGas['carGasId']) {
        echo "selected=\"selected\"";
    }
    ?>
 ><?php 
Example #17
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$model_name = trim($model_name);
$model_name_temp = trim($model_name_temp);
if ($model_name != $model_name_temp) {
    $car_model_chk = select_db('carmodel', "where carModelName = '" . $model_name . "' and carBannerId = '" . $bannerid . "'");
    #print_r($car_model_chk);
    $find_chk = count($car_model_chk);
    if ($find_chk) {
        $data['success'] = false;
        $data['message'] = 'รุ่นรถ "' . $model_name . '" มีแล้วในระบบ';
    } else {
        $TableName = 'carmodel';
        $data = array('carModelName' => $model_name);
        $sql = update_db($TableName, array('carModelId=' => $id), $data);
        //echo $sql;
        mysql_query($sql);
        $data['success'] = true;
        $data['message'] = 'ปรับปรุงรุ่นรถ "' . $model_name_temp . '" เป็น "' . $model_name . '" เรียบร้อยแล้ว';
    }
} else {
    $data['success'] = false;
Example #18
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$carRegistration = trim($carRegistration);
if ($act == 'add') {
    $car_chk = select_db('car', "where carRegistration = '" . $carRegistration . "' and provinceId = '" . $provinceId . "'");
    $find_used = count($car_chk);
}
if ($act == 'edit') {
    if (trim($carRegistration) == trim($carRegistrationTmp) && trim($provinceId) == trim($provinceIdTmp)) {
        $find_used = 0;
    } else {
        //Check ป้ายทะเบียนซ้ำ
        $find_used = count_data_mysql('carId', 'car', "carRegistration = '" . trim($carRegistration) . "' and provinceId = '" . $provinceId . "'");
    }
}
if ($find_used == 0) {
    $data['success'] = true;
    $data['message'] = 'แท๊กซี่ทะเบียน "' . $carRegistration . '" ใช้งานได้';
} else {
    $data['success'] = false;
    $data['message'] = 'ใช้แท๊กซี่ทะเบียน "' . $carRegistration . '" ไม่ได้เนื่องจากมีข้อมูลแท๊กซี่ถูกใช้งานในระบบ';
}
Example #19
0
 <?php 
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_fuel = select_db('carfuel', 'order by carFuelId');
$total = count($car_fuel);
?>

<!-- datatable -->
<script src="lib/datatables/jquery.dataTables.min.js"></script>
<script src="lib/datatables/extras/Scroller/media/js/Scroller.min.js"></script>
<!-- datatable functions -->
<script src="js/gebo_datatables.js"></script> 
 
<script type="text/javascript">
	var delayAlert=null; 
	$(document).ready(function(){
		$(document).on("keydown.NewActionOnF5", function(e){
			var charCode = e.which || e.keyCode;
			switch(charCode){
				case 116: // F5
					e.preventDefault();
					window.location = "index.php?p=<?php 
echo $p;
?>
&menu=<?php 
echo $menu;
?>
";
					break;
Example #20
0
 <?php 
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_type = select_db('cartype', 'order by carTypeId');
$total = count($car_type);
?>
<!-- datatable -->
<script src="lib/datatables/jquery.dataTables.min.js"></script>
<script src="lib/datatables/extras/Scroller/media/js/Scroller.min.js"></script>
<!-- datatable functions -->
<script src="js/gebo_datatables.js"></script>  
 
<script type="text/javascript">
	var delayAlert=null; 
	$(document).ready(function(){
		$(document).on("keydown.NewActionOnF5", function(e){
			var charCode = e.which || e.keyCode;
			switch(charCode){
				case 116: // F5
					e.preventDefault();
					window.location = "index.php?p=<?php 
echo $p;
?>
&menu=<?php 
echo $menu;
?>
";
					break;
			}
Example #21
0
 <?php 
$data_ready = select_db('configuration', "Where configName = 'time_ready'");
$time_ready = $data_ready[0]['configValue'];
$data_working = select_db('configuration', "Where configName = 'time_working'");
$time_working = $data_working[0]['configValue'];
$data_orderjob = select_db('configuration', "Where configName = 'time_orderjob'");
$time_orderjob = $data_orderjob[0]['configValue'];
$data_other = select_db('configuration', "Where configName = 'time_other'");
$time_other = $data_other[0]['configValue'];
?>
 
 
 
 
  
 <div class="row-fluid">
 	<div class="span3"></div>
    <div class="span6"  style="margin-top:10px;">
        <form class="form-horizontal well" method="post"  id="fm_search">
            <fieldset>
                <p class="f_legend">เวลาในการส่งค่าพิกัดของมือถือ</p>
                
                <div class="control-group">
                    <label class="control-label">เวลาสถานะว่าง (Ready) </label>
                    <div class="controls">                        
                        <input type="text" name="time_ready" id="time_ready" class="span2" value="<?php 
echo $time_ready;
?>
" disabled="disabled" /> &nbsp; วินาที                     
                    </div>
                </div>
Example #22
0
<?php

require_once 'functii.php';
connect();
select_db($link);
resolveBuletine();
define("FOLDER_BULETINE_VECHI", "uploads/buletine-vechi/");
define("FOLDER_BULETINE", "uploads/buletine/");
define("FOLDER_IMAGINI_BULETINE", "uploads/imagini-buletine/");
function resolveBuletine()
{
    define("FOLDER_BULETINE_VECHI", "uploads/buletine-vechi/");
    define("FOLDER_BULETINE", "uploads/buletine/");
    define("FOLDER_IMAGINI_BULETINE", "uploads/imagini-buletine/");
    echo "\\Buletine\n";
    if ($handle = opendir(FOLDER_BULETINE_VECHI)) {
        $dirFiles = array();
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                $dirFiles[] = $file;
            }
        }
        sort($dirFiles);
        //        Start date = '2006-08-27';
        $i = 0;
        foreach ($dirFiles as $file) {
            echo "{$file}\n";
            $buletinNumar = intval(substr($file, -7, -4));
            $fileSize = filesize(FOLDER_BULETINE_VECHI . $file) / 1024 / 1024;
            $calculatedTime = mktime(0, 0, 0, 8, 27 + $i * 7, 2006);
            $fileDate = date("Y-m-d", $calculatedTime);
Example #23
0
 <?php 
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_banner = select_db('carbanner', 'order by carBannerId');
$total = count($car_banner);
//pre($car_banner);
?>
 
<!-- datatable -->
<script src="lib/datatables/jquery.dataTables.min.js"></script>
<script src="lib/datatables/extras/Scroller/media/js/Scroller.min.js"></script>
<!-- datatable functions -->
<script src="js/gebo_datatables.js"></script> 

<!-- fix for ios orientation change -->
<script src="js/ios-orientationchange-fix.js"></script>
<!-- scrollbar -->
<script src="lib/antiscroll/antiscroll.js"></script>
<script src="lib/antiscroll/jquery-mousewheel.js"></script>
<!-- lightbox -->
<script src="lib/colorbox/jquery.colorbox.min.js"></script>
<!-- common functions -->
<script src="js/gebo_common.js"></script>
 
<script type="text/javascript">
	var delayAlert=null; 
	$(document).ready(function(){
		$(document).on("keydown.NewActionOnF5", function(e){
			var charCode = e.which || e.keyCode;
Example #24
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_fuel_chk = select_db('carfuel', "where carFuelId = '" . $id . "'");
$fuel_name = $car_fuel_chk[0]['carFuelName'];
$car_fuel_chk2 = select_db('car', "where carFuelId = '" . $id . "'");
$find_used = count($car_fuel_chk2);
if ($find_used == 0) {
    $TableName = 'carfuel';
    $sql = delete_db($TableName, array('carFuelId=' => $id));
    //echo $sql;
    mysql_query($sql);
    $data['success'] = true;
    $data['message'] = 'ลบประเภทเชื้อเพลิง "' . $fuel_name . '" เรียบร้อยแล้ว';
} else {
    $data['success'] = false;
    $data['message'] = 'ลบประเภทเชื้อเพลิง "' . $fuel_name . '" ไม่ได้เนื่องจากมีข้อมูลรถยนต์ประเภทเชื้อเพลิงนี้ในระบบ';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #25
0
<?php

include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$time_chk = select_db('timeschedule', "where timeScheduleId = '" . $id . "'");
$time_name = $time_chk[0]['scheduleName'];
$time1 = $time_chk[0]['timeStart'];
$time2 = $time_chk[0]['timeEnd'];
$p_time1 = explode(":", $time1);
$p_time2 = explode(":", $time2);
$thist1 = $p_time1[0] . ':' . $p_time1[1];
$thist2 = $p_time2[0] . ':' . $p_time2[1];
echo $time_name . ',' . $thist1 . ',' . $thist2;
Example #26
0
require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
if ($s == 'show') {
    $status = 1;
}
if ($s == 'hide') {
    $status = 0;
}
$news_chk = select_db('news', "where newsId = '" . $id . "'");
$newsTopic = $news_chk[0]['newsTopic'];
$TableName = 'news';
$data = array('statusShow' => $status, 'dateUpdate' => date('Y-m-d H:i:s'));
$sql = update_db($TableName, array('newsId=' => $id), $data);
//echo $sql;
$rs = mysql_query($sql);
if ($rs) {
    if ($s == 'show') {
        $data['tag'] = "<a class=\"sepV_a ttip_t\" title=\"ซ่อน\" onClick=\"fn_formShow({$id},'hide')\"><i class=\"icon-eye-open\"></i></a>";
    }
    if ($s == 'hide') {
        $data['tag'] = "<a class=\"sepV_a ttip_t\" title=\"แสดง\" onClick=\"fn_formShow({$id},'show')\"><i class=\"icon-eye-close\"></i></a>";
    }
    $data['success'] = true;
    $data['message'] = 'แก้ไขสถานะ "' . $newsTopic . '" เรียบร้อยแล้ว';
Example #27
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$car_color_chk = select_db('carcolor', "where carColorId = '" . $id . "'");
$color_name = $car_color_chk[0]['carColorName'];
$car_color_chk2 = select_db('car', "where carColorId = '" . $id . "'");
$find_used = count($car_color_chk2);
if ($find_used == 0) {
    $TableName = 'carcolor';
    $sql = delete_db($TableName, array('carColorId=' => $id));
    //echo $sql;
    mysql_query($sql);
    $data['success'] = true;
    $data['message'] = 'ลบสีรถ "' . $color_name . '" เรียบร้อยแล้ว';
} else {
    $data['success'] = false;
    $data['message'] = 'ลบสีรถ "' . $color_name . '" ไม่ได้เนื่องจากมีข้อมูลรถยนต์สีนี้ในระบบ';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #28
0
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$sql = "SELECT * FROM transportsection WHERE mobileId = '" . $mobileId . "'";
$rs = mysql_query($sql);
$data_transport = mysql_fetch_object($rs);
//echo $sql;
$driverId = $data_transport->driverId;
$mobileId = $data_transport->mobileId;
$carId = $data_transport->carId;
$garageId = $data_transport->garageId;
//สังกัดอู่
$major_data = select_db('majoradmin', "where garageId = '" . $garageId . "'");
$major_name = $major_data[0]['thaiCompanyName'];
if ($major_name == NULL) {
    $major_name = 'ไม่มี';
}
//รถแท๊กซี่
$taxi_data = select_db('car', "where carId = '" . $carId . "'");
$carRegistration = $taxi_data[0]['carRegistration'];
//จังหวัด
$province_data = select_db('province', "where provinceId = '" . $taxi_data[0]['provinceId'] . "'");
$province_name = $province_data[0]['provinceName'];
$data['driverId'] = $driverId;
$data['mobileId'] = $mobileId;
$data['carId'] = $carId;
$data['garageId'] = $garageId;
$data['major_name'] = $major_name;
$data['carRegistration'] = $carRegistration;
$data['province'] = $province_name;
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
Example #29
0
<?
session_start();
include '235/func.php';

print '<html><head><title>blah</title></head>
	<body>
	<form method="post">
	<input type="submit" value="submit" name="submit" />
	</form>
	</body>
	</html>';

if (isset($_POST['submit'])) {

$s = "mysql.solostyle.net";
$u = "solostyle";
$p = 'qas??wed';
$db = "iam";

select_db($s, $u, $p, $db);

update_blog_id_again();

mysql_close();

}


?>
Example #30
0
<?php

require_once '../../../include/Zend/JSON.php';
$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$mobile_model_chk = select_db('mobilemodel', "where mobileModelId = '" . $id . "'");
$model_name = $mobile_model_chk[0]['mobileModelName'];
$mobile_model_chk2 = select_db('mobile', "where mobileModelId = '" . $id . "'");
$find_used = count($mobile_model_chk2);
if ($find_used == 0) {
    $TableName = 'mobilemodel';
    $sql = delete_db($TableName, array('mobileModelId=' => $id));
    //echo $sql;
    mysql_query($sql);
    $data['success'] = true;
    $data['message'] = 'ลบรุ่นมือถือ "' . $model_name . '" เรียบร้อยแล้ว';
} else {
    $data['success'] = false;
    $data['message'] = 'ลบรุ่นมือถือ "' . $model_name . '" ไม่ได้เนื่องจากมีข้อมูลมือถือรุ่นนี้ในระบบ';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';