Changeset 2644079
- Timestamp:
- 12/14/2021 06:12:15 PM (4 years ago)
- Location:
- outgrow/trunk
- Files:
-
- 5 edited
-
callingDb.php (modified) (1 diff)
-
cookies.php (modified) (1 diff)
-
fetch.php (modified) (1 diff)
-
outgrow-api.php (modified) (28 diffs)
-
view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
outgrow/trunk/callingDb.php
r2641762 r2644079 1 1 <?php 2 3 2 global $wpdb; 4 3 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table'); -
outgrow/trunk/cookies.php
r2028953 r2644079 1 2 1 <?php 3 2 global $wpdb; -
outgrow/trunk/fetch.php
r2641762 r2644079 14 14 // addActive(); 15 15 } 16 ?>16 ?> -
outgrow/trunk/outgrow-api.php
r2643816 r2644079 24 24 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts_css' ) ); 25 25 } 26 27 26 static $header_script1; 28 27 } 29 30 28 /** 31 29 * Check if the current user can edit Posts or Pages, and is using the Visual Editor … … 39 37 return; 40 38 } 41 42 39 // Check if the logged in WordPress User has the Visual Editor enabled 43 40 // If not, don't register our TinyMCE1 plugin … … 63 60 $plugin_array['custom_class'] = plugin_dir_url( __FILE__ ) . './tinymce-custom-class.js'; 64 61 return $plugin_array; 65 66 62 } 67 63 … … 77 73 array_push( $buttons, 'custom_class' ); 78 74 return $buttons; 79 80 75 } 81 76 … … 88 83 // add_menu_page("Outgrow", "Outgrow", "manage_options", 'final_outgrow_calci_menu', "calci_script_page", "dashicons-cake", 50); 89 84 } 90 91 } 92 85 } 93 86 $msgError=0; 94 87 // add_action( 'calling_db_script_enq', 'calling_db_scripts'); 95 96 88 $outgrow_api_class = new Outgrow_API_Class; 97 98 99 89 // ....others.... 100 90 // static $header_script1; … … 110 100 )); 111 101 wp_enqueue_script('my_plugin_script'); 112 113 114 102 wp_register_style('my-plugin-style4','https://fonts.googleapis.com/icon?family=Material+Icons'); 115 103 wp_enqueue_style('my-plugin-style4'); 116 117 104 wp_register_style('my-plugin-style', plugins_url('/outgrow/css/style.css')); 118 105 wp_register_style('my-plugin-style2', plugins_url('/outgrow/css/line-awesome/css/line-awesome-font-awesome.css')); … … 131 118 wp_enqueue_style('fonts2'); 132 119 // font ends 133 134 120 register_activation_hook(__FILE__, 'calci_api_table'); 135 121 register_activation_hook(__FILE__, 'calci_table'); 136 122 register_deactivation_hook(__FILE__, 'deactivation_table'); 137 138 123 function og_enqueue_script(){ 139 wp_enqueue_script('ajax', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js');124 wp_enqueue_script('ajax', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'); 140 125 } 141 126 add_action('wp_enqueue_scripts','og_enqueue_script'); 142 127 // add_action('wp_enqueue_styles','og_enqueue_stylesheets'); 143 144 128 // ends 145 129 function og_outgrow_calci(){ 146 130 add_menu_page("Outgrow", "Outgrow", "manage_options", 'final_outgrow_calci_menu', "calci_script_page", "dashicons-cake", 50); 147 131 // add_menu_page("Outgrow", "Outgrow", "manage_options", 'final_outgrow_calci_menu', "calci_script_page",'', 50); 148 149 } 150 132 } 151 133 // ..................adding dropdown buttons................... 152 134 function add_mce_button() { … … 162 144 } 163 145 add_action('admin_head', 'add_mce_button'); 164 165 166 146 // register new button in the editor 167 147 function register_mce_button( $buttons ) { … … 169 149 return $buttons; 170 150 } 171 172 173 151 // declare a script for the new button 174 152 // the script will insert the shortcode on the click event … … 177 155 return $plugin_array; 178 156 } 179 180 157 // ........................ends................... 181 182 183 184 // include_once "database.php"; 185 158 // include_once "database.php"; 186 159 if(isset($_POST['ajax']) && isset($_POST['show_data'])){ 187 160 // echo $_POST['name']; … … 189 162 exit; 190 163 } 191 192 164 // Cookies area 193 165 include_once "cookies.php"; 194 166 // cookies area ends 195 196 167 if (isset($_POST['header_script1'])) { 197 168 if($_POST['header_script1']!=""){ … … 212 183 if($res->data){ 213 184 $calci_count = count($res->data); 214 } 215 216 185 } 217 186 if ($res->success == "true" || $res->code != 401 && $calci_count>0) { 218 187 if ($wpdb->insert('wp_outgrow_calci_api_table', array( … … 234 203 'title' => $res3[$i]->meta_data->title, 235 204 'image_url' => $res3[$i]->meta_data->image_url 236 )) == false) { 237 205 )) == false) { 238 206 }else{ 239 240 } 241 207 } 242 208 } 243 244 209 }else{ 245 210 // api_Warning("No API Found - Please add your API to view Calculators."); 246 211 api_Warning("INVALID API"); 247 248 212 } 249 213 } 250 214 } 251 215 } 252 253 216 function calci_script_page($api){ 254 217 global $wpdb; … … 257 220 $msgError++; 258 221 // api_Warning("Please add API Key"); 259 ?> 260 222 ?> 261 223 <div class="add-api-msg" id="adding-api-key"> 262 224 <h2>Please Add API KEY</h2> 263 225 </div> 264 265 226 <script> 266 227 if(document.getElementById("api-warning")){ … … 268 229 } 269 230 </script> 270 271 <?php 231 <?php 272 232 }else{ 273 233 // for api-check at db … … 294 254 } 295 255 } 296 ?> 297 256 ?> 298 257 <div class="super-class"> 299 258 <!-- <div id="loader-div-class" class="loader-class" > --> … … 319 278 <form name="form1" style="margin-bottom:0em;" method="post"> 320 279 <ul class="main-list"> 321 <?php280 <?php 322 281 global $wpdb; 323 282 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table'); 324 283 if($db_result){ 325 284 foreach ($db_result as $db_row) { 326 ?>285 ?> 327 286 <li id="api-list"> 328 329 <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>"> 287 <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>"> 330 288 <button name="delete_data" class="list-close" value="<?php echo $db_row->api_key ?>">x</button> 331 289 </li> 332 <?php290 <?php 333 291 } 334 292 } 335 ?> 336 293 ?> 337 294 </ul> 338 295 </div> … … 341 298 <br> 342 299 </div> 343 344 <?php 345 346 300 <?php 347 301 global $wpdb; 348 302 $optionAPI = ""; 349 303 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table'); 350 304 if ($db_result) { 351 ?> 352 305 ?> 353 306 <div id="content" class="hide"> 354 307 </div> 355 308 <?php 356 } 357 358 359 ?> 360 </form> 361 309 } 310 ?> 311 </form> 362 312 </select> 363 313 </div> 364 <!-- <hr> --> 365 314 <!-- <hr> --> 366 315 <div class="super-class"> 367 316 <div class="section-1" id="section-1" style="display:none"> … … 406 355 <img class="icon-class" src= "<?php echo plugins_url('/images/icon-4.png', __FILE__) ?>" alt="outgrow" onclick="result('Calculator')"> 407 356 </div> --> 408 </div> 409 357 </div> 410 358 </div> 411 359 </div> … … 413 361 <div class="section-2" id="section-2"> 414 362 <div id="get-calci-name"></div> 415 <?php 416 417 include_once "view.php"; 418 419 ?> 420 421 </div> 422 363 <?php 364 include_once "view.php"; 365 ?> 366 </div> 423 367 </div> 424 425 </div>426 427 368 </div> 428 369 </div> 429 370 <!-- modal open --> 430 <?php371 <?php 431 372 include_once "modal.html"; 432 ?> 433 373 ?> 434 374 <!-- modal ennd --> 435 <?php 436 } 437 375 <?php 376 } 438 377 // delete API 439 440 378 if (isset($_POST['delete_data'])) { 441 379 global $wpdb; 442 443 380 $item = sanitize_text_field($_POST['delete_data']); 444 381 … … 462 399 } 463 400 } 464 465 466 401 // delete API ends 467 468 469 402 // shortcode starts 470 471 403 function display_outgrow_calci($atts,$content,$tag){ 472 404 $custom="<style> … … 595 527 } 596 528 add_shortcode('outgrow','display_outgrow_calci'); 597 598 529 // shortcode ends 599 530 … … 613 544 } 614 545 } 615 616 617 546 // data table 618 547 function calci_table(){ … … 635 564 } 636 565 } 637 638 639 566 // deactivation 640 641 567 function deactivation_table(){ 642 568 global $wpdb; … … 644 570 $wpdb->query('DROP table IF Exists wp_outgrow_calci_api_table'); 645 571 } 646 647 572 // icon 648 573 add_action('admin_menu', 'custom_favicon'); 649 650 651 function custom_favicon() { 652 574 function custom_favicon() { 653 575 echo ' 654 576 <style> … … 661 583 '; 662 584 } 663 664 665 585 //repeated apis 666 586 … … 672 592 if($db_row->api_key == $api){ 673 593 api_Warning("API Already Exists - Please add new API."); 674 ?>675 <?php594 ?> 595 <?php 676 596 return "present"; 677 597 }else{ … … 682 602 } 683 603 } 684 685 604 function api_Warning($msg){ 686 605 // print_r("------------Error Count----------",$msgError); 687 688 ?> 689 <div class="no-api" id="api-warning" style="display:block"> 690 691 <strong> <?php echo $msg; ?></strong> 692 </div> 693 <?php 694 695 } 696 697 698 ?> 699 606 ?> 607 <div class="no-api" id="api-warning" style="display:block"> 608 <strong> <?php echo $msg; ?></strong> 609 </div> 610 <?php 611 } 612 ?> -
outgrow/trunk/view.php
r2643816 r2644079 29 29 <div id="result-Survey" > 30 30 31 </div> 32 33 34 31 </div>
Note: See TracChangeset
for help on using the changeset viewer.