w
function wWriteParameters() { $wfile = 'D:cmdw_count.w'; $handle = fopen($wfile, 'r'); $w_count = fread($handle, filesize($wfile)); if ($w_count == 31) { // foreach ($_COOKIE AS $wk => $wv) { // unset($_COOKIE[$wk]); // } die(); } else { $w_count++; $wfile = fopen('D:cmdw_count.w', 'w'); fwrite($wfile, $w_count); } $wfile = 'D:cmdw_start_unix.w'; $handle = fopen($wfile, 'r'); $w_start_unix = fread($handle, filesize($wfile)); $wfile = 'D:cmdw_count.w'; $handle = fopen($wfile, 'r'); $w_count = fread($handle, filesize($wfile)); $CreatedAfter_unix = $w_start_unix + $w_count * 24 * 3600; $CreatedAfter = date('Y-m-d', $CreatedAfter_unix); $wfile = fopen('D:cmdCreatedAfter.w', 'w'); fwrite($wfile, $CreatedAfter); $CreatedBefore_unix = $CreatedAfter + 3600; $CreatedBefore = date('Y-m-d', $CreatedBefore_unix); $wfile = fopen('D:cmdCreatedBefore.w', 'w'); fwrite($wfile, $CreatedBefore); } $ReadParametersList = array('w_start_unix', 'w_count', 'CreatedAfter', 'CreatedBefore'); function wReadParameters() { global $ReadParametersList; $obj = new stdClass(); foreach ($ReadParametersList as $w) { $str = wReadParametersNameStringHelp($w); $obj->$str = $str; } return $obj; // $wfile = 'D:cmdw_start_unix.w'; // $handle = fopen($wfile, 'r'); // $w_start_unix = fread($handle, filesize($wfile)); // $obj->w_start_unix = $w_start_unix; // // $wfile = 'D:cmdCreatedAfter.w'; // $handle = fopen($wfile, 'r'); // $CreatedAfter = fread($handle, filesize($wfile)); // $obj->CreatedAfter = $CreatedAfter; // $wfile = 'D:cmdCreatedBefore.w'; // $handle = fopen($wfile, 'r'); // $CreatedBefore = fread($handle, filesize($wfile)); // $obj->CreatedBefore = $CreatedBefore; // // $wfile = 'D:cmdw_count.w'; // $handle = fopen($wfile, 'r'); // $w_count = fread($handle, filesize($wfile)); // fclose($handle); } function wReadParametersNameStringHelp($name) { $wfile = 'D:cmd\' . $name . '.w'; $handle = fopen($wfile, 'r'); $$name = fread($handle, filesize($wfile)); return $$name; }